Opened 8 years ago

Last modified 5 years ago

#4229 new defect

Disable docks on landmaps

Reported by: elexis Owned by:
Priority: If Time Permits Milestone: Backlog
Component: UI – In-game Keywords:
Cc: Patch:

Description

Buildings like docks, carthaginian shipyard, briton island settlement and the ptolemian lighthouse can only be built in water. Hence showing these buttons in the construction panel is wrong since it will be impossible to build it. Instead the buttons could be hidden.

There is a similar mechanism, the DisabledTemplates which allows map authors to exclude buildings like the lighthouse, as it might be inappropriate for some maps.

There could be a new optional boolean setting hasWater specified by the JSON map file. If it's given and false (i.e. not undefined), building these water-buildings would become impossible in the gui. (A simulation check could be done in theory, but shouldn't be needed as the buildings can't be built due to the wrong terrain.)

The buildings to be disabled can be identified by BuildRestrictions.PlacementType being shore (as defined in pathfinder.xml).


(Notice this can change the order of the buttons which may confuse players. But this is already case with the DisabledTemplates approach and f.e. the tower icon being displayed in another place for the spartan woman than the spartan men. Hotkeys should also not use the numerical index, but become assigned to actual classes.)

Change History (3)

comment:1 by Vladislav Belov, 8 years ago

Could we just group some types of buildings and disable all elements in a group? I.e. water building or towers.

About buttons: usually in RTS order and positions of buttons don't change, just make button invisible, in other words empty square instead of button. In an implementation we just could insert an invisible disabled button for correct positions of other buttons.

Version 0, edited 8 years ago by Vladislav Belov (next)

comment:2 by Stan, 8 years ago

I wonder if we could use that for snow variants of buildings...

comment:3 by Imarok, 5 years ago

Component: UI & SimulationIn-game UI

Move tickets to In-game UI as UI & Simulation got some sub components.

Note: See TracTickets for help on using tickets.