showmood: display number of items already collected

develop
jj 2012-07-05 16:17:41 +02:00
parent 7732901b6e
commit 7074048146
2 changed files with 8 additions and 2 deletions

@ -66,7 +66,7 @@ module DFHack
if onext = @onupdate_list.sort.first if onext = @onupdate_list.sort.first
DFHack.onupdate_minyear = onext.minyear DFHack.onupdate_minyear = onext.minyear
DFHack.onupdate_minyeartick = onext.minyeartick DFHack.onupdate_minyeartick = onext.minyeartick
end end
@onupdate_list.last @onupdate_list.last
end end

@ -165,6 +165,8 @@ command_result df_showmood (color_ostream &out, vector <string> & parameters)
out.print("not yet claimed a workshop but will want"); out.print("not yet claimed a workshop but will want");
out.print(" the following items:\n"); out.print(" the following items:\n");
int count_got = job->items.size(), got;
for (size_t i = 0; i < job->job_items.size(); i++) for (size_t i = 0; i < job->job_items.size(); i++)
{ {
df::job_item *item = job->job_items[i]; df::job_item *item = job->job_items[i];
@ -267,7 +269,11 @@ command_result df_showmood (color_ostream &out, vector <string> & parameters)
} }
} }
out.print(", quantity %i\n", item->quantity); got = count_got;
if (got > item->quantity)
got = item->quantity;
out.print(", quantity %i (got %i)\n", item->quantity, got);
count_got -= got;
} }
} }
if (!found) if (!found)