private bool LiveButtonClicked(UIMainPanelMode mode) { var deskAuto = Game.Desktop && (mode != UIMainPanelMode.LIVE || MainPanel.Mode != UIMainPanelMode.LIVE); if (MainPanel.PanelActive || deskAuto) { if (MainPanel.ShowingSelect || deskAuto) { if (!MainPanel.PanelActive) { MainPanel.Open(); } //switch to the target mode MainPanel.SetMode(mode); MainPanel.SwitchAvatar?.Kill(); return(false); } else { StartSelect(); return(true); } } else { MainPanel.Open(); StartSelect(); return(true); } }
private void ModeChanged(UIMainPanelMode obj) { Clock?.SetHidden(obj != UIMainPanelMode.LIVE); DesktopUCP?.SetMode(obj); var lotType = MainPanel.GetLotType(true); var hit = FSO.HIT.HITVM.Get(); switch (obj) { case UIMainPanelMode.LIVE: case UIMainPanelMode.OPTIONS: hit.PlaySoundEvent(UIMusic.None); break; case UIMainPanelMode.BUY: switch (lotType) { case UICatalogMode.Downtown: hit.PlaySoundEvent(UIMusic.Downtown); break; case UICatalogMode.Vacation: hit.PlaySoundEvent(UIMusic.Vacation); break; case UICatalogMode.Community: hit.PlaySoundEvent(UIMusic.Unleashed); break; case UICatalogMode.Studiotown: hit.PlaySoundEvent(UIMusic.SuperstarTransition); break; case UICatalogMode.Magictown: hit.PlaySoundEvent(UIMusic.MagictownBuy); break; default: hit.PlaySoundEvent(UIMusic.Buy); break; } break; case UIMainPanelMode.BUILD: switch (lotType) { case UICatalogMode.Downtown: hit.PlaySoundEvent(UIMusic.Downtown); break; case UICatalogMode.Vacation: hit.PlaySoundEvent(UIMusic.Vacation); break; case UICatalogMode.Community: hit.PlaySoundEvent(UIMusic.Unleashed); break; case UICatalogMode.Studiotown: hit.PlaySoundEvent(UIMusic.SuperstarTransition); break; case UICatalogMode.Magictown: hit.PlaySoundEvent(UIMusic.MagictownBuild); break; default: hit.PlaySoundEvent(UIMusic.Build); break; } break; } }
public void SetMode(UIMainPanelMode mode) { LiveButton.Selected = mode == UIMainPanelMode.LIVE; BuyButton.Selected = mode == UIMainPanelMode.BUY; BuildButton.Selected = mode == UIMainPanelMode.BUILD; OptionsButton.Selected = mode == UIMainPanelMode.OPTIONS; }
public void EndSwitch(UIMainPanelMode mode) { UIButton frontButton; switch (mode) { case UIMainPanelMode.BUILD: frontButton = BuildButton; break; case UIMainPanelMode.BUY: frontButton = BuyButton; break; case UIMainPanelMode.OPTIONS: frontButton = OptionButton; break; default: frontButton = LiveButton; break; } //become this mode SendToFront(frontButton); foreach (var button in ButtonOrder) { GameFacade.Screens.Tween.To(button, 0.5f, new Dictionary <string, float>() { { "Y", 0 } }, TweenQuad.EaseOut); GameFacade.Screens.Tween.To(button, 0.5f, new Dictionary <string, float>() { { "Opacity", (button != frontButton)?0f:1f } }, TweenQuad.EaseOut); } }
public void SwitchMode(UIMainPanelMode mode) { UIButton frontButton; switch (mode) { case UIMainPanelMode.BUILD: frontButton = BuildButton; break; case UIMainPanelMode.BUY: frontButton = BuyButton; break; case UIMainPanelMode.OPTIONS: frontButton = OptionButton; break; default: frontButton = LiveButton; break; } if (OnModeClick?.Invoke(mode) ?? true) { //switching mode. show the modes. int i = 0; foreach (var button in ButtonOrder) { if (button == LiveButton && Game?.LotControl.ActiveEntity == null) { continue; } button.Visible = true; GameFacade.Screens.Tween.To(button, 0.5f, new Dictionary <string, float>() { { "Y", (-140) * (i++) } }, TweenQuad.EaseOut); GameFacade.Screens.Tween.To(button, 0.5f, new Dictionary <string, float>() { { "Opacity", 1 } }, TweenQuad.EaseOut); } } else { //become this mode //should happen as part of callback from main panel.. /* * SendToFront(frontButton); * foreach (var button in ButtonOrder) * { * GameFacade.Screens.Tween.To(button, 0.5f, new Dictionary<string, float>() { { "Y", 0 } }, TweenQuad.EaseOut); * GameFacade.Screens.Tween.To(button, 0.5f, new Dictionary<string, float>() { { "Opacity", (button != frontButton) ? 0f : 1f } }, TweenQuad.EaseOut); * } */ } }
public void SetMode(UIMainPanelMode mode) { if (mode == Mode) { return; } Mode = mode; Game.LotControl.World.State.BuildMode = 0; switch (mode) { case UIMainPanelMode.LIVE: Switcher.InitCategories(LiveCategories); break; case UIMainPanelMode.BUY: Switcher.InitCategories(BuyCategories); Game.LotControl.World.State.BuildMode = 1; break; case UIMainPanelMode.BUILD: Switcher.InitCategories(BuildCategories); Game.LotControl.World.State.BuildMode = 2; break; case UIMainPanelMode.OPTIONS: Switcher.InitCategories(OptionsCategories); break; } var live = (mode == UIMainPanelMode.LIVE); Game.LotControl.LiveMode = live; HideButton.Visible = live; ModeChanged?.Invoke(mode); }
private bool LiveButtonClicked(UIMainPanelMode mode) { if (MainPanel.PanelActive) { if (MainPanel.ShowingSelect) { //switch to the target mode MainPanel.SetMode(mode); MainPanel.SwitchAvatar.Kill(); return(false); } else { StartSelect(); return(true); } } else { MainPanel.Open(); StartSelect(); return(true); } }