コード例 #1
0
        public static void DrawLevelBar(Rect rect, CompVampire compVampire)
        {
            ////base.DrawOnGUI(rect, maxThresholdMarkers, customMargin, drawArrows, doTooltip);
            if (rect.height > 70f)
            {
                float num = (rect.height - 70f) / 2f;
                rect.height = 70f;
                rect.y     += num;
            }
            if (Mouse.IsOver(rect))
            {
                Widgets.DrawHighlight(rect);
            }
            TooltipHandler.TipRegion(rect, new TipSignal(() => XPTipString(compVampire), rect.GetHashCode()));
            float num2 = 14f;

            if (rect.height < 50f)
            {
                num2 *= Mathf.InverseLerp(0f, 50f, rect.height);
            }
            Text.Anchor = TextAnchor.UpperLeft;
            Rect rect3 = new Rect(rect.x, rect.y + rect.height / 2f, rect.width, rect.height);

            rect3 = new Rect(rect3.x, rect3.y, rect3.width, rect3.height - num2);

            Color colorToUse = new Color(1.0f, 0.91f, 0f);

            Widgets.FillableBar(rect3, (float)compVampire.XPTillNextLevelPercent, SolidColorMaterials.NewSolidColorTexture(colorToUse), BaseContent.GreyTex, false);
            //Widgets.FillableBar(rect3, (float)compVampire.XPTillNextLevelPercent, (Texture2D)AccessTools.Field(typeof(Widgets), "BarFullTexHor").GetValue(null), BaseContent.GreyTex, false);
            //compVampire.XPTillNextLevelPercent
        }
コード例 #2
0
        public virtual void UpdateDanger(Map map)
        {
            if (!Flammable && !Toxic)
            {
                return;
            }

            foreach (var offset in GenAdj.AdjacentCellsAndInside)
            {
                var cell = Position + offset;
                if (cell.InBounds(map))
                {
                    map.pathGrid.RecalculatePerceivedPathCostAt(cell);
#if DEBUG_DANGER
                    map.debugDrawer.FlashCell(
                        cell,
                        SolidColorMaterials.SimpleSolidColorMaterial(Color.Lerp(Color.green, Color.red,
                                                                                Mathf.Clamp01(
                                                                                    (float)map.pathGrid.pathGrid[
                                                                                        map.cellIndices.CellToIndex(cell)] /
                                                                                    1000))));
#endif
                }
            }
        }
コード例 #3
0
 public static void DrawWindowBackground(Rect rect)
 {
     GUI.color = new Color(23, 23, 23, 0.1f);
     GUI.DrawTexture(rect, SolidColorMaterials.NewSolidColorTexture(Color.white));
     GUI.color = Color.white;
     GUI.color = Color.white;
 }
コード例 #4
0
        /// <inheritdoc/>
        protected override void DrawWeightBar(Rect rect, Pawn selPawn)
        {
            base.DrawWeightBar(rect.ReplaceHeight(GenUI.SmallIconSize), selPawn);

            List <Thing> things = new List <Thing>();

            if (selPawn.equipment?.AllEquipmentListForReading != null)
            {
                things.AddRange(selPawn.equipment.AllEquipmentListForReading);
            }

            if (selPawn.inventory?.innerContainer != null)
            {
                things.AddRange(selPawn.inventory.innerContainer);
            }

            // Draw bulk bar.
            float currentBulk = things.Sum(thing => thing.GetStatValue(CE_StatDefOf.Bulk) * thing.stackCount)
                                + selPawn.apparel?.WornApparel.Sum(apparel => apparel.GetStatValue(CE_StatDefOf.WornBulk)) ?? 0;
            float carryBulk   = selPawn.GetStatValue(CE_StatDefOf.CarryBulk);
            float fillPercent = Mathf.Clamp01(currentBulk / carryBulk);

            GenBar.BarWithOverlay(
                rect.ReplaceY(rect.yMax + GenUI.GapSmall)
                , fillPercent
                , SolidColorMaterials.NewSolidColorTexture(Color.Lerp(AwesomeInventoryTex.RWPrimaryColor, AwesomeInventoryTex.Valvet, fillPercent))
                , UIText.Bulk.TranslateSimple()
                , currentBulk.ToString("0.#") + "/" + carryBulk.ToString()
                , (this.DrawHelper as DrawHelperCE).BulkTextFor(selPawn));
        }
コード例 #5
0
        public static void DrawLevelBar(Rect rect, CompVampire compVampire)
        {
            if (rect.height > 70f)
            {
                float num = (rect.height - 70f) / 2f;
                rect.height = 70f;
                rect.y     += num;
            }
            if (Mouse.IsOver(rect))
            {
                Widgets.DrawHighlight(rect);
            }
            TooltipHandler.TipRegion(rect, new TipSignal(() => XPTipString(compVampire), rect.GetHashCode()));
            float num2 = 14f;

            if (rect.height < 50f)
            {
                num2 *= Mathf.InverseLerp(0f, 50f, rect.height);
            }
            Text.Anchor = TextAnchor.UpperLeft;
            Rect rect3 = new Rect(rect.x, rect.y + rect.height / 2f, rect.width, rect.height);

            rect3 = new Rect(rect3.x, rect3.y, rect3.width, rect3.height - num2);

            Color colorToUse    = new Color(1.0f, 0.91f, 0f);
            Color colorToUseTwo = new Color(0.4f, 0.1f, 0.1f);

            Widgets.FillableBar(rect3, (float)compVampire.XPTillNextLevelPercent, SolidColorMaterials.NewSolidColorTexture(colorToUse), SolidColorMaterials.NewSolidColorTexture(colorToUseTwo), false);
        }
コード例 #6
0
        public override IEnumerable <Gizmo> CompGetGizmosExtra()
        {
            if (Find.Selector.NumSelected > 1 && LoadedModManager.GetMod <RemnantMod>().GetSettings <RemnantModSettings>().hideAuraWhenMultiselect)
            {
                yield break;
            }
            foreach (Gizmo gizmo in base.CompGetGizmosExtra())
            {
                yield return(gizmo);
            }
            if (IsInitialized)
            {
                yield return(new GizmoAuraStatus
                {
                    aura = aura,
                    label = "AuraGizmoLabel".Translate(AbilityUser.Name.ToStringShort),
                    FullShieldBarTex = SolidColorMaterials.NewSolidColorTexture(aura.GetColor())
                });

                foreach (Gizmo gizmo in aura.GetGizmos())
                {
                    yield return(gizmo);
                }
            }
        }
コード例 #7
0
 public static void DebugDraw()
 {
     if (DebugViewSettings.drawInfestationChance)
     {
         if (InfestationCellFinder.tmpCachedInfestationChanceCellColors == null)
         {
             InfestationCellFinder.tmpCachedInfestationChanceCellColors = new List <Pair <IntVec3, float> >();
         }
         if (Time.frameCount % 8 == 0)
         {
             InfestationCellFinder.tmpCachedInfestationChanceCellColors.Clear();
             Map      currentMap = Find.CurrentMap;
             CellRect cellRect   = Find.CameraDriver.CurrentViewRect;
             cellRect.ClipInsideMap(currentMap);
             cellRect = cellRect.ExpandedBy(1);
             InfestationCellFinder.CalculateTraversalDistancesToUnroofed(currentMap);
             InfestationCellFinder.CalculateClosedAreaSizeGrid(currentMap);
             InfestationCellFinder.CalculateDistanceToColonyBuildingGrid(currentMap);
             float num = 0.001f;
             for (int i = 0; i < currentMap.Size.z; i++)
             {
                 for (int j = 0; j < currentMap.Size.x; j++)
                 {
                     IntVec3 cell    = new IntVec3(j, 0, i);
                     float   scoreAt = InfestationCellFinder.GetScoreAt(cell, currentMap);
                     if (scoreAt > num)
                     {
                         num = scoreAt;
                     }
                 }
             }
             for (int k = 0; k < currentMap.Size.z; k++)
             {
                 for (int l = 0; l < currentMap.Size.x; l++)
                 {
                     IntVec3 intVec = new IntVec3(l, 0, k);
                     if (cellRect.Contains(intVec))
                     {
                         float scoreAt2 = InfestationCellFinder.GetScoreAt(intVec, currentMap);
                         if (scoreAt2 > 7.5f)
                         {
                             float second = GenMath.LerpDouble(7.5f, num, 0f, 1f, scoreAt2);
                             InfestationCellFinder.tmpCachedInfestationChanceCellColors.Add(new Pair <IntVec3, float>(intVec, second));
                         }
                     }
                 }
             }
         }
         for (int m = 0; m < InfestationCellFinder.tmpCachedInfestationChanceCellColors.Count; m++)
         {
             IntVec3 first   = InfestationCellFinder.tmpCachedInfestationChanceCellColors[m].First;
             float   second2 = InfestationCellFinder.tmpCachedInfestationChanceCellColors[m].Second;
             CellRenderer.RenderCell(first, SolidColorMaterials.SimpleSolidColorMaterial(new Color(0f, 0f, 1f, second2), false));
         }
     }
     else
     {
         InfestationCellFinder.tmpCachedInfestationChanceCellColors = null;
     }
 }
