#1802 closed enhancement (fixed)
[PATCH] Hero button
Reported by: | historic_bruno | Owned by: | |
---|---|---|---|
Priority: | Nice to Have | Milestone: | Alpha 14 |
Component: | UI & Simulation | Keywords: | simple patch |
Cc: | Patch: |
Description (last modified by )
The session UI should have a hero button. When the player has a living hero, it will show the portrait and any useful stats (e.g. health). When the button is pressed, the camera should focus on the hero. The button should appear consistent with the session UI style.
Attachments (6)
Change History (29)
by , 11 years ago
Attachment: | herobutton.jpg added |
---|
comment:1 by , 11 years ago
Description: | modified (diff) |
---|
comment:2 by , 11 years ago
Note, we'll probably have to move the framerate counter to somewhere else, which shouldn't be much of a hassle, except deciding where to put it.
comment:3 by , 11 years ago
Milestone: | Backlog → Alpha 13 |
---|---|
Priority: | Should Have → Nice to Have |
comment:4 by , 11 years ago
I have a wip patch but I'm wondering two issues:
- Where should I move the framerate counter?
- Should the portrait include a health bar?
comment:5 by , 11 years ago
Keywords: | review patch added |
---|---|
Summary: | Hero button → [PATCH] Hero button |
comment:6 by , 11 years ago
The patch moves the framerate counter to the right top of the screen and do not include a health bar in the hero button.
The button behaves as the group buttons. Single clic to select and double clic to select and center camera.
The tooltip is quite similar to the one proposed in the mockup.
by , 11 years ago
Attachment: | hero_button.patch added |
---|
comment:7 by , 11 years ago
Fps counter moved slightly down, just below time counter.
Removed unnecessary Select function.
comment:8 by , 11 years ago
I think it should support displaying multiple heros. Normal games are restricted to one hero but there could be multiple heros in screnarios or campaigns.
comment:9 by , 11 years ago
The patch keeps track of multiple heroes in Player component, however the changes purposed for the session.xml file add only one button object. Nevertheless, It would be very easy to extend it to show several heroes.
Assuming we have to support multiple heroes... how many should be supported?
comment:10 by , 11 years ago
I think it should display all heroes but do something smart if there are so many heroes that it would cover too much of the screen (like making it scrollable or scaling the images down). But I think for the moment it's fine to just add all heroes and don't cover the case where there are too many (if you don't want to do that work now to cover such a special case). I think the UI has to become more flexible in the future anyway and such cases can be covered once the UI offers more features.
comment:11 by , 11 years ago
If you place a Mill you get this error:
ERROR: Script message handler OnGlobalOwnershipChanged failed ERROR: JavaScript error: simulation/components/Player.js line 513 TypeError: cmpIdentity is null ([object Object])@simulation/components/Player.js:513 GetFormationUnitAIs([object Array],1)@simulation/helpers/Commands.js:1146 ProcessCommand(1,[object Object])@simulation/helpers/Commands.js:136 TryConstructBuilding(1,[object Object],false,[object Object])@simulation/helpers/Commands.js:800 ProcessCommand(1,[object Object])@simulation/helpers/Commands.js:262 ERROR: Failed to call ProcessCommand() global script function
comment:12 by , 11 years ago
Milestone: | Alpha 13 → Alpha 14 |
---|
comment:13 by , 11 years ago
This does seem to break building placement with the above error for all buildings (not just mills) over here.
But the button looks great. :D
comment:14 by , 11 years ago
Turns out it was a pretty trivial fix; you simply forgot to check if cmpIdentity was undefined a few times.
I fixed that, and also took the liberty of adding a hotkey for it, currently bound to ' (it's near the , and . hotkeys, which select all idle warriors/workers).
' cycles through living heroes, Shift+' adds them to the selection, and Alt+' selects all heroes.
by , 11 years ago
Attachment: | hero_button.3.patch added |
---|
Fix a couple of little bugs with the hotkey. Should be very solid now.
comment:15 by , 11 years ago
I opted to remove the hotkey, because I ended up refactoring the code so that I could use it for cycling any entity. I'll put the hero hotkey along with some building cycling hotkeys in another patch.
comment:16 by , 11 years ago
Keywords: | review removed |
---|---|
Resolution: | → fixed |
Status: | new → closed |
Fixed in r13339.
Thanks for the patches.
by , 11 years ago
Attachment: | hero-button-fix-garrisoned.patch added |
---|
Fix errors when attempting to center on a garrisoned hero
comment:19 by , 11 years ago
It would be nice to have the hero icon become reddish when his healt is low. Similar to the building icon when you have not enough resources to build them. Let me know if you want a new ticket for this.
comment:21 by , 11 years ago
A new ticket for that would be nice, maybe add something like centering on the building the hero is garrisoned in too. (Could be a simple ticket for someone new to our codebase)
Old mockup from Michael