Editor usable without console, HiddenSubPosition divisible with grid size

This commit is contained in:
Regalis
2016-02-02 19:04:15 +02:00
parent 14ee39e59a
commit 89406896ca
7 changed files with 208 additions and 61 deletions
+24 -9
View File
@@ -33,37 +33,52 @@ namespace Barotrauma
buttonsTab = new GUIFrame(new Rectangle(50, 0, 200, 360), Color.Transparent, Alignment.Left | Alignment.CenterY);
buttonsTab = new GUIFrame(new Rectangle(0,0,0,0), Color.Transparent, Alignment.Left | Alignment.CenterY);
buttonsTab.Padding = new Vector4(20.0f, 20.0f, 20.0f, 20.0f);
//menuTabs[(int)Tabs.Main].Padding = GUI.style.smallPadding;
int y = 170;
Rectangle panelRect = new Rectangle(
290, buttonsTab.Rect.Y,
290, y,
500, 360);
GUIButton button = new GUIButton(new Rectangle(0, 0, 0, 30), "Tutorial", Alignment.CenterX, GUI.Style, buttonsTab);
GUIButton button = new GUIButton(new Rectangle(50, y, 200, 30), "Tutorial", null, Alignment.TopLeft, Alignment.Left, GUI.Style, buttonsTab);
button.Color = button.Color * 0.8f;
button.OnClicked = TutorialButtonClicked;
button = new GUIButton(new Rectangle(0, 60, 0, 30), "New Game", Alignment.CenterX, GUI.Style, buttonsTab);
button = new GUIButton(new Rectangle(50, y + 60, 200, 30), "New Game", null, Alignment.TopLeft, Alignment.Left, GUI.Style, buttonsTab);
button.Color = button.Color * 0.8f;
button.UserData = Tab.NewGame;
button.OnClicked = SelectTab;
button = new GUIButton(new Rectangle(0, 100, 0, 30), "Load Game", Alignment.CenterX, GUI.Style, buttonsTab);
button = new GUIButton(new Rectangle(50, y + 100, 200, 30), "Load Game", null, Alignment.TopLeft, Alignment.Left, GUI.Style, buttonsTab);
button.Color = button.Color * 0.8f;
button.UserData = Tab.LoadGame;
button.OnClicked = SelectTab;
button = new GUIButton(new Rectangle(0, 160, 0, 30), "Join Server", Alignment.CenterX, GUI.Style, buttonsTab);
button = new GUIButton(new Rectangle(50, y + 160, 200, 30), "Join Server", null, Alignment.TopLeft, Alignment.Left, GUI.Style, buttonsTab);
button.Color = button.Color * 0.8f;
//button.UserData = (int)Tabs.JoinServer;
button.OnClicked = JoinServerClicked;
button = new GUIButton(new Rectangle(0, 200, 0, 30), "Host Server", Alignment.CenterX, GUI.Style, buttonsTab);
button = new GUIButton(new Rectangle(50, y + 200, 200, 30), "Host Server", null, Alignment.TopLeft, Alignment.Left, GUI.Style, buttonsTab);
button.Color = button.Color * 0.8f;
button.UserData = Tab.HostServer;
button.OnClicked = SelectTab;
button = new GUIButton(new Rectangle(0, 260, 0, 30), "Settings", Alignment.CenterX, GUI.Style, buttonsTab);
button = new GUIButton(new Rectangle(50, y + 260, 200, 30), "Submarine Editor", null, Alignment.TopLeft, Alignment.Left, GUI.Style, buttonsTab);
button.Color = button.Color * 0.8f;
button.OnClicked = (GUIButton btn, object userdata) => { GameMain.EditMapScreen.Select(); return true; };
button = new GUIButton(new Rectangle(50, y + 320, 200, 30), "Settings", null, Alignment.TopLeft, Alignment.Left, GUI.Style, buttonsTab);
button.Color = button.Color * 0.8f;
button.UserData = Tab.Settings;
button.OnClicked = SelectTab;
button = new GUIButton(new Rectangle(0, 320, 0, 30), "Quit", Alignment.CenterX, GUI.Style, buttonsTab);
button = new GUIButton(new Rectangle(0, 0, 150, 30), "Quit", Alignment.BottomRight, GUI.Style, buttonsTab);
button.Color = button.Color * 0.8f;
button.OnClicked = QuitClicked;
//----------------------------------------------------------------------