Handles object selection, preview, and editing UI. More...
#include <dungeon_object_selector.h>
Private Member Functions | |
| void | DrawRoomGraphics () |
| bool | MatchesObjectFilter (int obj_id, int filter_type) |
| void | CalculateObjectDimensions (const zelda3::RoomObject &object, int &width, int &height) |
| void | PlaceObjectAtPosition (int x, int y) |
| void | DrawCompactObjectEditor () |
| void | DrawCompactSpriteEditor () |
| void | DrawCompactItemEditor () |
| void | DrawCompactEntranceEditor () |
| void | DrawCompactDoorEditor () |
| void | DrawCompactChestEditor () |
| void | DrawCompactPropertiesEditor () |
| bool | DrawObjectPreview (const zelda3::RoomObject &object, ImVec2 top_left, float size) |
| zelda3::RoomObject | MakePreviewObject (int obj_id) const |
| void | EnsureRegistryInitialized () |
| ImU32 | GetObjectTypeColor (int object_id) |
| std::string | GetObjectTypeSymbol (int object_id) |
| void | RenderObjectPrimitive (const zelda3::RoomObject &object, int x, int y) |
| void | InvalidatePreviewCache () |
| bool | GetOrCreatePreview (int obj_id, float size, gfx::BackgroundBuffer **out) |
Handles object selection, preview, and editing UI.
Definition at line 32 of file dungeon_object_selector.h.
|
inlineexplicit |
Definition at line 34 of file dungeon_object_selector.h.
| void yaze::editor::DungeonObjectSelector::DrawTileSelector | ( | ) |
Definition at line 38 of file dungeon_object_selector.cc.
References DrawObjectRenderer(), DrawRoomGraphics(), and EnsureRegistryInitialized().

| void yaze::editor::DungeonObjectSelector::DrawObjectRenderer | ( | ) |
Definition at line 59 of file dungeon_object_selector.cc.
References yaze::gui::CanvasFrameOptions::canvas_size, yaze::gui::CanvasFrameOptions::draw_grid, DrawObjectAssetBrowser(), EnsureRegistryInitialized(), yaze::gui::CanvasFrameOptions::grid_step, yaze::zelda3::RoomObject::id_, yaze::zelda3::RoomObject::layer_, object_canvas_, object_loaded_, place_x_, place_y_, PlaceObjectAtPosition(), preview_object_, yaze::gui::CanvasFrameOptions::render_popups, RenderObjectPrimitive(), yaze::zelda3::RoomObject::size_, yaze::zelda3::RoomObject::x_, and yaze::zelda3::RoomObject::y_.
Referenced by Draw(), and DrawTileSelector().

| void yaze::editor::DungeonObjectSelector::DrawIntegratedEditingPanels | ( | ) |
Definition at line 222 of file dungeon_object_selector.cc.
References DrawCompactChestEditor(), DrawCompactDoorEditor(), DrawCompactEntranceEditor(), DrawCompactItemEditor(), DrawCompactObjectEditor(), DrawCompactPropertiesEditor(), DrawCompactSpriteEditor(), dungeon_editor_system_, and object_editor_.
Referenced by Draw().
| void yaze::editor::DungeonObjectSelector::Draw | ( | ) |
Definition at line 143 of file dungeon_object_selector.cc.
References DrawIntegratedEditingPanels(), DrawObjectRenderer(), and DrawRoomGraphics().

|
inline |
Definition at line 42 of file dungeon_object_selector.h.
References yaze::editor::EditorContext::game_data, game_data_, yaze::editor::EditorContext::rom, and rom_.
Referenced by yaze::editor::ObjectEditorPanel::SetContext().
|
inline |
Definition at line 46 of file dungeon_object_selector.h.
References game_data_, and rom_.
|
inline |
|
inline |
|
inline |
Definition at line 51 of file dungeon_object_selector.h.
References game_data(), and game_data_.
Referenced by yaze::editor::ObjectEditorPanel::SetGameData().

