public UIExitDialog(UIDestroyablePanel parent) : base(UIDialogStyle.Standard, true) { Parent = parent; this.RenderScript("exitdialog.uis"); this.SetSize(380, 180); ExitButton.OnButtonClick += new ButtonClickDelegate(ExitButton_OnButtonClick); CancelButton.OnButtonClick += new ButtonClickDelegate(CancelButton_OnButtonClick); ReLoginButton.OnButtonClick += new ButtonClickDelegate(ReLoginButton_OnButtonClick); }
public void SetPanel(int newPanel) { OptionsModeButton.Selected = false; BuyModeButton.Selected = false; BuildModeButton.Selected = false; LiveModeButton.Selected = false; if (Game.InLot) { Game.LotController.QueryPanel.Active = false; Game.LotController.QueryPanel.Visible = false; Game.LotController.LiveMode = true; Game.vm.Context.World.State.BuildMode = false; } if (CurrentPanel != -1) { this.Remove(Panel); Panel.Destroy(); if (Game.InLot) { Game.LotController.PanelActive = false; } } if (newPanel != CurrentPanel) { if (Game.InLot) { Game.LotController.PanelActive = true; } switch (newPanel) { case 5: Panel = new UIOptions(); Panel.X = 177; Panel.Y = 96; this.Add(Panel); OptionsModeButton.Selected = true; SetFocus(UCPFocusMode.ActiveTab); break; case 2: if (!Game.InLot) { break; //not ingame } Panel = new UIBuyMode(Game.LotController); Game.LotController.LiveMode = false; Panel.X = 177; Panel.Y = 96; ((UIBuyMode)Panel).vm = Game.vm; this.Add(Panel); BuyModeButton.Selected = true; SetFocus(UCPFocusMode.ActiveTab); break; case 3: if (!Game.InLot) { break; //not ingame } Panel = new UIBuildMode(Game.LotController); //enable air tile graphics Game.vm.Context.World.State.BuildMode = true; Game.LotController.LiveMode = false; Panel.X = 177; Panel.Y = 96; ((UIBuildMode)Panel).vm = Game.vm; this.Add(Panel); BuildModeButton.Selected = true; SetFocus(UCPFocusMode.ActiveTab); break; case 1: if (!Game.InLot) { break; //not ingame } Panel = new UILiveMode(Game.LotController); Panel.X = 177; Panel.Y = 63; this.Add(Panel); LiveModeButton.Selected = true; SetFocus(UCPFocusMode.ActiveTab); break; default: if (Game.InLot) { Game.LotController.PanelActive = false; } break; } CurrentPanel = newPanel; } else { Remove(PanelBlocker); PanelBlocker = null; CurrentPanel = -1; } }
public void SetPanel(int newPanel) { OptionsModeButton.Selected = false; BuyModeButton.Selected = false; BuildModeButton.Selected = false; LiveModeButton.Selected = false; if (Game.InLot) { Game.LotController.QueryPanel.Active = false; Game.LotController.QueryPanel.Visible = false; Game.LotController.LiveMode = true; Game.vm.Context.World.State.BuildMode = false; } if (CurrentPanel != -1) { this.Remove(Panel); Panel.Destroy(); if (Game.InLot) Game.LotController.PanelActive = false; } if (newPanel != CurrentPanel) { if (Game.InLot) Game.LotController.PanelActive = true; switch (newPanel) { case 5: Panel = new UIOptions(); Panel.X = 177; Panel.Y = 96; this.Add(Panel); OptionsModeButton.Selected = true; SetFocus(UCPFocusMode.ActiveTab); break; case 2: if (!Game.InLot) break; //not ingame Panel = new UIBuyMode(Game.LotController); Game.LotController.LiveMode = false; Panel.X = 177; Panel.Y = 96; ((UIBuyMode)Panel).vm = Game.vm; this.Add(Panel); BuyModeButton.Selected = true; SetFocus(UCPFocusMode.ActiveTab); break; case 3: if (!Game.InLot) break; //not ingame Panel = new UIBuildMode(Game.LotController); //enable air tile graphics Game.vm.Context.World.State.BuildMode = true; Game.LotController.LiveMode = false; Panel.X = 177; Panel.Y = 96; ((UIBuildMode)Panel).vm = Game.vm; this.Add(Panel); BuildModeButton.Selected = true; SetFocus(UCPFocusMode.ActiveTab); break; case 1: if (!Game.InLot) break; //not ingame Panel = new UILiveMode(Game.LotController); Panel.X = 177; Panel.Y = 63; this.Add(Panel); LiveModeButton.Selected = true; SetFocus(UCPFocusMode.ActiveTab); break; default: if (Game.InLot) Game.LotController.PanelActive = false; break; } CurrentPanel = newPanel; } else { Remove(PanelBlocker); PanelBlocker = null; CurrentPanel = -1; } }