Skip to content

Commit

Permalink
Add room warps
Browse files Browse the repository at this point in the history
  • Loading branch information
Dregu committed Aug 25, 2024
1 parent ab97866 commit 13a9a9c
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 4 deletions.
23 changes: 20 additions & 3 deletions ui.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1342,6 +1342,21 @@ void UI::DrawPlayer() {
fmt::format("Warp ({})", ImGui::GetKeyChordName(keys["warp"]))
.c_str()))
doWarp = true;
ImGui::SeparatorText("Room warps");
ImGui::PushID("RoomWarps");
for (int m = 0; m < 5; ++m) {
ImGui::PushID(m);
for (int i = 0; i < 32; ++i) {
auto tile = GetNthTile(653, i, m);
if (!tile.has_value())
break;
ImGui::PushID(i);
DrawSelectedTileRow(tile.value(), false);
ImGui::PopID();
}
ImGui::PopID();
}
ImGui::PopID();
ImGui::PopID();
}
if (*Max::get().equipment() != 0 && *Max::get().item() == 0) {
Expand Down Expand Up @@ -2153,9 +2168,11 @@ void UI::DrawSelectedTile(SelectedTile &tile) {
ImGui::PopItemWidth();
}

void UI::DrawSelectedTileRow(SelectedTile &tile) {
DrawTileRow(*tile.tile);
ImGui::SameLine(0, 4);
void UI::DrawSelectedTileRow(SelectedTile &tile, bool editable) {
if (editable) {
DrawTileRow(*tile.tile);
ImGui::SameLine(0, 4);
}
ImGui::Text("M:%d R:%02d,%02d T:%02d,%02d L:%s", tile.map, tile.room.x,
tile.room.y, tile.pos.x, tile.pos.y, (tile.layer ? "BG" : "FG"));
ImGui::SameLine(ImGui::GetContentRegionMax().x - 24.f * uiScale, 0);
Expand Down
2 changes: 1 addition & 1 deletion ui.h
Original file line number Diff line number Diff line change
Expand Up @@ -292,7 +292,7 @@ class UI {
void DrawTile(Tile &tile);
void DrawTileRow(Tile &tile);
void DrawSelectedTile(SelectedTile &tile);
void DrawSelectedTileRow(SelectedTile &tile);
void DrawSelectedTileRow(SelectedTile &tile, bool editable = true);
void DrawCustomKey(std::string name, GAME_INPUT i);
void DrawUIKeys();
void KeyCapture();
Expand Down

0 comments on commit 13a9a9c

Please sign in to comment.