Download scripts/5_Mission/DayZ/GUI/NewUI/ConsoleToolbarHandler.c from FelonieZ/DayZ_Scripts: direct link, hf CLI and curl.
- Browser
- Download file 2.1 kB
-
https://huggingface.co/datasets/FelonieZ/DayZ_Scripts/resolve/main/scripts/5_Mission/DayZ/GUI/NewUI/ConsoleToolbarHandler.c
- Command line
-
hf download hf://datasets/FelonieZ/DayZ_Scripts/scripts/5_Mission/DayZ/GUI/NewUI/ConsoleToolbarHandler.c
-
curl -L -o ConsoleToolbarHandler.c https://huggingface.co/datasets/FelonieZ/DayZ_Scripts/resolve/main/scripts/5_Mission/DayZ/GUI/NewUI/ConsoleToolbarHandler.c
2.1 kB
| class ConsoleToolbarWidgetHandlerBase : ScriptedWidgetEventHandler | |
| { | |
| Widget m_ToolbarWidget; //'toolbar_bg' | |
| RichTextWidget m_ToolbarText; | |
| void OnWidgetScriptInit(Widget w) | |
| { | |
| m_ToolbarWidget = w; | |
| m_ToolbarWidget.SetHandler(this); | |
| m_ToolbarText = RichTextWidget.Cast(m_ToolbarWidget.FindAnyWidget("ContextToolbarText")); | |
| if (GetGame().GetMission()) | |
| { | |
| GetGame().GetMission().GetOnInputDeviceChanged().Insert(OnInputDeviceChanged); | |
| } | |
| UpdateControlsElements(); | |
| } | |
| protected void OnInputDeviceChanged(EInputDeviceType pInputDeviceType) | |
| { | |
| UpdateControlsElements(pInputDeviceType); | |
| } | |
| protected void UpdateControlsElements(EInputDeviceType pInputDeviceType = EInputDeviceType.UNKNOWN) | |
| { | |
| m_ToolbarWidget.Show(false); | |
| } | |
| } | |
| class PasswordMenuToolbarHandler : ConsoleToolbarWidgetHandlerBase | |
| { | |
| override protected void UpdateControlsElements(EInputDeviceType pInputDeviceType = EInputDeviceType.UNKNOWN) | |
| { | |
| string text = ""; | |
| text += string.Format(" %1",InputUtils.GetRichtextButtonIconFromInputAction("UAUICtrlY", "#server_browser_show / #server_browser_hide", EUAINPUT_DEVICE_CONTROLLER, InputUtils.ICON_SCALE_TOOLBAR)); | |
| text += string.Format(" %1",InputUtils.GetRichtextButtonIconFromInputAction("UAUICtrlX", "#server_browser_menu_connect", EUAINPUT_DEVICE_CONTROLLER, InputUtils.ICON_SCALE_TOOLBAR)); | |
| text += string.Format(" %1",InputUtils.GetRichtextButtonIconFromInputAction("UAUIBack", "#STR_settings_menu_root_toolbar_bg_ConsoleToolbar_Back_BackText0", EUAINPUT_DEVICE_CONTROLLER, InputUtils.ICON_SCALE_TOOLBAR)); | |
| m_ToolbarText.SetText(text); | |
| bool toolbarShow = false; | |
| if (pInputDeviceType == EInputDeviceType.UNKNOWN) | |
| { | |
| toolbarShow = !GetGame().GetInput().IsEnabledMouseAndKeyboardEvenOnServer() || GetGame().GetInput().GetCurrentInputDevice() == EInputDeviceType.CONTROLLER; | |
| } | |
| else | |
| { | |
| toolbarShow = pInputDeviceType == EInputDeviceType.CONTROLLER; | |
| } | |
| m_ToolbarWidget.Show(toolbarShow); | |
| } | |
| }; |