Display autogems config option

develop
lethosor 2017-07-12 16:07:44 -04:00
parent a708b0b303
commit 60d1c270c2
1 changed files with 9 additions and 1 deletions

@ -50,6 +50,7 @@ const char *usage = (
"While this option is enabled, jobs will be created in Jeweler's Workshops\n" "While this option is enabled, jobs will be created in Jeweler's Workshops\n"
"to cut any accessible rough gems.\n" "to cut any accessible rough gems.\n"
); );
std::set<mat_index> blacklist;
void add_task(mat_index gem_type, df::building_workshopst *workshop) { void add_task(mat_index gem_type, df::building_workshopst *workshop) {
// Create a single task in the specified workshop. // Create a single task in the specified workshop.
@ -121,6 +122,7 @@ bool valid_gem(df::item* item) {
if (item->flags.bits.construction) return false; if (item->flags.bits.construction) return false;
if (item->flags.bits.garbage_collect) return false; if (item->flags.bits.garbage_collect) return false;
if (item->flags.bits.in_building) return false; if (item->flags.bits.in_building) return false;
if (blacklist.count(item->getMaterialIndex())) return false;
return true; return true;
} }
@ -245,6 +247,8 @@ struct autogem_hook : public df::viewscreen_dwarfmodest {
running = !running; running = !running;
return true; return true;
} else if (input->count(interface_key::CUSTOM_SHIFT_G)) {
Core::getInstance().setHotkeyCmd("gui/autogems");
} }
return false; return false;
@ -269,7 +273,11 @@ struct autogem_hook : public df::viewscreen_dwarfmodest {
} }
if (pen.valid()) { if (pen.valid()) {
OutputHotkeyString(x, y, (running? "Auto Cut Gems": "No Auto Cut Gems"), "g", false, x, COLOR_WHITE, COLOR_LIGHTRED); OutputHotkeyString(x, y, (running? "Auto Cut Gems": "No Auto Cut Gems"),
interface_key::CUSTOM_G, false, x, COLOR_WHITE, COLOR_LIGHTRED);
x += running ? 5 : 2;
OutputHotkeyString(x, y, "Opts", interface_key::CUSTOM_SHIFT_G,
false, 0, COLOR_WHITE, COLOR_LIGHTRED);
} }
} }
} }