Skip to content

Commit 4bce233

Browse files
committed
confirm: more specific order-remove descriptions
Let order removal confirmation show the specific variety of - shield (shield, buckler), and - helm (helm, cap, hood), - gloves (gauntlets, gloves, mittens), - shoes (shoes, high boots, low boots, socks), - ammo (bolt), - trap component (axe blade, corkscrew, ball, disc, spike), and - meal (easy, fine, lavish). Most of these were previously described using the "generic" variety ("Gloves" for gauntlets, "Shoes" for socks, etc.), but meals looked particularly odd since they were previously described as "Coral", "Green Glass", and "Clear Glass" "Prepare Meal". `itemdefs.food` is not used because those list the final item names (biscuits, stew, roast), not the meal "type" (easy, fine, lavish).
1 parent fc3e300 commit 4bce233

File tree

2 files changed

+26
-0
lines changed

2 files changed

+26
-0
lines changed

changelog.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ Template for new versions:
4141
- `confirm`: when editing a uniform, confirm discard of changes when exiting with Escape
4242
- `confirm`: when removing a manager order, show correct order description when using non-100% interface setting
4343
- `confirm`: when removing a manager order, show correct order description after prior order removal or window resize (when scrolled to bottom of order list)
44+
- `confirm`: when removing a manager order, show specific item/job type for ammo, shield, helm, gloves, shoes, trap component, and meal orders
4445

4546
## Misc Improvements
4647

internal/confirm/specs.lua

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -453,6 +453,12 @@ local orders = df.global.world.manager_orders.all
453453
local itemdefs = df.global.world.raws.itemdefs
454454
local reactions = df.global.world.raws.reactions.reactions
455455

456+
local meal_type_by_ingredient_count = {
457+
[2] = 'easy',
458+
[3] = 'fine',
459+
[4] = 'lavish',
460+
}
461+
456462
local function make_order_desc(order)
457463
if order.job_type == df.job_type.CustomReaction then
458464
for _, reaction in ipairs(reactions) do
@@ -461,16 +467,35 @@ local function make_order_desc(order)
461467
end
462468
end
463469
return ''
470+
elseif order.job_type == df.job_type.PrepareMeal then
471+
-- DF uses mat_type as ingredient count?
472+
local meal_type = meal_type_by_ingredient_count[order.mat_type]
473+
if meal_type then
474+
return 'prepare ' .. meal_type .. ' meal'
475+
end
476+
return 'prepare meal'
464477
end
465478
local noun
466479
if order.job_type == df.job_type.MakeArmor then
467480
noun = itemdefs.armor[order.item_subtype].name
468481
elseif order.job_type == df.job_type.MakeWeapon then
469482
noun = itemdefs.weapons[order.item_subtype].name
483+
elseif order.job_type == df.job_type.MakeShield then
484+
noun = itemdefs.shields[order.item_subtype].name
485+
elseif order.job_type == df.job_type.MakeAmmo then
486+
noun = itemdefs.ammo[order.item_subtype].name
487+
elseif order.job_type == df.job_type.MakeHelm then
488+
noun = itemdefs.helms[order.item_subtype].name
489+
elseif order.job_type == df.job_type.MakeGloves then
490+
noun = itemdefs.gloves[order.item_subtype].name
470491
elseif order.job_type == df.job_type.MakePants then
471492
noun = itemdefs.pants[order.item_subtype].name
493+
elseif order.job_type == df.job_type.MakeShoes then
494+
noun = itemdefs.shoes[order.item_subtype].name
472495
elseif order.job_type == df.job_type.MakeTool then
473496
noun = itemdefs.tools[order.item_subtype].name
497+
elseif order.job_type == df.job_type.MakeTrapComponent then
498+
noun = itemdefs.trapcomps[order.item_subtype].name
474499
elseif order.job_type == df.job_type.SmeltOre then
475500
noun = 'ore'
476501
else

0 commit comments

Comments
 (0)