예제 #1
0
            internal void <> m__0()
            {
                Text.Font   = GameFont.Small;
                Text.Anchor = TextAnchor.MiddleLeft;
                Rect  rect  = this.rect.AtZero();
                float alpha = this.$this.Alpha;

                GUI.color = new Color(1f, 1f, 1f, alpha);
                if (Message.ShouldDrawBackground)
                {
                    GUI.color = new Color(0.15f, 0.15f, 0.15f, 0.8f * alpha);
                    GUI.DrawTexture(rect, BaseContent.WhiteTex);
                    GUI.color = new Color(1f, 1f, 1f, alpha);
                }
                if (CameraJumper.CanJump(this.$this.lookTargets.TryGetPrimaryTarget()))
                {
                    UIHighlighter.HighlightOpportunity(rect, "Messages");
                    Widgets.DrawHighlightIfMouseover(rect);
                }
                Rect rect2 = new Rect(2f, 0f, rect.width - 2f, rect.height);

                Widgets.Label(rect2, this.$this.text);
                if (Current.ProgramState == ProgramState.Playing && CameraJumper.CanJump(this.$this.lookTargets.TryGetPrimaryTarget()) && Widgets.ButtonInvisible(rect, false))
                {
                    CameraJumper.TryJumpAndSelect(this.$this.lookTargets.TryGetPrimaryTarget());
                    PlayerKnowledgeDatabase.KnowledgeDemonstrated(ConceptDefOf.ClickingMessages, KnowledgeAmount.Total);
                }
                Text.Anchor = TextAnchor.UpperLeft;
                GUI.color   = Color.white;
                if (Mouse.IsOver(rect))
                {
                    Messages.Notify_Mouseover(this.$this);
                }
            }
예제 #2
0
        public void Draw(int xOffset, int yOffset)
        {
            Rect rect = CalculateRect(xOffset, yOffset);

            Find.WindowStack.ImmediateWindow(Gen.HashCombineInt(ID, 45574281), rect, WindowLayer.Super, delegate
            {
                Text.Font   = GameFont.Small;
                Text.Anchor = TextAnchor.MiddleLeft;
                Rect rect2  = rect.AtZero();
                float alpha = Alpha;
                GUI.color   = new Color(1f, 1f, 1f, alpha);
                if (ShouldDrawBackground)
                {
                    GUI.color = new Color(0.15f, 0.15f, 0.15f, 0.8f * alpha);
                    GUI.DrawTexture(rect2, BaseContent.WhiteTex);
                    GUI.color = new Color(1f, 1f, 1f, alpha);
                }
                if (CameraJumper.CanJump(lookTargets.TryGetPrimaryTarget()) || quest != null)
                {
                    UIHighlighter.HighlightOpportunity(rect2, "Messages");
                    Widgets.DrawHighlightIfMouseover(rect2);
                }
                Widgets.Label(new Rect(2f, 0f, rect2.width - 2f, rect2.height), text);
                if (Current.ProgramState == ProgramState.Playing && Widgets.ButtonInvisible(rect2))
                {
                    if (CameraJumper.CanJump(lookTargets.TryGetPrimaryTarget()))
                    {
                        CameraJumper.TryJumpAndSelect(lookTargets.TryGetPrimaryTarget());
                        PlayerKnowledgeDatabase.KnowledgeDemonstrated(ConceptDefOf.ClickingMessages, KnowledgeAmount.Total);
                    }
                    else if (quest != null)
                    {
                        if (Find.MainTabsRoot.OpenTab == MainButtonDefOf.Quests)
                        {
                            SoundDefOf.Click.PlayOneShotOnCamera();
                        }
                        else
                        {
                            Find.MainTabsRoot.SetCurrentTab(MainButtonDefOf.Quests);
                        }
                        ((MainTabWindow_Quests)MainButtonDefOf.Quests.TabWindow).Select(quest);
                    }
                }
                Text.Anchor = TextAnchor.UpperLeft;
                GUI.color   = Color.white;
                if (Mouse.IsOver(rect2))
                {
                    Messages.Notify_Mouseover(this);
                }
            }, doBackground: false, absorbInputAroundWindow: false, 0f);
        }
예제 #3
0
        public void Draw(int xOffset, int yOffset)
        {
            Rect rect = this.CalculateRect((float)xOffset, (float)yOffset);

            Find.WindowStack.ImmediateWindow(Gen.HashCombineInt(this.ID, 45574281), rect, WindowLayer.Super, delegate
            {
                Text.Font   = GameFont.Small;
                Text.Anchor = TextAnchor.MiddleLeft;
                Rect rect   = rect.AtZero();
                float alpha = this.Alpha;
                GUI.color   = new Color(1f, 1f, 1f, alpha);
                if (Message.ShouldDrawBackground)
                {
                    GUI.color = new Color(0.15f, 0.15f, 0.15f, 0.8f * alpha);
                    GUI.DrawTexture(rect, BaseContent.WhiteTex);
                    GUI.color = new Color(1f, 1f, 1f, alpha);
                }
                if (CameraJumper.CanJump(this.lookTargets.TryGetPrimaryTarget()))
                {
                    UIHighlighter.HighlightOpportunity(rect, "Messages");
                    Widgets.DrawHighlightIfMouseover(rect);
                }
                Rect rect2 = new Rect(2f, 0f, rect.width - 2f, rect.height);
                Widgets.Label(rect2, this.text);
                if (Current.ProgramState == ProgramState.Playing && CameraJumper.CanJump(this.lookTargets.TryGetPrimaryTarget()))
                {
                    if (Widgets.ButtonInvisible(rect, false))
                    {
                        CameraJumper.TryJumpAndSelect(this.lookTargets.TryGetPrimaryTarget());
                        PlayerKnowledgeDatabase.KnowledgeDemonstrated(ConceptDefOf.ClickingMessages, KnowledgeAmount.Total);
                    }
                }
                Text.Anchor = TextAnchor.UpperLeft;
                GUI.color   = Color.white;
                if (Mouse.IsOver(rect))
                {
                    Messages.Notify_Mouseover(this);
                }
            }, false, false, 0f);
        }