void OnScreenChanged(MyTerminalPageEnum screen) { if (GetItemInControlPanel() is MyTerminalBlock entity) { Debug.WriteLine(entity.CustomName); } //switch (screen) //{ // case MyTerminalPageEnum.None: // break; // case MyTerminalPageEnum.Properties: // break; // case MyTerminalPageEnum.Inventory: // break; // case MyTerminalPageEnum.ControlPanel: // break; // case MyTerminalPageEnum.Production: // break; // case MyTerminalPageEnum.Info: // break; // case MyTerminalPageEnum.Factions: // break; // case MyTerminalPageEnum.Comms: // break; // case MyTerminalPageEnum.Gps: // break; // default: // throw new ArgumentOutOfRangeException(); //} }
static MyContextKind GetContextByPage(MyTerminalPageEnum page) { switch (page) { case MyTerminalPageEnum.Inventory: return MyContextKind.Inventory; case MyTerminalPageEnum.ControlPanel: return MyContextKind.Terminal; case MyTerminalPageEnum.Production: return MyContextKind.Production; default: return MyContextKind.None; } }
static MyContextKind GetContextByPage(MyTerminalPageEnum page) { switch (page) { case MyTerminalPageEnum.Inventory: return(MyContextKind.Inventory); case MyTerminalPageEnum.ControlPanel: return(MyContextKind.Terminal); case MyTerminalPageEnum.Production: return(MyContextKind.Production); default: return(MyContextKind.None); } }
protected override void OnUpdate() { if (_available) { var screen = MyGuiScreenTerminal.GetCurrentScreen(); if (screen != _currentScreen) { _currentScreen = screen; OnScreenChanged(screen); } } base.OnUpdate(); }
public static void Show(MyTerminalPageEnum page, MyCharacter user, MyEntity interactedEntity) { if (!MyPerGameSettings.TerminalEnabled) return; bool showProperties = MyInput.Static.IsAnyShiftKeyPressed(); Debug.Assert(m_instance == null); m_instance = new MyGuiScreenTerminal(); m_instance.m_user = user; m_openInventoryInteractedEntity = interactedEntity; if(MyFakes.ENABLE_TERMINAL_PROPERTIES) m_instance.m_initialPage = showProperties ? MyTerminalPageEnum.Properties : page; else m_instance.m_initialPage = page; InteractedEntity = interactedEntity; m_instance.RecreateControls(true); MyGuiSandbox.AddScreen(MyGuiScreenGamePlay.ActiveGameplayScreen = m_instance); m_screenOpen = true; string target = interactedEntity != null ? interactedEntity.GetType().Name : ""; MyAnalyticsHelper.ReportActivityStart(user, "show_terminal", target, "gui", string.Empty); }
internal static void Show(MyTerminalPageEnum page, MyCharacter user, MyEntity interactedEntity) { if (!MyPerGameSettings.TerminalEnabled) return; bool showProperties = MyInput.Static.IsAnyShiftKeyPressed(); System.Diagnostics.Debug.Assert(m_instance == null); m_instance = new MyGuiScreenTerminal(); m_instance.m_user = user; m_openInventoryInteractedEntity = interactedEntity; if(MyFakes.ENABLE_TERMINAL_PROPERTIES) m_instance.m_initialPage = showProperties ? MyTerminalPageEnum.Properties : page; else m_instance.m_initialPage = page; InteractedEntity = interactedEntity; m_instance.RecreateControls(true); MyGuiSandbox.AddScreen(MyGuiScreenGamePlay.ActiveGameplayScreen = m_instance); m_screenOpen = true; }