#1668 closed enhancement (fixed)
[PATCH] Add "Random" option to map selection dropdown
Reported by: | O.Davoodi | Owned by: | O.Davoodi |
---|---|---|---|
Priority: | Nice to Have | Milestone: | Alpha 12 |
Component: | UI & Simulation | Keywords: | gui match setup map patch |
Cc: | Patch: |
Description
Here is a patch. Notice that there is no such an option for scenarios because of their non-fixed player count.
Attachments (3)
Change History (17)
by , 12 years ago
Attachment: | maprandomselect.patch added |
---|
comment:2 by , 12 years ago
My patch already handles that. It selects a random map from the current "list" meaning that map filters are important.
comment:3 by , 12 years ago
Keywords: | patch review added |
---|---|
Summary: | Add "Random" option to map selection dropdown → [PATCH] Add "Random" option to map selection dropdown |
Ah, that works :)
comment:4 by , 12 years ago
After applying the patch I get these errors after trying to play Random:
WARNING: JavaScript warning: gui/gamesetup/gamesetup.js line 777 reference to undefined property g_GameAttributes.map.Name WARNING: JavaScript warning: Script value conversion check failed: JSVAL_IS_STRING(v) || JSVAL_IS_NUMBER(v) (got type undefined) ERROR: File 'maps/random/undefined' does not exist ERROR: CMapGeneratorWorker::Run: Failed to load RMS 'maps/random/undefined'
The warnings also appear for scenarios.
I would suggest changing "Random" to a different color as we do for random civs, so it stands out more from the rest of the list.
comment:5 by , 12 years ago
Warning stems from :777, which is probably supposed to be:
if (g_GameAttributes.map == "random")
I assume so because g_GameAttributes.map is a string, not an object, and the random map "filename" to be swapped out is "random", not "Random".
comment:6 by , 12 years ago
Oh I'm really sorry. I didn't copy the newer files into my checkout directory before creating the patches.
by , 12 years ago
Attachment: | maprandomselect.3.patch added |
---|
comment:7 by , 12 years ago
Version I've uploaded trims some trailing whitespace. I also colourized the map name for the host; unsure if it should also be done at the map data level, as that would make both the client display and the label above the map description orange.
comment:12 by , 12 years ago
Nice! Can also be added to Scenario maps?
EDIT: Random is white here, not orange.
comment:14 by , 12 years ago
Keywords: | review removed |
---|
We could also add something like AOK's "Random land map" option, which would select a non-naval map, and "Random" would select from all random maps as in your patch.