Skip to content

Commit

Permalink
System Editor: show disabled body economic properties
Browse files Browse the repository at this point in the history
- These properties are currently overwritten when loading custom systems
- Display a disabled edit field with a TODO notice until that changes
  • Loading branch information
sturnclaw committed Mar 1, 2024
1 parent cd815ba commit fa42d04
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions src/editor/system/GalaxyEditAPI.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -548,11 +548,16 @@ void SystemBody::EditorAPI::EditOrbitalParameters(SystemBody *body, UndoSystem *

void SystemBody::EditorAPI::EditEconomicProperties(SystemBody *body, UndoSystem *undo)
{
ImGui::SeparatorText("Economic Parameters");

// TODO: system generation currently ignores these fields of a system body
// and overwrites them with randomly-rolled values.
return;
ImGui::BeginDisabled();

ImGui::SeparatorText("Economic Parameters");
ImGui::PushTextWrapPos(ImGui::GetContentRegionAvail().x);
ImGui::TextColored(ImVec4(0.8, 0.8, 0.8, 1.0), "These fields are currently overwritten when the system is loaded.");
ImGui::PopTextWrapPos();
ImGui::Spacing();

ImGui::InputFixed("Population", &body->m_population);
if (Draw::UndoHelper("Edit Population", undo))
Expand All @@ -561,6 +566,8 @@ void SystemBody::EditorAPI::EditEconomicProperties(SystemBody *body, UndoSystem
ImGui::InputFixed("Agricultural Activity", &body->m_agricultural);
if (Draw::UndoHelper("Edit Agricultural Activity", undo))
AddUndoSingleValue(undo, &body->m_agricultural);

ImGui::EndDisabled();
}

void SystemBody::EditorAPI::EditStarportProperties(SystemBody *body, UndoSystem *undo)
Expand Down

0 comments on commit fa42d04

Please sign in to comment.