feat: Add custom overworld map settings UI to OverworldEditor
This commit is contained in:
@@ -332,7 +332,78 @@ void OverworldEditor::DrawOverworldMapSettings() {
|
||||
}
|
||||
|
||||
void OverworldEditor::DrawCustomOverworldMapSettings() {
|
||||
// TODO: Add @JaredBrian ZSCustomOverworld features to OverworldEditor
|
||||
if (BeginTable(kOWMapTable.data(), 15, kOWMapFlags, ImVec2(0, 0), -1)) {
|
||||
for (const auto &name : kMapSettingsColumnNames)
|
||||
ImGui::TableSetupColumn(name);
|
||||
|
||||
TableNextColumn();
|
||||
ImGui::SetNextItemWidth(120.f);
|
||||
ImGui::Combo("##world", ¤t_world_, kWorldList.data(), 3);
|
||||
|
||||
static const std::array<std::string, 8> kCustomMapSettingsColumnNames = {
|
||||
"TileGfx0", "TileGfx1", "TileGfx2", "TileGfx3",
|
||||
"TileGfx4", "TileGfx5", "TileGfx6", "TileGfx7"};
|
||||
for (int i = 0; i < 8; ++i) {
|
||||
TableNextColumn();
|
||||
ImGui::BeginGroup();
|
||||
if (gui::InputHexByte(kCustomMapSettingsColumnNames[i].data(),
|
||||
overworld_.mutable_overworld_map(current_map_)
|
||||
->mutable_custom_tileset(i),
|
||||
kInputFieldSize)) {
|
||||
RefreshMapProperties();
|
||||
RefreshOverworldMap();
|
||||
}
|
||||
ImGui::EndGroup();
|
||||
}
|
||||
|
||||
TableNextColumn();
|
||||
ImGui::BeginGroup();
|
||||
if (gui::InputHexByte("Palette",
|
||||
overworld_.mutable_overworld_map(current_map_)
|
||||
->mutable_area_palette(),
|
||||
kInputFieldSize)) {
|
||||
RefreshMapProperties();
|
||||
status_ = RefreshMapPalette();
|
||||
RefreshOverworldMap();
|
||||
}
|
||||
ImGui::EndGroup();
|
||||
|
||||
TableNextColumn();
|
||||
ImGui::BeginGroup();
|
||||
gui::InputHexByte("Spr Gfx",
|
||||
overworld_.mutable_overworld_map(current_map_)
|
||||
->mutable_sprite_graphics(game_state_),
|
||||
kInputFieldSize);
|
||||
ImGui::EndGroup();
|
||||
|
||||
TableNextColumn();
|
||||
ImGui::BeginGroup();
|
||||
gui::InputHexByte("Spr Palette",
|
||||
overworld_.mutable_overworld_map(current_map_)
|
||||
->mutable_sprite_palette(game_state_),
|
||||
kInputFieldSize);
|
||||
ImGui::EndGroup();
|
||||
|
||||
TableNextColumn();
|
||||
ImGui::BeginGroup();
|
||||
gui::InputHexWord(
|
||||
"Msg Id",
|
||||
overworld_.mutable_overworld_map(current_map_)->mutable_message_id(),
|
||||
kInputFieldSize + 20);
|
||||
ImGui::EndGroup();
|
||||
|
||||
TableNextColumn();
|
||||
ImGui::SetNextItemWidth(100.f);
|
||||
ImGui::Combo("##World", &game_state_, kGamePartComboString.data(), 3);
|
||||
|
||||
TableNextColumn();
|
||||
ImGui::Checkbox(
|
||||
"##mosaic",
|
||||
overworld_.mutable_overworld_map(current_map_)->mutable_mosaic());
|
||||
HOVER_HINT("Enable Mosaic effect for the current map");
|
||||
|
||||
ImGui::EndTable();
|
||||
}
|
||||
}
|
||||
|
||||
void OverworldEditor::DrawOverworldMaps() {
|
||||
|
||||
@@ -118,6 +118,29 @@ class OverworldMap : public editor::context::GfxContext {
|
||||
auto set_sprite_palette(int i, uint8_t value) { sprite_palette_[i] = value; }
|
||||
auto set_message_id(uint16_t value) { message_id_ = value; }
|
||||
|
||||
uint8_t* mutable_custom_tileset(int index) {
|
||||
switch (index) {
|
||||
case 0:
|
||||
return &custom_tileset_.TileGFX0;
|
||||
case 1:
|
||||
return &custom_tileset_.TileGFX1;
|
||||
case 2:
|
||||
return &custom_tileset_.TileGFX2;
|
||||
case 3:
|
||||
return &custom_tileset_.TileGFX3;
|
||||
case 4:
|
||||
return &custom_tileset_.TileGFX4;
|
||||
case 5:
|
||||
return &custom_tileset_.TileGFX5;
|
||||
case 6:
|
||||
return &custom_tileset_.TileGFX6;
|
||||
case 7:
|
||||
return &custom_tileset_.TileGFX7;
|
||||
default:
|
||||
return &custom_tileset_.TileGFX0;
|
||||
}
|
||||
}
|
||||
|
||||
void SetAsLargeMap(int parent_index, int quadrant) {
|
||||
parent_ = parent_index;
|
||||
large_index_ = quadrant;
|
||||
|
||||
Reference in New Issue
Block a user