0ad/source/gui
wraitii 4bb31f084e Make real directory paths on the VFS predictable.
Partial revert/fix of 2f19cf86d3 and 2567fee329.

Before this diff, it was possible for a mod containing a cache/ or a
config/ folder to get written to incorrectly.
The issue is VFS can map multiple directories to one 'virtual' path, for
reading mods. However, writing data is problematic: which path to
choose?
The only viable solution is to use a path relative to the highest
priority directory encountered in the VFS path, or write paths could be
'hijacked' by lower-priority mods.

This fixes these issues by:
- Adding a new lookup mode ('Real-path') that explicitly picks the real
path relative to the highest-priority subdirectory in the VFS Path.
- Preventing overwriting a real directory with a lower priority one in
general.
- Revert c0c8132dd4's GetRealPath change, re-introducing the function as
GetOriginalPath.

This also cleans up some duplication that led to empty mod folders in
the user mod path, and cleans up loading the 'user' mod.

Note that the new 'realpath' lookup can still be somewhat complex with
many mount points at various hierarchy levels, but it is at least
predictable/deterministic without having to be careful about populating
order.

Fixes #2553

Differential Revision: https://code.wildfiregames.com/D3217
This was SVN commit r25104.
2021-03-22 18:49:42 +00:00
..
ObjectBases Removes unused containers included in headers. 2021-03-03 23:01:08 +00:00
ObjectTypes Removes usages of GetRenderPath to checking for support of shaders. 2021-01-16 23:18:56 +00:00
Scripting Refactor all usage of RegisterFunction to ScriptFunction::Register 2021-03-02 20:01:14 +00:00
SettingTypes Further header & precompiled cleanup, fix no-PCH builds. 2020-12-09 14:39:14 +00:00
tests Make real directory paths on the VFS predictable. 2021-03-22 18:49:42 +00:00
CGUI.cpp Refactors smart pointers creation, reduces code duplication and improves exception safety. 2021-02-13 23:53:40 +00:00
CGUI.h Removes unused containers included in headers. 2021-03-03 23:01:08 +00:00
CGUIScrollBarVertical.cpp Cleanup GUI includes, whitespace, map iterators, nullptr. 2019-09-22 23:28:25 +00:00
CGUIScrollBarVertical.h Delete GUI.h umbrella include following 8d0cb1b954. 2019-09-20 13:11:18 +00:00
CGUISetting.cpp Fix building without precompiled headers. 2020-11-18 11:35:36 +00:00
CGUISetting.h Improve JS Exception handling. 2020-11-15 18:29:17 +00:00
CGUISprite.cpp Use CGUI& instead of CGUI* so that the 50+ users stop wondering whether or not that is null and can't even be mistaken to add redundant null checks preemptively. 2019-08-21 10:12:33 +00:00
CGUISprite.h Clean up header includes, add new forward declarations. 2020-11-21 11:20:29 +00:00
CGUIText.cpp Sort GUI Object types, GUI Object bases and GUI Setting value types into three new folders. 2019-10-02 09:44:00 +00:00
CGUIText.h Sort GUI Object types, GUI Object bases and GUI Setting value types into three new folders. 2019-10-02 09:44:00 +00:00
GUIManager.cpp Replace DISCARD macro with ignore_result template. 2020-12-15 09:03:44 +00:00
GUIManager.h Removes unused containers included in headers. 2021-03-03 23:01:08 +00:00
GUIMatrix.cpp Move GetDefaultGuiMatrix to a separate file. 2019-08-04 03:52:00 +00:00
GUIMatrix.h Move GetDefaultGuiMatrix to a separate file. 2019-08-04 03:52:00 +00:00
GUIObjectTypes.cpp Add getTextSize() for CButton 2020-12-11 16:12:46 +00:00
GUIRenderer.cpp Reduces the number of GL state changes in GUI. 2021-02-11 19:15:35 +00:00
GUIRenderer.h Clean up header includes, add new forward declarations. 2020-11-21 11:20:29 +00:00
GUISettingTypes.h Sort GUI Object types, GUI Object bases and GUI Setting value types into three new folders. 2019-10-02 09:44:00 +00:00
GUIStringConversions.cpp Sort GUI Object types, GUI Object bases and GUI Setting value types into three new folders. 2019-10-02 09:44:00 +00:00
GUITooltip.cpp Sort GUI Object types, GUI Object bases and GUI Setting value types into three new folders. 2019-10-02 09:44:00 +00:00
GUITooltip.h Use CGUI& instead of CGUI* so that the 50+ users stop wondering whether or not that is null and can't even be mistaken to add redundant null checks preemptively. 2019-08-21 10:12:33 +00:00
IGUIScrollBar.cpp Further header & precompiled cleanup, fix no-PCH builds. 2020-12-09 14:39:14 +00:00
IGUIScrollBar.h Clean up header includes, add new forward declarations. 2020-11-21 11:20:29 +00:00
SGUIIcon.h Move GUIbase structs and enums to separate files. 2019-10-01 12:46:55 +00:00
SGUIMessage.h Allow right-click on disabled buttons. 2020-11-14 18:16:24 +00:00
SGUIStyle.h Move GUIbase structs and enums to separate files. 2019-10-01 12:46:55 +00:00