|
|
using System;
|
|
|
using ImGuiNET;
|
|
|
|
|
|
using Num = System.Numerics;
|
|
|
|
|
|
using isometricparkfna.Engines;
|
|
|
using isometricparkfna.Messages;
|
|
|
using isometricparkfna.UI;
|
|
|
|
|
|
namespace isometricparkfna.UI
|
|
|
{
|
|
|
|
|
|
public static class MainMenu
|
|
|
{
|
|
|
|
|
|
|
|
|
public static void Render(ImFontPtr font, ImGuiWindowBridgeEngine bridgeEngine
|
|
|
/*ImFontPtr smallFont, GameBridgeEngine bridgeEngine */ //, ref bool quit, ref bool paused, ref int rate, ref bool showBudget, string header
|
|
|
)
|
|
|
{
|
|
|
//Has to go first so the measurement is correct:
|
|
|
ImGui.PushFont(font);
|
|
|
|
|
|
ImGui.GetStyle().WindowMenuButtonPosition = ImGuiDir.None;
|
|
|
bool newShow = true;
|
|
|
|
|
|
Num.Vector2 text_size = ImGui.CalcTextSize("Quit to Main Menu");
|
|
|
Num.Vector2 button_size = new Num.Vector2((int)text_size.X*1.1f,
|
|
|
(int)text_size.Y*1.25f+5);
|
|
|
|
|
|
|
|
|
StyleSets.defaultSet.push();
|
|
|
|
|
|
ImGui.Begin("##Toolbar", ref newShow, ImGuiWindowFlags.NoResize | ImGuiWindowFlags.NoCollapse | ImGuiWindowFlags.NoSavedSettings | ImGuiWindowFlags.NoTitleBar);
|
|
|
|
|
|
if (ImGui.Button("New Game", button_size))
|
|
|
{
|
|
|
bridgeEngine.gameStateMessages.Add(new GameStateMessage { isPlaying = true});
|
|
|
}
|
|
|
|
|
|
if (ImGui.Button("Quit", button_size))
|
|
|
{
|
|
|
System.Console.WriteLine("Quitting");
|
|
|
Environment.Exit(0);
|
|
|
}
|
|
|
|
|
|
ImGui.End();
|
|
|
|
|
|
ImGui.GetStyle().WindowMenuButtonPosition = ImGuiDir.Left;
|
|
|
StyleSets.defaultSet.pop();
|
|
|
ImGui.PopFont();
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
|