|
inline |
Definition at line 52 of file dungeon_object_selector.h.
References game_data_.
Referenced by yaze::editor::ObjectEditorPanel::OpenStaticObjectEditor(), and SetGameData().
|
inline |
Definition at line 55 of file dungeon_object_selector.h.
References dungeon_editor_system_.
|
inline |
Definition at line 59 of file dungeon_object_selector.h.
References object_editor_.
|
inline |
Definition at line 64 of file dungeon_object_selector.h.
References rooms_.
Referenced by yaze::editor::ObjectEditorPanel::SetRooms().
|
inline |
Definition at line 65 of file dungeon_object_selector.h.
References rooms_.
Referenced by yaze::editor::ObjectEditorPanel::DrawDoorSection(), and yaze::editor::ObjectEditorPanel::OpenStaticObjectEditor().
|
inline |
Definition at line 66 of file dungeon_object_selector.h.
References current_room_id_.
Referenced by yaze::editor::ObjectEditorPanel::SetCurrentRoom().
|
inline |
Definition at line 69 of file dungeon_object_selector.h.
References current_palette_group_id_.
|
inline |
Definition at line 72 of file dungeon_object_selector.h.
References current_palette_group_.
Referenced by yaze::editor::ObjectEditorPanel::SetCurrentPaletteGroup().
|
inline |
Definition at line 75 of file dungeon_object_selector.h.
References current_palette_id_.
|
inline |
Definition at line 80 of file dungeon_object_selector.h.
References object_selected_callback_.
Referenced by yaze::editor::ObjectEditorPanel::ObjectEditorPanel().
|
inline |
Definition at line 85 of file dungeon_object_selector.h.
References object_placement_callback_.
|
inline |
Definition at line 90 of file dungeon_object_selector.h.
References object_double_click_callback_.
Referenced by yaze::editor::ObjectEditorPanel::ObjectEditorPanel().
|
inline |
Definition at line 95 of file dungeon_object_selector.h.
References preview_object_.
|
inline |
Definition at line 96 of file dungeon_object_selector.h.
References object_loaded_.
| void yaze::editor::DungeonObjectSelector::DrawObjectAssetBrowser | ( | ) |
Definition at line 482 of file dungeon_object_selector.cc.
References current_palette_group_id_, DrawObjectPreview(), yaze::gfx::PaletteGroupMap::dungeon_main, enable_object_previews_, game_data_, yaze::zelda3::CustomObjectManager::Get(), yaze::zelda3::GetObjectName(), yaze::zelda3::GetObjectSubtype(), GetObjectTypeColor(), GetObjectTypeSymbol(), yaze::editor::AgentUI::GetTheme(), ICON_MD_IMAGE, MakePreviewObject(), object_double_click_callback_, object_loaded_, object_selected_callback_, yaze::zelda3::GameData::palette_groups, preview_object_, preview_palette_, rom_, selected_object_id_, SelectObject(), yaze::zelda3::RoomObject::SetRom(), yaze::gfx::PaletteGroup::size(), yaze::zelda3::RoomObject::size_, and static_editor_object_id_.
Referenced by DrawObjectRenderer(), and yaze::editor::ObjectEditorPanel::DrawObjectSelector().
| void yaze::editor::DungeonObjectSelector::SelectObject | ( | int | obj_id | ) |
Definition at line 463 of file dungeon_object_selector.cc.
References current_palette_group_id_, yaze::gfx::PaletteGroupMap::dungeon_main, game_data_, object_loaded_, object_selected_callback_, yaze::zelda3::GameData::palette_groups, preview_object_, preview_palette_, rom_, selected_object_id_, and yaze::zelda3::RoomObject::SetRom().
Referenced by DrawObjectAssetBrowser(), and yaze::editor::ObjectEditorPanel::SelectObject().

