Opened 6 years ago

Closed 6 years ago

Last modified 6 years ago

#4079 closed defect (fixed)

[PATCH] Show Upgrade in Structure Tree

Reported by: fatherbushido Owned by:
Priority: Should Have Milestone: Alpha 22
Component: UI & Simulation Keywords: patch
Cc: s0600204 Patch:

Description (last modified by s0600204)

Since r18467, there is an Upgrade component. Currently it is used for the wall gate.

We can can remove the current gate in the structure tree and show the upgrade (i guess only for structure and not for units).

Attachments (3)

upgradeEntity.patch (8.1 KB ) - added by s0600204 6 years ago.
Proposed patch. Requires #3993 patch v4.1
upgradeEntity_v1.1.patch (8.2 KB ) - added by s0600204 6 years ago.
Suppress the stone cost in Gate template. (*Seriously* the correct patch this time.)
upgradeEntity_v2.patch (8.4 KB ) - added by s0600204 6 years ago.
Rebase after Tech Reqs work (#4263) was merged into main trunk

Download all attachments as: .zip

Change History (18)

comment:1 by elexis, 6 years ago

While at it, the resource costs for the gate should be removed as gates can't be placed directly.

by s0600204, 6 years ago

Attachment: upgradeEntity.patch added

Proposed patch. Requires #3993 patch v4.1

comment:2 by s0600204, 6 years ago

Keywords: patch rfc added
Milestone: BacklogAlpha 21
Summary: Show Upgrade in Structure Tree[PATCH] Show Upgrade in Structure Tree

Patch displays the upgrade options of any structure (or wallset) that has them. (Works with fatherbushido's patch for #4125)

Patch also displays any units with upgrade options, alongside the trainer units down the right-hand side.

And I've disabled the cost component for Gates.

Last edited 6 years ago by s0600204 (previous) (diff)

comment:3 by fatherbushido, 6 years ago

Just a quick remark, we let a cost component for Gates to prevent instantaneous repair.

comment:4 by s0600204, 6 years ago

Good point.

Does the repair need a resource and a time, or just a time? I ask because palisade gates are built/upgraded with wood, but have stone (and no wood) in their Cost.

by s0600204, 6 years ago

Attachment: upgradeEntity_v1.1.patch added

Suppress the stone cost in Gate template. (*Seriously* the correct patch this time.)

comment:5 by bb, 6 years ago

Last edited 6 years ago by bb (previous) (diff)

in reply to:  5 comment:6 by bb, 6 years ago

Templates.js L308 and further for consistence it might be good to make upgrades an object instead of an array, have no strong opinion on it.

Draw.js L90 ++p instead of p++

Structree.js L229-241 why braces? L237 !newUpgrades[phase] instead of !(phase in newUpgrades) L285 gives folowing error:

ERROR: JavaScript error: gui/structree/structree.js line 285
ReferenceError: GetPhaseOfTemplate is not defined
  selectCiv@gui/structree/structree.js:285:9
  __eventhandler38 (selectionchange)@civSelection selectionchange:0:1
  init@gui/structree/structree.js:38:3
  __eventhandler8 (press)@menuStrucTreeButton press:2:8
ERROR: GUI page 'page_structree.xml': Failed to call init() function

The called function does not seem to exist, probably cause of #3393.

Didn't test due to error.

Last edited 6 years ago by bb (previous) (diff)

comment:7 by elexis, 6 years ago

Milestone: Alpha 21Alpha 22

Moving to alpha 22 as long as #3993 is there as well.

comment:8 by elexis, 6 years ago

Milestone: Alpha 22Alpha 21

Perhaps I find time to review it. The tower upgrade should be shown there.

comment:9 by elexis, 6 years ago

Milestone: Alpha 21Alpha 22

#3993, I forgot, too bad.

comment:10 by elexis, 6 years ago

Milestone: Alpha 22Work In Progress

Moving to the new WIP milestone.

comment:11 by fatherbushido, 6 years ago

s0600204: We can invest that one now. Does it need some rebasing/cleaning before?

Last edited 6 years ago by fatherbushido (previous) (diff)

by s0600204, 6 years ago

Attachment: upgradeEntity_v2.patch added

Rebase after Tech Reqs work (#4263) was merged into main trunk

comment:12 by s0600204, 6 years ago

Description: modified (diff)

Patch ported to Phabricator: D92 Please direct further feedback there.

comment:13 by elexis, 6 years ago

Keywords: rfc removed

comment:14 by s0600204, 6 years ago

Description: modified (diff)
Milestone: Work In ProgressAlpha 22
Resolution: fixed
Status: newclosed

Committed in r19600

comment:15 by s0600204, 6 years ago

In 19711:

Fix rP19600 not handling upgradeable units correctly.

Tested By: wowgetoffyourcellphone
Refs: #4079
Differential Revision: https://code.wildfiregames.com/D517

Note: See TracTickets for help on using tickets.