|
|
|
|
|
using System;
|
|
|
using ImGuiNET;
|
|
|
|
|
|
using Num = System.Numerics;
|
|
|
|
|
|
using isometricparkfna.Engines;
|
|
|
using isometricparkfna.Messages;
|
|
|
using isometricparkfna.UI;
|
|
|
|
|
|
namespace isometricparkfna.UI
|
|
|
{
|
|
|
|
|
|
public static class InGameMenu
|
|
|
{
|
|
|
|
|
|
|
|
|
public static void Render(ImFontPtr font, ImGuiWindowBridgeEngine bridgeEngine, int width)
|
|
|
{
|
|
|
|
|
|
ImGui.GetStyle().WindowMenuButtonPosition = ImGuiDir.None;
|
|
|
bool newShow = true;
|
|
|
Num.Vector2 button_size = new Num.Vector2(120, 20);
|
|
|
StyleSet.pushStyleVarSet(StyleSet.defaultWindowVars);
|
|
|
StyleSet.pushColorSet(StyleSet.defaultWindowColors);
|
|
|
|
|
|
|
|
|
ImGui.SetNextWindowPos(new Num.Vector2(width/2, 200));
|
|
|
|
|
|
ImGui.PushFont(font);
|
|
|
// ImGui.PushFont(smallFont);
|
|
|
ImGui.Begin("##In-game Toolbar", ref newShow, ImGuiWindowFlags.NoResize | ImGuiWindowFlags.NoCollapse | ImGuiWindowFlags.NoSavedSettings | ImGuiWindowFlags.NoTitleBar);
|
|
|
|
|
|
if (ImGui.Button("Options", button_size))
|
|
|
{
|
|
|
bridgeEngine.typeMessages.Add(new ToggleWindowTypeMessage{Window = Window.Options});
|
|
|
}
|
|
|
if (ImGui.Button("Return to Game", button_size))
|
|
|
{
|
|
|
bridgeEngine.typeMessages.Add(new ToggleWindowTypeMessage{Window = Window.InGameMenu});
|
|
|
}
|
|
|
if (ImGui.Button("Quit to Main Menu", button_size))
|
|
|
{
|
|
|
|
|
|
bridgeEngine.gameStateMessages.Add(new GameStateMessage{isPlaying = false});
|
|
|
bridgeEngine.typeMessages.Add(new ToggleWindowTypeMessage{Window = Window.InGameMenu});
|
|
|
}
|
|
|
if (ImGui.Button("Quit", button_size))
|
|
|
{
|
|
|
|
|
|
System.Console.WriteLine("Quitting");
|
|
|
Environment.Exit(0);
|
|
|
}
|
|
|
|
|
|
ImGui.End();
|
|
|
|
|
|
|
|
|
ImGui.GetStyle().WindowMenuButtonPosition = ImGuiDir.Left;
|
|
|
StyleSet.popStyleVarSet(StyleSet.defaultWindowVars);
|
|
|
StyleSet.popColorSet(StyleSet.defaultWindowColors);
|
|
|
ImGui.PopFont();
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
|