Commit graph

50 commits

Author SHA1 Message Date
phosit
d842a134f9
Remove Engine.SwitchGuiPage from loading 2026-04-26 12:44:40 +02:00
ramtzok1
1b797ce0a0
Add specific tips for multiplayer sessions
A multi player loading screen will have possibility of showing single
and multi player tips while multi player tips are in favor.

Tips are now separated by categories. During loading those category
have an occurrence probability, where we are choosing a random category
based on chance and not by complete randomness. From there we just
picking a random tip from that category.
2025-04-12 10:38:57 +02:00
Vantha
d7dda097e1 Extend the tips page for multiple images per tip
Enable the Tips and Tricks page to show multiple images for each tip.
Add a small GUI panel below the image for switching between them.
Only show it when the current tip has more than one images.

Introduce tipfiles.json to assign images to the text files.
(And stop of relying on file naming)

Add a tip about wonders, and make some slight changes to other texts.
Improve existing tip images and add a bunch of new ones.
2024-12-20 19:46:07 +01:00
Vantha
38b71c1bac Add a Tips and Tricks page containing the loading screen tips
- Small popup page accessible from the main menu via Learn to Play.
- Lets the player read through the tips with 'Previous' and 'Next' buttons.
- Tips continue to be shown on the loading screen.
-> but there without the scrolling ability.

- Added two new hotkeys for quicker tip changing (item.prev and item.next)
-> set to the left and right arrows respectively by default.

- Responsible scripts are placed in gui/reference/tips/.
- The tip text files have been moved to gui/reference/tips/texts/.
- Tip image files have been moved to art/textures/ui/tips/.

- Added a series of new sprites (textures in art/textures/ui/tipdisplay/)
-> comprises a title decoration, a bullet point sprite, and a new button
style.
2024-09-30 06:22:47 +02:00
elexis
c16eddaedc Rewrite loading screen to use class semantics, refs #5387.
Add config option to display the loading screen stage description.
Add tip functions for future use, refs D1730.
Harmonize coordinates.

Differential Revision: https://code.wildfiregames.com/D2418
This was SVN commit r23150.
2019-11-12 15:54:09 +00:00
elexis
feb88a337a Pass arbitrary arguments to GUI events / SendEventToAll and remove loading screen progess workaround, refs D1716, 6d792365aa, bd3bd084c0, 4b1297b328, db5d4bb5f1.
Differential Revision: https://code.wildfiregames.com/D1754
Reviewed By: Itms
Comments By: leper
This was SVN commit r22515.
2019-07-19 21:15:04 +00:00
Imarok
c158785f13 Remove and Update some outdated tips and refactor tip displaying
Reviewed by: s0600204, Nescio, Imarok
Patch by: Angen
Refs: #4428
Differential Revision: https://code.wildfiregames.com/D1377
This was SVN commit r22137.
2019-03-20 22:27:54 +00:00
elexis
58b2e2baf4 JS file listing cleanup, refs #4868.
Add global filelisting helper.
Remove getXMLFileList and getJSONFileList from the unsorted
gui/common/functions_utility.js.
Make hidden maps prefix more transparent.
Remove hardcoded magic numbers that are string lengths.
Shorten loading screen code and separate pathnames from code.

Differential Revision: https://code.wildfiregames.com/D1107
Reviewed By: bb
This was SVN commit r20692.
2017-12-26 22:44:37 +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
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
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
8c2a5f7bc8 Ensure that the quote of the day isn't empty by filtering blank lines.
Patch By: Sandarac
Differential Revision: https://code.wildfiregames.com/D224
This was SVN commit r19300.
2017-03-16 19:11:27 +00:00
elexis
08fbf223f6 Unify random integer and float helper functions of GUI, Simulation and AI.
Patch By: bb
Differential Revision: D121
Refs: #4326

Removes the Random.js simulation helper and randomFloat function of the
random map scripts library.
Adds randomIntInclusive and randomIntExclusive to make the calls more
readable and fix and prevent off-by-one mistakes.
Adds randBool and use it in an AI occurance. It will be used in many
places by the random map scripts.
Use the pickRandom function introduced in 3c56638e8b in more applicable
occurances.
Replace remaining occurances of Math.random() with the new functions to
easily test completeness.

Cleanup of the random map script functions will come in a separate
commit.

This was SVN commit r19270.
2017-03-03 21:13:10 +00:00
elexis
a89f521e08 GUI cleanup.
Remove sprintf from untranslated error messages, unneeded braces and
comments, add missing quotes.

This was SVN commit r18934.
2016-11-14 13:43:27 +00:00
elexis
34ce0f865d Reset the cursor when opening new GUI pages. Patch by danger89, refs #539.
Remove duplicate cursor image and duplicate hardcoded default paths.

This was SVN commit r18933.
2016-11-14 13:23:07 +00:00
elexis
856dc1c999 Network cleanup.
Send the "client has rejoined" message after the synchronization
finished instead of right after the loading screen.
Patch by echotangoecho, refs #1949, #1950.

