Opened 8 years ago
Closed 8 years ago
#4217 closed defect (fixed)
[PATCH] Structure tree shows wrong specific tech names
Reported by: | elexis | Owned by: | s0600204 |
---|---|---|---|
Priority: | Must Have | Milestone: | Alpha 22 |
Component: | UI & Simulation | Keywords: | patch |
Cc: | Patch: |
Description (last modified by )
If one opens the tech tree and looks at the name of a tech that has a specific name, change to a civ that has a different (or no) specific name for that tech and then change back, then that tech will display the second civ's specific name (or in the case where the second civ doesn't have one, no specific name at all).
F.e. the "Steel Working" upgrade at the blacksmith for iber
and maur
, or the "Sentries" upgrade belonging to the wooden and stone towers when switching from a hellenic civ to a non-hellenic civ and back again.
Bug reported by WarBeast.
Attachments (1)
Change History (9)
by , 8 years ago
Attachment: | specificNames.patch added |
---|
comment:1 by , 8 years ago
Cc: | removed |
---|---|
Description: | modified (diff) |
Keywords: | patch rfc added |
Milestone: | Backlog → Alpha 21 |
Owner: | set to |
Status: | new → assigned |
comment:4 by , 8 years ago
Description: | modified (diff) |
---|
Few notes: 1.
if (template.name.specific != template.name.generic) return template.name.specific; else return false;
Could be written shorter:
return template.name.specific != template.name.generic ? template.name.specific : false;
2.
if (template.name.specific.generic) return template.name.specific.generic; return false;
The same:
return template.name.specific.generic || false;
comment:5 by , 8 years ago
Summary: | Structure tree shows wrong specific tech names → [PATCH] Structure tree shows wrong specific tech names |
---|
comment:6 by , 8 years ago
a ? b : false
is equal to a && b
.
To also post something about the approach of the patch: Passing a second argument to the tooltip functions, when almost all of them only take one argument (extendedEntityState from GUIInterface that must have the same format as the TemplateData) seems ugly. If some other tooltip function also needs an argument, it would collide. I didn't investigate the bug, but isn't it only in the structure tree? Could we get away with reloading some data when switching the civ in the structure tree?
comment:7 by , 8 years ago
Keywords: | rfc removed |
---|---|
Milestone: | Work In Progress → Alpha 22 |
In r19120 by fatherbushido:
Merge different logics of technology requirements and fix the related bugs. Create a global script which derive the technology requirements objects in a form usable for structure tree, gui, simulation and AI. Reviewed by mimo (for AI) and fatherbushido. Fixes #3993, #1646, #4263, #4217. Refs #4108.
In r19121 by fatherbushido:
Add a simulation test to the previous commit of s0600204's patch. Refs #4263.
comment:8 by , 8 years ago
Resolution: | → fixed |
---|---|
Status: | assigned → closed |
Proposed patch