protected override void DrawMainPart() { rect.Reset(); Box(BoxPosition, locale["title"]); float offset = new AutoScaleFloat(120f); rect.MoveOffsetX(offset); rect.width -= offset; pageSelection = SelectionGrid(rect, pageSelection, modeSelection, modeSelection.Length); rect.ResetX(); rect.MoveToEndY(BoxPosition, Style.Height); rect.MoveToEndX(BoxPosition, Style.LabelOffset); rect.width = Style.LabelOffset; if (Button(rect, locale["btnClose"])) { Disable(); } }
protected override void DrawMainPart() { rect.Reset(); Box(WindowPosition, locale["title"]); float offset = new AutoScaleFloat(120f); rect.MoveOffsetX(offset); rect.width -= offset; pageSelection = SelectionGrid(rect, pageSelection, modeSelection, modeSelection.Length); rect.ResetX(); rect.MoveToEndY(WindowPosition, Style.Height); rect.MoveToEndX(WindowPosition, Style.LabelOffset * 2f + Style.HorizontalMargin); rect.width = Style.LabelOffset; if (Button(rect, locale["btnReset"], false)) { GameModes.DisableAll(); } rect.MoveX(Style.HorizontalMargin, true); if (Button(rect, locale["btnClose"])) { Disable(); } }
protected override void DrawMainPart() { left.Reset(); right.Reset(); rect.Reset(); float offset = new AutoScaleFloat(120f); rect.MoveOffsetX(offset); rect.width -= offset; pageSelection = SelectionGrid(rect, pageSelection, selections, selections.Length, true); rect.ResetX(); LabelCenter(right, locale["picker" + pageSelection.ToString()], true); right.BeginHorizontal(2); if (Button(right, locale["update"], false)) { if (pageSelection == CustomLogicPage) { allNames = LoadFiles(LogicsPath); } else { allNames = LoadFiles(MapsPath); } } right.MoveX(); if (Button(right, locale["random"], true)) { int pickId = Random.Range(0, allNames.Length); if (filter.Length > 0) { PickByName(allNames[pickId], true); } else { Pick(pickId, allNames[pickId], true); } } right.ResetX(); filter = TextField(right, filter, locale["filter"], Style.LabelOffset, true); scrollArea.y = right.y; right.MoveToEndY(BoxPosition, Style.Height + Style.VerticalMargin); scrollArea.height = right.y - scrollArea.y; scrollRect.Reset(); scrollAreaView.height = (Style.Height * allNames.Length) + ((Style.VerticalMargin * 2) * allNames.Length); scroll = BeginScrollView(scrollArea, scroll, scrollAreaView); for (int i = 0; i < allNames.Length; i++) { if (Button(scrollRect, allNames[i], (i != allNames.Length - 1))) { if (filter.Length == 0) { Pick(i, allNames[i], false); } else { PickByName(allNames[i], false); } } } EndScrollView(); }