|
|
|
@ -53,6 +53,7 @@ using namespace std;
|
|
|
|
|
#include "df/general_ref.h"
|
|
|
|
|
#include "df/general_ref_unit_workerst.h"
|
|
|
|
|
#include "df/general_ref_building_holderst.h"
|
|
|
|
|
#include "df/interface_button_building_new_jobst.h"
|
|
|
|
|
|
|
|
|
|
using namespace DFHack;
|
|
|
|
|
using namespace df::enums;
|
|
|
|
@ -476,3 +477,25 @@ bool Job::isSuitableMaterial(df::job_item *item, int mat_type, int mat_index)
|
|
|
|
|
|
|
|
|
|
return minfo.isValid() && iinfo.matches(*item, &minfo);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
std::string Job::getName(df::job *job)
|
|
|
|
|
{
|
|
|
|
|
CHECK_NULL_POINTER(job);
|
|
|
|
|
|
|
|
|
|
std::string desc;
|
|
|
|
|
auto button = df::allocate<df::interface_button_building_new_jobst>();
|
|
|
|
|
button->reaction_name = job->reaction_name;
|
|
|
|
|
button->hist_figure_id = job->hist_figure_id;
|
|
|
|
|
button->job_type = job->job_type;
|
|
|
|
|
button->item_type = job->item_type;
|
|
|
|
|
button->item_subtype = job->item_subtype;
|
|
|
|
|
button->mat_type = job->mat_type;
|
|
|
|
|
button->mat_index = job->mat_index;
|
|
|
|
|
button->item_category = job->item_category;
|
|
|
|
|
button->material_category = job->material_category;
|
|
|
|
|
|
|
|
|
|
button->getLabel(&desc);
|
|
|
|
|
delete button;
|
|
|
|
|
|
|
|
|
|
return desc;
|
|
|
|
|
}
|
|
|
|
|