This was SVN commit r18203.
2016-05-19 21:03:46 +00:00
elexis
57af0ac8b4 Session chat cleanup.
Remove duplicate call to parseChatCommands.
Rename msg.action to msg.me, as it only applies to the "/me" chat
command.
Remove some duplicate checks.
Remove unused variable userTag.
Also fix a wrong space in the loading screen.

This was SVN commit r17528.
2015-12-22 14:56:30 +00:00
elexis
72dcd7422d Loading screen cleanup. Patch by Stan, refs #2087.
Use let instead of var.
Use g_ prefix for globals.
Remove trailing whitespace.

This was SVN commit r17523.
2015-12-20 23:02:18 +00:00
mimo
4235c67764 still another bunch of cleanup (mainly missing semicolon) signaled by jshint
This was SVN commit r17046.
2015-09-19 12:55:58 +00:00
leper
7a70c475df Improve rejoin messages. Patch by elexis. Fixes #1949.
This was SVN commit r16614.
2015-05-03 02:06:17 +00:00
JoshuaJB
e4d3189494 Lots of GUI fixes to issues pointed out by alpha123 on IRC.
This was SVN commit r15235.
2014-05-27 05:34:28 +00:00
Gallaecio
b5dfacbf18 Translated map name in the loading screen, regenerated translation templates and updated translations from Transifex
This was SVN commit r15053.
2014-04-28 12:31:28 +00:00
Gallaecio
e05c8263c5 Internationalization of the public mod (JavaScript and GUI XML side)
It includes a marvelous language selection menu developed by Yves.

It also includes the introduction of a sprintf implementation for
JavaScript, as well as
translation helper functions that use JavaScript-side translation
caching.

This patch includes code by Yves, sanderd17, leper and Gallaecio.

Ref #67

This was SVN commit r14954.
2014-04-20 20:51:48 +00:00
Yves
4b1297b328 Removes g_ScriptingHost and implements global to compartment 1 to 1 relation.
Each GUI Page gets its own compartment and all ScriptInterfaces in the
same thread should now use the same JS Runtime.
This is required for the SpiderMonkey upgrade.
Check the ticket for details.

Closes #2241
Refs #1886
Refs #1966

This was SVN commit r14496.
2014-01-04 10:14:53 +00:00
Yves
3ab983f8a1 Some "varfare" again plus a call to initMusic because that will be needed for the Spidermonkey upgrade.
This was SVN commit r14188.
2013-11-15 18:35:19 +00:00
historic_bruno
7901ed51d4 Implements skirmish maps, based on patch by sanderd17, fixes #1198. Skirmish maps are like scenarios, except the player can choose their civ during match setup. To create a skirmish map: place some skirmish entities for each player in Atlas (see templates/skirmish/* for examples), uncheck the player's civ in Atlas' player panel if desired, and save in the maps/skirmishes directory. The map will appear in match setup under the "Skirmish" match type.
Implements custom, VFS-based map load/save dialogs for Atlas (replaces
broken native file dialogs), fixes #631, #889.
Fixes map loading/saving to handle arbitrary subdirectories for better
organization.
Adds default settings to Atlas player panel, fixes #1872. Each setting
now has a checkbox to choose whether it should be saved with the map
(avoids writing lots of useless default data for each map).
Adds map preview setting to Atlas, refs #1745.
Cleans up and simplifies some duplicate code.
Fixes optional serialization performance test.

This was SVN commit r13938.
2013-10-04 02:29:16 +00:00
WhiteTreePaladin
b65b7d95e7 Make the progress bar finish early so that the user can actually see it finish. Display percent progress rather than details.
This was SVN commit r10272.
2011-09-13 12:24:13 +00:00
WhiteTreePaladin
be69735582 Trying to clean up music in the scripts. It is still broken.
This was SVN commit r10249.
2011-09-11 03:30:41 +00:00
WhiteTreePaladin
142bd05380 Menu: removed autohiding, doubled speed, added sound effects. GUI art: changed gold titlebar back to bronze, made progressbar consistent with titlebar. Repositioned start game button.
This was SVN commit r10155.
2011-09-01 02:36:38 +00:00
historic_bruno
fb411d3f39 Fixes slightly broken game attributes and setup.
Includes random map size and seed in reportPerformance. Fixes #793.
Fixes loading screen to use actual map names.

This was SVN commit r9336.
2011-04-28 01:21:02 +00:00
historic_bruno
2b138f47db Handle map loading errors in autostart and normal setup modes. Adds TODOs for Atlas and Replay modes. See #764.
Fixes loading screen 'title'.
Fixes broken autostart behavior for random maps and multiplayer games.

