Commit graph

32 commits

Author SHA1 Message Date
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
b7c59622ec Remove two GetTemplateDataHelper unused arguments following 1b20ac7671 and 6643613b54, refs #3934, #4801 / D1938.
Reported By: Polakrity
This was SVN commit r22836.
2019-09-03 09:42:37 +00:00
elexis
be963ec9b7 Delete 27 invalid style settings and add LOGWARNING to inform future authors.
Unify the two IGUIObject::LoadStyle functions and remove CGUI argument
that is always identical to the member.

Differential Revision: https://code.wildfiregames.com/D2232
Tested on: gcc 9.1.0., clang 8.0.1, Jenkins

This was SVN commit r22792.
2019-08-27 16:03:24 +00:00
elexis
86c151ebaa PushGuiPage support for passing a function instead of a function name.
Allows coding the GUI without global functions which break
prototype-oriented coding, refs #5322, fixing the concern in 4b1297b328.

Supports stacked message boxes and removes the according workaround.
Change structree / civinfo switch-dialog code from 760a47335d to perform
the callback for page that actually registered the callback.
Ensure the parent that the callbackhandler is always called if the page
is closed.
Merge PopGuiPage and PopGuiPageCB following that choice, incidentally
leaving cleaner code.

Differential Revision: https://code.wildfiregames.com/D1684
Comments by: Yves, Vladislav, wraitii, leper
This was SVN commit r22676.
2019-08-16 18:46:04 +00:00
elexis
e370c509a6 Small closePage() cleanup for D1684.
Rename close() to closePage() for structree / template viewer / civ info
for global consistency.
Remove a splashscreen proxy and move splashscreen closing from XML to
closePage() in JS.

This was SVN commit r22669.
2019-08-15 13:29:11 +00:00
wraitii
6643613b54 Easier introduction of new damage types.
725aa8a686 introduced a DamageTypes.js global script similar to the
resources one. However, we never actually need to refer to this script
since we can always use the damage types provided by the
template/context/object we are looping over/...
There is one exception to this for AI weighting of damage types.
However, since damage types are not stored in files, this is strictly
equivalent to hardcoding them in the global script and was deemed
acceptable.

Patch By: freagarach
Reviewed By: wraitii
Refs #4801 (by invalidating it for now, though such helper files might
be useful in the future if damage types require more metadata).

Differential Revision: https://code.wildfiregames.com/D1938
This was SVN commit r22527.
2019-07-22 18:37:18 +00:00
s0600204
9c5062147a Add a GetTextSize() method to GUI objects
Usage:
  let size = Engine.GetGUIObjectByName({gui_object_name}).GetTextSize()

Returns a JS object containing the height and width of the primary text
field within
the object, taking into account new lines, text wrapping, and font
changes.

Unless the object doesn't contain text, in which case the method will
return undefined.

Commented on by: vladislavbelov
Additional code by: elexis
Reviewed By: wraitii
Differential Revision: https://code.wildfiregames.com/D844
This was SVN commit r22134.
2019-03-18 22:15:40 +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
s0600204
262a0f7c68 Show correct cost for trainable gaia animals in structree and viewer
Reported by: causative
Refs: D297

This was SVN commit r21571.
2018-03-16 21:39:06 +00:00
s0600204
9f47cc2403 Account for upgrade options of parent when determining base template for Template Viewer
Reported by: wowgetoffyourcellphone
Report:
https://wildfiregames.com/forum/index.php?/topic/24027-viewer/&do=findComment&comment=349110

Refs: D297, c8fda40b02

This was SVN commit r21410.
2018-03-01 23:50:27 +00:00
elexis
db07c11216 Maximize civ selection dropdown size in the gamesetup, i.e increase the size by 3 more civs.
Further increasing the size for mods was neglected in d6c028923e / D527
and
Delenda Est had a copy of gamesetup.xml to extend the size already.

This was SVN commit r21353.
2018-02-24 12:19:47 +00:00
s0600204
1d0700c3cb Reduce duplication in code compiling template lists in Reference Suite
Also supports having initial start entity templates not in the usual
`simulation/templates/{structures|units}` folders

This was SVN commit r21340.
2018-02-23 22:04:45 +00:00
s0600204
760a47335d Add buttons for changing between, and hotkeys for opening, the civinfo and structree
Patch by: fpre
Reviewed By: s0600204
Fixes: #4970
Differential Revision: https://code.wildfiregames.com/D846
This was SVN commit r21339.
2018-02-23 20:54:28 +00:00
s0600204
c8fda40b02 Implement an in-game Template Details Viewer
Right-click on icons of units, structures, technologies, flora, fauna,
etc. and view additional details.


Reviewed By: elexis
Fixes: #3212
Differential Revision: https://code.wildfiregames.com/D297
This was SVN commit r21310.
2018-02-21 21:39:00 +00:00
s0600204
9501292661 Merge the structree's loadUnit and loadStructure functions
The resultant function should be able to handle any (selectable) entity
template.

This was SVN commit r21174.
2018-02-11 04:09:28 +00:00
s0600204
a9f701a475 Unify structree build queue loading duplication.
In similar vein to c53adeaaa6

