main menu buttons have different text color when window is opened

This commit is contained in:
in0finite 2019-07-09 17:44:00 +02:00
parent 3b1dae27b3
commit fc49001762
3 changed files with 13 additions and 3 deletions

View file

@ -9,11 +9,15 @@ namespace SanAndreasUnity.UI
public class MainMenu : MonoBehaviour {
public static MainMenu Instance { get; private set; }
public float minButtonHeight = 25f;
public float minButtonWidth = 70f;
public float spaceAtBottom = 15f;
public float spaceBetweenButtons = 5f;
public Color openedWindowTextColor = Color.green;
public bool drawBackground = false;
public Color backgroundColor = Color.black;
public bool drawLogo = false;
@ -25,9 +29,10 @@ namespace SanAndreasUnity.UI
void Start ()
void Awake()
{
if (null == Instance)
Instance = this;
}
void OnGUI ()

View file

@ -269,11 +269,16 @@ namespace SanAndreasUnity.UI {
{
// draw a button in main menu
var originalColor = GUI.contentColor;
if (this.IsOpened)
GUI.contentColor = MainMenu.Instance.openedWindowTextColor;
if (GUILayout.Button (this.windowName, MainMenu.ButtonLayoutOptions))
{
this.IsOpened = !this.IsOpened;
}
GUI.contentColor = originalColor;
}
}

View file

@ -4,7 +4,7 @@
- scene changing: When network (server/client) is stopped, offline scene should be loaded. But, when switching back to online scene, Loader should not load everything again. Instead, only Cell loading should be done, if the new scene is main scene. But, are old meshes/textures destroyed ? Do we leave memory behind, every time when network is stopped ? Or... just exit the game when network is stopped (display message box first ?).
- order of buttons in main menu
- order of buttons in main menu - assign sort priorities
- add ability for client to request: