Commit graph

40 commits

Author SHA1 Message Date
phosit
434a1a1905
Remove Engine.SwitchGuiPage from mod 2026-04-26 12:44:41 +02:00
phosit
40762c257d Quit Engine by closing the root page
When the root page gets closed the engine quits instead or crashing.
The root pages are changed to use that mechanism to quit the engine.
This removes the need of `Engine.Exit` for the GUI.
2025-03-12 12:07:37 +01:00
phosit
df5fee6103 Rename PushGuiPage to OpenChildPage
There is no `PopGuiPage` anymore. For symmetry there should also be no
`PushGuiPage`.
2025-03-09 10:39:20 +01:00
Dunedan
fc7e4ae69e
Small UI adjustments for better text fitting
When running 0ad with a language other than English, there are various
places where text doesn't properly fit. This adjusts the UI in a bunch
of these places to better accommodate longer strings as they appear in
other languages than English and to make the UI look more uniform in
general.
2024-12-28 08:52:13 +01:00
Stan
9af1433995 Rename the "color" property of COlist columns to "textcolor"
Patch by: @Vantha
Differential Revision: https://code.wildfiregames.com/D5278
This was SVN commit r28120.
2024-06-22 20:18:09 +00:00
bb
ca4ee134fc Add tooltip to modmod explaining about loading order
Patch By: Ceres
Reviewed By: marder
Comments By: Stan
Differential Revision: D4252
This was SVN commit r25925.
2021-09-17 14:41:09 +00:00
wraitii
bce26e905f Mod selector: "start mods" saves the configuration.
Differential Revision: https://code.wildfiregames.com/D3992
This was SVN commit r25573.
2021-05-26 13:27:43 +00:00
Angen
f1acd22455 Do not allow to start pyrogenesis with incompatible mods
Fixing following problems:
Issue number one:
Enable mod with a23 compatibility in a23b.
Save configuration.
Start a24.
Better result:
Mod will be enabled and invisible in mod selection screen producing
various errors.
Worse result:
Game will crash and refuse to start.

Issue number two:
Mods can silently set loaded mods without restarting the engine, so mods
can unlist themselves from compatibility detection.

Solution:
Enable necessary mods instead if running with gui and open mod page.
Open information window on top of mod page to infom why mod page is
showing up.
On mod page show mods which failed in compatibility check and color the
resposnible ones.
Disable start button without enabled mods.
Show non existed mods if they failed in compatibility check.

Else just log to mainlog and close.