コード例 #8
0
        /// <summary>
        /// Draw weight bar and bulk bar.
        /// </summary>
        /// <param name="canvas"> Rect for drawing weight bar and bulk bar. </param>
        protected override void DrawWeightBar(Rect canvas)
        {
            base.DrawWeightBar(canvas.ReplaceHeight(GenUI.SmallIconSize));

            float currentBulk = _currentLoadout.GroupBy(
                groupSelector => groupSelector.AllowedThing
                , groupSelector => groupSelector.AllowedStackCount)
                                .Sum(
                group => group.Key.IsApparel
                                     ? BulkUtility.BulkFor(group.Key, null, true)
                + BulkUtility.BulkFor(group.Key, null, false) * (group.Sum() - 1)
                                     : BulkUtility.BulkFor(group.Key, null, false) * group.Sum());
            float capaticyBulk = MassBulkUtility.BaseCarryBulk(_pawn)
                                 +
                                 _currentLoadout.Select(selector => selector.AllowedThing).Distinct().Sum(
                thingDef => thingDef.equippedStatOffsets.GetStatOffsetFromList(CE_StatDefOf.CarryBulk));

            float fillPercent = Mathf.Clamp01(currentBulk / capaticyBulk);

            canvas.Set(canvas.x, canvas.y + GenUI.ListSpacing + GenUI.GapTiny, canvas.width, GenUI.SmallIconSize);
            GenBar.BarWithOverlay(
                canvas
                , fillPercent
                , SolidColorMaterials.NewSolidColorTexture(Color.Lerp(AwesomeInventoryTex.RWPrimaryColor, AwesomeInventoryTex.Valvet, fillPercent))
                , UIText.Bulk.TranslateSimple()
                , currentBulk.ToString("0.#") + "/" + capaticyBulk.ToString("0.#")
                , string.Empty);
        }
コード例 #9
0
        private static void DrawColorOption(Listing_Standard listing, string label, Color color, Action <Color> action)
        {
            Rect      rect = listing.GetRect(GenUI.ListSpacing);
            WidgetRow row  = new WidgetRow(rect.x, rect.y, UIDirection.RightThenDown, rect.width);

            if (!_textureCache.TryGetValue(color, out Texture2D texture))
            {
                texture = SolidColorMaterials.NewSolidColorTexture(color);
                _textureCache[color] = texture;
            }

            if (row.ButtonIcon(texture))
            {
                Find.WindowStack.Add(
                    new Dialog_ColorPicker(
                        color
                        , (newColor) =>
                {
                    action.Invoke(newColor);
                    ModSettings.UISettingsChanged = true;
                }));
            }

            row.GapButtonIcon();
            row.Label(label);
        }
コード例 #10
0
        public static void DrawDebug()
        {
            if (!DebugViewSettings.drawDoorsDebug)
            {
                return;
            }
            CellRect     currentViewRect = Find.CameraDriver.CurrentViewRect;
            List <Thing> list            = Find.CurrentMap.listerThings.ThingsInGroup(ThingRequestGroup.BuildingArtificial);

            for (int i = 0; i < list.Count; i++)
            {
                if (currentViewRect.Contains(list[i].Position))
                {
                    Building_Door building_Door = list[i] as Building_Door;
                    if (building_Door != null)
                    {
                        Color col;
                        if (building_Door.FreePassage)
                        {
                            col = new Color(0f, 1f, 0f, 0.5f);
                        }
                        else
                        {
                            col = new Color(1f, 0f, 0f, 0.5f);
                        }
                        CellRenderer.RenderCell(building_Door.Position, SolidColorMaterials.SimpleSolidColorMaterial(col, false));
                    }
                }
            }
        }
