mirror of
https://github.com/Stone-Red-Code/StoneRed.LogicSimulator.git
synced 2026-09-08 07:55:58 +02:00
Disable input white QuickMenu is open
This commit is contained in:
@@ -24,6 +24,7 @@ internal class Srls : Game
|
|||||||
private SrlsWindow? currentSrlsWindow = null;
|
private SrlsWindow? currentSrlsWindow = null;
|
||||||
private SrlsScreen? currentSrlsScreen = null;
|
private SrlsScreen? currentSrlsScreen = null;
|
||||||
public float Scale { get; private set; }
|
public float Scale { get; private set; }
|
||||||
|
public bool WindowOpen => currentSrlsWindow is not null;
|
||||||
public GraphicsDeviceManager Graphics { get; }
|
public GraphicsDeviceManager Graphics { get; }
|
||||||
|
|
||||||
public Desktop Desktop { get; private set; } = null!;
|
public Desktop Desktop { get; private set; } = null!;
|
||||||
|
|||||||
@@ -36,8 +36,11 @@ internal class WorldScreen : SrlsScreen<Grid>
|
|||||||
private SpinButton frequency = null!;
|
private SpinButton frequency = null!;
|
||||||
private CheckBox highPerformance = null!;
|
private CheckBox highPerformance = null!;
|
||||||
private ListBox nativeComponentsListBox = null!;
|
private ListBox nativeComponentsListBox = null!;
|
||||||
|
|
||||||
private float fps;
|
private float fps;
|
||||||
|
|
||||||
|
private bool blockInput;
|
||||||
|
|
||||||
private MouseStateExtended previousMouseState;
|
private MouseStateExtended previousMouseState;
|
||||||
|
|
||||||
private ConnectionContext? connectionContext = null;
|
private ConnectionContext? connectionContext = null;
|
||||||
@@ -183,6 +186,12 @@ internal class WorldScreen : SrlsScreen<Grid>
|
|||||||
upsLabel.Font = srls.FontSystem.GetFont(10 * srls.Scale);
|
upsLabel.Font = srls.FontSystem.GetFont(10 * srls.Scale);
|
||||||
positionLabel.Font = srls.FontSystem.GetFont(10 * srls.Scale);
|
positionLabel.Font = srls.FontSystem.GetFont(10 * srls.Scale);
|
||||||
|
|
||||||
|
if (blockInput)
|
||||||
|
{
|
||||||
|
blockInput = srls.WindowOpen;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
MouseStateExtended mouseState = MouseExtended.GetState();
|
MouseStateExtended mouseState = MouseExtended.GetState();
|
||||||
KeyboardStateExtended keyboardState = KeyboardExtended.GetState();
|
KeyboardStateExtended keyboardState = KeyboardExtended.GetState();
|
||||||
|
|
||||||
@@ -248,8 +257,11 @@ internal class WorldScreen : SrlsScreen<Grid>
|
|||||||
|
|
||||||
if (keyboardState.IsKeyDown(Keys.Q))
|
if (keyboardState.IsKeyDown(Keys.Q))
|
||||||
{
|
{
|
||||||
|
blockInput = true;
|
||||||
|
|
||||||
UnSelectLogicGate();
|
UnSelectLogicGate();
|
||||||
worldData.LogicGates = simulator.GetLogicGates();
|
worldData.LogicGates = simulator.GetLogicGates();
|
||||||
|
|
||||||
srls.ShowWindow(new QuickMenu(worldData));
|
srls.ShowWindow(new QuickMenu(worldData));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user