|
|
|
@ -1072,9 +1072,9 @@ private:
|
|
|
|
|
class Planner
|
|
|
|
|
{
|
|
|
|
|
public:
|
|
|
|
|
bool lock_selection;
|
|
|
|
|
bool quickfort_mode, in_dummmy_screen;
|
|
|
|
|
|
|
|
|
|
Planner() : lock_selection(true)
|
|
|
|
|
Planner() : quickfort_mode(false), in_dummmy_screen(false)
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
@ -1361,27 +1361,42 @@ struct buildingplan_hook : public df::viewscreen_dwarfmodest
|
|
|
|
|
{
|
|
|
|
|
send_key(interface_key::CURSOR_DOWN_Z);
|
|
|
|
|
send_key(interface_key::CURSOR_UP_Z);
|
|
|
|
|
planner.in_dummmy_screen = false;
|
|
|
|
|
}
|
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (is_planmode_enabled(type))
|
|
|
|
|
{
|
|
|
|
|
if (planner.quickfort_mode && planner.in_dummmy_screen)
|
|
|
|
|
{
|
|
|
|
|
if (input->count(interface_key::SELECT) || input->count(interface_key::SEC_SELECT)
|
|
|
|
|
|| input->count(interface_key::LEAVESCREEN))
|
|
|
|
|
{
|
|
|
|
|
planner.in_dummmy_screen = false;
|
|
|
|
|
send_key(interface_key::LEAVESCREEN);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (input->count(interface_key::SELECT))
|
|
|
|
|
{
|
|
|
|
|
if (ui_build_selector->errors.size() == 0 && planner.allocatePlannedBuilding(type))
|
|
|
|
|
{
|
|
|
|
|
send_key(interface_key::CURSOR_DOWN_Z);
|
|
|
|
|
send_key(interface_key::CURSOR_UP_Z);
|
|
|
|
|
if (!planner.lock_selection)
|
|
|
|
|
send_key(interface_key::LEAVESCREEN);
|
|
|
|
|
if (planner.quickfort_mode)
|
|
|
|
|
{
|
|
|
|
|
planner.in_dummmy_screen = true;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
else if (input->count(interface_key::CUSTOM_L))
|
|
|
|
|
else if (input->count(interface_key::CUSTOM_F))
|
|
|
|
|
{
|
|
|
|
|
planner.lock_selection = !planner.lock_selection;
|
|
|
|
|
planner.quickfort_mode = !planner.quickfort_mode;
|
|
|
|
|
}
|
|
|
|
|
else if (input->count(interface_key::CUSTOM_M))
|
|
|
|
|
{
|
|
|
|
@ -1453,6 +1468,19 @@ struct buildingplan_hook : public df::viewscreen_dwarfmodest
|
|
|
|
|
int x = left_margin;
|
|
|
|
|
auto type = ui_build_selector->building_type;
|
|
|
|
|
if (plannable)
|
|
|
|
|
{
|
|
|
|
|
if (planner.quickfort_mode && planner.in_dummmy_screen)
|
|
|
|
|
{
|
|
|
|
|
Screen::Pen pen(' ',COLOR_BLACK);
|
|
|
|
|
int y = dims.y1 + 1;
|
|
|
|
|
Screen::fillRect(pen, x, y, dims.menu_x2, y + 20);
|
|
|
|
|
|
|
|
|
|
++y;
|
|
|
|
|
|
|
|
|
|
OutputString(COLOR_BROWN, x, y, "Quickfort Placeholder", true, left_margin);
|
|
|
|
|
OutputString(COLOR_WHITE, x, y, "Enter, Shift-Enter or Esc", true, left_margin);
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
int y = 23;
|
|
|
|
|
|
|
|
|
@ -1460,7 +1488,7 @@ struct buildingplan_hook : public df::viewscreen_dwarfmodest
|
|
|
|
|
|
|
|
|
|
if (is_planmode_enabled(type))
|
|
|
|
|
{
|
|
|
|
|
OutputToggleString(x, y, "Lock Selection", "l", planner.lock_selection, true, left_margin);
|
|
|
|
|
OutputToggleString(x, y, "Quickfort Mode", "f", planner.quickfort_mode, true, left_margin);
|
|
|
|
|
|
|
|
|
|
auto filter = planner.getDefaultItemFilterForType(type);
|
|
|
|
|
|
|
|
|
@ -1476,9 +1504,16 @@ struct buildingplan_hook : public df::viewscreen_dwarfmodest
|
|
|
|
|
for_each_(filter_descriptions,
|
|
|
|
|
[&](string d) { OutputString(COLOR_BROWN, x, y, " *" + d, true, left_margin); });
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
planner.in_dummmy_screen = false;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
else if (isInPlannedBuildingQueryMode())
|
|
|
|
|
{
|
|
|
|
|
planner.in_dummmy_screen = false;
|
|
|
|
|
|
|
|
|
|
// Hide suspend toggle option
|
|
|
|
|
int y = 20;
|
|
|
|
|
Screen::Pen pen(' ', COLOR_BLACK);
|
|
|
|
@ -1497,6 +1532,10 @@ struct buildingplan_hook : public df::viewscreen_dwarfmodest
|
|
|
|
|
for_each_(filters,
|
|
|
|
|
[&](string d) { OutputString(COLOR_BLUE, x, y, "*" + d, true, left_margin); });
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
planner.in_dummmy_screen = false;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|