コード例 #11
0
        public override IEnumerable <Gizmo> GetGizmos()
        {
            string label = "";

            if (absorbedDamage == 0f)
            {
                label = "AngerLevelNotAngryLabel".Translate().CapitalizeFirst();
            }
            else if (absorbedDamage <= 25f)
            {
                label = "AngerLevelAnnoyedLabel".Translate().CapitalizeFirst();
            }
            else if (absorbedDamage <= 50f)
            {
                label = "AngerLevelAngryLabel".Translate().CapitalizeFirst();
            }
            else if (absorbedDamage <= 75f)
            {
                label = "AngerLevelRagingLabel".Translate().CapitalizeFirst();
            }
            else
            {
                label = "AngerLevelLostHairLabel".Translate().CapitalizeFirst();
            }
            yield return(new GizmoYangAngerLevel
            {
                label = label,
                labelColor = GetLabelColor(),
                aura = this,
                currentAbsorbedDamage = absorbedDamage,
                FullShieldBarTex = SolidColorMaterials.NewSolidColorTexture(GetColor())
            });
        }
コード例 #12
0
        public override void PostDraw()
        {
            Chamber chamber = parent.Linked <Chamber>();

            if (chamber == null)
            {
                return;
            }

            updateValues();

            if (unfilledMat == null)
            {
                unfilledMat = SolidColorMaterials.SimpleSolidColorMaterial(new Color(107 / 255f, 107 / 255f, 107 / 255f), false);
                filledMat   = new Material[] {
                    SolidColorMaterials.SimpleSolidColorMaterial(new Color(255 / 255f, 110 / 255f, 26 / 255f), false),
                    SolidColorMaterials.SimpleSolidColorMaterial(new Color(29 / 255f, 179 / 255f, 139 / 255f), false),
                    SolidColorMaterials.SimpleSolidColorMaterial(new Color(169 / 255f, 58 / 255f, 255 / 255f), false),
                };
            }

            for (int i = 0; i < 3; i++)
            {
                GenDraw.FillableBarRequest r = default(GenDraw.FillableBarRequest);
                r.center      = parent.DrawPos + new Vector3((-8f + 14 * i) / 64, 0.1f, -4f / 64);
                r.size        = barSize;
                r.fillPercent = values[i];
                r.filledMat   = filledMat[i];
                r.unfilledMat = unfilledMat;
                r.margin      = 0;
                r.rotation    = Rot4.West;
                GenDraw.DrawFillableBar(r);
            }
        }
コード例 #13
0
ファイル: Tools.cs プロジェクト: DoctorVanGogh/zombieland
        public static void DebugPosition(Vector3 pos, Color color)
        {
            pos.y = Altitudes.AltitudeFor(AltitudeLayer.Pawn - 1);
            var material = SolidColorMaterials.SimpleSolidColorMaterial(color);

            DrawScaledMesh(MeshPool.plane10, material, pos + new Vector3(0.5f, 0f, 0.5f), Quaternion.identity, 1.0f, 1.0f);
        }
コード例 #14
0
 public void SetFilledColor(Color newColor)
 {
     if (newColor.r != FilledColor.r || newColor.g != FilledColor.g || newColor.b != FilledColor.b || newColor.a != FilledColor.a)
     {
         FilledMat   = SolidColorMaterials.NewSolidColorMaterial(newColor, ShaderDatabase.MetaOverlay);
         FilledColor = newColor;
     }
 }
コード例 #15
0
 public ListWidget(D itemDrawer)
 {
     this.itemDrawer      = itemDrawer;
     this.selectedTexture = SolidColorMaterials.NewSolidColorTexture(new Color(0.2656f, 0.2773f, 0.2891f));
     this.rowTextures.Add(SolidColorMaterials.NewSolidColorTexture(new Color(0.1523f, 0.168f, 0.1836f)));
     this.rowTextures.Add(SolidColorMaterials.NewSolidColorTexture(new Color(0.1094f, 0.125f, 0.1406f)));
     this.backgroundColor = SolidColorMaterials.NewSolidColorTexture(new Color(0.0664f, 0.082f, 0.0938f));
 }
コード例 #16
0
 public static Texture2D FactionOneColorTexture(Faction factionOne)
 {
     if (factionOneColorTexture == null && factionOne != null)
     {
         factionOneColorTexture = SolidColorMaterials.NewSolidColorTexture(factionOne.Color);
     }
     return(factionOneColorTexture);
 }
