fix1
This commit is contained in:
parent
f19b02f3bc
commit
bc10a6d7b3
3 changed files with 4 additions and 24 deletions
|
@ -83,12 +83,7 @@ public abstract class AbstractGui : IDrawableObject
|
|||
}
|
||||
if (SelectedElement is TextBox)
|
||||
{
|
||||
TextBox box = (TextBox)SelectedElement;
|
||||
box.hoverState = MonogameLibrary.UI.Enums.HoverState.Hovering;
|
||||
if (isStartedPrint)
|
||||
{
|
||||
box.SelectIt();
|
||||
}
|
||||
(SelectedElement as TextBox).hoverState = MonogameLibrary.UI.Enums.HoverState.Hovering;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -118,11 +113,6 @@ public abstract class AbstractGui : IDrawableObject
|
|||
Button button = SelectedElement as Button;
|
||||
button.CallLeftBtnEvent();
|
||||
}
|
||||
else if (SelectedElement is TextBox)
|
||||
{
|
||||
TextBox textBox = SelectedElement as TextBox;
|
||||
isStartedPrint = true;
|
||||
}
|
||||
}
|
||||
else if (isPressed && (gamePadState.Buttons.A == ButtonState.Released &&
|
||||
gamePadState.DPad.Down == ButtonState.Released &&
|
||||
|
@ -136,13 +126,11 @@ public abstract class AbstractGui : IDrawableObject
|
|||
if (keyboardState.IsKeyDown(Keys.Up) && !isPressed)
|
||||
{
|
||||
isPressed = true;
|
||||
isStartedPrint = false;
|
||||
ChangeSelectedElement(-1);
|
||||
}
|
||||
else if (keyboardState.IsKeyDown(Keys.Down) && !isPressed)
|
||||
{
|
||||
isPressed = true;
|
||||
isStartedPrint = false;
|
||||
ChangeSelectedElement(1);
|
||||
}
|
||||
else if (keyboardState.IsKeyDown(Keys.Enter) && !isPressed)
|
||||
|
@ -153,11 +141,6 @@ public abstract class AbstractGui : IDrawableObject
|
|||
Button button = SelectedElement as Button;
|
||||
button.CallLeftBtnEvent();
|
||||
}
|
||||
else if (SelectedElement is TextBox)
|
||||
{
|
||||
TextBox textBox = SelectedElement as TextBox;
|
||||
isStartedPrint = true;
|
||||
}
|
||||
}
|
||||
else if (isPressed && (keyboardState.IsKeyUp(Keys.Enter) &&
|
||||
keyboardState.IsKeyUp(Keys.Down) &&
|
||||
|
|
|
@ -46,7 +46,7 @@ namespace DangerousD.GameCore.GUI
|
|||
rectangle = new Rectangle(screenWidth / 20, screenHeight / 15, (int)(40 * 2.4), (int)(40 * 2.4)),
|
||||
fontColor = Color.Black,
|
||||
fontName = "font2",
|
||||
textureName = "textboxbackground1-1"
|
||||
text = "<-"
|
||||
};
|
||||
backButton.LeftButtonPressed += () => {
|
||||
AppManager.Instance.ChangeGameState(GameState.Menu);
|
||||
|
@ -67,7 +67,6 @@ namespace DangerousD.GameCore.GUI
|
|||
textureName = "textboxbackground6-1"
|
||||
|
||||
};
|
||||
Elements.Add(loginTextBox);
|
||||
loginTextBox.LoadTexture(AppManager.Instance.Content);
|
||||
loginTextBox.TextChanged += input => {
|
||||
if (loginTextBox.fontColor == Color.Gray)
|
||||
|
@ -94,7 +93,6 @@ namespace DangerousD.GameCore.GUI
|
|||
textAligment = TextAligment.Left,
|
||||
textureName = "textboxbackground6-1"
|
||||
};
|
||||
Elements.Add(passwordTextBox);
|
||||
passwordTextBox.LoadTexture(AppManager.Instance.Content);
|
||||
passwordTextBox.TextChanged += input => {
|
||||
if (passwordTextBox.fontColor == Color.Gray)
|
||||
|
@ -122,7 +120,6 @@ namespace DangerousD.GameCore.GUI
|
|||
fontName = "ButtonFont",
|
||||
textureName = "textboxbackground2-1"
|
||||
};
|
||||
Elements.Add(logButton);
|
||||
logButton.LeftButtonPressed += () => {
|
||||
if (CheckUser())
|
||||
{
|
||||
|
@ -140,7 +137,6 @@ namespace DangerousD.GameCore.GUI
|
|||
fontName = "ButtonFont",
|
||||
textureName = "textboxbackground2-1"
|
||||
};
|
||||
Elements.Add(regButton);
|
||||
regButton.LeftButtonPressed += GoToRegWebServer;
|
||||
Elements.Add(regButton);
|
||||
|
||||
|
|
|
@ -13,7 +13,7 @@ namespace DangerousD.GameCore.Managers
|
|||
{
|
||||
public class SettingsManager
|
||||
{
|
||||
private SettingsContainer settingsContainer= new SettingsContainer();
|
||||
private SettingsContainer settingsContainer = new SettingsContainer();
|
||||
public bool IsFullScreen { get => settingsContainer.IsFullScreen; }
|
||||
public float MainVolume { get => settingsContainer.MainVolume; }
|
||||
public float MusicVolume { get => settingsContainer.MusicVolume; }
|
||||
|
@ -57,6 +57,7 @@ namespace DangerousD.GameCore.Managers
|
|||
}
|
||||
|
||||
settingsContainer = JsonConvert.DeserializeObject<SettingsContainer>(File.ReadAllText("GameSettings.txt"));
|
||||
if (settingsContainer == null) { settingsContainer = new SettingsContainer(); }
|
||||
SetIsFullScreen(settingsContainer.IsFullScreen);
|
||||
SetMainVolume(settingsContainer.MainVolume);
|
||||
SetMusicVolume(settingsContainer.MusicVolume);
|
||||
|
|
Loading…
Add table
Reference in a new issue