|
inline |
Definition at line 105 of file dungeon_object_selector.h.
References static_editor_object_id_.
Referenced by yaze::editor::ObjectEditorPanel::CloseStaticObjectEditor(), and yaze::editor::ObjectEditorPanel::OpenStaticObjectEditor().
|
inline |
Definition at line 108 of file dungeon_object_selector.h.
References static_editor_object_id_.
|
private |
Definition at line 167 of file dungeon_object_selector.cc.
References yaze::gui::Canvas::AddImageAt(), current_room_id_, yaze::gui::CanvasFrameOptions::draw_grid, yaze::gui::Canvas::DrawTileSelector(), yaze::gfx::Arena::Get(), yaze::gfx::Arena::gfx_sheets(), yaze::gui::CanvasFrameOptions::grid_step, yaze::gui::Canvas::height(), yaze::Rom::is_loaded(), yaze::gui::CanvasFrameOptions::render_popups, rom_, room_gfx_canvas_, rooms_, and yaze::gui::Canvas::width().
Referenced by Draw(), and DrawTileSelector().
|
private |
Definition at line 790 of file dungeon_object_selector.cc.
|
private |
Definition at line 809 of file dungeon_object_selector.cc.
Referenced by RenderObjectPrimitive().
|
private |
Definition at line 831 of file dungeon_object_selector.cc.
References object_loaded_, object_placement_callback_, preview_object_, and yaze::zelda3::RoomObject::set_x().
Referenced by DrawObjectRenderer().

|
private |
Definition at line 277 of file dungeon_object_selector.cc.
References yaze::zelda3::DungeonObjectEditor::kEdit, yaze::zelda3::DungeonObjectEditor::kInsert, yaze::zelda3::DungeonObjectEditor::kSelect, and object_editor_.
Referenced by DrawIntegratedEditingPanels().
|
private |
Definition at line 845 of file dungeon_object_selector.cc.
References dungeon_editor_system_, yaze::zelda3::DungeonEditorSystem::kEnemy, yaze::zelda3::DungeonEditorSystem::SpriteData::layer, new_sprite_id_, new_sprite_x_, new_sprite_y_, yaze::zelda3::DungeonEditorSystem::SpriteData::sprite_id, yaze::zelda3::DungeonEditorSystem::SpriteData::type, yaze::zelda3::DungeonEditorSystem::SpriteData::x, and yaze::zelda3::DungeonEditorSystem::SpriteData::y.
Referenced by DrawIntegratedEditingPanels().
|
private |
Definition at line 901 of file dungeon_object_selector.cc.
References dungeon_editor_system_, yaze::zelda3::DungeonEditorSystem::ItemData::is_hidden, yaze::zelda3::DungeonEditorSystem::ItemData::item_id, yaze::zelda3::DungeonEditorSystem::kKey, new_item_id_, new_item_x_, new_item_y_, yaze::zelda3::DungeonEditorSystem::ItemData::room_id, yaze::zelda3::DungeonEditorSystem::ItemData::type, yaze::zelda3::DungeonEditorSystem::ItemData::x, and yaze::zelda3::DungeonEditorSystem::ItemData::y.
Referenced by DrawIntegratedEditingPanels().
|
private |
Definition at line 958 of file dungeon_object_selector.cc.
References dungeon_editor_system_, entrance_source_x_, entrance_source_y_, entrance_target_room_id_, entrance_target_x_, and entrance_target_y_.
Referenced by DrawIntegratedEditingPanels().
|
private |
Definition at line 1006 of file dungeon_object_selector.cc.
References yaze::zelda3::BigKeyDoor, yaze::zelda3::BombableDoor, yaze::zelda3::BottomSidedShutter, yaze::zelda3::CaveExit, current_room_id_, yaze::zelda3::CurtainDoor, yaze::zelda3::DashWall, yaze::zelda3::DungeonEditorSystem::DoorData::direction, door_direction_, door_target_room_, door_x_, door_y_, yaze::zelda3::DoubleSidedShutter, dungeon_editor_system_, yaze::zelda3::DungeonSwapMarker, yaze::zelda3::ExitMarker, yaze::zelda3::ExplodingWall, yaze::zelda3::EyeWatchDoor, yaze::zelda3::FancyDungeonExit, yaze::zelda3::GetDoorDirectionName(), yaze::zelda3::GetDoorTypeName(), yaze::editor::AgentUI::GetTheme(), yaze::zelda3::DungeonEditorSystem::DoorData::is_locked, yaze::zelda3::DungeonEditorSystem::DoorData::key_type, yaze::zelda3::LayerSwapMarker, yaze::zelda3::NormalDoor, yaze::zelda3::NormalDoorLower, yaze::zelda3::DungeonEditorSystem::DoorData::requires_key, yaze::zelda3::DungeonEditorSystem::DoorData::room_id, rooms_, yaze::zelda3::SmallKeyDoor, yaze::zelda3::SmallKeyStairsDown, yaze::zelda3::SmallKeyStairsUp, yaze::zelda3::DungeonEditorSystem::DoorData::target_room_id, yaze::zelda3::DungeonEditorSystem::DoorData::target_x, yaze::zelda3::DungeonEditorSystem::DoorData::target_y, yaze::zelda3::TopSidedShutter, yaze::zelda3::WaterfallDoor, yaze::zelda3::DungeonEditorSystem::DoorData::x, and yaze::zelda3::DungeonEditorSystem::DoorData::y.
Referenced by DrawIntegratedEditingPanels().