コード例 #17
0
 public static Texture2D FactionTwoColorTexture(Faction factionInstigator)
 {
     if (factionTwoColorTexture == null && factionInstigator != null)
     {
         factionTwoColorTexture = SolidColorMaterials.NewSolidColorTexture(factionInstigator.Color);
     }
     return(factionTwoColorTexture);
 }
コード例 #18
0
ファイル: ProTBin.cs プロジェクト: keenkrozzy/Prophecy
        private static void LoadTextures()
        {
            BGMain = ContentFinder <Texture2D> .Get("Prophecy/Meta/BGMain", true);

            ProTitle = ContentFinder <Texture2D> .Get("Prophecy/Meta/ProTitle", true);

            try
            {
                Traverse.CreateWithType("UI_BackgroundMain").Field("BGPlanet").SetValue(BGMain);
            }
            catch
            {
                Log.Message("ProTBin.LoadTextures: Failed to Traverse BGPlanet");
            }

            // Textures for PNC_Cards
            texPassionMinorIcon = ContentFinder <Texture2D> .Get("UI/Icons/PassionMinor", true);

            texPassionMajorIcon = ContentFinder <Texture2D> .Get("UI/Icons/PassionMajor", true);

            texSkillBarFill             = SolidColorMaterials.NewSolidColorTexture(new Color(1f, 1f, 1f, 0.1f));
            texSkillBarFillMinorPassion = BumpGradient(new Color(1f, 1f, 0f, .4f), new Color(1f, 1f, 1f, 0.1f));
            texSkillBarFillMajorPassion = BumpGradient(new Color(1f, 0f, 0f, .4f), new Color(1f, 1f, 1f, 0.1f));

            texWeaponsTab = ContentFinder <Texture2D> .Get("Prophecy/PreGame/WeaponsTab", true);

            texWeaponsTab.wrapMode = TextureWrapMode.Clamp;

            texFoodsTab = ContentFinder <Texture2D> .Get("Prophecy/PreGame/Tab_Foods", true);

            texFoodsTab.wrapMode = TextureWrapMode.Clamp;

            texApparelTab = ContentFinder <Texture2D> .Get("Prophecy/PreGame/Tab_Apparel", true);

            texApparelTab.wrapMode = TextureWrapMode.Clamp;

            texDrugsTab = ContentFinder <Texture2D> .Get("Prophecy/PreGame/Tab_Drugs", true);

            texDrugsTab.wrapMode = TextureWrapMode.Clamp;

            texResourcesTab = ContentFinder <Texture2D> .Get("Prophecy/PreGame/Tab_Resources", true);

            texResourcesTab.wrapMode = TextureWrapMode.Clamp;

            texItemsTab = ContentFinder <Texture2D> .Get("Prophecy/PreGame/Tab_Items", true);

            texItemsTab.wrapMode = TextureWrapMode.Clamp;

            texWeaponsTab_Hover = ContentFinder <Texture2D> .Get("Prophecy/PreGame/WeaponsTab_Hover", true);

            texWeaponsTab_Hover.wrapMode = TextureWrapMode.Clamp;

            texVellum = ContentFinder <Texture2D> .Get("Prophecy/PreGame/Vellum", true);

            texVellum.wrapMode = TextureWrapMode.Repeat;
        }
コード例 #19
0
ファイル: Resources.cs プロジェクト: LazyRichard/AnimalTab
        static Resources()
        {
            CheckboxBackground        = SolidColorMaterials.NewSolidColorTexture(0f, 0f, 0f, .2f);
            CheckboxBackground_Danger = SolidColorMaterials.NewSolidColorTexture(0.8f, 0f, 0f, .2f);
            CheckOnWhite = ContentFinder <Texture2D> .Get("UI/Icons/Animal/CheckOnWhite");

            Filter = ContentFinder <Texture2D> .Get("UI/Icons/Filters/Filter");

            Pregnant = ContentFinder <Texture2D> .Get("UI/Icons/Filters/Pregnant");
        }
