Skip to content

Commit

Permalink
fix: hook item find and item hook brush name
Browse files Browse the repository at this point in the history
  • Loading branch information
phacUFPE committed Jun 25, 2024
1 parent ccee564 commit f0f897d
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 10 deletions.
5 changes: 2 additions & 3 deletions source/find_item_window.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,7 @@ FindItemDialog::FindItemDialog(wxWindow* parent, const wxString &title, bool onl

wxBoxSizer* options_box_sizer = newd wxBoxSizer(wxVERTICAL);

wxString radio_boxChoices[] = { "Find by Server ID",
"Find by Client ID",
wxString radio_boxChoices[] = { "Find by Item ID",
"Find by Name",
"Find by Types",
"Find by Tile Types",
Expand Down Expand Up @@ -370,7 +369,7 @@ void FindItemDialog::RefreshContentsInternal() {
continue;
}

if ((unpassable->GetValue() && !item.unpassable) || (unmovable->GetValue() && item.moveable) || (block_missiles->GetValue() && !item.blockMissiles) || (block_pathfinder->GetValue() && !item.blockPathfinder) || (readable->GetValue() && !item.canReadText) || (writeable->GetValue() && !item.canWriteText) || (pickupable->GetValue() && !item.pickupable) || (stackable->GetValue() && !item.stackable) || (rotatable->GetValue() && !item.rotable) || (hangable->GetValue() && !item.isHangable) || (hook_east->GetValue() && !item.hookEast) || (hook_south->GetValue() && !item.hookSouth) || (has_elevation->GetValue() && !item.hasElevation) || (ignore_look->GetValue() && !item.ignoreLook) || (floor_change->GetValue() && !item.isFloorChange())) {
if ((unpassable->GetValue() && !item.unpassable) || (unmovable->GetValue() && item.moveable) || (block_missiles->GetValue() && !item.blockMissiles) || (block_pathfinder->GetValue() && !item.blockPathfinder) || (readable->GetValue() && !item.canReadText) || (writeable->GetValue() && !item.canWriteText) || (pickupable->GetValue() && !item.pickupable) || (stackable->GetValue() && !item.stackable) || (rotatable->GetValue() && !item.rotable) || (hangable->GetValue() && !item.isHangable) || (hook_east->GetValue() && (!item.hookEast && item.hook != ITEM_HOOK_EAST)) || (hook_south->GetValue() && (!item.hookSouth && item.hook != ITEM_HOOK_SOUTH)) || (has_elevation->GetValue() && !item.hasElevation) || (ignore_look->GetValue() && !item.ignoreLook) || (floor_change->GetValue() && !item.isFloorChange())) {
continue;
}

Expand Down
4 changes: 2 additions & 2 deletions source/item.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -202,13 +202,13 @@ bool Item::hasProperty(enum ITEMPROPERTY prop) const {
break;

case HOOK_SOUTH:
if (type.hookSouth || type.hook == ItemHook_t::ITEM_HOOK_SOUTH) {
if (type.hookSouth || type.hook == ITEM_HOOK_SOUTH) {
return true;
}
break;

case HOOK_EAST:
if (type.hookEast || type.hook == ItemHook_t::ITEM_HOOK_EAST) {
if (type.hookEast || type.hook == ITEM_HOOK_EAST) {
return true;
}
break;
Expand Down
12 changes: 7 additions & 5 deletions source/raw_brush.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -50,13 +50,15 @@ std::string RAWBrush::getName() const {
return "RAWBrush";
}

if (itemtype->hookSouth) {
return i2s(itemtype->id) + " - " + itemtype->name + " (Hook South)";
} else if (itemtype->hookEast) {
return i2s(itemtype->id) + " - " + itemtype->name + " (Hook East)";
auto brushName = fmt::format("{} - {}", itemtype->id, itemtype->name);

if (itemtype->hookSouth || itemtype->hook == ITEM_HOOK_SOUTH) {
return brushName.append(" (Hook South)");
} else if (itemtype->hookEast || itemtype->hook == ITEM_HOOK_EAST) {
return brushName.append(" (Hook East)");
}

return i2s(itemtype->id) + " - " + itemtype->name + itemtype->editorsuffix;
return brushName.append(itemtype->editorsuffix);
}

void RAWBrush::undraw(BaseMap* map, Tile* tile) {
Expand Down

0 comments on commit f0f897d

Please sign in to comment.