This was SVN commit r21118.
2018-02-06 01:14:17 +00:00
elexis
c53adeaaa6 Unify structree production queue loading duplication.
Differential Revision: https://code.wildfiregames.com/D1192
Reviewed By: s0600204
This was SVN commit r21022.
2018-01-26 22:18:35 +00:00
elexis
2d187ba735 Fix unintented newline in 435081f916.
Display the tech filename in the structure tree warning rather than the
english label to ease mod debugging.

This was SVN commit r20811.
2018-01-09 21:38:17 +00:00
s0600204
f6b5488a24 Move unravelPhases function from structree to globalscripts for use in AI init.
Reviewed By: mimo
Differential Revision: https://code.wildfiregames.com/D1183
This was SVN commit r20750.
2018-01-02 06:38:09 +00:00
s0600204
00b05fd9f7 Use phase techs to determine phase order in structure tree.
(Instead of non-phase techs which is what it was using up to now.)


Reviewed/accepted by: mimo
Changes agreed (but not tested/formally proven) by: elexis

Differential Revision: https://code.wildfiregames.com/D1181
This was SVN commit r20749.
2018-01-02 06:23:33 +00:00
s0600204
7aae697bc5 Remove civ-specific hardcoding in rmgen wall-placement script.
Original Patch By: FeXoR
Reviewed By: FeXoR
Commented On By: elexis
Refs #2944
Differential Revision: https://code.wildfiregames.com/D900
This was SVN commit r20625.
2017-12-10 03:12:54 +00:00
mimo
2a6fcafbae Add a {native} civ replacement in buildable and trainable template names
Reviewed By: wraitii, elexis, with inputs from s0600204
Differential Revision: https://code.wildfiregames.com/D1084
This was SVN commit r20603.
2017-12-07 18:33:08 +00:00
elexis
7fda43d14e Expose the same file listing function to JS GUI, simulation and rmgen, refs #4868.
Removes the workaround and limitations of globalscripts Resources
(52f311da2b) and loadCivFiles (89055ef858), allowing them to actually
become actually global.
Rename to ListDirectoryFiles as proposed by wraitii.

Differential Revision: https://code.wildfiregames.com/D1103
Reviewed By: s0600204
Proofread by: echotangoecho
Comments by: wraitii
Relevant discussions with leper in #4868, D1062

This was SVN commit r20586.
2017-12-04 23:46:55 +00:00
mimo
8de5c26540 Allow civ specific techs with {civ}
Discussed with leper

Reviewed By: bb
Trac Tickets: #4589

Differential Revision: https://code.wildfiregames.com/D1024
This was SVN commit r20551.
2017-11-28 20:43:00 +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
elexis
89055ef858 Delete GetCivData from MapGeneratorWorker.cpp which is redundant with the ReadJSONFile from 871ed04521.
Unify civ file loading from gui/common/functions_civinfo.js and
rmgen/library.js in globalscripts/Templates.js.
Delete the two forgotton headers in 4275a8a33c.

Refs #4868, #4804, D900.
Differential Revision: https://code.wildfiregames.com/D1062
Discussed with: leper

This was SVN commit r20528.
2017-11-26 13:30:57 +00:00
Imarok
6c5a8269f3 Fix some style issues noticed by our linter
Reviewed By: bb
Differential Revision: https://code.wildfiregames.com/D585
This was SVN commit r20322.
2017-10-21 17:31:05 +00:00
leper
725aa8a686 Move damage types definition to a new helper similar to how resources are handled.
This should make adding new damage types a little easier, however such
an
extension would still need changes to the AI, and to all templates that
have Armour, Attack, or DeathDamage.

Reviewed By: elexis
Differential Revision: https://code.wildfiregames.com/D866
This was SVN commit r20203.
2017-09-18 16:33:56 +00:00
elexis
3c73b329f2 JS cleanup.
Mark global consts as variable if mods can legitimately modify them.
Keep global objects const if mods should insert their modifications at a
different place, refs D829.
Mark the few consts inside function scope as let or var for consistency.
Don't touch the AI, simulation test and rmgen folder.
Change some var to let.
Remove an unused variable in the mainmenu and summary screen.
Inline few variables.

This was SVN commit r20047.
2017-08-26 20:10:39 +00:00
elexis
b5ea27904d JS GUI cleanup.
Mark g_CivData as const and don't use optional arguments at loadCivData.
Translate the infinity symbol in the summary screen.

Refs D829
Reviewed By: s0600204
This was SVN commit r20043.
2017-08-26 18:53:37 +00:00
elexis
c4cef0d289 Don't write two helper variables to g_CivInfo in the structure tree,
so that the object has the same content throughout the entire GUI and
can be marked read-only.

Refs D829
Reviewed by: s0600204
This was SVN commit r20042.
2017-08-26 17:57:11 +00:00
s0600204
cdf6109713 Relocate and Rearrange the structree codebase
Makes it possible to reuse the more generic parts of the `structree`
codebase in other pages without including `structree`-specific logic.
This sets the stage for further reference/encyclopedia-type pages.

Reviewed By: fatherbushido, elexis
Differential Revision: https://code.wildfiregames.com/D295
This was SVN commit r19940.
2017-07-31 12:49:00 +00:00