コード例 #20
0
        private static void LoadTextures()
        {
            loaded = false;
            TexturePassionMajor = ContentFinder <Texture2D> .Get("UI/Icons/PassionMajor", true);

            TexturePassionMinor = ContentFinder <Texture2D> .Get("UI/Icons/PassionMinor", true);

            TextureRadioButtonOff = ContentFinder <Texture2D> .Get("UI/Widgets/RadioButOff", true);

            TexturePortraitBackground = ContentFinder <Texture2D> .Get("EdB/PrepareCarefully/CharMakerPortraitBG", true);

            TextureFieldAtlas = ContentFinder <Texture2D> .Get("EdB/PrepareCarefully/FieldAtlas", true);

            TextureButtonPrevious = ContentFinder <Texture2D> .Get("EdB/PrepareCarefully/ButtonPrevious", true);

            TextureButtonNext = ContentFinder <Texture2D> .Get("EdB/PrepareCarefully/ButtonNext", true);

            TextureButtonRandom = ContentFinder <Texture2D> .Get("EdB/PrepareCarefully/ButtonRandom", true);

            TextureButtonRandomLarge = ContentFinder <Texture2D> .Get("EdB/PrepareCarefully/ButtonRandomLarge", true);

            TexturePassionNone = ContentFinder <Texture2D> .Get("EdB/PrepareCarefully/NoPassion", true);

            TextureButtonDelete = ContentFinder <Texture2D> .Get("EdB/PrepareCarefully/ButtonDelete", true);

            TextureButtonDeleteTab = ContentFinder <Texture2D> .Get("EdB/PrepareCarefully/ButtonDeleteTab", true);

            TextureButtonDeleteTabHighlight = ContentFinder <Texture2D> .Get("EdB/PrepareCarefully/ButtonDeleteTabHighlight", true);

            TextureButtonReset = ContentFinder <Texture2D> .Get("EdB/PrepareCarefully/ButtonReset", true);

            TextureButtonClearSkills = ContentFinder <Texture2D> .Get("EdB/PrepareCarefully/ButtonClear", true);

            TextureAlert = ContentFinder <Texture2D> .Get("EdB/PrepareCarefully/Alert", true);

            TextureAlertSmall = ContentFinder <Texture2D> .Get("EdB/PrepareCarefully/AlertSmall", true);

            TextureDerivedRelationship = ContentFinder <Texture2D> .Get("EdB/PrepareCarefully/DerivedRelationship", true);

            TextureButtonAdd = ContentFinder <Texture2D> .Get("EdB/PrepareCarefully/ButtonAdd", true);

            TextureDeleteX = ContentFinder <Texture2D> .Get("UI/Buttons/Delete", true);

            TextureSortAscending = ContentFinder <Texture2D> .Get("EdB/PrepareCarefully/SortAscending", true);

            TextureSortDescending = ContentFinder <Texture2D> .Get("EdB/PrepareCarefully/SortDescending", true);

            TextureTabAtlas = ContentFinder <Texture2D> .Get("UI/Widgets/TabAtlas", true);

            TextureAlternateRow = SolidColorMaterials.NewSolidColorTexture(new Color(1, 1, 1, 0.05f));
            TextureSkillBarFill = SolidColorMaterials.NewSolidColorTexture(new Color(1f, 1f, 1f, 0.1f));

            loaded = true;
        }
コード例 #21
0
        public static Texture2D getSolidColorTexture(Color color)
        {
            Texture2D tex;

            if (!cachedSolidColorTextures.TryGetValue(color, out tex))
            {
                tex = SolidColorMaterials.NewSolidColorTexture(color);
                cachedSolidColorTextures.Add(color, tex);
            }
            return(tex);
        }
コード例 #22
0
        private void DrawWarmup()
        {
            float height = 0.5f;
            float width  = 0.25f * (1 - abilityWarmUpTicks / (float)currentAbilityTicksTotal);
            //GenDraw.DrawCooldownCircle(this.Position.ToVector3Shifted() + new Vector3(0, 3f, 0), width);

            Vector3   s      = new Vector3(width, 10f, height);
            Matrix4x4 matrix = default(Matrix4x4);

            matrix.SetTRS(Position.ToVector3Shifted() + new Vector3(0, 3f, 0), Quaternion.identity, s);
            Graphics.DrawMesh(MeshPool.plane20, matrix, SolidColorMaterials.SimpleSolidColorMaterial(new Color(1f, 1f, 1f, 0.5f), false), 0);
        }
