From d2edce5f893ba2baea5a93f6e8edeafe64086826 Mon Sep 17 00:00:00 2001 From: Interfiber Date: Sat, 27 May 2023 19:50:03 -0400 Subject: [PATCH] map info editor --- imgui.ini | 9 +++++++-- maps/ph_example.map | 2 +- src/mapEditor.cpp | 17 +++++++++++++++++ 3 files changed, 25 insertions(+), 3 deletions(-) diff --git a/imgui.ini b/imgui.ini index 2450bc6..cb6abb6 100644 --- a/imgui.ini +++ b/imgui.ini @@ -4,8 +4,8 @@ Size=400,400 Collapsed=0 [Window][Phoenix Map Editor] -Pos=732,455 -Size=773,153 +Pos=833,459 +Size=773,184 Collapsed=0 [Window][Map Editor Tools] @@ -13,3 +13,8 @@ Pos=860,128 Size=357,247 Collapsed=0 +[Window][Map Information Editor] +Pos=838,656 +Size=588,347 +Collapsed=0 + diff --git a/maps/ph_example.map b/maps/ph_example.map index 1c2f7f3..bed3bfb 100644 --- a/maps/ph_example.map +++ b/maps/ph_example.map @@ -2,7 +2,7 @@ MAPNAME ph_exampleMap MAPVERS b1 MAPAUTH JohnDoe MAPSIZE 20x20 -MAPSCAL 3x3 +MAPSCAL 6x6 MAPSPWN 499,666 MAP TILE WALL diff --git a/src/mapEditor.cpp b/src/mapEditor.cpp index a58973e..2e887ac 100644 --- a/src/mapEditor.cpp +++ b/src/mapEditor.cpp @@ -195,6 +195,23 @@ void runMapEditor() { } ImGui::End(); + + ImGui::Begin("Map Information Editor"); + ImGui::Text("WARNING! Changing map size and scale after you build your " + "map will break it!"); + ImGui::Text("NOTE! Map properties save on map save"); + ImGui::NewLine(); + ImGui::Separator(); + ImGui::NewLine(); + ImGui::InputText("Map name", &editorState.currentMap.mapName); + ImGui::InputText("Map version", &editorState.currentMap.mapVersion); + ImGui::InputText("Map author", &editorState.currentMap.mapAuthor); + ImGui::InputInt("Map scale", &editorState.currentMap.mapScaleX); + ImGui::InputInt("Map scale (Y)", &editorState.currentMap.mapScaleY); + ImGui::InputInt("Map width", &editorState.currentMap.mapWidth); + ImGui::InputInt("Map height", &editorState.currentMap.mapHeight); + + ImGui::End(); } // Rendering