public override void LessonOnGUI() { Rect mainRect = MainRect; float alpha = 1f; if (doFadeIn) { alpha = Mathf.Clamp01(base.AgeSeconds / 0.4f); } if (Expiring) { float num = expiryTime - Time.timeSinceLevelLoad; if (num < 1.1f) { alpha = num / 1.1f; } } WindowStack windowStack = Find.WindowStack; int iD = 134706; Rect rect = mainRect; WindowLayer layer = WindowLayer.Super; Action doWindowFunc = delegate { Rect rect2 = mainRect.AtZero(); Text.Font = GameFont.Small; if (!Expiring) { def.HighlightAllTags(); } if (doFadeIn || Expiring) { GUI.color = new Color(1f, 1f, 1f, alpha); } Widgets.DrawWindowBackgroundTutor(rect2); Rect rect3 = rect2.ContractedBy(10f); rect3.width = 432f; Widgets.Label(rect3, def.HelpTextAdjusted); Rect butRect = new Rect(rect2.xMax - 32f - 8f, rect2.y + 8f, 32f, 32f); Texture2D tex = (!Expiring) ? TexButton.CloseXBig : Widgets.CheckboxOnTex; if (Widgets.ButtonImage(butRect, tex, new Color(0.95f, 0.95f, 0.95f), new Color(0.8352941f, 0.6666667f, 0.274509817f))) { SoundDefOf.Click.PlayOneShotOnCamera(); CloseButtonClicked(); } if (Time.timeSinceLevelLoad > expiryTime) { CloseButtonClicked(); } GUI.color = Color.white; }; bool doBackground = false; float shadowAlpha = alpha; windowStack.ImmediateWindow(iD, rect, layer, doWindowFunc, doBackground, absorbInputAroundWindow: false, shadowAlpha); }
public override void LessonOnGUI() { Rect mainRect = MainRect; float alpha = 1f; if (doFadeIn) { alpha = Mathf.Clamp01(base.AgeSeconds / 0.4f); } if (Expiring) { float num = expiryTime - Time.timeSinceLevelLoad; if (num < 1.1f) { alpha = num / 1.1f; } } Find.WindowStack.ImmediateWindow(134706, mainRect, WindowLayer.Super, delegate { Rect rect = mainRect.AtZero(); Text.Font = GameFont.Small; if (!Expiring) { def.HighlightAllTags(); } if (doFadeIn || Expiring) { GUI.color = new Color(1f, 1f, 1f, alpha); } Widgets.DrawWindowBackgroundTutor(rect); Rect rect2 = rect.ContractedBy(10f); rect2.width = 432f; Widgets.Label(rect2, def.HelpTextAdjusted); Rect butRect = new Rect(rect.xMax - 32f - 8f, rect.y + 8f, 32f, 32f); Texture2D tex = ((!Expiring) ? TexButton.CloseXBig : Widgets.CheckboxOnTex); if (Widgets.ButtonImage(butRect, tex, new Color(0.95f, 0.95f, 0.95f), new Color(71f / 85f, 2f / 3f, 14f / 51f))) { SoundDefOf.Click.PlayOneShotOnCamera(); CloseButtonClicked(); } if (Time.timeSinceLevelLoad > expiryTime) { CloseButtonClicked(); } GUI.color = Color.white; }, doBackground: false, absorbInputAroundWindow: false, alpha); }
public void LearningReadoutOnGUI() { if (!TutorSystem.TutorialMode && TutorSystem.AdaptiveTrainingEnabled && (Find.PlaySettings.showLearningHelper || activeConcepts.Count != 0) && !Find.WindowStack.IsOpen<Screen_Credits>()) { float b = (float)UI.screenHeight / 2f; float a = contentHeight + 14f; windowRect = new Rect((float)UI.screenWidth - 8f - 200f, 8f, 200f, Mathf.Min(a, b)); Rect rect = windowRect; Find.WindowStack.ImmediateWindow(76136312, windowRect, WindowLayer.Super, windowOnGUICached, doBackground: false); float num = Time.realtimeSinceStartup - lastConceptActivateRealTime; if (num < 1f && num > 0f) { GenUI.DrawFlash(rect.x, rect.center.y, (float)UI.screenWidth * 0.6f, Pulser.PulseBrightness(1f, 1f, num) * 0.85f, new Color(0.8f, 0.77f, 0.53f)); } ConceptDef conceptDef = ((selectedConcept != null) ? selectedConcept : mouseoverConcept); if (conceptDef != null) { DrawInfoPane(conceptDef); conceptDef.HighlightAllTags(); } mouseoverConcept = null; } }
public void LearningReadoutOnGUI() { if (!TutorSystem.TutorialMode && TutorSystem.AdaptiveTrainingEnabled) { if (Find.PlaySettings.showLearningHelper || this.activeConcepts.Count != 0) { if (!Find.WindowStack.IsOpen <Screen_Credits>()) { float b = (float)UI.screenHeight / 2f; float a = this.contentHeight + 14f; Rect outRect = new Rect((float)UI.screenWidth - 8f - 200f, 8f, 200f, Mathf.Min(a, b)); Rect outRect2 = outRect; Find.WindowStack.ImmediateWindow(76136312, outRect, WindowLayer.Super, delegate { outRect = outRect.AtZero(); Rect rect = outRect.ContractedBy(7f); Rect viewRect = rect.AtZero(); bool flag = this.contentHeight > rect.height; Widgets.DrawWindowBackgroundTutor(outRect); if (flag) { viewRect.height = this.contentHeight + 40f; viewRect.width -= 20f; this.scrollPosition = GUI.BeginScrollView(rect, this.scrollPosition, viewRect); } else { GUI.BeginGroup(rect); } float num2 = 0f; Text.Font = GameFont.Small; Rect rect2 = new Rect(0f, 0f, viewRect.width - 24f, 24f); Widgets.Label(rect2, "LearningHelper".Translate()); num2 = rect2.yMax; Rect butRect = new Rect(rect2.xMax, rect2.y, 24f, 24f); if (Widgets.ButtonImage(butRect, this.showAllMode ? TexButton.Minus : TexButton.Plus)) { this.showAllMode = !this.showAllMode; if (this.showAllMode) { SoundDefOf.Tick_High.PlayOneShotOnCamera(null); } else { SoundDefOf.Tick_Low.PlayOneShotOnCamera(null); } } if (this.showAllMode) { Rect rect3 = new Rect(0f, num2, viewRect.width - 20f - 2f, 28f); this.searchString = this.FilterSearchStringInput(Widgets.TextField(rect3, this.searchString)); if (this.searchString == "") { GUI.color = new Color(0.6f, 0.6f, 0.6f, 1f); Text.Anchor = TextAnchor.MiddleLeft; Rect rect4 = rect3; rect4.xMin += 7f; Widgets.Label(rect4, "Filter".Translate() + "..."); Text.Anchor = TextAnchor.UpperLeft; GUI.color = Color.white; } Rect butRect2 = new Rect(viewRect.width - 20f, num2 + 14f - 10f, 20f, 20f); if (Widgets.ButtonImage(butRect2, TexButton.CloseXSmall)) { this.searchString = ""; SoundDefOf.Tick_Tiny.PlayOneShotOnCamera(null); } num2 = rect3.yMax + 4f; } IEnumerable <ConceptDef> enumerable = this.showAllMode ? DefDatabase <ConceptDef> .AllDefs : this.activeConcepts; if (enumerable.Any <ConceptDef>()) { GUI.color = new Color(1f, 1f, 1f, 0.5f); Widgets.DrawLineHorizontal(0f, num2, viewRect.width); GUI.color = Color.white; num2 += 4f; } if (this.showAllMode) { enumerable = from c in enumerable orderby this.DisplayPriority(c) descending, c.label select c; } foreach (ConceptDef conceptDef2 in enumerable) { if (!conceptDef2.TriggeredDirect) { num2 = this.DrawConceptListRow(0f, num2, viewRect.width, conceptDef2).yMax; } } this.contentHeight = num2; if (flag) { GUI.EndScrollView(); } else { GUI.EndGroup(); } }, false, false, 1f); float num = Time.realtimeSinceStartup - this.lastConceptActivateRealTime; if (num < 1f && num > 0f) { GenUI.DrawFlash(outRect2.x, outRect2.center.y, (float)UI.screenWidth * 0.6f, Pulser.PulseBrightness(1f, 1f, num) * 0.85f, new Color(0.8f, 0.77f, 0.53f)); } ConceptDef conceptDef = (this.selectedConcept == null) ? this.mouseoverConcept : this.selectedConcept; if (conceptDef != null) { this.DrawInfoPane(conceptDef); conceptDef.HighlightAllTags(); } this.mouseoverConcept = null; } } } }