コード例 #23
0
        public void DrawLedLight()
        {
            MAD.DrawHelper.RectangleRequest r = default(MAD.DrawHelper.RectangleRequest);


            r.size = new Vector2(0.16f, 0.16f);

            if (this.powerComp.PowerOn)
            {
                if (this.IcookingTicking == 0)
                {
                    r.mat = SolidColorMaterials.SimpleSolidColorMaterial(new Color(0f, 0.8f, 0f));
                }
                else
                {
                    r.mat = SolidColorMaterials.SimpleSolidColorMaterial(new Color(0.8f, 0f, 0f));
                }
            }
            else
            {
                r.mat = SolidColorMaterials.SimpleSolidColorMaterial(new Color(0.6f, 0.6f, 0.6f));
            }


            Rot4 rotation2 = base.Rotation;

            rotation2.Rotate(RotationDirection.Clockwise);
            r.rotation = rotation2;

            if (r.rotation == Rot4.West) //North
            {
                r.rotation = Rot4.West;
                r.center   = this.DrawPos + Vector3.up * 0.1f + Vector3.forward * 0.08f;
            }
            if (r.rotation == Rot4.North) //East
            {
                r.rotation = Rot4.North;
                r.center   = this.DrawPos + Vector3.up * 0.1f + Vector3.right * 0.08f;
            }
            if (r.rotation == Rot4.East) //South
            {
                r.rotation = Rot4.East;
                r.center   = this.DrawPos + Vector3.up * 0.1f + Vector3.back * 0.08f;
            }
            if (r.rotation == Rot4.South) //West
            {
                r.rotation = Rot4.South;
                r.center   = this.DrawPos + Vector3.up * 0.1f + Vector3.left * 0.08f;
            }

            MAD.DrawHelper.DrawRectangle(r);
        }
コード例 #24
0
        static Resources()
        {
            Dark = new Color( 0f, 0f, 0f, .2f );
            Danger = new Color( 0.8f, 0f, 0f, .2f );

            Background_Dark = SolidColorMaterials.NewSolidColorTexture( Dark );
            Background_Danger = SolidColorMaterials.NewSolidColorTexture( Danger );
            CheckOnWhite = ContentFinder<Texture2D>.Get("UI/Icons/Animal/CheckOnWhite");
            Filter = ContentFinder<Texture2D>.Get( "UI/Icons/Filters/Filter" );
            Pregnant = ContentFinder<Texture2D>.Get("UI/Icons/Filters/Pregnant");
            Handling = ContentFinder<Texture2D>.Get( "UI/Icons/Filters/Training" );
            Egg = ContentFinder<Texture2D>.Get( "UI/Icons/Animal/Egg" );
        }
コード例 #25
0
        public void DrawSubField(Vector3 position, float shieldShieldRadius)
        {
            position += new Vector3(0.5f, 0.0f, 0.5f);
            Vector3   s      = new Vector3(shieldShieldRadius, 1f, shieldShieldRadius);
            Matrix4x4 matrix = new Matrix4x4();

            matrix.SetTRS(position, Quaternion.identity, s);
            if ((UnityEngine.Object) this.currentMatrialColour == (UnityEngine.Object)null)
            {
                this.currentMatrialColour = SolidColorMaterials.NewSolidColorMaterial(new Color(this.colourRed, this.colourGreen, this.colourBlue, 0.15f), ShaderDatabase.MetaOverlay);
            }
            UnityEngine.Graphics.DrawMesh(Enhanced_Defence.ShieldUtils.Graphics.CircleMesh, matrix, this.currentMatrialColour, 0);
        }
コード例 #26
0
        public override IEnumerable <Gizmo> GetGizmos()
        {
            string label = "AdamAbsorbDamageLabel".Translate().CapitalizeFirst();

            yield return(new GizmoAdamAbsorbLevel
            {
                label = label,
                labelColor = GetLabelColor(),
                aura = this,
                currentAbsorbedDamage = absorbedDamage,
                FullShieldBarTex = SolidColorMaterials.NewSolidColorTexture(GetColor())
            });
        }
コード例 #27
0
        // Note: this type is marked as 'beforefieldinit'.
        static InspectPaneFiller()
        {
            ColorInt colorInt = new ColorInt(26, 52, 52);

            InspectPaneFiller.MoodTex = SolidColorMaterials.NewSolidColorTexture(colorInt.ToColor);
            ColorInt colorInt2 = new ColorInt(10, 10, 10);

            InspectPaneFiller.BarBGTex = SolidColorMaterials.NewSolidColorTexture(colorInt2.ToColor);
            ColorInt colorInt3 = new ColorInt(35, 35, 35);

            InspectPaneFiller.HealthTex = SolidColorMaterials.NewSolidColorTexture(colorInt3.ToColor);
            InspectPaneFiller.debug_inspectStringExceptionErrored = false;
        }