|
private |
Definition at line 1137 of file dungeon_object_selector.cc.
References chest_big_, chest_item_id_, chest_x_, chest_y_, dungeon_editor_system_, chest::x, and chest::y.
Referenced by DrawIntegratedEditingPanels().
|
private |
Definition at line 1189 of file dungeon_object_selector.cc.
References dungeon_editor_system_, yaze::zelda3::DungeonEditorSystem::RoomProperties::dungeon_id, dungeon_id_, yaze::zelda3::DungeonEditorSystem::RoomProperties::floor_level, floor_level_, yaze::zelda3::DungeonEditorSystem::RoomProperties::is_boss_room, is_boss_room_, yaze::zelda3::DungeonEditorSystem::RoomProperties::is_save_room, is_save_room_, yaze::zelda3::DungeonEditorSystem::RoomProperties::music_id, music_id_, yaze::zelda3::DungeonEditorSystem::RoomProperties::name, yaze::zelda3::DungeonEditorSystem::RoomProperties::room_id, and room_name_.
Referenced by DrawIntegratedEditingPanels().
|
private |
Definition at line 1399 of file dungeon_object_selector.cc.
References yaze::gfx::BackgroundBuffer::bitmap(), and GetOrCreatePreview().
Referenced by DrawObjectAssetBrowser().

|
private |
Definition at line 1264 of file dungeon_object_selector.cc.
References yaze::zelda3::RoomObject::EnsureTilesLoaded(), rom_, and yaze::zelda3::RoomObject::SetRom().
Referenced by DrawObjectAssetBrowser().

|
private |
Definition at line 1258 of file dungeon_object_selector.cc.
References object_registry_, yaze::zelda3::DungeonObjectRegistry::RegisterVanillaRange(), and registry_initialized_.
Referenced by DrawObjectRenderer(), and DrawTileSelector().

|
private |
Definition at line 347 of file dungeon_object_selector.cc.
References yaze::editor::AgentUI::GetTheme().
Referenced by DrawObjectAssetBrowser(), and RenderObjectPrimitive().