Another fixes:
Display in enabled mods really enabled mods as current logic confuses
players about which mods they have enabled and is not helpful (ref
#4881)

Note:
this will not solve issue with mods claiming being compatible with
engine version while in fact being incompatible.

Comments by: @vladislavbelov, @Stan, @Imarok
Tested by: @wraitii
Differential revision: D3592
Fixes: #6044 #4881

This was SVN commit r25410.
2021-05-09 13:53:25 +00:00
Angen
841bf5f2dd Color incompatible mods and add filter
This helps to see compatible mods in the list, which can get a bit long.
For incompatible mods in disabled section use gray colour.
For incompatible mods in enabled section use red colour (what can happen
when using arguments to start the game or they can be in config file).
Add option to filter compatible mods, this does not affect enabled
section, because if there is incompatible mod, it is error and it needs
to be always visible.
Add function recomputeCompatibility and g_ModsCompatibility to avoid
recomputing aredependenciesmet when coloring mods, because every column
is colored separately.
Disable enable mod button if mod is incompatible.
Remove all dependencies met messages as they are now replaced by this
mechanism.

fix getSelectedModUrl in process

Differential revision: D3687
Fixes: #6053
Tested by: @Freagarach
Comments by: @vladislavbelov
This was SVN commit r25095.
2021-03-21 10:22:50 +00:00
Angen
1c68d9890b Remove redundant applyFilters method from modmod
All functionality in applyFilters is handled by displayModLists and
modSelected functions.
This is also fixing issue of triggering selected event on the same list
multiple times and not updating mod description and buttons when
applying filters.

Differential revision: D3722
This was SVN commit r25094.
2021-03-21 08:51:17 +00:00
wraitii
1c9efa6fb5 Implement Single-Player campaigns - Barebones tutorial campaign included.
This implements necessary tooling to create a simple SP campaign.
The architecture is intended to be easily extensible in the future.

'Campaign Run' contains the metadata of a campaign, e.g. maps
played/won. It's saved in the user folder under
saves/campaigns/*.0adcampaign
Campaign templates are JSON files in campaigns/

Campaigns can specify which Menu interface they will use. This is
intended to allow more complex layouts/presentation.
For now, a simple list interface is provided. This allows making
campaigns without any fancy art required (and effectively mimics AoE1's
campaign interface).

The behaviour on game end is also intended to be extensible, supporting
things such as carrying over units between scenarios - for now, it
simply records won games.

GameSetup is not available for now - scenarios are triggered with the
settings defined in the map/default settings. Improving on this requires
refactoring the gamesetup further.

The load/save game page has been extended slightly to support
showing/hiding campaign games (campaign gamed are saved under saves/
directly, there is no strong motivation to do otherwise at this point)

Closes #4387

Differential Revision: https://code.wildfiregames.com/D11
This was SVN commit r24979.
2021-03-02 15:43:44 +00:00
Angen
75b8d3194e Show a default value in playersFilter input to show user what it is for [v2]
Redo original diff D245 by ffffffff after commit of cpp changes for
input placeholders.

Differential revision: D3245
Reviewed by: bb
Comments by: Stan, wraitii
This was SVN commit r24439.
2020-12-23 15:50:16 +00:00
Angen
37e08a4ffb Implement placeholder text for input fields and get rid of hack with mod filter
different font colour
no need to delete the text, when one wants to write there something
text displayed is not a value so field is technically empty
will disappear when user writes some character
will appear when user deletes all characters
we can get rid of text value "Filter" in mod selection screen and ugly
hack around it

Differential Revision: D2460
Comments by: vladislavbelov, elexis
This was SVN commit r24433.
2020-12-21 09:04:12 +00:00
Imarok
0c917a2a52 Fix button caption and enable in modmod
Differential Revision: https://code.wildfiregames.com/D1623
This was SVN commit r23506.
2020-02-17 18:22:52 +00:00
bb
a852bffeaa Standardize modmod buttons width
Patch By: Nescio
Differential Revision: https://code.wildfiregames.com/D2569
This was SVN commit r23393.
2020-01-14 21:02:48 +00:00
elexis
702cdbf0c7 Remove GUI object setting values z="0", size="0 0 100% 100%", hidden="false" in XML page specifications that are redundant with the default style values.
Remove question by brian in single_details_area.xml from b66d1716e7
which is answered by "because the style set it".
Delete BuildNameText style, because it specifies ghost="true" in both
style and sole object using the style.
Don't touch progressbar and structree styles, because there is more to
clean.

Differential Revision: https://code.wildfiregames.com/D2292
This was SVN commit r22957.
2019-09-21 15:54:25 +00:00
elexis
d412b2010b Delete unused CCheckbox text setting remains following b1422137e5, refs 0f807c643a.
Differential Revision: https://code.wildfiregames.com/D2314
Tested on: clang 8.0.1., Jenkins

This was SVN commit r22952.
2019-09-21 03:11:18 +00:00
elexis
0c3a610acc Delete invalid ModmodScrollbar style use and style property from 64bfa089af and 833c9f108c, identified by the LOGWARNING from be963ec9b7, reported by nani.
This was SVN commit r22800.
2019-08-29 07:56:26 +00:00
elexis
da49aa1541 Refactor lobby terms and conditions UI from 80dbd1f2a3 / D1568 to a new terms dialog UI and reuse that for mod.io and the UserReporter, refs #5257, #5218.
Reuse all existing strings, use a FileExists hack for mod.io until the
new strings are committed.
Rename prelobby/common/terms/terms.js to termslobby.js for easier
distinction from common/terms.js.

Based on patch by: bb
Differential Revision: https://code.wildfiregames.com/D1602
refs https://code.wildfiregames.com/D1601
refs https://github.com/bb-bb/0ad/tree/terms
refs https://github.com/elexis1/0ad/tree/terms

This was SVN commit r21887.
2018-09-14 15:14:48 +00:00
Itms
e84e712801 Enlarge some GUI elements in order to display correctly the majority of strings for the bundled languages.
This was SVN commit r21804.
2018-04-29 14:34:10 +00:00
Itms
833c9f108c mod.io support.
mod.io is a new platform for sharing mods, that 0 A.D. can make use of
in order to download mods and install them.

Based on patch by leper, numerous changes from s0600204, vladislavbelov,
Imarok, elexis, temple and myself.
Differential Revision: https://code.wildfiregames.com/D1029
This was SVN commit r21759.
2018-04-22 18:14:45 +00:00
Imarok
724b25bac6 Style adjustments to 936c16050b
This was SVN commit r21738.
2018-04-17 17:31:11 +00:00
Imarok
936c16050b Make modmod looking nicer
Reviewed by: Itms
Differential Revision: https://code.wildfiregames.com/D1412
This was SVN commit r21721.
2018-04-14 20:04:17 +00:00
elexis
8aaff7fc62 Implement an auto-scroll setting for GUI lists.
Patch By: fpre / ffffffff
Fixes #4987, refs #4254

This allows the replay menu and lobby to focus the selected element if,
but only if it is expected by the user.
Replaces 3f5648767d which scrolled the selected player into view every
single time a new playerlist was received by the lobby server.

This was SVN commit r20958.
2018-01-22 04:45:27 +00:00
elexis
16dab5a587 Hide the cancel button in the modmod of the mod mod and the quit button when called from the public mod.
Differential Revision: https://code.wildfiregames.com/D1141
Reviewed By: Grugnas
Refs #4890

This was SVN commit r20645.
2017-12-12 16:06:52 +00:00
elexis
0d51f0391a Add buttons to visit the website of the selected mod.
Differential Revision: https://code.wildfiregames.com/D1101
Refs #4890
Reviewed By: Grugnas
Comments By: fpre / ffffffff
This was SVN commit r20599.
2017-12-06 19:58:23 +00:00
elexis
5e85ca5d7b Deprecate type property of mods.
Such a property should be well defined, but currently it contains
arbitrary text and is redundant with the description.

Differential Revision: https://code.wildfiregames.com/D1082
Refs #4890
Discussed with: leper
Reviewed By: wraitii
This was SVN commit r20575.
2017-12-03 21:44:16 +00:00
elexis
71ef1a6e95 Replace mod selection sorting choice dropdown and checkbox with the column based sorting from b8fce56821, refs #2405.
Use case insensitive sorting iff it's the locale default.

This was SVN commit r20555.
2017-11-29 12:47:16 +00:00
elexis
d3ce5289b6 Cleanup mod selection GUI page.
Refactor functions and unify sort dropdown choices.
Move colors to globals so that they are easily modifiable, even from
external files, refs fd034c9bcd / D911.
Fix broken "Dependency not met" translation and wrong equal comparison
operator description (== vs =), refs 64bfa089af.
Use localeCompare, simpler loops and array functions, JSdoc syntax,
ternaries, deepfreeze, let keyword and prefix increment operator.
Renames to increase descriptiveness and consistency.
Remove duplication, tautologic and unsatisfiable conditions, dead code,
unused variables and GUI object names, example within example,
unneeded variables, parentheses, TODOs, strict checks and keep XML
element, misleading linebreaks, pointless comments and "Mods Loaded"
string and the switch fall-through.

This was SVN commit r20552.
2017-11-28 22:43:27 +00:00
elexis
752005c4a4 Enable and disable mods more comfortably using the doubleclick event, refs #3574 / 70164a02c4.
Filter mods while typing, refs D860 / 7a157faf3c.

This was SVN commit r20550.
2017-11-28 18:57:01 +00:00
elexis
b1a116db37 Move translate functions from mod/globalscripts/ to mod/gui/common/.
This throws reference errors at JS compile time when attempting to
translate strings in the simulation.

Differential Revision: https://code.wildfiregames.com/D1075
Refs D619
Reviewed By: bb
This was SVN commit r20549.
2017-11-28 18:48:52 +00:00
elexis
9950e06d4c Include entire directories in GUI pages instead of a subset of the files contained, where possible.
This allows mods to add new JS files without introducing a hardly
maintainable copy of the XML file.

Differential Revision: https://code.wildfiregames.com/D619
Proofread By: bb
This was SVN commit r20535.
2017-11-27 16:29:23 +00:00
leper
fd034c9bcd Use white text in the mod selection screen. Patch by Nescio.
Differential Revision: https://code.wildfiregames.com/D911
This was SVN commit r20195.
2017-09-18 03:08:25 +00:00
elexis
8f1b37b216 Major ordered list GUI cleanup. Patch by Imarok, fixes #3905.
Remove m_SelectedDef, m_SelectedColumnOrder and m_HeadingHeight. Use
GetSetting and SetSetting instead. Thus
implement selecting a column / column order sprite from JS correctly.
Since the actual list sorting is done in JS, only the column header
sprites were inaccurate.

Remove "selected_def" since that is redundant with "selected_column".
Merge "selected_column" with "default_column" (and
"selected_column_order" with "default_column_order") since
all properties provided in XML pages are defaults and to remove the
copying on init.

Rename "def" to "column" and "ObjectDef" to "COListColumn".
Replace 30px header height hardcoded in the C++ with an option set by
the style.
Remove the unneeded requirement to specify a "list_name".
Thus rename "list_name" to "list_month" in the replay menu.
Remove unneeded "list_" prefix and substr(5) in column checks.
Use ranged loops.
Fix typo "Avalible".
Add an error message if the GUI style doesn't specify the selected
column order.

This was SVN commit r18652.
2016-08-31 19:29:48 +00:00
historic_bruno
a964e83c79 Fixes button order consistency in a few places: resign confirmation, manual, splashscreen, fixes #2837. NOTE: the convention is Cancel/Back button on the left, other action buttons are to the right. Please report any you find that don't match that!
Adds hotkey.cancel mapped to the Escape key, which is now used for
closing/canceling in-game dialogs, fixes #2636, #3200. Please report any
dialogs where Esc doesn't work!

This was SVN commit r16736.
2015-06-08 03:07:45 +00:00
leper
0aa7e882b7 More gui cleanup.
This was SVN commit r16263.
2015-02-03 02:37:42 +00:00
leper
1d1c086e2a Allow translating some strings in the mod selector. Fixes #2919.
Also change column size so that the gd translation fits. (Verified with
long strings)

This was SVN commit r15932.
2014-11-07 00:57:09 +00:00
leper
d6709d3e08 Ignore mods (in the modmod) that do not specify required properties. Fixes #2822. Refs #2794.
Fixes description display if filters are used.

This was SVN commit r15792.
2014-09-24 01:36:57 +00:00
Itms
c56089a082 Reference a missing script file in the mod selector.
Reported and patched by Radagast, fixes #2762

This was SVN commit r15699.
2014-09-03 16:58:08 +00:00
leper
64bfa089af Add mod selection mod.
Includes some contributions by rada and sanderd17.

This was SVN commit r15677.
2014-08-25 16:02:54 +00:00