Opened 2 years ago

Closed 2 years ago

#5136 closed task (needsinfo)

Use less inclusive includes in the GUI

Reported by: Itms Owned by:
Priority: Should Have Milestone:
Component: UI & Simulation Keywords:
Cc: Patch:

Description

Currently all the GUI uses

<script directory="gui/lobby/"/>

for scripts. This is likely to cause subtle issues, and an explicit list of included files would be friendlier to maintain.

Change History (2)

comment:1 by elexis, 2 years ago

There was a reviewed commit implementing this bugdescription as a feature, so reading that discussion can help precise the (to me invalid) issue description.

This is likely to cause subtle issues

It will cause issues if people uncautiously put files in arbitrary directories without checking where they are loaded from, such as putting something in gui/lobby/ and want it to not to be loaded by the lobby gui page. There is no reason to put it in that directory then.

Previously different GUI pages were placed a single directory. For instance the pregamesetup page (join/host by ip dialog) into the gamesetup directory and the prelobby dialog into the lobby page. This made it hard to figure out which file is relevant in which context and to find out that the directories actually share zero code nor markup.

Another example were mods that wanted to add one include and thus had to overwrite the entire markup file, including the most frequently and gamebreaking ones as gamesetup and session ones. Reverting to file includes means you're guaranteeing bugs.

The benefit of using at most two different includes (the page itself or common) is that it becomes easier to maintain and thus prevents subtle issues.

Not using the minimum set of rules just expands the complexity and thus will cause subtle issues if the developer or modder doesn't lookup all directory includes.

comment:2 by elexis, 2 years ago

Cc: leper removed
Milestone: Backlog
Resolution: needsinfo
Status: newclosed
Note: See TracTickets for help on using tickets.