|
private |
Definition at line 396 of file dungeon_object_selector.cc.
Referenced by DrawObjectAssetBrowser().
|
private |
Definition at line 443 of file dungeon_object_selector.cc.
References CalculateObjectDimensions(), yaze::gui::Canvas::DrawRect(), yaze::gui::Canvas::DrawText(), GetObjectTypeColor(), yaze::editor::AgentUI::GetTheme(), and object_canvas_.
Referenced by DrawObjectRenderer().
|
private |
Definition at line 1271 of file dungeon_object_selector.cc.
References preview_cache_.
Referenced by GetOrCreatePreview().
|
private |
Definition at line 1275 of file dungeon_object_selector.cc.
References yaze::gfx::BackgroundBuffer::bitmap(), cached_preview_blockset_, cached_preview_palette_, cached_preview_room_id_, yaze::gfx::Arena::CREATE, current_palette_group_, current_room_id_, yaze::zelda3::ObjectDrawer::DrawObject(), yaze::zelda3::RoomObject::EnsureTilesLoaded(), yaze::gfx::Arena::Get(), yaze::zelda3::ObjectDrawer::InitializeDrawRoutines(), InvalidatePreviewCache(), yaze::Rom::is_loaded(), preview_cache_, yaze::gfx::Arena::ProcessTextureQueue(), yaze::gfx::Arena::QueueTextureCommand(), rom_, rooms_, yaze::zelda3::RoomObject::SetRom(), yaze::gfx::PaletteGroup::size(), and yaze::zelda3::RoomObject::tiles().
Referenced by DrawObjectPreview().
|
private |
Definition at line 131 of file dungeon_object_selector.h.
Referenced by context(), DrawObjectAssetBrowser(), DrawRoomGraphics(), GetOrCreatePreview(), MakePreviewObject(), rom(), SelectObject(), SetContext(), and SetRom().
|
private |
Definition at line 132 of file dungeon_object_selector.h.
Referenced by context(), DrawObjectAssetBrowser(), game_data(), SelectObject(), SetContext(), and SetGameData().
|
private |
Definition at line 133 of file dungeon_object_selector.h.
Referenced by DrawRoomGraphics().
|
private |
Definition at line 135 of file dungeon_object_selector.h.
Referenced by DrawObjectRenderer(), and RenderObjectPrimitive().
|
private |
Definition at line 138 of file dungeon_object_selector.h.
Referenced by DrawCompactChestEditor(), DrawCompactDoorEditor(), DrawCompactEntranceEditor(), DrawCompactItemEditor(), DrawCompactPropertiesEditor(), DrawCompactSpriteEditor(), DrawIntegratedEditingPanels(), and set_dungeon_editor_system().
|
private |
Definition at line 140 of file dungeon_object_selector.h.
Referenced by DrawCompactObjectEditor(), DrawIntegratedEditingPanels(), and set_object_editor().
|
private |
Definition at line 143 of file dungeon_object_selector.h.
Referenced by DrawCompactDoorEditor(), DrawRoomGraphics(), get_rooms(), GetOrCreatePreview(), and set_rooms().
|
private |
Definition at line 144 of file dungeon_object_selector.h.
Referenced by DrawCompactDoorEditor(), DrawRoomGraphics(), GetOrCreatePreview(), and set_current_room_id().
|
private |
Definition at line 147 of file dungeon_object_selector.h.
Referenced by DrawObjectAssetBrowser(), SelectObject(), and set_current_palette_group_id().
|
private |
Definition at line 148 of file dungeon_object_selector.h.
Referenced by SetCurrentPaletteId().
|
private |
Definition at line 149 of file dungeon_object_selector.h.
Referenced by GetOrCreatePreview(), and SetCurrentPaletteGroup().
|
private |
Definition at line 151 of file dungeon_object_selector.h.
Referenced by EnsureRegistryInitialized().
|
private |
Definition at line 154 of file dungeon_object_selector.h.
Referenced by DrawObjectAssetBrowser(), DrawObjectRenderer(), GetPreviewObject(), PlaceObjectAtPosition(), and SelectObject().
|
private |
Definition at line 155 of file dungeon_object_selector.h.
Referenced by DrawObjectAssetBrowser(), and SelectObject().
|
private |
Definition at line 156 of file dungeon_object_selector.h.
Referenced by DrawObjectAssetBrowser(), DrawObjectRenderer(), IsObjectLoaded(), PlaceObjectAtPosition(), and SelectObject().
|
private |
Definition at line 159 of file dungeon_object_selector.h.
Referenced by DrawObjectAssetBrowser(), SelectObject(), and SetObjectSelectedCallback().
|
private |
Definition at line 160 of file dungeon_object_selector.h.
Referenced by PlaceObjectAtPosition(), and SetObjectPlacementCallback().
|
private |
Definition at line 161 of file dungeon_object_selector.h.
Referenced by DrawObjectAssetBrowser(), and SetObjectDoubleClickCallback().
|
private |
Definition at line 164 of file dungeon_object_selector.h.
Referenced by DrawObjectAssetBrowser(), and SelectObject().
|
private |
Definition at line 165 of file dungeon_object_selector.h.
Referenced by DrawObjectAssetBrowser(), GetStaticEditorObjectId(), and SetStaticEditorObjectId().
|
private |
Definition at line 168 of file dungeon_object_selector.h.
Referenced by DrawObjectRenderer().
|
private |
Definition at line 169 of file dungeon_object_selector.h.
Referenced by DrawObjectRenderer().
|
private |
Definition at line 172 of file dungeon_object_selector.h.
|
private |
Definition at line 173 of file dungeon_object_selector.h.
|
private |
Definition at line 176 of file dungeon_object_selector.h.
Referenced by DrawCompactSpriteEditor().
|
private |
Definition at line 177 of file dungeon_object_selector.h.
Referenced by DrawCompactSpriteEditor().
|
private |
Definition at line 178 of file dungeon_object_selector.h.
Referenced by DrawCompactSpriteEditor().
|
private |
Definition at line 181 of file dungeon_object_selector.h.
Referenced by DrawCompactItemEditor().
|
private |
Definition at line 182 of file dungeon_object_selector.h.
Referenced by DrawCompactItemEditor().
|
private |
Definition at line 183 of file dungeon_object_selector.h.
Referenced by DrawCompactItemEditor().
|
private |
Definition at line 186 of file dungeon_object_selector.h.
Referenced by DrawCompactEntranceEditor().
|
private |
Definition at line 187 of file dungeon_object_selector.h.
Referenced by DrawCompactEntranceEditor().
|
private |
Definition at line 188 of file dungeon_object_selector.h.
Referenced by DrawCompactEntranceEditor().
|
private |
Definition at line 189 of file dungeon_object_selector.h.
Referenced by DrawCompactEntranceEditor().
|
private |
Definition at line 190 of file dungeon_object_selector.h.
Referenced by DrawCompactEntranceEditor().
|
private |
Definition at line 193 of file dungeon_object_selector.h.
Referenced by DrawCompactDoorEditor().
|
private |
Definition at line 194 of file dungeon_object_selector.h.
Referenced by DrawCompactDoorEditor().
|
private |
Definition at line 195 of file dungeon_object_selector.h.
Referenced by DrawCompactDoorEditor().
|
private |
Definition at line 196 of file dungeon_object_selector.h.
Referenced by DrawCompactDoorEditor().
|
private |
Definition at line 199 of file dungeon_object_selector.h.
Referenced by DrawCompactChestEditor().
|
private |
Definition at line 200 of file dungeon_object_selector.h.
Referenced by DrawCompactChestEditor().
|
private |
Definition at line 201 of file dungeon_object_selector.h.
Referenced by DrawCompactChestEditor().
|
private |
Definition at line 202 of file dungeon_object_selector.h.
Referenced by DrawCompactChestEditor().
|
private |
Definition at line 205 of file dungeon_object_selector.h.
Referenced by DrawCompactPropertiesEditor().
|
private |
Definition at line 206 of file dungeon_object_selector.h.
Referenced by DrawCompactPropertiesEditor().
|
private |
Definition at line 207 of file dungeon_object_selector.h.
Referenced by DrawCompactPropertiesEditor().
|
private |
Definition at line 208 of file dungeon_object_selector.h.
Referenced by DrawCompactPropertiesEditor().
|
private |
Definition at line 209 of file dungeon_object_selector.h.
Referenced by DrawCompactPropertiesEditor().
|
private |
Definition at line 210 of file dungeon_object_selector.h.
Referenced by DrawCompactPropertiesEditor().
|
private |
Definition at line 213 of file dungeon_object_selector.h.
Referenced by EnsureRegistryInitialized().
|
private |
Definition at line 216 of file dungeon_object_selector.h.
Referenced by DrawObjectAssetBrowser().
|
private |
Definition at line 220 of file dungeon_object_selector.h.
Referenced by GetOrCreatePreview(), and InvalidatePreviewCache().
|
private |
Definition at line 221 of file dungeon_object_selector.h.
Referenced by GetOrCreatePreview().
|
private |
Definition at line 222 of file dungeon_object_selector.h.
Referenced by GetOrCreatePreview().
|
private |
Definition at line 223 of file dungeon_object_selector.h.
Referenced by GetOrCreatePreview().
|
private |
Definition at line 228 of file dungeon_object_selector.h.