Download scripts/3_Game/DayZ/GUI/Spacers/HorizontalSpacer.c from FelonieZ/DayZ_Scripts: direct link, hf CLI and curl.
- Browser
- Download file 616 Bytes
-
https://huggingface.co/datasets/FelonieZ/DayZ_Scripts/resolve/main/scripts/3_Game/DayZ/GUI/Spacers/HorizontalSpacer.c
- Command line
-
hf download hf://datasets/FelonieZ/DayZ_Scripts/scripts/3_Game/DayZ/GUI/Spacers/HorizontalSpacer.c
-
curl -L -o HorizontalSpacer.c https://huggingface.co/datasets/FelonieZ/DayZ_Scripts/resolve/main/scripts/3_Game/DayZ/GUI/Spacers/HorizontalSpacer.c
616 Bytes
| // ----------------------------------------------------------- | |
| class HorizontalSpacer : SpacerBase | |
| { | |
| reference int Border; | |
| reference int Gap; | |
| override protected void UpdateChild(Widget child, float w, float h, int index) | |
| { | |
| float itemWidth = (w - (Border * 2) - ((m_count - 1) * Gap)) / m_count; | |
| float itemHeight = h - (2 * Border); | |
| child.SetPos(Border + ((itemWidth + Gap) * index), Border); | |
| child.SetSize(itemWidth, itemHeight); | |
| if(child.GetChildren()) | |
| { | |
| Widget c = child.GetChildren(); | |
| RightGap gap; | |
| c.GetScript(gap); | |
| if(gap) | |
| gap.OnUpdate(c); | |
| //gap.Update(); | |
| } | |
| } | |
| }; |