mirror of
https://github.com/antopilo/Nuake.git
synced 2026-09-21 20:08:40 +03:00
Added resolution and monitor launch arg for editor
This commit is contained in:
@@ -34,6 +34,9 @@ int main(int argc, char* argv[])
|
||||
{
|
||||
bool playMode = false;
|
||||
std::string projectPath = "";
|
||||
|
||||
Vector2 editorResolution = Vector2(1280, 720);
|
||||
int monitorIdx = -1;
|
||||
for (uint32_t i = 0; i < argc; i++)
|
||||
{
|
||||
char* arg = argv[i];
|
||||
@@ -47,6 +50,31 @@ int main(int argc, char* argv[])
|
||||
}
|
||||
playMode = true;
|
||||
}
|
||||
|
||||
if (args == "--resolution")
|
||||
{
|
||||
if (argc >= i + 1)
|
||||
{
|
||||
std::string resString = std::string(argv[i + 1]);
|
||||
const auto& resSplits = String::Split(resString, 'x');
|
||||
if (resSplits.size() == 2)
|
||||
{
|
||||
int width = stoi(resSplits[0]);
|
||||
int height = stoi(resSplits[1]);
|
||||
editorResolution = Vector2(width, height);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (args == "--monitor")
|
||||
{
|
||||
if (argc >= i + 1)
|
||||
{
|
||||
std::string monitorIdxString = std::string(argv[i + 1]);
|
||||
monitorIdx = stoi(monitorIdxString);
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
bool shouldLoadProject = false;
|
||||
@@ -95,12 +123,19 @@ int main(int argc, char* argv[])
|
||||
else
|
||||
{
|
||||
Nuake::Engine::Init();
|
||||
Engine::GetCurrentWindow()->SetSize(editorResolution);
|
||||
|
||||
Nuake::EditorInterface editor;
|
||||
editor.BuildFonts();
|
||||
|
||||
Ref<Nuake::Window> window = Nuake::Engine::GetCurrentWindow();
|
||||
window->SetTitle(WindowTitle);
|
||||
|
||||
if (monitorIdx != -1)
|
||||
{
|
||||
window->SetMonitor(monitorIdx);
|
||||
}
|
||||
|
||||
using namespace Nuake;
|
||||
|
||||
GizmoDrawer gizmoDrawer = GizmoDrawer();
|
||||
|
||||
Reference in New Issue
Block a user