Skip to content

Commit

Permalink
rename minimize_on_travel to collapse_on_travel, default false
Browse files Browse the repository at this point in the history
  • Loading branch information
DubbleClick committed May 3, 2024
1 parent 86c3b20 commit 5a2a13d
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 10 deletions.
16 changes: 7 additions & 9 deletions GWToolboxdll/Windows/TravelWindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ namespace {

// ==== options ====
bool close_on_travel = false;
bool minimize_on_travel = false;
bool collapse_on_travel = false;

// ==== scroll to outpost ====
GW::Constants::MapID scroll_to_outpost_id = GW::Constants::MapID::None; // Which outpost do we want to end up in?
Expand Down Expand Up @@ -489,7 +489,7 @@ void TravelWindow::Terminate()
GW::UI::RemoveUIMessageCallback(&OnUIMessage_HookEntry);
}

void TravelWindow::TravelButton(const char* text, const int x_idx, const GW::Constants::MapID mapid)
void TravelWindow::TravelButton(const char* text, const int x_idx, const GW::Constants::MapID mapid) const
{
if (x_idx != 0) {
ImGui::SameLine(0, ImGui::GetStyle().ItemInnerSpacing.x);
Expand All @@ -510,8 +510,6 @@ void TravelWindow::TravelButton(const char* text, const int x_idx, const GW::Con
}
}



void TravelWindow::Draw(IDirect3DDevice9*)
{
if (!visible) {
Expand Down Expand Up @@ -787,7 +785,7 @@ bool TravelWindow::Travel(const GW::Constants::MapID map_id, const GW::Constants
return false;
}

if (minimize_on_travel) {
if (collapse_on_travel) {
to_minimize = true;
}

Expand Down Expand Up @@ -822,8 +820,8 @@ void TravelWindow::DrawSettingsInternal()
{
ImGui::Checkbox("Close on travel", &close_on_travel);
ImGui::ShowHelp("Will close the travel window when clicking on a travel destination");
ImGui::Checkbox("Minimize on travel", &minimize_on_travel);
ImGui::ShowHelp("Will minimize the travel window when clicking on a travel destination");
ImGui::Checkbox("Collapse on travel", &collapse_on_travel);
ImGui::ShowHelp("Will collapse the travel window when clicking on a travel destination");
ImGui::PushItemWidth(100.0f);
if (ImGui::InputInt("Number of favorites", &fav_count)) {
if (fav_count < 0) {
Expand Down Expand Up @@ -852,7 +850,7 @@ void TravelWindow::LoadSettings(ToolboxIni* ini)
fav_index[static_cast<size_t>(i)] = ini->GetLongValue(Name(), key, -1);
}
LOAD_BOOL(close_on_travel);
LOAD_BOOL(minimize_on_travel);
LOAD_BOOL(collapse_on_travel);
LOAD_BOOL(retry_map_travel);
}

Expand All @@ -867,7 +865,7 @@ void TravelWindow::SaveSettings(ToolboxIni* ini)
ini->SetLongValue(Name(), key, fav_index[ui]);
}
SAVE_BOOL(close_on_travel);
SAVE_BOOL(minimize_on_travel);
SAVE_BOOL(collapse_on_travel);
SAVE_BOOL(retry_map_travel);
}

Expand Down
2 changes: 1 addition & 1 deletion GWToolboxdll/Windows/TravelWindow.h
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ class TravelWindow : public ToolboxWindow {
static GW::Constants::MapID GetNearestOutpost(GW::Constants::MapID map_to);

private:
void TravelButton(const char* text, const int x_idx, const GW::Constants::MapID mapid);
void TravelButton(const char* text, const int x_idx, const GW::Constants::MapID mapid) const;
// ==== Travel variables ====
GW::Constants::District district = GW::Constants::District::Current;
uint32_t district_number = 0;
Expand Down

0 comments on commit 5a2a13d

Please sign in to comment.