This was SVN commit r9193.
2011-04-07 02:32:16 +00:00
Ykkrosh
23a3dfe755 Fix typo in error message.
This was SVN commit r8863.
2011-01-12 12:19:13 +00:00
WhiteTreePaladin
6e37762e3c fix some more issues with the loading tips
This was SVN commit r8781.
2010-12-03 23:52:11 +00:00
WhiteTreePaladin
83f297182e Fix tip loading issue with pre-converted textures
This was SVN commit r8780.
2010-12-03 23:31:02 +00:00
WhiteTreePaladin
c922912ac5 Cleaned up loading files
Changed single player start game text

This was SVN commit r8735.
2010-11-28 17:27:00 +00:00
WhiteTreePaladin
db22548ecb New loading screen style (may need more polishing)
This was SVN commit r8699.
2010-11-27 03:07:48 +00:00
WhiteTreePaladin
042972e298 Renamed "session_new" to "session"
This was SVN commit r8608.
2010-11-14 20:32:38 +00:00
Ykkrosh
5d764f1435 Run network server in a separate thread, to minimise latency.
Make some parts of logger and console thread-safe.
Simplify console: remove special commands; remove prefix for script
commands.
Remove LOG_ONCE, to simplify logger.
Change some code to use the new logger interface.
Fix OOS when revealing map.
Clean up some formatting.

This was SVN commit r8511.
2010-10-31 22:00:28 +00:00
Ykkrosh
10c5dbcba4 Fix Atlas and autostart.
Fix non-POD in varargs.
Remove misleading max_players config variable (the engine doesn't care
about it, all the limits are hard-coded).
Remove civ-center-based player civ initialisation hack.
Add dummy player_defaults.json.
Clean up formatting a bit.

This was SVN commit r8498.
2010-10-30 13:27:23 +00:00
historic_bruno
9ee44bd9b8 Game setup changes, including showing name, civ, team, and some options loaded from the scenarios. Civ data added. Civ info window to preview civs. Icon tooltips. Support for random map implementation. Fixes #590.
This was SVN commit r8494.
2010-10-30 04:02:42 +00:00
Ykkrosh
5eedb07297 Fix selection of loading screen textures with pre-converted texture cache
This was SVN commit r8305.
2010-10-07 19:56:13 +00:00
Ykkrosh
64daef95df Fix chat to use GUID instead of host ID.
Fix randomly incorrect player names.
Fix script errors when connecting to an invalid IP address.
Adjust the server/client disconnection messages to be a bit more
accurate.

This was SVN commit r7946.
2010-08-14 19:45:22 +00:00
WhiteTreePaladin
4cfca1625d Added Multi-player chat in menu and hotkey (return key)
Made player names match custom names in multi-player

The chat window will still need some more aesthetic work

This was SVN commit r7909.
2010-08-11 22:16:16 +00:00
Ykkrosh
9674c3c0fe Remove ScriptingHost initialisation code (share with ScriptInterface instead).
Fix GUI scripts to avoid strict warnings.
Rejig GUI/SpiderMonkey interface to use less custom code, and to work
with JSOPTION_VAROBJFIX.
Add event name to GUI event handler function names (visible in the
profiler).

This was SVN commit r7769.
2010-07-19 23:01:58 +00:00
Ykkrosh
1c0536bf08 # Refactored the networking code, and redesigned the game setup screen.
Major updates to most network classes.
Simplify CNetServer so it doesn't duplicate any client behaviour; all
players now run CNetClient.
Remove most player/slot management from networking code.
Wait for all players to finish loading before starting the simulation.
Remove CGameAttributes; attributes are now just a JS object.
Remove CPlayer; they are now just simulation entities.
Handle player colours via simulation system.
Add a default map for Atlas, so it always has something to load.
Move network documentation to Doxygen.
Remove lots of now-unused code.

This was SVN commit r7653.
2010-06-30 21:41:04 +00:00
Ykkrosh
8c1a3f7c8a Protect against missing globals when loading GUI in unusual ways
This was SVN commit r7550.
2010-05-20 00:57:03 +00:00
Ykkrosh
e140aa7baf Avoid running the old simulation code in the background when it's not needed.
Optimise GUI updates to only occur when necessary.
Switch to more peaceful music after starting the game.

This was SVN commit r7492.
2010-05-01 16:20:58 +00:00
Ykkrosh
7c2e9027c2 # Rewrite of the game's simulation system
Giant merge from
http://svn.wildfiregames.com/hg-source/file/5fb522019d5e
Infrastructure is largely complete, gameplay is largely missing
Disabled by default; use command-line flag "-sim2"
(Second attempt at commit...)

This was SVN commit r7259.
2010-01-09 19:20:14 +00:00
Ykkrosh
5a53b3183a Remove old debug statement
This was SVN commit r7238.
2009-12-31 16:47:02 +00:00
Ykkrosh
f0d9806b3f # Restructured GUI implementation
CGUI now represents a single 'page'. CGUIManager maintains multiple
pages and switches between them.
Split the XML files into pregame, loading, session and messagebox pages.
Added hotloading of GUI pages.
Minor GUI cleanups.
(Merge from hg 81862d33780c)

This was SVN commit r7214.
2009-12-03 20:17:22 +00:00