Skip to content

Commit

Permalink
Merge branch 'main' into feat-read-assets-from-client-11+
Browse files Browse the repository at this point in the history
  • Loading branch information
phacUFPE authored Nov 18, 2024
2 parents 5e06489 + 0257afe commit 891ea35
Showing 1 changed file with 16 additions and 16 deletions.
32 changes: 16 additions & 16 deletions source/find_item_window.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -89,8 +89,8 @@ FindItemDialog::FindItemDialog(wxWindow* parent, const wxString &title, bool onl
"Bed",
"Key" };

int types_choices_count = sizeof(typesChoices) / sizeof(wxString);
typesRadioBox = newd wxRadioBox(this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, types_choices_count, typesChoices, 1, wxRA_SPECIFY_COLS);
int typesChoicesCount = sizeof(typesChoices) / sizeof(wxString);
typesRadioBox = newd wxRadioBox(this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, typesChoicesCount, typesChoices, 1, wxRA_SPECIFY_COLS);
typesRadioBox->SetSelection(0);
typesRadioBox->Enable(false);
typeBoxSizer->Add(typesRadioBox, 0, wxALL | wxEXPAND, 5);
Expand Down Expand Up @@ -178,10 +178,10 @@ FindItemDialog::FindItemDialog(wxWindow* parent, const wxString &title, bool onl
this->RefreshContentsInternal();

// Connect Events
optionsRadioBox->Connect(wxEVT_COMMAND_RADIOBOX_SELECTED, wxCommandEventHandler(FindItemDialog::OnOptionChange), NULL, this);
itemIdSpin->Connect(wxEVT_COMMAND_SPINCTRL_UPDATED, wxCommandEventHandler(FindItemDialog::OnItemIdChange), NULL, this);
itemIdSpin->Connect(wxEVT_COMMAND_TEXT_UPDATED, wxCommandEventHandler(FindItemDialog::OnItemIdChange), NULL, this);
nameTextInput->Connect(wxEVT_COMMAND_TEXT_UPDATED, wxCommandEventHandler(FindItemDialog::OnText), NULL, this);
optionsRadioBox->Connect(wxEVT_COMMAND_RADIOBOX_SELECTED, wxCommandEventHandler(FindItemDialog::OnOptionChange), nullptr, this);
itemIdSpin->Connect(wxEVT_COMMAND_SPINCTRL_UPDATED, wxCommandEventHandler(FindItemDialog::OnItemIdChange), nullptr, this);
itemIdSpin->Connect(wxEVT_COMMAND_TEXT_UPDATED, wxCommandEventHandler(FindItemDialog::OnItemIdChange), nullptr, this);
nameTextInput->Connect(wxEVT_COMMAND_TEXT_UPDATED, wxCommandEventHandler(FindItemDialog::OnText), nullptr, this);

typesRadioBox->Connect(wxEVT_COMMAND_RADIOBOX_SELECTED, wxCommandEventHandler(FindItemDialog::OnTypeChange), nullptr, this);
tileTypesRadioBox->Connect(wxEVT_COMMAND_RADIOBOX_SELECTED, wxCommandEventHandler(FindItemDialog::OnTypeChange), nullptr, this);
Expand Down Expand Up @@ -291,8 +291,8 @@ void FindItemDialog::RefreshContentsInternal() {
continue;
}

RAWBrush* raw_brush = item.raw_brush;
if (!raw_brush) {
RAWBrush* rawBrush = item.raw_brush;
if (!rawBrush) {
continue;
}

Expand All @@ -301,7 +301,7 @@ void FindItemDialog::RefreshContentsInternal() {
}

foundSearchResults = true;
itemsList->AddBrush(raw_brush);
itemsList->AddBrush(rawBrush);
}
} else if (selection == SearchMode::Names) {
std::string searchString = as_lower_str(nstr(nameTextInput->GetValue()));
Expand All @@ -312,21 +312,21 @@ void FindItemDialog::RefreshContentsInternal() {
continue;
}

RAWBrush* raw_brush = item.raw_brush;
if (!raw_brush) {
RAWBrush* rawBrush = item.raw_brush;
if (!rawBrush) {
continue;
}

if (onlyPickupables && !item.pickupable) {
continue;
}

if (as_lower_str(raw_brush->getName()).find(searchString) == std::string::npos) {
if (as_lower_str(rawBrush->getName()).find(searchString) == std::string::npos) {
continue;
}

foundSearchResults = true;
itemsList->AddBrush(raw_brush);
itemsList->AddBrush(rawBrush);
}
}
} else if (selection == SearchMode::Types) {
Expand All @@ -336,8 +336,8 @@ void FindItemDialog::RefreshContentsInternal() {
continue;
}

RAWBrush* raw_brush = item.raw_brush;
if (!raw_brush) {
RAWBrush* rawBrush = item.raw_brush;
if (!rawBrush) {
continue;
}

Expand All @@ -351,7 +351,7 @@ void FindItemDialog::RefreshContentsInternal() {
}

foundSearchResults = true;
itemsList->AddBrush(raw_brush);
itemsList->AddBrush(rawBrush);
}
} else if (selection == SearchMode::Properties) {
bool hasSelected = (unpassable->GetValue() || unmovable->GetValue() || blockMissiles->GetValue() || blockPathfinder->GetValue() || readable->GetValue() || writeable->GetValue() || pickupable->GetValue() || stackable->GetValue() || rotatable->GetValue() || hangable->GetValue() || hookEast->GetValue() || hookSouth->GetValue() || hasElevation->GetValue() || ignoreLook->GetValue() || floorChange->GetValue());
Expand Down

0 comments on commit 891ea35

Please sign in to comment.