|Anonymous | Login | Signup for a new account||2019-04-20 14:52 CEST|
|Main | My View | View Issues | Change Log | Wiki | Tavern | News|
|Viewing Issue Simple Details|
|ID||Category||Severity||Reproducibility||Date Submitted||Last Update|
|0005169||[DCSS] Patches||feature||N/A||2012-01-04 05:44||2014-10-03 01:14|
|Status||resolved||Product Branch||0.10 ancient branch|
|Summary||0005169: Shopping sorting|
I've coded a sorting method that works transparently with other shopping features (item selection, shopping list, etc). Originally to enable sorting by price, but as it is easily extensible I've also done alphabetical and type/subtype sorting.
Although it works perfectly for me so far, it hasn't been tested thoroughly. I've tried to keep all changes inside shopping.cc in the hopes of improving readability. It probably needs a more serious DCSS developer review.
But I am interested in feedback, and hope it can be used in the project (in it's current or in an improved form). If so, I'd like it to be considered along my other contributions as worthy of having "Alex Henry" included in CREDITS.txt .
|Tags||No tags attached.|
Shopping+sorting2.patch [^] (4,888 bytes) 2012-01-04 06:42 [Show Content]
0001-Shopping-sorting.patch [^] (4,870 bytes) 2013-03-11 21:34 [Show Content]
0002-Various-cleanups-for-shopping-list-ordering.patch [^] (6,369 bytes) 2013-03-11 21:34 [Show Content]
0001-Shopping-sorting201310.patch [^] (6,372 bytes) 2013-10-15 20:36 [Show Content]
|I've seen recent edits on shopping.cc change DESC_NOCAP_A to DESC_A. I've fixed this on the second file, please ignore the first one.|
edited on: 2013-03-11 19:39
I'd prefer to use the STL sort algorithm to implementing bubble sort (or even to implementing a faster sort, for that matter). Some updates for 0.12 will be needed, but those are fairly small (mostly std::icide).
Edit: deleted the first, superseded, patch.
|I get: malformed patch at line 120: @@ -282,7 +353,7 @@|
|Fixed up the malformedness; I'm also renaming the global variable "order" into "shopping_order", and making it static.|
I have uploaded an updated version of the patch that applies against current trunk. I also added another commit with some code cleanup (including using std::sort instead of custom-implemented bubble sort).
As far as the change goes: I'd really rather see the menu keys remain in order (a for the currently-first item, b for the currently-second, etc), as the stash search does. That will take some more work (the "obvious" fix of "c = 'a' + index" doesn't actually change the bindings in console mode, just the display).
Kek, do you think that's something that can be fixed relatively easily?
Found a simple enough hack to fix it :) Sorry about the delay, but I can honestly say I did not play a single Dungeon Crawl game until I found time to work on this patch again...
Again, I'm not much of a C coder and I've only tested this unthoroughly in Linux (local tiles and console): further review and testing would be welcome. I also did not understand the syntax of some comment lines nor did they help me anyway so I just removed the ones that would be affected by my changes... Maybe not the best idea, but I'll be checking comments here if any suggestions come up.
I'm posting a new, single patch to apply relatively to version 13 - should be trivial enough to use on 14 also. Since the new release is due in a few days (congrats btw) I'll wait a bit before posting the patch and this comment.
|Pushed in 0.16-a0-920-g19b1b05, after modernising for code/display changes in the shopping screen. Thanks for the patch!|
|Thank YOU again wheals! I have been thinking about creating a new patch with an enhanced and very useful autofight lua script I made. If you are interested what is the best way to contact you about it?|
|I'd suggest putting it on Mantis again, especially since I don't really understand Lua. Hopefully we can get it in sooner than this one ;)|
|2012-01-04 05:44||tukkek||New Issue|
|2012-01-04 05:44||tukkek||File Added: Shopping+sorting.patch|
|2012-01-04 06:42||tukkek||Note Added: 0016522|
|2012-01-04 06:42||tukkek||File Added: Shopping+sorting2.patch|
|2013-03-11 19:38||neil||Note Added: 0021357|
|2013-03-11 19:38||neil||File Deleted: Shopping+sorting.patch|
|2013-03-11 19:39||neil||Note Edited: 0021357|
|2013-03-11 19:52||neil||Note Added: 0021359|
|2013-03-11 20:11||neil||Note Added: 0021360|
|2013-03-11 21:34||neil||File Added: 0001-Shopping-sorting.patch|
|2013-03-11 21:34||neil||File Added: 0002-Various-cleanups-for-shopping-list-ordering.patch|
|2013-03-11 21:41||neil||Note Added: 0021364|
|2013-10-15 20:36||tukkek||File Added: 0001-Shopping-sorting201310.patch|
|2013-10-15 20:36||tukkek||Note Added: 0024196|
|2014-09-29 23:50||wheals||Note Added: 0027386|
|2014-09-29 23:50||wheals||Status||new => resolved|
|2014-09-29 23:50||wheals||Fixed in Branch||=> 0.16 development branch|
|2014-09-29 23:50||wheals||Resolution||open => done|
|2014-09-29 23:50||wheals||Assigned To||=> wheals|
|2014-10-02 14:50||tukkek||Note Added: 0027405|
|2014-10-03 01:14||wheals||Note Added: 0027409|
|Mantis 1.1.8[^] Copyright © 2000 - 2009 Mantis Group|