Opened 8 years ago
Last modified 3 years ago
#4180 new defect
[PATCH] Add "Requires X." tooltip to aura tooltips automatically.
Reported by: | fatherbushido | Owned by: | |
---|---|---|---|
Priority: | Nice to Have | Milestone: | Backlog |
Component: | UI – In-game | Keywords: | patch, simple |
Cc: | Patch: |
Description (last modified by )
Now we have auras wich can requires a technology (see for example the 2nd wonder aura) and there is an explicit "Requires X." in the aura tooltip (aura description). We should generate that tooltip automatically.
The files to look at are simulation/components/GuiInterface.js
, globalscripts/Templates.js
and gui/common/tooltips.js
. You can look for auraName and auraDescription and add that requirement.
Attachments (3)
Change History (18)
comment:1 by , 8 years ago
- Added required tech in parenthesis
- Removed required tech from second Wonder's auraDescription
follow-up: 5 comment:2 by , 8 years ago
Thanks for working on it (so quickly).
- Don't forget to remove the description.
- I forgot to mention in ticket description to modify gui/structree/helper.js (to load the aura template for the structure tree). You could then check in the structure tree.
comment:3 by , 8 years ago
Keywords: | rfc added |
---|
comment:4 by , 8 years ago
Keywords: | patch added |
---|---|
Summary: | Add "Requires X." tooltip to aura tooltips automatically. → [PATCH] Add "Requires X." tooltip to aura tooltips automatically. |
comment:5 by , 8 years ago
Replying to fatherbushido:
Thanks for working on it (so quickly).
- Don't forget to remove the description.
- I forgot to mention in ticket description to modify gui/structree/helper.js (to load the aura template for the structure tree). You could then check in the structure tree.
Sorry, I forgot to upload the xml where I removed the tech from the description. Thanks for reminding me! What do you want me to do in helper.js? Since requiredTechnology is an ID and not a name, I suppose it should not be translated with translateObjectKeys()?
by , 8 years ago
Attachment: | 4180_aura_reqtech_tooltip.patch added |
---|
change: modified second Wonder's auraDescription
follow-up: 7 comment:6 by , 8 years ago
Anyway there is something to check with the structure tree. I look at your tooltip, in fact you use GetTechnologyData but this is a session function which is i guess not accesible from the structure tree.
So i got that error:
ERROR: JavaScript error: gui/common/tooltips.js line 539 ReferenceError: GetTechnologyData is not defined getAurasTooltip/tooltips<@gui/common/tooltips.js:539:1 getAurasTooltip@gui/common/tooltips.js:531:6 assembleTooltip/<@gui/structree/draw.js:387:40 assembleTooltip@gui/structree/draw.js:387:2 draw@gui/structree/draw.js:63:1 selectCiv@gui/structree/structree.js:303:2 __eventhandler38 (selectionchange)@civSelection selectionchange:0:1 init@gui/structree/structree.js:38:3 __eventhandler8 (press)@menuStrucTreeButton press:2:8
comment:7 by , 8 years ago
Ah, right! Sorry, I didn't realise the aura's tooltip is used in the structree. It works in-game, but fails in the structree (as you showed). I will fix that.
by , 8 years ago
Attachment: | 4180_aura_reqtech_tooltip_v2.patch added |
---|
Added getTechnologyName(id) to global scritps. Found no similar function available from both inside and outside sessions.
by , 8 years ago
Attachment: | 4180_aura_reqtech_tooltip_v3.patch added |
---|
fatherbushido: is the new function getTechnologyName(id) useful to have in global scripts, or should we move it to /gui/common/functions_utility.js?
comment:9 by , 7 years ago
that new function is not desired you must use the existing function in session and structure tree to get the tech name (those functions use a cache wich is needed to not load stuff from json everytime). Add your name to the contributors file too.
comment:10 by , 7 years ago
Keywords: | rfc removed |
---|
comment:11 by , 5 years ago
Component: | UI & Simulation → In-game UI |
---|
Move tickets to In-game UI
as UI & Simulation
got some sub components.
comment:12 by , 4 years ago
Description: | modified (diff) |
---|---|
Milestone: | Work In Progress → Backlog |
Priority: | If Time Permits → Nice to Have |
Patch is outdated and no work on it since long time, but nice to have since one can easily change requirements whilst keeping translations.
comment:14 by , 3 years ago
Keywords: | simple removed |
---|---|
severity: | → simple |
comment:15 by , 3 years ago
Keywords: | simple added |
---|