Opened 12 years ago

Closed 11 years ago

Last modified 11 years ago

#1591 closed enhancement (fixed)

[PATCH] Show combined costs in gate conversion tooltip.

Reported by: wraitii Owned by: leper
Priority: Nice to Have Milestone: Alpha 14
Component: UI & Simulation Keywords: simple patch
Cc: Patch:

Description

The gate conversion tooltip only takes a single gate into account, even when the user has selected multiple long walls segment. It should take every wall segment into account and update the tooltip. It should also make sure the red overlay (showing a lack of resources) is correctly updated for multiple gates, see #1571.

Attachments (1)

gate_costs.patch (1.5 KB ) - added by Jake Ware 11 years ago.
Cleaned edit

Download all attachments as: .zip

Change History (14)

comment:1 by Markus, 11 years ago

Keywords: simple added; gate conversion UI tooltip removed

comment:2 by Jake Ware, 11 years ago

Keywords: review patch added
Milestone: BacklogAlpha 14
Summary: Show combined costs in gate conversion tooltip.[PATCH] Show combined costs in gate conversion tooltip.

comment:3 by sanderd17, 11 years ago

Two things I only leared myself recently:

  • You should make the svn diff from the root svn directory. That way, it will be easy to apply, and it will display nicely in trac
  • You should clean your diff, all those lines where you changed an emptyline with tabs to one without tabs shouldn't happen. Just edit the diff in a text editor, and use those paragraphs.

in reply to:  3 comment:4 by Jake Ware, 11 years ago

Replying to sanderd17: Thanks, did it seem alright otherwise?

comment:5 by sanderd17, 11 years ago

The code looks alright on first sight. But I haven't got around testing it. The code looks clean though.

Also, note the indentation. That's done with tabs in 0 A.D. (http://trac.wildfiregames.com/wiki/Coding_Conventions)

comment:6 by Jake Ware, 11 years ago

Yes, I read that. The non-tab indentation was just a couple typos. Re-uploading the cleaned patch now.

by Jake Ware, 11 years ago

Attachment: gate_costs.patch added

Cleaned edit

comment:7 by sanderd17, 11 years ago

I tried it, and it seems to work as it should. Thanks for the patch.

comment:8 by Jake Ware, 11 years ago

My pleasure.

comment:9 by leper, 11 years ago

Wouldn't the patch get a lot shorter by using JavaScripts Array.reduce()?

comment:10 by Jake Ware, 11 years ago

Leper: I'll look into it. I honestly wasn't expecting to be using javascript a whole lot when I first found the project, and I am certainly not a JS expert, so I didn't know that that function existed.

comment:11 by leper, 11 years ago

Owner: set to leper
Resolution: fixed
Status: newclosed

In 13511:

Show combined costs in the gate conversion tooltip. Based on patch by Jgwman. Fixes #1591.

comment:12 by leper, 11 years ago

Keywords: review removed

Thanks for the patch. I replaced the counting code with Array.reduce and fixed a small bug related to the time display.

comment:13 by Jake Ware, 11 years ago

Cool, sorry, I haven't had much time lately.

Note: See TracTickets for help on using tickets.