Page MenuHomeWildfire Games

Order players by resource or population tooltip numbers
ClosedPublic

Authored by ffffffff on Dec 5 2017, 11:29 PM.

Details

Summary

Might be meh but sometimes important. In-game in ressource/population tooltip its often very important to see fast as player, who has the most of a ressource or if a player has realy low population or high population, to ask for res share or to ask for make one player to pop up if he has low pop.

Therefore a order of the player with the numbers for ressources (food, wood, metal, stone) and population from high to low is very helpful, rather then just having players ordered by there position, as its hard to see fast differences between this numbers.

So this patch will order players in tooltip by ressources and population numbers to fast get an impression of the numbers.

Population tooltip:

Ressource (f.e. wood) tooltip:

Test Plan

discuss

Diff Detail

Lint
Lint Skipped
Unit
Unit Tests Skipped

Event Timeline

There are a very large number of changes, so older changes are hidden. Show Older Changes

option sort players in ressource/population tooltip by value

ffffffff updated this revision to Diff 4758.Dec 12 2017, 11:36 PM
bb added a comment.Dec 13 2017, 12:01 AM

In principle the option could also be a dropdown with options [none, ascending, descending]

binaries/data/config/default.cfg
351

ressources => resources

binaries/data/mods/public/gui/options/options.json
119–120

same same

also don't like the slash, just putting and might be better

ffffffff updated this revision to Diff 4760.Dec 13 2017, 12:34 AM
ffffffff updated this revision to Diff 4763.Dec 13 2017, 12:48 AM
ffffffff updated this revision to Diff 4771.Dec 14 2017, 2:33 PM

Math.sign unneed for sort compare works well with just difference b.value - a.value.

temple resigned from this revision.Dec 16 2017, 4:27 PM

No strong opinion.
Would be nice to have resources displayed in the tribute window, so you don't have to waste time hovering over icons to see who needs what.
Observers would probably also prefer to see all the info at once (and more info too, e.g. like in D920).

In D1113#46204, @temple wrote:

No strong opinion.
Would be nice to have resources displayed in the tribute window, so you don't have to waste time hovering over icons to see who needs what.
Observers would probably also prefer to see all the info at once (and more info too, e.g. like in D920).

lol and true this is much easier to show number of resource from player in tooltip on tribute resource when hovering xD (i figure to implement that)

but still for overview for all resources from team its nicer to have possible orderings in that tp. (to manage donation among team)

ffffffff retitled this revision from Order players in/by ressource/population tooltip numbers to Order players by resource or population tooltip numbers.Dec 22 2017, 11:55 PM

Maybe if you could see this stats as observer without having to select a player first.

Yep, this is also planed. It shall come numbers in observer mode, when no player is selected, as sum to the resources and population.

bb added inline comments.Dec 23 2017, 9:05 PM
binaries/data/mods/public/gui/session/session.js
1143–1156

The spaces actually were correct

1153–1154

As the only thing done with these two is adding them to each other, don't make them separately. Also in the original code there was a translate call around them, that should be kept.

ffffffff updated this revision to Diff 5016.EditedDec 31 2017, 6:54 PM

hotkey tooltip, click on resource cycle order or unordered

ffffffff edited the summary of this revision. (Show Details)Dec 31 2017, 7:00 PM
ffffffff edited reviewers, added: bb; removed: elexis, temple.
ffffffff removed a subscriber: bb.
mapkoc added a comment.Jan 1 2018, 3:28 AM

Works perfect. I find this very useful for tributes and to manage team.
How does a spec see this? can he order stats?

Yep. Spec sees all players as list and can therefore sort them as well. : )

ffffffff updated this revision to Diff 5041.Jan 2 2018, 5:56 PM

set function setConfigDb

bb requested changes to this revision.Jan 7 2018, 11:53 PM
bb added inline comments.
binaries/data/config/default.cfg
351

respoptooltipsort

binaries/data/mods/public/gui/options/options.json
120

...players in the population and...

binaries/data/mods/public/gui/session/session.js
1137

Build => create
stat => state

1138

also explain what will happen with the res

1139

so that are viewablePlayerStates?

Players whos states are viewed in the tooltip.

1140

integer => number
period

1143

order => sort

1158

hardcodish => meh

1160

Value to set under name.

1161

we don't return

1163–1166

so does the chat window extending stuff in menu.js => merge

1165

allPlayerStates

1166

viewedPlayerState

1167

(everything is viewable, but ok)

1168

why get the keys and forEach, while we could simple for in?

1168–1175

see how easy it is to cheat

1169

tooltipSort

1170

something goes wrong here since I do get the tooltip when not having an ally or without shared los

1171

cycle order would mean that (123) becomes (312), not swap ascending descending

1172

sad we need to hardcode that

1173

we had those strings already in options => merge

1175

ordertooltip + 2 mod 3 - 1?

1176

sssssssssshhh, don't tell that

1179–1183

swap

1188

why not set those in the xml?
also onpress the tooltip needs to be updated

1195–1196

swap

This revision now requires changes to proceed.Jan 7 2018, 11:53 PM
ffffffff added inline comments.
binaries/data/mods/public/gui/session/session.js
1163–1166
ffffffff added inline comments.Jan 9 2018, 2:34 PM
binaries/data/mods/public/gui/session/session.js
1137

state or statistics

1138

Resource code, that can be sorted by sort.

1139

maybe also statistics?

1140

ok + name to sort.

1171

"swap order" or "change order" ?

seems shorter

1179–1183

Swap you mean the order here?

1195–1196

Swap, you want orderHotkeyTooltip down?

@bb Can we discuss about the last points and then commit? Please send me a ping in #0ad-dev irc.

bb added inline comments.Jan 22 2018, 10:30 PM
binaries/data/mods/public/gui/session/session.js
1137

state

1138

code => type
can=> will

1139

n

1171

change

1195–1196

y and same above

Do we even need the option setting if we can set it by click the res/pop icon in the top panel? I guess no. Can wipe.

binaries/data/mods/public/gui/session/session.js
1173

How to get these from options.json? I guess not good ez.

1188

dynamically need tooltipSort var in changeorder and tooltip var string for tooltip

ffffffff added inline comments.Jan 23 2018, 2:26 PM
binaries/data/mods/public/gui/session/session.js
1172

"... to change order."

ffffffff updated this revision to Diff 5449.Jan 23 2018, 3:41 PM

onpress xml

bb accepted this revision.Jan 29 2018, 11:49 PM

few trivial style issues do not another iteration, so accept

binaries/data/mods/public/gui/session/menu.js
355 ↗(On Diff #5449)

already done

binaries/data/mods/public/gui/session/session.js
1139

playerstates

1162

nuke

1169

sad we have an object here, and can't use nice array functions...

1173

setstringtags

1178

wrong semicolon, and unneeded braces

binaries/data/mods/public/gui/session/top_panel/resource_population.xml
7 ↗(On Diff #5449)

as xml's are sets of magical numbers, this is ok with me

This revision is now accepted and ready to land.Jan 29 2018, 11:49 PM
bb added inline comments.Jan 29 2018, 11:55 PM
binaries/data/mods/public/gui/options/options.json
121

old name

This revision was automatically updated to reflect the committed changes.
Owners added a subscriber: Restricted Owners Package.Jan 30 2018, 12:12 AM