void draw(int id) { GUI.DragWindow(new Rect(0, 0, 268, 28)); if (GUIUtils.CloseHelpButtons(winRect, "Layers")) { showWindow = false; expandingWindow = false; } GUI.Label(new Rect(5, 22, 310, 28), LocalizationManager.instance.current["layers_desc"]); GUIUtils.DrawSeparator(new Vector2(7, 46), 306); scrollLayers = GUI.BeginScrollView(new Rect(7, 52, 306, winRect.height - 69), scrollLayers, new Rect(0, 0, 282, m_layers.Count * 26 + 32)); for (int i = 0; i < m_layers.Count; i++) { if (GUI.Button(new Rect(9, i * 26 + 1, 24, 24), ProceduralObjectsMod.Icons[m_layers[i].m_isHidden ? 3 : 4])) { ProceduralObjectsLogic.PlaySound(); m_layers[i].m_isHidden = !m_layers[i].m_isHidden; } bool canBeMoved = CanLayerMoveUp(m_layers[i]) || CanLayerMoveDown(m_layers[i]); if (canBeMoved) { if (CanLayerMoveUp(m_layers[i])) { if (GUI.Button(new Rect(35, i * 26 + 1, 25, 12), ProceduralObjectsMod.Icons[6])) { ProceduralObjectsLogic.PlaySound(); MoveLayerUp(m_layers[i]); } } if (CanLayerMoveDown(m_layers[i])) { if (GUI.Button(new Rect(35, i * 26 + 13.5f, 25, 12), ProceduralObjectsMod.Icons[7])) { ProceduralObjectsLogic.PlaySound(); MoveLayerDown(m_layers[i]); } } } m_layers[i].m_name = GUI.TextField(new Rect(canBeMoved ? 62 : 35, i * 26 + 1, canBeMoved ? 192 : 219, 24), m_layers[i].m_name); GUI.color = Color.red; if (GUI.Button(new Rect(256, i * 26 + 1, 24, 24), "X")) { ProceduralObjectsLogic.PlaySound(); RemoveLayer(m_layers[i], logic.proceduralObjects); } GUI.color = Color.white; } newLayerText = GUI.TextField(new Rect(35, m_layers.Count * 26 + 1, 219, 24), newLayerText); if (GUI.Button(new Rect(256, m_layers.Count * 26 + 1, 24, 24), "<size=14>+</size>")) { ProceduralObjectsLogic.PlaySound(); AddLayer(newLayerText); } GUI.EndScrollView(); if (GUI.RepeatButton(new Rect(120, winRect.height - 14, 80, 10), string.Empty)) { expandingWindow = true; } }
void DrawUpdateUI(int id) { GUI.DragWindow(new Rect(0, 0, 575, 22)); if (displayChangelog) { GUIUtils.HelpButton(600, "Changelog"); GUI.Label(new Rect(10, 25, 580, 275), LocalizationManager.instance.current["version"] + " " + Changelog[currentShowingChangelogIndex]); if (currentShowingChangelogIndex != 0) { if (GUI.Button(new Rect(125, 310, 110, 30), LocalizationManager.instance.current["next_version"])) { currentShowingChangelogIndex -= 1; } } if (currentShowingChangelogIndex != (Changelog.Length - 1)) { if (GUI.Button(new Rect(5, 310, 120, 30), LocalizationManager.instance.current["prev_version"])) { currentShowingChangelogIndex += 1; } } if (GUI.Button(new Rect(235, 310, 215, 30), LocalizationManager.instance.current["ok"])) { ProceduralObjectsLogic.PlaySound(); if (displayLoadingFailures) { displayChangelog = false; } else { AllowedToShow = false; } } } else if (displayLoadingFailures) { GUI.Label(new Rect(10, 23, 580, 25), LocalizationManager.instance.current["stats_failed"]); GUIUtils.DrawSeparator(new Vector2(10, 47), 580); var f = loading_failures[currentFailuresIndex]; if (f.DrawUI(new Rect(10, 50, 580, 250))) { if (f.sameForAllToggle) { for (int i = currentFailuresIndex; i < loading_failures.Count; i++) { loading_failures[i].keep = f.keep; } AllowedToShow = false; return; } if (currentFailuresIndex == loading_failures.Count - 1) { AllowedToShow = false; } else { currentFailuresIndex += 1; } } /* * if (GUI.Button(new Rect(235, 310, 215, 30), LocalizationManager.instance.current["ok"])) * AllowedToShow = false; */ } }
private void draw(int id) { if (GUIUtils.CloseHelpButtons(window, "Render_Options")) { showWindow = false; } GUI.DragWindow(new Rect(0, 0, 360, 26)); GUI.Label(new Rect(5, 32, 245, 24), LocalizationManager.instance.current["current_calc_method"] + " :"); if (GUI.Button(new Rect(255, 30, 130, 27), LocalizationManager.instance.current[calculateDynamically ? "renderCalc_dyn" : "renderCalc_fix"])) { ProceduralObjectsLogic.PlaySound(); calculateDynamically = !calculateDynamically; ProceduralObjectsMod.UseDynamicRenderDist.value = calculateDynamically; } GUIUtils.DrawSeparator(new Vector2(5, 60), 380); if (calculateDynamically) { GUI.Label(new Rect(5, 65, 380, 25), string.Format(LocalizationManager.instance.current["renderCalc_dyn_mult"], ProceduralObjectsMod.DynamicRDMultiplier.value).ToString()); var slider = Mathf.Round(GUI.HorizontalSlider(new Rect(5, 91, 380, 22), ProceduralObjectsMod.DynamicRDMultiplier.value, 40, 180) / 10f) * 10f; if (slider != ProceduralObjectsMod.DynamicRDMultiplier.value) { ProceduralObjectsMod.DynamicRDMultiplier.value = slider; } GUI.Label(new Rect(5, 110, 380, 25), string.Format(LocalizationManager.instance.current["renderCalc_dyn_thre"], Gizmos.ConvertRoundToDistanceUnit(ProceduralObjectsMod.DynamicRDMinThreshold.value).ToString()) + ProceduralObjectsMod.distanceUnit); var slider2 = Mathf.Round(GUI.HorizontalSlider(new Rect(5, 136, 380, 22), ProceduralObjectsMod.DynamicRDMinThreshold.value, 10, 1000) / 10f) * 10f; if (slider2 != ProceduralObjectsMod.DynamicRDMinThreshold.value) { ProceduralObjectsMod.DynamicRDMinThreshold.value = slider2; } } else { GUI.Label(new Rect(5, 65, 380, 25), string.Format(LocalizationManager.instance.current["settings_RD_PROP_label"], Gizmos.ConvertRoundToDistanceUnit(ProceduralObjectsMod.PropRenderDistance.value).ToString()) + ProceduralObjectsMod.distanceUnit); var slider = Mathf.Round(GUI.HorizontalSlider(new Rect(5, 91, 380, 22), ProceduralObjectsMod.PropRenderDistance.value, 10, 24000) / 10f) * 10f; if (slider != ProceduralObjectsMod.PropRenderDistance.value) { ProceduralObjectsMod.PropRenderDistance.value = slider; } GUI.Label(new Rect(5, 110, 380, 25), string.Format(LocalizationManager.instance.current["settings_RD_BUILDING_label"], Gizmos.ConvertRoundToDistanceUnit(ProceduralObjectsMod.BuildingRenderDistance.value).ToString()) + ProceduralObjectsMod.distanceUnit); var slider2 = Mathf.Round(GUI.HorizontalSlider(new Rect(5, 136, 380, 22), ProceduralObjectsMod.BuildingRenderDistance.value, 10, 24000) / 10f) * 10f; if (slider2 != ProceduralObjectsMod.BuildingRenderDistance.value) { ProceduralObjectsMod.BuildingRenderDistance.value = slider2; } } if (GUI.Button(new Rect(5, 160, 380, 28), LocalizationManager.instance.current["renderCalc_RECALC"])) { ProceduralObjectsLogic.PlaySound(); GUIUtils.ShowModal(LocalizationManager.instance.current["renderCalc_RECALC_title"], LocalizationManager.instance.current["renderCalc_RECALC_confirm"], (bool ok) => { if (ok) { RecalculateAll(); } }); } GUIUtils.DrawSeparator(new Vector2(5, 192), 380); GUI.Label(new Rect(5, 195, 380, 25), LocalizationManager.instance.current["renderCalc_globalMul"] + " : " + globalMultiplier.ToString()); var slider3 = GUIUtils.HorizontalSliderIncrements(new Rect(5, 220, 380, 22), ProceduralObjectsMod.GlobalRDMultiplier.value, 0.1f, 0.2f, 0.3f, 0.5f, 0.7f, 1f, 1.5f, 2f, 2.5f, 3f, 4f, 6f); if (slider3 != ProceduralObjectsMod.GlobalRDMultiplier.value) { ProceduralObjectsMod.GlobalRDMultiplier.value = slider3; globalMultiplier = slider3; } }