コード例 #28
0
        protected override void FillWindow(Rect inRect)
        {
            base.FillWindow(inRect);
            GUI.BeginGroup(inRect);

            Rect titleBgRect = titleRect.ContractedBy(HalfMargin);

            //GUI.DrawTexture(titleBgRect, SolidColorMaterials.NewSolidColorTexture(Color.white));
            DrawTitleLabel(titleBgRect.ContractedBy(HalfMargin));

            Rect texturesBgRect = texturesRect.ContractedBy(HalfMargin);

            GUI.DrawTexture(texturesBgRect, SolidColorMaterials.NewSolidColorTexture(Color.black));
            DrawTextureChooser(texturesBgRect.ContractedBy(HalfMargin));

            Rect batteryBgRect = batteryRect.ContractedBy(HalfMargin);

            //GUI.DrawTexture(batteryBgRect, SolidColorMaterials.NewSolidColorTexture(Color.black));
            DrawBatteryChooser(batteryBgRect.ContractedBy(HalfMargin));

            Rect costListBgRect = costListRect.ContractedBy(HalfMargin);

            GUI.DrawTexture(costListBgRect, SolidColorMaterials.NewSolidColorTexture(Color.black));
            DrawCostList(costListBgRect.ContractedBy(HalfMargin));

            Rect saveLoadBgRect = saveLoadRect.ContractedBy(HalfMargin);

            //GUI.DrawTexture(saveLoadBgRect, SolidColorMaterials.NewSolidColorTexture(Color.black));
            DrawSaveLoadButton(saveLoadBgRect.ContractedBy(HalfMargin));

            Rect extrasBgRect = extrasRect.ContractedBy(HalfMargin);

            GUI.DrawTexture(extrasBgRect, SolidColorMaterials.NewSolidColorTexture(Color.black));
            DrawExtras(extrasBgRect.ContractedBy(HalfMargin));

            Rect baseWorkBgRect = baseWorkRect.ContractedBy(HalfMargin);

            GUI.DrawTexture(baseWorkBgRect, SolidColorMaterials.NewSolidColorTexture(Color.black));
            DrawBaseWorkChooser(baseWorkBgRect.ContractedBy(HalfMargin));

            Rect specialWorkBgRect = specialWorkRect.ContractedBy(HalfMargin);

            GUI.DrawTexture(specialWorkBgRect, SolidColorMaterials.NewSolidColorTexture(Color.black));
            DrawSpecialWorkChooser(specialWorkBgRect.ContractedBy(HalfMargin));

            powerRect = new Rect(inRect.xMax - 200f, inRect.height - 66f - 18f - 30f, 200f, 30f);
            GUI.DrawTexture(powerRect, SolidColorMaterials.NewSolidColorTexture(Color.black));
            DrawPowerRequirement(powerRect);

            GUI.EndGroup();
        }
コード例 #29
0
 internal static void PrepareReflection()
 {
     selectedMessageField = typeof(EditWindow_Log).GetField("selectedMessage", BindingFlags.NonPublic | BindingFlags.Static);
     if (selectedMessageField != null && selectedMessageField.FieldType != typeof(LogMessage))
     {
         selectedMessageField = null;
     }
     if (selectedMessageField == null)
     {
         HugsLibController.Logger.Error("Failed to reflect EditWindow_Log.selectedMessage");
     }
     LongEventHandler.ExecuteWhenFinished(() => lineTexture = SolidColorMaterials.NewSolidColorTexture(separatorLineColor));
     AddOwnWidgets();
 }
コード例 #30
0
        static InspectPaneFiller()
        {
            // Note: this type is marked as 'beforefieldinit'.
            ColorInt colorInt = new ColorInt(26, 52, 52);

            InspectPaneFiller.MoodTex = SolidColorMaterials.NewSolidColorTexture(colorInt.ToColor);
            ColorInt colorInt2 = new ColorInt(10, 10, 10);

            InspectPaneFiller.BarBGTex = SolidColorMaterials.NewSolidColorTexture(colorInt2.ToColor);
            ColorInt colorInt3 = new ColorInt(35, 35, 35);

            InspectPaneFiller.HealthTex = SolidColorMaterials.NewSolidColorTexture(colorInt3.ToColor);
            InspectPaneFiller.debug_inspectStringExceptionErrored = false;
        }