Opened 9 years ago
Closed 6 years ago
#3212 closed enhancement (fixed)
[PATCH] Provide a unit tree like the tech tree is provided
Reported by: | Kalle Richter | Owned by: | s0600204 |
---|---|---|---|
Priority: | Should Have | Milestone: | Alpha 23 |
Component: | UI & Simulation | Keywords: | patch |
Cc: | Patch: | Phab:D297 |
Description
Currently a tree overview of technologies is provided at http://s06eye.co.uk/0ad/techtree-v2. It'd be nice to have such overview for units and links to both at central location.
Attachments (2)
Change History (26)
comment:1 by , 9 years ago
comment:2 by , 9 years ago
The tech tree in the main menu doesn't display units (see screenshot). I clicked on different icons, but units are not accessible (maybe you can clearify what different icons you mean exactly).
comment:3 by , 9 years ago
Sorry for the misunderstanding.
I meant that it's a future plan to be able to see information of units when clicking on the icons. Not that it already happens now.
comment:4 by , 9 years ago
sanderd17:
I meant that it's a future plan to be able to see information of units when clicking on the icons.
This the sort of thing you have in mind? (activates with a right-click on certain icons)
- http://imgur.com/Mrsbdk6
- http://imgur.com/a/NWnDl
- http://imgur.com/dJ8P1QB (current layout)
It's implemented as a separate page, so it can be used almost anywhere in GUI code with a call of Engine.PushGuiPage("page_viewer.xml", "gaia/fauna_sheep")
.
Currently usable as a mod from https://github.com/s0600204/0ad-structree-mod/tree/entityDetails
comment:5 by , 9 years ago
That has been desired for years, please submit a patch against SVN for it :)
comment:6 by , 9 years ago
Component: | Non-game systems → UI & Simulation |
---|---|
Keywords: | patch added |
Type: | task → enhancement |
comment:7 by , 9 years ago
Keywords: | review added |
---|---|
Milestone: | Backlog → Alpha 19 |
Summary: | Provide a unit tree like the tech tree is provided → [PATCH] Provide a unit tree like the tech tree is provided |
comment:8 by , 9 years ago
Milestone: | Alpha 19 → Alpha 20 |
---|
This looks really awesome but I think it is a too large feature to include it right now. Be assured that we will look into committing that as soon as the release is over!
comment:9 by , 8 years ago
Patch tested and still working. Beyond the layout itself, which can be refined, we would imo need:
-A small button somewhere when selecting a unit to open it
-keyboard shortcut (to quickly check some data).
It would be the first part of my GUI revamp as written here: http://wildfiregames.com/forum/index.php?showtopic=20190&p=311004
comment:10 by , 8 years ago
Milestone: | Alpha 20 → Alpha 21 |
---|
Hi! So unfortunately nobody had time to take a look at this since the last release, which is a shame because this feature is great.
I rebased the patch and it works fine. However there is a huge problem, which is that a lot of things are not translated at all, especially the "History" part of templates. I fixed that, but if we commit translators will have a ton of translation work to perform before A20, which is bad.
Also some History parts are empty right now.
So I think we should fill out our History content, and remove altogether the old and now useless History page in the main menu. I set up a git branch here: https://github.com/na-Itms/0ad/tree/encyclopedia If anybody wants to propose pull requests, they're gladly welcome :)
comment:11 by , 8 years ago
Most of the useless History tags are now removed in r17988, so they should be mostly ready to translate.
comment:12 by , 8 years ago
This is a very nice patch, and still applies cleanly (apart from one line).
Some remarks on the functionality:
- For the icons that currently don't have an action (big selection icon, and the icons in the structure tree), it would be better to show the screen on a left click IMO
- It would be good to show the icons can be clicked by having some "highlight" overlay when hoovering the icon (similar to what you see when hovering the civ icon to open the structree)
- The tooltips in the structree could be made a bit smaller (remove some stats from it), while the encyclopedia could show a lot more stats
- It should be possible to go from one encyclopedia page to another by following different links (a unit can promote to another unit, a unit can build a structure, a structure can produce a unit, ...)
However, the functionality is already good enough to commit it now IMO.
Some comments on the code:
- getEntityStats doesn't return stats, but a formatted string. So the name could be a bit better, like "getEntityStatsTooltip" or "formatEntityStats".
- Instead of testing for
typeof g_Lists !== "undefined"
, it's easier in JS to test forg_Lists
. An array gets converted to a truth value (even if it's empty), and undefined is a false value.
The rest looks very nice.
comment:13 by , 8 years ago
This is a very nice patch
Thank you
For the icons that currently don't have an action (big selection icon, and the icons in the structure tree), it would be better to show the screen on a left click IMO
Hmm... but having it on a right-click for everything is more consistent
The tooltips in the structree could be made a bit smaller (remove some stats from it), while the encyclopedia could show a lot more stats
Personally disagree, as that makes it harder to players compare stats, but meh.
Instead of testing for
typeof g_Lists !== "undefined"
, it's easier in JS to test forg_Lists
. An array gets converted to a truth value (even if it's empty), and undefined is a false value.
I'm afraid I'm going to have to disagree with this, for the following reason:
var a = { "b": "foo" } if (a) // true if (a.b) // true if (a.b === undefined) // false if (a.c) // false if (a.c === undefined) // true if (d) // error: "d not defined" if (d === undefined) // error: "d not defined" if (typeof d === "undefined") // true var e = undefined; // explicitly set as undefined if (e) // false if (e === undefined) // true
However, the functionality is already good enough to commit it now IMO.
As the viewer
reuses and slightly modifies code belonging to the structree
, it is affected by #3747 and #3801. I'd like to get those resolved before getting this committed because resolving merge conflicts and sorting out regression is *so* fun.
And thanks for the review!
comment:14 by , 8 years ago
comment:15 by , 8 years ago
Keywords: | rfc added; review removed |
---|
Move tickets from the review queue to the rfc one.
comment:18 by , 7 years ago
It would be nice if we could include that one too.
comment:21 by , 7 years ago
For those tracking progress of the off-topic entityDetails
/templateDetails
page -> Phab:D297
For those who are looking forward to an actual unit-tree/unit-tables page... one possibility...
comment:23 by , 7 years ago
Keywords: | rfc removed |
---|---|
Milestone: | Work In Progress → Alpha 23 |
Patch: | → Phab:D297 |
You should be able to access units, buildings and tech descriptions by clicking on the different icons.
So it's a plain extension of the structure tree.
Note that the structure tree is also part of the game (under the main screen), and in #3101, the structure tree should be made available in game.
When you are in game, the structure tree and its visualisations could even display which techs are researched, which units unlocked, which effects applied, ...
But I guess one step at a time would be best.