mirror of
https://github.com/arabine/open-story-teller.git
synced 2025-12-06 17:09:06 +01:00
viariables not clear before project load
This commit is contained in:
parent
a308714302
commit
41914362d5
4 changed files with 5 additions and 4 deletions
|
|
@ -511,6 +511,7 @@ bool StoryProject::Load(ResourceManager &manager, NodesFactory &factory)
|
||||||
nlohmann::json j = nlohmann::json::parse(f);
|
nlohmann::json j = nlohmann::json::parse(f);
|
||||||
|
|
||||||
manager.Clear();
|
manager.Clear();
|
||||||
|
m_variables.clear();
|
||||||
|
|
||||||
if (ParseStoryInformation(j))
|
if (ParseStoryInformation(j))
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -764,7 +764,7 @@ void AppController::CloseProject()
|
||||||
m_dbg.run_result = VM_FINISHED;
|
m_dbg.run_result = VM_FINISHED;
|
||||||
m_dbg.free_run = false;
|
m_dbg.free_run = false;
|
||||||
m_dbg.m_breakpoints.clear();
|
m_dbg.m_breakpoints.clear();
|
||||||
|
|
||||||
m_resources.Clear(); // Clear loaded resources
|
m_resources.Clear(); // Clear loaded resources
|
||||||
m_eventQueue.clear(); // Clear any pending VM events
|
m_eventQueue.clear(); // Clear any pending VM events
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -28,7 +28,7 @@ int64_t FloatToScaled(float floatValue, int scalePower) {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void VariablesWindow::ShowRAMEditor(std::shared_ptr<IStoryProject> story)
|
void VariablesWindow::DrawVariableEditor(std::shared_ptr<IStoryProject> story)
|
||||||
{
|
{
|
||||||
|
|
||||||
if (ImGui::Button("Add variable")) {
|
if (ImGui::Button("Add variable")) {
|
||||||
|
|
@ -114,7 +114,7 @@ void VariablesWindow::Draw(std::shared_ptr<IStoryProject> story)
|
||||||
|
|
||||||
if (story)
|
if (story)
|
||||||
{
|
{
|
||||||
ShowRAMEditor(story);
|
DrawVariableEditor(story);
|
||||||
}
|
}
|
||||||
|
|
||||||
WindowBase::EndDraw();
|
WindowBase::EndDraw();
|
||||||
|
|
|
||||||
|
|
@ -14,6 +14,6 @@ public:
|
||||||
void Draw(std::shared_ptr<IStoryProject> story);
|
void Draw(std::shared_ptr<IStoryProject> story);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void ShowRAMEditor(std::shared_ptr<IStoryProject> story);
|
void DrawVariableEditor(std::shared_ptr<IStoryProject> story);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue