Project

Profile

Help

HostedRedmine.com has moved to the Planio platform. All logins and passwords remained the same. All users will be able to login and use Redmine just as before. Read more...

Feature #861498

Reduce/improve ruleset hardcoding around irrigation/mining actions in SDL clients

Added by Jacob Nevins 11 months ago. Updated about 1 month ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
gui-sdl2
Sprint/Milestone:
Start date:
Due date:
% Done:

0%

Estimated time:

Description

The SDL clients contain horrible hardcoding around mining/irrigation: they look at the terrain names to decide what UI text and icon to use, assuming that classic ruleset is being used, so that they can display custom icons for chopping forests, etc.

This is getting in my way for #861460.

This patch won't eliminate the hardcoding (because of the icons), but it'll reduce its scope a lot, and tweak the remainder so that it is wrong less of the time:
  • If irrigation/mining build extras, now say the specific extra name ("Build Farmland"), regardless of underlying terrain type (previously: would never name extra; if you were lucky it would say "Build Irrigation", otherwise something like "Irrigate to [Current]", or even "Plant Forest")
  • If irrigation changes terrain, now say "Change to [New]", except if the terrain is Forest/Jungle ("Cut Down to [New]"). (previously: would only mention target terrain when changing from Swamp, Forest, Jungle)
  • Mining terrain change hardcoding is now based on the result terrain. Previously it would say "Plant Forest" if the start terrain was Jungle/Plains/Grassland/Swamp (in classic rules, these mine to Forest); now it only says "Plant Forest" when end terrain is Forest, otherwise "Change to [New]".
m-sdl-irrig-mine-hardcoding.patch (9.22 KB) m-sdl-irrig-mine-hardcoding.patch Jacob Nevins, 2020-02-23 05:18 PM
30-sdl-irrig-mine-hardcoding.patch (8.53 KB) 30-sdl-irrig-mine-hardcoding.patch Jacob Nevins, 2020-02-23 05:18 PM
26-sdl-irrig-mine-hardcoding.patch (16.7 KB) 26-sdl-irrig-mine-hardcoding.patch Jacob Nevins, 2020-02-23 05:18 PM

Related issues

Related to Freeciv - Bug #861867: Reduce/improve ruleset hardcoding around irrigation/mining actions in Qt clientClosed

<a title="Actions" class="icon-only icon-actions js-contextmenu" href="#">Actions</a>
Blocks Freeciv - Bug #861460: SDL activity button tooltips say activities will take far more turns than they really willClosed

<a title="Actions" class="icon-only icon-actions js-contextmenu" href="#">Actions</a>

History

#2 Updated by Jacob Nevins 11 months ago

  • Blocks Bug #861460: SDL activity button tooltips say activities will take far more turns than they really will added

#3 Updated by Marko Lindqvist 11 months ago

Jacob Nevins wrote:

they look at the terrain names to decide what UI text and icon to use, assuming that classic ruleset is being used, so that they can display custom icons for chopping forests, etc.

I think this has also been ported to Qt-client at some point, going backwards.

#4 Updated by Jacob Nevins 11 months ago

  • Related to Bug #861867: Reduce/improve ruleset hardcoding around irrigation/mining actions in Qt client added

#5 Updated by Jacob Nevins 11 months ago

I think this [hardcoding] has also been ported to Qt-client at some point

So it has. -> bug #861867

#6 Updated by Jacob Nevins 11 months ago

  • Status changed from Resolved to Closed

#7 Updated by Marko Lindqvist about 1 month ago

I think this was causing the Bug #894434 regression.

Also available in: Atom PDF