Exemplo n.º 1
0
 public void HighlightAllTags()
 {
     if (this.highlightTags != null)
     {
         for (int i = 0; i < this.highlightTags.Count; i++)
         {
             UIHighlighter.HighlightTag(this.highlightTags[i]);
         }
     }
 }
 public override void LessonOnGUI()
 {
     foreach (Thing t in this.ThingsToSelect())
     {
         TutorUtility.DrawLabelOnThingOnGUI(t, this.def.onMapInstruction);
     }
     if (this.RelevantBill() == null)
     {
         UIHighlighter.HighlightTag("AddBill");
     }
     base.LessonOnGUI();
 }
 public override string GetExplanation()
 {
     UIHighlighter.HighlightTag("MainTab-StoryTab-Closed");
     foreach (ModContentPackWrapper MCPW in StoryManager.StoryHandler.ModFolder)
     {
         if (MCPW.HasUnseenMissions)
         {
             UIHighlighter.HighlightTag(MCPW.identifier + "-StoryHighlight");
         }
     }
     return(base.GetExplanation());
 }
Exemplo n.º 4
0
        public override void LessonOnGUI()
        {
            Text.Font = GameFont.Small;
            string textAdj = this.def.text.AdjustedForKeys(null, true);
            float  num     = Text.CalcHeight(textAdj, 290f);
            float  num2    = num + 20f;

            if (this.ShowProgressBar)
            {
                num2 += 47f;
            }
            Vector2 b = new Vector2((float)UI.screenWidth - 17f - 155f, 17f + num2 / 2f);

            if (!Find.TutorialState.introDone)
            {
                float screenOverlayAlpha = 0f;
                if (this.def.startCentered)
                {
                    Vector2 vector = new Vector2((float)(UI.screenWidth / 2), (float)(UI.screenHeight / 2));
                    if (base.AgeSeconds < 4f)
                    {
                        b = vector;
                        screenOverlayAlpha = 0.9f;
                    }
                    else if (base.AgeSeconds < 5f)
                    {
                        float t = (base.AgeSeconds - 4f) / 1f;
                        b = Vector2.Lerp(vector, b, t);
                        screenOverlayAlpha = Mathf.Lerp(0.9f, 0f, t);
                    }
                }
                if (screenOverlayAlpha > 0f)
                {
                    Rect fullScreenRect = new Rect(0f, 0f, (float)UI.screenWidth, (float)UI.screenHeight);
                    Find.WindowStack.ImmediateWindow(972651, fullScreenRect, WindowLayer.SubSuper, delegate
                    {
                        GUI.color = new Color(1f, 1f, 1f, screenOverlayAlpha);
                        GUI.DrawTexture(fullScreenRect, BaseContent.BlackTex);
                        GUI.color = Color.white;
                    }, false, true, 0f);
                }
                else
                {
                    Find.TutorialState.introDone = true;
                }
            }
            Rect mainRect = new Rect(b.x - 155f, b.y - num2 / 2f - 10f, 310f, num2);

            if (Find.TutorialState.introDone && Find.WindowStack.IsOpen <Page_ConfigureStartingPawns>())
            {
                Rect mainRect2 = mainRect;
                mainRect2.x = 17f;
                if ((mainRect.Contains(Event.current.mousePosition) || (this.def == InstructionDefOf.RandomizeCharacter && UI.screenHeight <= 768)) && !mainRect2.Contains(Event.current.mousePosition))
                {
                    mainRect.x = 17f;
                }
            }
            Find.WindowStack.ImmediateWindow(177706, mainRect, WindowLayer.Super, delegate
            {
                Rect rect = mainRect.AtZero();
                Widgets.DrawWindowBackgroundTutor(rect);
                Rect rect2 = rect.ContractedBy(10f);
                Text.Font  = GameFont.Small;
                Rect rect3 = rect2;
                if (this.ShowProgressBar)
                {
                    rect3.height -= 47f;
                }
                Widgets.Label(rect3, textAdj);
                if (this.ShowProgressBar)
                {
                    Rect rect4 = new Rect(rect2.x, rect2.yMax - 30f, rect2.width, 30f);
                    Widgets.FillableBar(rect4, this.ProgressPercent, LearningReadout.ProgressBarFillTex);
                }
                if (this.AgeSeconds < 0.5f)
                {
                    GUI.color = new Color(1f, 1f, 1f, Mathf.Lerp(1f, 0f, this.AgeSeconds / 0.5f));
                    GUI.DrawTexture(rect, BaseContent.WhiteTex);
                    GUI.color = Color.white;
                }
            }, false, false, 1f);
            if (this.def.highlightTags != null)
            {
                for (int i = 0; i < this.def.highlightTags.Count; i++)
                {
                    UIHighlighter.HighlightTag(this.def.highlightTags[i]);
                }
            }
        }
        public override void LessonOnGUI()
        {
            Text.Font = GameFont.Small;
            string textAdj = this.def.text.AdjustedForKeys();
            float  num     = Text.CalcHeight(textAdj, 290f);
            float  num2    = (float)(num + 20.0);

            if (this.ShowProgressBar)
            {
                num2 = (float)(num2 + 47.0);
            }
            Vector2 b = new Vector2((float)((float)UI.screenWidth - 17.0 - 155.0), (float)(17.0 + num2 / 2.0));

            if (!Find.TutorialState.introDone)
            {
                float screenOverlayAlpha = 0f;
                if (this.def.startCentered)
                {
                    Vector2 vector = new Vector2((float)(UI.screenWidth / 2), (float)(UI.screenHeight / 2));
                    if (base.AgeSeconds < 4.0)
                    {
                        b = vector;
                        screenOverlayAlpha = 0.9f;
                    }
                    else if (base.AgeSeconds < 5.0)
                    {
                        float t = (float)((base.AgeSeconds - 4.0) / 1.0);
                        b = Vector2.Lerp(vector, b, t);
                        screenOverlayAlpha = Mathf.Lerp(0.9f, 0f, t);
                    }
                }
                if (screenOverlayAlpha > 0.0)
                {
                    Rect fullScreenRect = new Rect(0f, 0f, (float)UI.screenWidth, (float)UI.screenHeight);
                    Find.WindowStack.ImmediateWindow(972651, fullScreenRect, WindowLayer.SubSuper, delegate
                    {
                        GUI.color = new Color(1f, 1f, 1f, screenOverlayAlpha);
                        GUI.DrawTexture(fullScreenRect, BaseContent.BlackTex);
                        GUI.color = Color.white;
                    }, false, true, 0f);
                }
                else
                {
                    Find.TutorialState.introDone = true;
                }
            }
            Rect mainRect = new Rect((float)(b.x - 155.0), (float)(b.y - num2 / 2.0 - 10.0), 310f, num2);

            Find.WindowStack.ImmediateWindow(177706, mainRect, WindowLayer.Super, delegate
            {
                Rect rect = mainRect.AtZero();
                Widgets.DrawWindowBackgroundTutor(rect);
                Rect rect2 = rect.ContractedBy(10f);
                Text.Font  = GameFont.Small;
                Rect rect3 = rect2;
                if (this.ShowProgressBar)
                {
                    rect3.height -= 47f;
                }
                Widgets.Label(rect3, textAdj);
                if (this.ShowProgressBar)
                {
                    Rect rect4 = new Rect(rect2.x, (float)(rect2.yMax - 30.0), rect2.width, 30f);
                    Widgets.FillableBar(rect4, this.ProgressPercent, LearningReadout.ProgressBarFillTex);
                }
                if (base.AgeSeconds < 0.5)
                {
                    GUI.color = new Color(1f, 1f, 1f, Mathf.Lerp(1f, 0f, (float)(base.AgeSeconds / 0.5)));
                    GUI.DrawTexture(rect, BaseContent.WhiteTex);
                    GUI.color = Color.white;
                }
            }, false, false, 1f);
            if (this.def.highlightTags != null)
            {
                for (int i = 0; i < this.def.highlightTags.Count; i++)
                {
                    UIHighlighter.HighlightTag(this.def.highlightTags[i]);
                }
            }
        }