Skip to content

Commit

Permalink
Add hex tileid
Browse files Browse the repository at this point in the history
  • Loading branch information
Dregu committed Aug 24, 2024
1 parent 527d0f0 commit 0f01144
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions ui.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1852,8 +1852,15 @@ void UI::RefreshMods() {
}

void UI::DrawTile(Tile &tile) {
ImGui::PushItemWidth(36.f * uiScale);
ImGui::InputScalar("##TileID", ImGuiDataType_U16, &tile.id, 0, 0);
ImGui::PopItemWidth();
ImGui::SameLine(40.f * uiScale, 4);
ImGui::PushItemWidth(80.f * uiScale);
ImGui::InputScalar("ID", ImGuiDataType_U16, &tile.id, &u16_one);
ImGui::InputScalar("ID##TileIDHex", ImGuiDataType_U16, &tile.id, &u16_one, 0,
"%04X", ImGuiInputTextFlags_CharsHexadecimal);
ImGui::PopItemWidth();
ImGui::PushItemWidth(120.f * uiScale);
ImGui::InputScalar("Param", ImGuiDataType_U8, &tile.param, &u8_one);
ImGui::InputScalar("Flags", ImGuiDataType_U8, &tile.flags, &u8_one);
ImGui::PopItemWidth();
Expand All @@ -1872,14 +1879,14 @@ void UI::DrawTileRow(Tile &tile) {
}

void UI::DrawSelectedTile(SelectedTile &tile) {
ImGui::PushItemWidth(80.f * uiScale);
ImGui::PushItemWidth(120.f * uiScale);
DrawTile(*tile.tile);
ImGui::BeginDisabled();
ImGui::InputInt2("Room", &tile.room.x, ImGuiInputTextFlags_ReadOnly);
ImGui::InputInt2("Position", &tile.pos.x, ImGuiInputTextFlags_ReadOnly);
ImGui::InputInt("Layer", &tile.layer, 0, 0, ImGuiInputTextFlags_ReadOnly);
ImGui::InputInt("Map", &tile.map, 0, 0, ImGuiInputTextFlags_ReadOnly);
ImGui::EndDisabled();
DrawTile(*tile.tile);
ImGui::PopItemWidth();
}

Expand Down

0 comments on commit 0f01144

Please sign in to comment.