Download scripts/3_Game/DayZ/GUI/Tabber.c from FelonieZ/DayZ_Scripts: direct link, hf CLI and curl.
- Browser
- Download file 1.03 kB
-
https://huggingface.co/datasets/FelonieZ/DayZ_Scripts/resolve/main/scripts/3_Game/DayZ/GUI/Tabber.c
- Command line
-
hf download hf://datasets/FelonieZ/DayZ_Scripts/scripts/3_Game/DayZ/GUI/Tabber.c
-
curl -L -o Tabber.c https://huggingface.co/datasets/FelonieZ/DayZ_Scripts/resolve/main/scripts/3_Game/DayZ/GUI/Tabber.c
1.03 kB
| // ----------------------------------------------------------- | |
| class Tabber : ScriptedWidgetEventHandler | |
| { | |
| Widget ButtonsPanel; | |
| Widget ContentPanel; | |
| reference int SelectedTab; | |
| // ----------------------------------------------------------- | |
| void OnWidgetScriptInit(Widget w) | |
| { | |
| w.SetHandler(this); | |
| SelectTab(SelectedTab); | |
| } | |
| // ----------------------------------------------------------- | |
| override bool OnClick(Widget w, int x, int y, int button) | |
| { | |
| if (w && w.GetParent() == ButtonsPanel) | |
| { | |
| SelectedTab = 0; | |
| Widget iw = ButtonsPanel.GetChildren(); | |
| while(iw) | |
| { | |
| if (iw == w) break; | |
| SelectedTab++; | |
| iw = iw.GetSibling(); | |
| } | |
| SelectTab(SelectedTab); | |
| } | |
| return false; | |
| } | |
| // ----------------------------------------------------------- | |
| protected void SelectTab(int index) | |
| { | |
| Print(index); | |
| int n = 0; | |
| Widget w = ContentPanel.GetChildren(); | |
| while(w) | |
| { | |
| if (n == index) | |
| { | |
| w.Show(true); | |
| } | |
| else | |
| { | |
| w.Show(false); | |
| } | |
| n++; | |
| w = w.GetSibling(); | |
| } | |
| } | |
| }; |