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

Repository
rP 0 A.D. Public Repository
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.

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 ↗(On Diff #4758)

ressources => resources

binaries/data/mods/public/gui/options/options.json
119–120 ↗(On Diff #4758)

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–1147 ↗(On Diff #4771)

The spaces actually were correct

1153–1154 ↗(On Diff #4771)

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
363 ↗(On Diff #5041)

respoptooltipsort

binaries/data/mods/public/gui/options/options.json
134 ↗(On Diff #5041)

...players in the population and...

binaries/data/mods/public/gui/session/session.js
1120 ↗(On Diff #5041)

Build => create
stat => state

1121 ↗(On Diff #5041)

also explain what will happen with the res

1122 ↗(On Diff #5041)

so that are viewablePlayerStates?

Players whos states are viewed in the tooltip.

1123 ↗(On Diff #5041)

integer => number
period

1126 ↗(On Diff #5041)

order => sort

1133 ↗(On Diff #5041)

hardcodish => meh

1147 ↗(On Diff #5041)

Value to set under name.

1148 ↗(On Diff #5041)

we don't return

1150–1153 ↗(On Diff #5041)

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

1158 ↗(On Diff #5041)

allPlayerStates

1159 ↗(On Diff #5041)

viewedPlayerState

1160 ↗(On Diff #5041)

(everything is viewable, but ok)

1161 ↗(On Diff #5041)

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

1161–1168 ↗(On Diff #5041)

see how easy it is to cheat

1169 ↗(On Diff #5041)

sssssssssshhh, don't tell that

1173 ↗(On Diff #5041)

tooltipSort

1174 ↗(On Diff #5041)

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

1175 ↗(On Diff #5041)

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

1176 ↗(On Diff #5041)

sad we need to hardcode that

1177 ↗(On Diff #5041)

we had those strings already in options => merge

1179 ↗(On Diff #5041)

ordertooltip + 2 mod 3 - 1?

1191–1195 ↗(On Diff #5041)

swap

1200 ↗(On Diff #5041)

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

1208–1209 ↗(On Diff #5041)

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
1150–1153 ↗(On Diff #5041)
ffffffff added inline comments.Jan 9 2018, 2:34 PM
binaries/data/mods/public/gui/session/session.js
1120 ↗(On Diff #5041)

state or statistics

1121 ↗(On Diff #5041)

Resource code, that can be sorted by sort.

1122 ↗(On Diff #5041)

maybe also statistics?

1123 ↗(On Diff #5041)

ok + name to sort.

1175 ↗(On Diff #5041)

"swap order" or "change order" ?

seems shorter

1191–1195 ↗(On Diff #5041)

Swap you mean the order here?

1208–1209 ↗(On Diff #5041)

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
1120 ↗(On Diff #5041)

state

1121 ↗(On Diff #5041)

code => type
can=> will

1122 ↗(On Diff #5041)

n

1175 ↗(On Diff #5041)

change

1208–1209 ↗(On Diff #5041)

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
1177 ↗(On Diff #5041)

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

1200 ↗(On Diff #5041)

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
1176 ↗(On Diff #5439)

"... 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
1122 ↗(On Diff #5449)

playerstates

1149 ↗(On Diff #5449)

nuke

1160 ↗(On Diff #5449)

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

1169 ↗(On Diff #5449)

wrong semicolon, and unneeded braces

1177 ↗(On Diff #5449)

setstringtags

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
135 ↗(On Diff #5449)

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