mirror of
https://github.com/Stone-Red-Code/StoneRed.LogicSimulator.git
synced 2026-09-04 17:16:29 +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 SrlsScreen? currentSrlsScreen = null;
|
||||
public float Scale { get; private set; }
|
||||
public bool WindowOpen => currentSrlsWindow is not null;
|
||||
public GraphicsDeviceManager Graphics { get; }
|
||||
|
||||
public Desktop Desktop { get; private set; } = null!;
|
||||
|
||||
@@ -36,8 +36,11 @@ internal class WorldScreen : SrlsScreen<Grid>
|
||||
private SpinButton frequency = null!;
|
||||
private CheckBox highPerformance = null!;
|
||||
private ListBox nativeComponentsListBox = null!;
|
||||
|
||||
private float fps;
|
||||
|
||||
private bool blockInput;
|
||||
|
||||
private MouseStateExtended previousMouseState;
|
||||
|
||||
private ConnectionContext? connectionContext = null;
|
||||
@@ -183,6 +186,12 @@ internal class WorldScreen : SrlsScreen<Grid>
|
||||
upsLabel.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();
|
||||
KeyboardStateExtended keyboardState = KeyboardExtended.GetState();
|
||||
|
||||
@@ -248,8 +257,11 @@ internal class WorldScreen : SrlsScreen<Grid>
|
||||
|
||||
if (keyboardState.IsKeyDown(Keys.Q))
|
||||
{
|
||||
blockInput = true;
|
||||
|
||||
UnSelectLogicGate();
|
||||
worldData.LogicGates = simulator.GetLogicGates();
|
||||
|
||||
srls.ShowWindow(new QuickMenu(worldData));
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user