File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -163,6 +163,7 @@ Omniclasm
163163Ong Ying Gao ong-yinggao98
164164oorzkws oorzkws
165165OwnageIsMagic OwnageIsMagic
166+ pajawojciech pajawojciech
166167palenerd dlmarquis
167168PassionateAngler PassionateAngler
168169Patrik Lundell PatrikLundell
Original file line number Diff line number Diff line change @@ -57,6 +57,7 @@ Template for new versions:
5757## New Tools
5858
5959## New Features
60+ - `orders`: added search overlay to find and navigate to matching manager orders with arrow indicators
6061- `sort`: Add death cause button to dead/missing tab in the creatures screen
6162
6263## Fixes
@@ -115,6 +116,7 @@ Template for new versions:
115116## Documentation
116117
117118## API
119+ - ``dfhack.job.getManagerOrderName``: New function to get the display name of a manager order
118120
119121## Lua
120122
Original file line number Diff line number Diff line change @@ -1430,6 +1430,10 @@ Job module
14301430
14311431 Returns the job's description, as seen in the Units and Jobs screens.
14321432
1433+ * ``dfhack.job.getManagerOrderName(manager_order) ``
1434+
1435+ Returns the manager order's description, as seen in the Work orders screen.
1436+
14331437Hotkey module
14341438-------------
14351439
Original file line number Diff line number Diff line change @@ -92,6 +92,7 @@ distribution.
9292#include " df/job_item.h"
9393#include " df/job_material_category.h"
9494#include " df/language_word_table.h"
95+ #include " df/manager_order.h"
9596#include " df/material.h"
9697#include " df/map_block.h"
9798#include " df/nemesis_record.h"
@@ -2018,6 +2019,7 @@ static const LuaWrapper::FunctionReg dfhack_job_module[] = {
20182019 WRAPM (Job,isSuitableItem),
20192020 WRAPM (Job,isSuitableMaterial),
20202021 WRAPM (Job,getName),
2022+ WRAPM (Job,getManagerOrderName),
20212023 WRAPM (Job,linkIntoWorld),
20222024 WRAPM (Job,removePostings),
20232025 WRAPM (Job,disconnectJobItem),
Original file line number Diff line number Diff line change @@ -41,6 +41,7 @@ namespace df
4141 struct job_item_filter ;
4242 struct building ;
4343 struct unit ;
44+ struct manager_order ;
4445}
4546
4647namespace DFHack
@@ -117,6 +118,7 @@ namespace DFHack
117118 int mat_index,
118119 df::item_type itype);
119120 DFHACK_EXPORT std::string getName (df::job *job);
121+ DFHACK_EXPORT std::string getManagerOrderName (df::manager_order *order);
120122
121123 struct JobDeleter {
122124 void operator ()(df::job *ptr) const {
Original file line number Diff line number Diff line change @@ -49,6 +49,7 @@ distribution.
4949#include " df/job_list_link.h"
5050#include " df/job_postingst.h"
5151#include " df/job_restrictionst.h"
52+ #include " df/manager_order.h"
5253#include " df/plotinfost.h"
5354#include " df/specific_ref.h"
5455#include " df/unit.h"
@@ -686,3 +687,27 @@ std::string Job::getName(df::job *job)
686687
687688 return desc;
688689}
690+
691+ std::string Job::getManagerOrderName (df::manager_order *order)
692+ {
693+ CHECK_NULL_POINTER (order);
694+
695+ std::string desc;
696+ auto button = df::allocate<df::interface_button_building_new_jobst>();
697+ button->mstring = order->reaction_name ;
698+ button->jobtype = order->job_type ;
699+ button->itemtype = order->item_type ;
700+ button->subtype = order->item_subtype ;
701+ button->material = order->mat_type ;
702+ button->matgloss = order->mat_index ;
703+ button->specflag = order->specflag ;
704+ button->job_item_flag = order->material_category ;
705+ button->specdata = order->specdata ;
706+ button->art_specifier_id1 = order->art_spec .id ;
707+ button->art_specifier_id2 = order->art_spec .subid ;
708+
709+ button->text (&desc);
710+ delete button;
711+
712+ return desc;
713+ }
You can’t perform that action at this time.
0 commit comments