Polyphase Game Engine
Loading...
Searching...
No Matches
ScriptEditorWindow.h
Go to the documentation of this file.
1#pragma once
2
3#if EDITOR
4
5#include <string>
6#include <vector>
7
8class ScriptEditorWindow
9{
10public:
11 void Init();
12 void Shutdown();
13 void DrawContent();
14
15 void OpenFile(const std::string& filePath);
16
17 // The editor font atlas was rebuilt: Zep's cached ImFont pointers are stale.
18 // sizeRatio = new text scale / old text scale.
19 void OnEditorFontsRebuilt(float sizeRatio);
20 bool HasUnsavedChanges() const;
21
22 // Toolbar actions
23 void DoNew();
24 void DoOpen();
25 void DoSave();
26 void DoSaveAs();
27 void DoCloseCurrentBuffer();
28
29private:
30 void* mEditor = nullptr; // Zep::ZepEditor_ImGui* (opaque, created on first OpenFile)
31 bool mInitialized = false;
32
33 void EnsureEditor();
34
35 // Recent files
36 std::vector<std::string> mRecentFiles;
37 static const size_t kMaxRecentFiles = 10;
38 void AddRecentFile(const std::string& filePath);
39 void LoadRecentFiles();
40 void SaveRecentFiles();
41 std::string GetRecentFilesPath() const;
42};
43
44ScriptEditorWindow* GetScriptEditorWindow();
45
46#endif
void Shutdown()
Definition Engine.cpp:1298