Example #1
0
        public override void DoWindowContents(Rect inRect)
        {
            if (!this.Initalized)
            {
                this.Init(inRect);
            }

            Widgets.Label(new Rect(3f, CurrentTraitScrollView.DrawRect.y - 23f, this.windowRect.width, 20f), "PS_CurrentTraitsLab".Translate());
            Widgets.Label(new Rect((this.windowRect.width - (this.Margin * 2f)) * 0.5f + 3f, CurrentTraitScrollView.DrawRect.y - 23f, this.windowRect.width, 20f), "PS_OptionalTraitsLab".Translate());
            Widgets.Label(new Rect(3f, CurrentConditioningScrollView.DrawRect.y - 20f - 5f, this.windowRect.width, 20f), "PS_CurrentConditioningLab".Translate());

            GUI.color = Color.gray;
            var addtempRect = new Rect(AddTraitScrollView.DrawRect.x - 3f, AddTraitScrollView.DrawRect.y - 3f, AddTraitScrollView.DrawRect.width + 6f, AddTraitScrollView.DrawRect.height + 6f);

            Widgets.DrawBox(addtempRect);
            var curtempRect = new Rect(CurrentTraitScrollView.DrawRect.x - 3f, CurrentTraitScrollView.DrawRect.y - 3f, CurrentTraitScrollView.DrawRect.width + 6f, CurrentTraitScrollView.DrawRect.height + 6f);

            Widgets.DrawBox(curtempRect);
            var curContempRect = new Rect(CurrentConditioningScrollView.DrawRect.x - 3f, CurrentConditioningScrollView.DrawRect.y - 3f, CurrentConditioningScrollView.DrawRect.width + 6f, CurrentConditioningScrollView.DrawRect.height + 6f);

            Widgets.DrawBox(curContempRect);


            var labBox = new Rect(curContempRect.x, curContempRect.yMax + 3f, this.windowRect.width - this.Margin * 2f - 3f, 60f);

            Widgets.DrawBox(labBox);


            var refreshLabBox = new Rect(labBox.x, labBox.yMax + 3f, curContempRect.width, 26f);

            TooltipHandler.TipRegion(refreshLabBox, this.ToolTipFunc("PS_ToolTips_ConditioningFallRate".Translate()));
            Widgets.DrawBox(refreshLabBox);

            var daysBox = new Rect(addtempRect.x, labBox.yMax + 3f, addtempRect.width * 0.5f - 1.5f, 26f);

            Widgets.DrawBox(daysBox);
            TooltipHandler.TipRegion(daysBox, this.ToolTipFunc("PS_ToolTips_ConditioningTime".Translate()));
            var chanceBox = new Rect(daysBox.x + daysBox.width + 3f, daysBox.y, daysBox.width, daysBox.height);

            TooltipHandler.TipRegion(chanceBox, this.ToolTipFunc("PS_ToolTips_SuccessChance".Translate()));
            Widgets.DrawBox(chanceBox);

            GUI.color = Color.white;
            Widgets.Label(new Rect(refreshLabBox.x + 3f, refreshLabBox.y + 2f, refreshLabBox.width - 6f, refreshLabBox.height - 2f), string.Format("PS_UILabels_ConditioningFallRate".Translate(), this.GetRefreshRate()));
            Widgets.Label(new Rect(daysBox.x + 3f, daysBox.y + 2f, daysBox.width - 6f, daysBox.height - 2f), string.Format("PS_UILabels_ConditioningTime".Translate(), this.GetDays()));
            Widgets.Label(new Rect(chanceBox.x + 3f, chanceBox.y + 2f, chanceBox.width - 6f, chanceBox.height - 2f), string.Format("PS_UILabels_SuccessChance".Translate(), this.GetFailChance()));

            Widgets.Label(new Rect(labBox.x + 3f, labBox.y + 2f, labBox.width - 6f, labBox.height - 2f), this.BuildInfoString());
            //Widgets.Label(labBox, (this.AddingTrait ? "Adding" : "Removeing") + ":\n " + (this.ToAlter != null ? this.ToAlter.LabelCap : "Unset"));

            AddTraitScrollView.Draw();
            CurrentTraitScrollView.Draw();
            CurrentConditioningScrollView.Draw();

            if (this.ChangeType == TraitAlterType.Added && this.StartTraits.Count() >= 3)
            {
                if (!PS_TextureLoader.Loaded)
                {
                    PS_TextureLoader.Reset();
                }
                var warnBox = new Rect(labBox.xMax - 20f, labBox.y + 2, 18f, 18f);
                Widgets.DrawAtlas(warnBox, PS_TextureLoader.Warning);

                TooltipHandler.TipRegion(warnBox, this.ToolTipFunc("PS_3OrMoreWarning".Translate()));
            }


            Text.Font = GameFont.Small;

            Text.Font = GameFont.Medium;
            // Cancel Button
            var cancelButtonRecGrid  = GetRecForGridLocation(0, 5.5f, 1, 0.5f);// new Rect(inRect.width * 0.5f, inRect.height - inRect.height * 0.1f, inRect.width * 0.5f, inRect.height * 0.1f);
            var cancelButtonRectTrue = new Rect(cancelButtonRecGrid.x + 5, cancelButtonRecGrid.y, cancelButtonRecGrid.width - 10f, cancelButtonRecGrid.height);
            var cancelButton         = Widgets.ButtonText(cancelButtonRectTrue, "PS_Cancel".Translate());

            if (cancelButton)
            {
                this.Close(true);
            }

            // Submit Button
            var submitButtonRecGrid  = GetRecForGridLocation(1, 5.5f, 1, 0.5f);// new Rect(0, inRect.height - inRect.height * 0.1f, inRect.width * 0.5f, inRect.height * 0.1f);
            var submitButtonRectTrue = new Rect(submitButtonRecGrid.x + 5, submitButtonRecGrid.y, submitButtonRecGrid.width - 10f, submitButtonRecGrid.height);
            var button = Widgets.ButtonText(submitButtonRectTrue, "PS_Accept".Translate());

            if (button)
            {
                if (!this.CheatMode)
                {
                    this.ApplyNewTraits(this.Pawn);
                }
                this.Close(true);
            }
        }
 // Token: 0x0600043A RID: 1082 RVA: 0x0001611D File Offset: 0x0001431D
 static PS_TextureLoader()
 {
     PS_TextureLoader.LoadTextures();
 }