private void ItemCardStatus(HoverTextDrawer hoverTextDrawer, KSelectable kselectable3)
        {
            // 何故IEnumerable<Entry>を宣言してないのか???
            List <StatusItemGroup.Entry> entries = new List <StatusItemGroup.Entry>();

            foreach (StatusItemGroup.Entry entry in kselectable3.GetStatusItemGroup())
            {
                entries.Add(entry);
            }

            var a = entries.
                    Where((e) => __private_accessor.ShowStatusItemInCurrentOverlay(e.item)).
                    OrderBy((e) => e.category != null && e.category.Id != "Main" ? 0 : 1).
                    Take(SelectToolHoverTextCard.maxNumberOfDisplayedSelectableWarnings);

            foreach (StatusItemGroup.Entry entry in entries)
            {
                Sprite icon = entry.item.sprite?.sprite ?? __this.iconWarning;

                Color            color = __this.Styles_BodyText.Standard.textColor;
                TextStyleSetting style = __this.Styles_BodyText.Standard;
                if (__private_accessor.IsStatusItemWarning(entry))
                {
                    color = __this.HoverTextStyleSettings[1].textColor;
                    style = __this.HoverTextStyleSettings[1];
                }

                hoverTextDrawer.NewLine(26);
                hoverTextDrawer.DrawIcon(icon, color, 18, 2);
                hoverTextDrawer.DrawText(entry.GetName(), style);
            }
        }
        private void HeatflowCard(HoverTextDrawer hoverTextDrawer)
        {
            if (!Grid.Solid[cellPos] && isVisible)
            {
                float thermalComfort  = GameUtil.GetThermalComfort(cellPos, 0f);
                float thermalComfort2 = GameUtil.GetThermalComfort(cellPos, -0.08368001f);
                float num2            = 0f;

                string text = String.Empty;

                if (thermalComfort2 * 0.001f > -0.278933346f - num2 && thermalComfort2 * 0.001f < 0.278933346f + num2)
                {
                    text = UI.OVERLAYS.HEATFLOW.NEUTRAL;
                }
                else if (thermalComfort2 <= ExternalTemperatureMonitor.GetExternalColdThreshold(null))
                {
                    text = UI.OVERLAYS.HEATFLOW.COOLING;
                }
                else if (thermalComfort2 >= ExternalTemperatureMonitor.GetExternalWarmThreshold(null))
                {
                    text = UI.OVERLAYS.HEATFLOW.HEATING;
                }
                float dtu_s = 1f * thermalComfort;
                text = text + " (" + GameUtil.GetFormattedHeatEnergyRate(dtu_s, GameUtil.HeatEnergyFormatterUnit.Automatic) + ")";
                hoverTextDrawer.BeginShadowBar(false);
                hoverTextDrawer.DrawText(UI.OVERLAYS.HEATFLOW.HOVERTITLE, __this.Styles_BodyText.Standard);
                hoverTextDrawer.NewLine(26);
                hoverTextDrawer.DrawText(text, __this.Styles_BodyText.Standard);
                hoverTextDrawer.EndShadowBar();
            }
        }
Esempio n. 3
0
        /// <summary>
        /// Draws tool tips for selectable items in the sweep area.
        /// </summary>
        /// <param name="selected">The items which were found.</param>
        /// <param name="drawer">The renderer for hover card text.</param>
        private void DrawPickupText(IEnumerable <KSelectable> selected, HoverTextDrawer drawer)
        {
            var hoverInstance = HoverTextScreen.Instance;

            // For each pickupable object, show the type
            foreach (var obj in selected)
            {
                var cc = obj.GetComponent <Clearable>();
                var ec = obj.GetComponent <PrimaryElement>();
                // Ignore duplicants
                if (cc != null && cc.isClearable && ec != null && obj.GetComponent <
                        MinionIdentity>() == null)
                {
                    var element = ec.Element;
                    drawer.BeginShadowBar(false);
                    // Element name (uppercase)
                    drawer.DrawText(obj.GetProperName().ToUpper(), Styles_Title.Standard);
                    drawer.NewLine(26);
                    drawer.DrawIcon(hoverInstance.GetSprite("dash"), 18);
                    // Mass (kg, g, mg...)
                    drawer.DrawText(GameUtil.GetFormattedMass(ec.Mass), Styles_BodyText.
                                    Standard);
                    drawer.NewLine(26);
                    drawer.DrawIcon(hoverInstance.GetSprite("dash"), 18);
                    // Temperature
                    drawer.DrawText(GameUtil.GetFormattedTemperature(ec.Temperature),
                                    Styles_BodyText.Standard);
                    drawer.EndShadowBar();
                }
            }
        }
Esempio n. 4
0
        public override void UpdateHoverElements(List <KSelectable> hoveredObjects)
        {
            HoverTextScreen screenInstance = HoverTextScreen.Instance;
            HoverTextDrawer drawer         = screenInstance.BeginDrawing();

            drawer.BeginShadowBar();

            DrawTitle(screenInstance, drawer);
            drawer.NewLine();

            drawer.DrawIcon(screenInstance.GetSprite("icon_mouse_left"), 20);
            drawer.DrawText(UsingSnapshot ? BlueprintsStrings.STRING_BLUEPRINTS_SNAPSHOT_ACTION_CLICK : BlueprintsStrings.STRING_BLUEPRINTS_CREATE_ACTION_DRAG, Styles_Instruction.Standard);
            drawer.AddIndent(8);

            drawer.DrawIcon(screenInstance.GetSprite("icon_mouse_right"), 20);
            drawer.DrawText(BlueprintsStrings.STRING_BLUEPRINTS_SNAPSHOT_ACTION_BACK, Styles_Instruction.Standard);

            if (UsingSnapshot)
            {
                drawer.NewLine(32);
                drawer.DrawText(string.Format(BlueprintsStrings.STRING_BLUEPRINTS_SNAPSHOT_NEWSNAPSHOT, UI.FormatAsHotkey("[" + GameUtil.GetActionString(Integration.BlueprintsDeleteAction.GetKAction()) + "]")), Styles_Instruction.Standard);
            }

            drawer.EndShadowBar();
            drawer.EndDrawing();
        }
    public void ShowHoverTextOnHoveredItem(KSelectable hover_obj, HoverTextDrawer drawer, SelectToolHoverTextCard hover_text_card)
    {
        bool flag = false;

        foreach (Chore.Precondition.Context succeededContext in preconditionSnapshot.succeededContexts)
        {
            Chore.Precondition.Context current = succeededContext;
            if (current.chore.showAvailabilityInHoverText && !current.chore.target.isNull && !((UnityEngine.Object)current.chore.target.gameObject != (UnityEngine.Object)hover_obj.gameObject))
            {
                if (!flag)
                {
                    drawer.NewLine(26);
                    drawer.DrawText(DUPLICANTS.CHORES.PRECONDITIONS.HEADER.ToString().Replace("{Selected}", this.GetProperName()), hover_text_card.Styles_BodyText.Standard);
                    flag = true;
                }
                ShowHoverTextOnHoveredItem(current, hover_obj, drawer, hover_text_card);
            }
        }
        foreach (Chore.Precondition.Context failedContext in preconditionSnapshot.failedContexts)
        {
            Chore.Precondition.Context current2 = failedContext;
            if (current2.chore.showAvailabilityInHoverText && !current2.chore.target.isNull && !((UnityEngine.Object)current2.chore.target.gameObject != (UnityEngine.Object)hover_obj.gameObject))
            {
                if (!flag)
                {
                    drawer.NewLine(26);
                    drawer.DrawText(DUPLICANTS.CHORES.PRECONDITIONS.HEADER.ToString().Replace("{Selected}", this.GetProperName()), hover_text_card.Styles_BodyText.Standard);
                    flag = true;
                }
                ShowHoverTextOnHoveredItem(current2, hover_obj, drawer, hover_text_card);
            }
        }
    }
Esempio n. 6
0
    public override void UpdateHoverElements(List <KSelectable> selected)
    {
        HoverTextScreen instance        = HoverTextScreen.Instance;
        HoverTextDrawer hoverTextDrawer = instance.BeginDrawing();

        hoverTextDrawer.BeginShadowBar(false);
        switch (currentReqState)
        {
        case PlanScreen.RequirementsState.Materials:
        case PlanScreen.RequirementsState.Complete:
            hoverTextDrawer.DrawText(UI.TOOLTIPS.NOMATERIAL.text.ToUpper(), HoverTextStyleSettings[0]);
            hoverTextDrawer.NewLine(26);
            hoverTextDrawer.DrawText(UI.TOOLTIPS.SELECTAMATERIAL, HoverTextStyleSettings[1]);
            break;

        case PlanScreen.RequirementsState.Tech:
        {
            TechItem techItem   = Db.Get().TechItems.Get(currentDef.PrefabID);
            Tech     parentTech = techItem.parentTech;
            hoverTextDrawer.DrawText(string.Format(UI.PRODUCTINFO_RESEARCHREQUIRED, parentTech.Name).ToUpper(), HoverTextStyleSettings[0]);
            break;
        }
        }
        hoverTextDrawer.NewLine(26);
        hoverTextDrawer.DrawIcon(instance.GetSprite("icon_mouse_right"), 18);
        hoverTextDrawer.DrawText(backStr, Styles_Instruction.Standard);
        hoverTextDrawer.EndShadowBar();
        hoverTextDrawer.EndDrawing();
    }
Esempio n. 7
0
        public override void UpdateHoverElements(List <KSelectable> hoveredObjects)
        {
            HoverTextScreen screenInstance = HoverTextScreen.Instance;
            HoverTextDrawer drawer         = screenInstance.BeginDrawing();

            drawer.BeginShadowBar(false);

            DrawTitle(screenInstance, drawer);
            drawer.NewLine(26);

            drawer.DrawIcon(screenInstance.GetSprite("icon_mouse_left"), 20);
            drawer.DrawText(UsingSnapshot ? Strings.Get(BlueprintsStrings.STRING_BLUEPRINTS_SNAPSHOT_ACTION_CLICK) : Strings.Get(BlueprintsStrings.STRING_BLUEPRINTS_CREATE_ACTION_DRAG), Styles_Instruction.Standard);
            drawer.AddIndent(8);

            drawer.DrawIcon(screenInstance.GetSprite("icon_mouse_right"), 20);
            drawer.DrawText(Strings.Get(BlueprintsStrings.STRING_BLUEPRINTS_SNAPSHOT_ACTION_BACK), Styles_Instruction.Standard);

            if (UsingSnapshot)
            {
                drawer.NewLine(32);
                drawer.DrawText(string.Format(Strings.Get(BlueprintsStrings.STRING_BLUEPRINTS_SNAPSHOT_NEWSNAPSHOT), BlueprintsAssets.BLUEPRINTS_KEYBIND_SNAPSHOT_NEWSNAPSHOT.GetStringFormatted()), Styles_Instruction.Standard);
            }

            drawer.EndShadowBar();
            drawer.EndDrawing();
        }
Esempio n. 8
0
 /// <summary>
 /// Draws tool tips for selectable items in the sweep area.
 /// </summary>
 /// <param name="selected">The items which were found.</param>
 /// <param name="drawer">The renderer for hover card text.</param>
 /// <param name="dash">The dash sprite.</param>
 private void DrawPickupText(IEnumerable <KSelectable> selected, HoverTextDrawer drawer,
                             Sprite dash)
 {
     // For each pickupable object, show the type
     foreach (var selectable in selected)
     {
         var cc = selectable.GetComponent <Clearable>();
         var ec = selectable.GetComponent <PrimaryElement>();
         // Ignore Duplicants
         if (cc != null && cc.isClearable && ec != null && selectable.GetComponent <
                 MinionIdentity>() == null)
         {
             drawer.BeginShadowBar(false);
             // Element name (uppercase)
             drawer.DrawText(GameUtil.GetUnitFormattedName(selectable.gameObject, true),
                             Styles_Title.Standard);
             drawer.NewLine();
             drawer.DrawIcon(dash);
             // Mass (kg, g, mg...)
             drawer.DrawText(GameUtil.GetFormattedMass(ec.Mass), Styles_Values.Property.
                             Standard);
             drawer.NewLine();
             drawer.DrawIcon(dash);
             // Temperature
             drawer.DrawText(GameUtil.GetFormattedTemperature(ec.Temperature),
                             Styles_BodyText.Standard);
             drawer.EndShadowBar();
         }
     }
 }
        private void LogicCard(HoverTextDrawer hoverTextDrawer, List <KSelectable> hoverObjects)
        {
            foreach (KSelectable kselectable2 in hoverObjects)
            {
                LogicPorts ports      = kselectable2.GetComponent <LogicPorts>();
                string     properName = kselectable2.GetProperName().ToUpper();

                if (ports != null)
                {
                    LogicPorts.Port port;
                    bool            portIsInput;
                    if (ports.TryGetPortAtCell(cellPos, out port, out portIsInput))
                    {
                        LogicCardPort(hoverTextDrawer, properName, ports, port, portIsInput);
                    }
                }

                LogicGate            gates = kselectable2.GetComponent <LogicGate>();
                LogicGateBase.PortId portId;
                if (gates != null && gates.TryGetPortAtCell(cellPos, out portId))
                {
                    LogicCardGate(hoverTextDrawer, properName, gates, portId);
                }
            }
        }
Esempio n. 10
0
        public override void UpdateHoverElements(List <KSelectable> hoveredObjects)
        {
            HoverTextScreen screenInstance = HoverTextScreen.Instance;
            HoverTextDrawer drawer         = screenInstance.BeginDrawing();

            drawer.BeginShadowBar(false);

            DrawTitle(screenInstance, drawer);
            drawer.NewLine(26);

            drawer.DrawIcon(screenInstance.GetSprite("icon_mouse_left"), 20);
            drawer.DrawText(UsingSnapshot ? "CLICK" : "DRAG", Styles_Instruction.Standard);
            drawer.AddIndent(8);

            drawer.DrawIcon(screenInstance.GetSprite("icon_mouse_right"), 20);
            drawer.DrawText("BACK", Styles_Instruction.Standard);

            if (UsingSnapshot)
            {
                drawer.NewLine(32);
                drawer.DrawText(BlueprintsAssets.BLUEPRINTS_STRING_DELETESNAPSHOT, Styles_Instruction.Standard);
            }

            drawer.EndShadowBar();
            drawer.EndDrawing();
        }
 private void MiscCardExposedToSpace(HoverTextDrawer hoverTextDrawer)
 {
     if (CellSelectionObject.IsExposedToSpace(cellPos))
     {
         hoverTextDrawer.NewLine(26);
         hoverTextDrawer.DrawIcon(__this.iconDash, 18);
         hoverTextDrawer.DrawText(MISC.STATUSITEMS.SPACE.NAME, __this.Styles_BodyText.Standard);
     }
 }
 private void MiscCardDisease(HoverTextDrawer hoverTextDrawer)
 {
     if (Grid.DiseaseCount[cellPos] > 0 || modeIsDisease)
     {
         hoverTextDrawer.NewLine(26);
         hoverTextDrawer.DrawIcon(__this.iconDash, 18);
         hoverTextDrawer.DrawText(GameUtil.GetFormattedDisease(Grid.DiseaseIdx[cellPos], Grid.DiseaseCount[cellPos], true), __this.Styles_Values.Property.Standard);
     }
 }
 private void MiscCardEntombedItem(HoverTextDrawer hoverTextDrawer)
 {
     if (Game.Instance.GetComponent <EntombedItemVisualizer>().IsEntombedItem(cellPos))
     {
         hoverTextDrawer.NewLine(26);
         hoverTextDrawer.DrawIcon(__this.iconDash, 18);
         hoverTextDrawer.DrawText(MISC.STATUSITEMS.BURIEDITEM.NAME, __this.Styles_BodyText.Standard);
     }
 }
 private void DrawKiloDTU(HoverTextDrawer hoverTextDrawer, float dtu)
 {
     if (CurrentMode == OverlayModes.Temperature.ID && dtu > 0.0f)
     {
         hoverTextDrawer.NewLine(26);
         hoverTextDrawer.DrawIcon(__this.iconDash, 18);
         hoverTextDrawer.DrawText(Mathf.Round(dtu / 100.0f) / 10.0f + "k DTU", __this.Styles_BodyText.Standard);
     }
 }
        private void MiscCardElementCategory(HoverTextDrawer hoverTextDrawer)
        {
            Element element = Grid.Element[cellPos];

            if (!element.IsVacuum)
            {
                hoverTextDrawer.NewLine(26);
                hoverTextDrawer.DrawIcon(__this.iconDash, 18);
                hoverTextDrawer.DrawText(ElementLoader.elements[(int)Grid.ElementIdx[cellPos]].GetMaterialCategoryTag().ProperName(), __this.Styles_BodyText.Standard);
            }
        }
        private void LogicCardPort(HoverTextDrawer hoverTextDrawer, string properName, LogicPorts ports, LogicPorts.Port port, bool isInput)
        {
            hoverTextDrawer.BeginShadowBar(false);

            LocString defaultName;
            int       portState;
            string    fmt;

            if (isInput)
            {
                defaultName = UI.LOGIC_PORTS.PORT_INPUT_DEFAULT_NAME;
                portState   = ports.GetInputValue(port.id);
                fmt         = UI.TOOLS.GENERIC.LOGIC_INPUT_HOVER_FMT;
            }
            else
            {
                defaultName = UI.LOGIC_PORTS.PORT_OUTPUT_DEFAULT_NAME;
                portState   = ports.GetOutputValue(port.id);
                fmt         = UI.TOOLS.GENERIC.LOGIC_OUTPUT_HOVER_FMT;
            }
            string desc = port.displayCustomName ? port.description : defaultName.text;

            hoverTextDrawer.DrawText(fmt.Replace("{Port}", desc.ToUpper()).Replace("{Name}", properName), __this.Styles_BodyText.Standard);
            hoverTextDrawer.NewLine(26);

            bool             portConnected = ports.IsPortConnected(port.id);
            TextStyleSetting textStyleSetting;

            if (portConnected)
            {
                textStyleSetting = ((portState == 1) ? __this.Styles_LogicActive.Selected : __this.Styles_LogicSignalInactive);
            }
            else
            {
                textStyleSetting = __this.Styles_LogicActive.Standard;
            }
            hoverTextDrawer.DrawIcon((portState == 1 && portConnected) ? __this.iconActiveAutomationPort : __this.iconDash, textStyleSetting.textColor, 18, 2);
            hoverTextDrawer.DrawText(port.activeDescription, textStyleSetting);
            hoverTextDrawer.NewLine(26);

            TextStyleSetting textStyleSetting2;

            if (portConnected)
            {
                textStyleSetting2 = ((portState == 0) ? __this.Styles_LogicStandby.Selected : __this.Styles_LogicSignalInactive);
            }
            else
            {
                textStyleSetting2 = __this.Styles_LogicStandby.Standard;
            }
            hoverTextDrawer.DrawIcon((portState == 0 && portConnected) ? __this.iconActiveAutomationPort : __this.iconDash, textStyleSetting2.textColor, 18, 2);
            hoverTextDrawer.DrawText(port.inactiveDescription, textStyleSetting2);
            hoverTextDrawer.EndShadowBar();
        }
        private void ItemCardBasic(HoverTextDrawer hoverTextDrawer, KSelectable kselectable3)
        {
            PrimaryElement primaryElement = kselectable3.GetComponent <PrimaryElement>();
            string         text12         = GameUtil.GetUnitFormattedName(kselectable3.gameObject, true);

            if (primaryElement != null && kselectable3.GetComponent <Building>() != null)
            {
                text12 = StringFormatter.Replace(StringFormatter.Replace(UI.TOOLS.GENERIC.BUILDING_HOVER_NAME_FMT, "{Name}", text12), "{Element}", primaryElement.Element.nameUpperCase);
            }
            hoverTextDrawer.DrawText(text12, __this.Styles_BodyText.Standard);
        }
    protected void DrawInstructions(HoverTextScreen screen, HoverTextDrawer drawer)
    {
        TextStyleSetting standard = Styles_Instruction.Standard;

        drawer.NewLine(26);
        drawer.DrawIcon(screen.GetSprite("icon_mouse_left"), 20);
        drawer.DrawText(ActionName, standard);
        drawer.AddIndent(8);
        drawer.DrawIcon(screen.GetSprite("icon_mouse_right"), 20);
        drawer.DrawText(backStr, standard);
    }
    public virtual void UpdateHoverElements(List <KSelectable> hover_objects)
    {
        HoverTextScreen instance        = HoverTextScreen.Instance;
        HoverTextDrawer hoverTextDrawer = instance.BeginDrawing();

        hoverTextDrawer.BeginShadowBar(false);
        DrawTitle(instance, hoverTextDrawer);
        DrawInstructions(HoverTextScreen.Instance, hoverTextDrawer);
        hoverTextDrawer.EndShadowBar();
        hoverTextDrawer.EndDrawing();
    }
        private void ItemCard(HoverTextDrawer hoverTextDrawer, KSelectable kselectable3, bool selected)
        {
            hoverTextDrawer.BeginShadowBar(selected);

            ItemCardBasic(hoverTextDrawer, kselectable3);
            ItemCardDisease(hoverTextDrawer, kselectable3);
            ItemCardStatus(hoverTextDrawer, kselectable3);
            ItemCardThermal(hoverTextDrawer, kselectable3);
            ItemCardLightingForChore(hoverTextDrawer, kselectable3);

            hoverTextDrawer.EndShadowBar();
        }
        // EffectorEntry
        private void DecorCardEntry(HoverTextDrawer hoverTextDrawer, EffectorEntry entry)
        {
            string text = string.Empty;

            if (entry.count > 1)
            {
                text = string.Format(UI.OVERLAYS.DECOR.COUNT, entry.count);
            }
            text = string.Format(UI.OVERLAYS.DECOR.ENTRY, GameUtil.GetFormattedDecor(entry.value, false), entry.name, text);

            hoverTextDrawer.DrawIcon(__this.iconDash, 18);
            hoverTextDrawer.DrawText(text, __this.Styles_BodyText.Standard);
        }
        private void DecorCard(HoverTextDrawer hoverTextDrawer)
        {
            float decorAtCell = GameUtil.GetDecorAtCell(cellPos);

            hoverTextDrawer.BeginShadowBar(false);
            hoverTextDrawer.DrawText(UI.OVERLAYS.DECOR.HOVERTITLE, __this.Styles_BodyText.Standard);
            hoverTextDrawer.NewLine(26);
            hoverTextDrawer.DrawText(UI.OVERLAYS.DECOR.TOTAL + GameUtil.GetFormattedDecor(decorAtCell, true), __this.Styles_BodyText.Standard);

            if (!Grid.Solid[cellPos] && isVisible)
            {
                DecorCardDetail(hoverTextDrawer);
            }
            hoverTextDrawer.EndShadowBar();
        }
Esempio n. 23
0
        /// <summary>
        /// Called when thermal information needs to be displayed for buildings and other
        /// items in game (like debris).
        /// </summary>
        private static void AddThermalInfoEntities(HoverTextDrawer drawer, string _,
                                                   TextStyleSetting style)
        {
            var instance       = ThermalTooltipsPatches.TooltipInstance;
            var primaryElement = instance?.PrimaryElement;

            if (primaryElement != null)
            {
                float mass = GetAdjustedMass(primaryElement.gameObject, primaryElement.Mass);
                instance.Drawer = drawer;
                instance.Style  = style;
                instance.DisplayThermalInfo(primaryElement.Element, primaryElement.Temperature,
                                            mass);
                instance.PrimaryElement = null;
            }
        }
        private void MiscCardMass(HoverTextDrawer hoverTextDrawer)
        {
            Element element = Grid.Element[cellPos];

            string[] array = WorldInspector.MassStringsReadOnly(cellPos);
            hoverTextDrawer.NewLine(26);
            hoverTextDrawer.DrawIcon(__this.iconDash, 18);
            // キャッシュ済みのGetBreathableString的なモノを出す。
            for (int m = 0; m < array.Length; m++)
            {
                if (m >= 3 || !element.IsVacuum)
                {
                    hoverTextDrawer.DrawText(array[m], __this.Styles_BodyText.Standard);
                }
            }
        }
Esempio n. 25
0
    public override void UpdateHoverElements(List <KSelectable> selected)
    {
        int num = Grid.PosToCell(Camera.main.ScreenToWorldPoint(KInputManager.GetMousePos()));

        if (Grid.IsValidCell(num))
        {
            HoverTextScreen instance        = HoverTextScreen.Instance;
            HoverTextDrawer hoverTextDrawer = instance.BeginDrawing();
            hoverTextDrawer.BeginShadowBar(false);
            if (Grid.IsVisible(num))
            {
                DrawTitle(instance, hoverTextDrawer);
                DrawInstructions(HoverTextScreen.Instance, hoverTextDrawer);
                Element element = Grid.Element[num];
                bool    flag    = false;
                if (Grid.Solid[num] && Diggable.IsDiggable(num))
                {
                    flag = true;
                }
                if (flag)
                {
                    hoverTextDrawer.NewLine(26);
                    hoverTextDrawer.DrawText(element.nameUpperCase, Styles_Title.Standard);
                    hoverTextDrawer.NewLine(26);
                    hoverTextDrawer.DrawIcon(instance.GetSprite("dash"), 18);
                    hoverTextDrawer.DrawText(element.GetMaterialCategoryTag().ProperName(), Styles_BodyText.Standard);
                    hoverTextDrawer.NewLine(26);
                    hoverTextDrawer.DrawIcon(instance.GetSprite("dash"), 18);
                    string[] array = WorldInspector.MassStringsReadOnly(num);
                    hoverTextDrawer.DrawText(array[0], Styles_Values.Property.Standard);
                    hoverTextDrawer.DrawText(array[1], Styles_Values.Property_Decimal.Standard);
                    hoverTextDrawer.DrawText(array[2], Styles_Values.Property.Standard);
                    hoverTextDrawer.DrawText(array[3], Styles_Values.Property.Standard);
                    hoverTextDrawer.NewLine(26);
                    hoverTextDrawer.DrawIcon(instance.GetSprite("dash"), 18);
                    hoverTextDrawer.DrawText(GameUtil.GetHardnessString(Grid.Element[num], true), Styles_BodyText.Standard);
                }
            }
            else
            {
                hoverTextDrawer.DrawIcon(instance.GetSprite("iconWarning"), 18);
                hoverTextDrawer.DrawText(UI.TOOLS.GENERIC.UNKNOWN, Styles_BodyText.Standard);
            }
            hoverTextDrawer.EndShadowBar();
            hoverTextDrawer.EndDrawing();
        }
    }
        public override void UpdateHoverElements(List <KSelectable> hoveredObjects)
        {
            HoverTextScreen screenInstance = HoverTextScreen.Instance;
            HoverTextDrawer drawer         = screenInstance.BeginDrawing();

            drawer.BeginShadowBar(false);

            DrawTitle(screenInstance, drawer);
            drawer.NewLine(26);

            drawer.DrawIcon(screenInstance.GetSprite("icon_mouse_left"), 20);
            drawer.DrawText(Strings.Get(BlueprintsStrings.STRING_BLUEPRINTS_USE_ACTION_CLICK), Styles_Instruction.Standard);
            drawer.AddIndent(8);

            drawer.DrawIcon(screenInstance.GetSprite("icon_mouse_right"), 20);
            drawer.DrawText(Strings.Get(BlueprintsStrings.STRING_BLUEPRINTS_USE_ACTION_BACK), Styles_Instruction.Standard);
            drawer.NewLine(32);

            if (BlueprintsState.LoadedBlueprints.Count > 0)
            {
                drawer.DrawText(string.Format(Strings.Get(BlueprintsStrings.STRING_BLUEPRINTS_USE_CYCLEBLUEPRINTS), Utilities.GetKeyCodeString(BlueprintsAssets.BLUEPRINTS_KEYBIND_USE_CYCLELEFT), Utilities.GetKeyCodeString(BlueprintsAssets.BLUEPRINTS_KEYBIND_USE_CYCLERIGHT)), Styles_Instruction.Standard);
                drawer.NewLine(20);

                drawer.DrawText(string.Format(Strings.Get(BlueprintsStrings.STRING_BLUEPRINTS_USE_NAMEBLUEPRINT), Utilities.GetKeyCodeString(BlueprintsAssets.BLUEPRINTS_KEYBIND_USE_RENAME)), Styles_Instruction.Standard);
                drawer.NewLine(20);

                drawer.DrawText(string.Format(Strings.Get(BlueprintsStrings.STRING_BLUEPRINTS_USE_DELETEBLUEPRINT), Utilities.GetKeyCodeString(BlueprintsAssets.BLUEPRINTS_KEYBIND_USE_DELETE)), Styles_Instruction.Standard);

                if (PrefabErrorCount > 0)
                {
                    drawer.NewLine(32);
                    drawer.DrawIcon(screenInstance.GetSprite("iconWarning"), 18);
                    drawer.DrawText(string.Format(Strings.Get(BlueprintsStrings.STRING_BLUEPRINTS_USE_ERRORMESSAGE), PrefabErrorCount), Styles_Instruction.Selected);
                }

                drawer.NewLine(32);
                drawer.DrawText(string.Format(Strings.Get(BlueprintsStrings.STRING_BLUEPRINTS_USE_SELECTEDBLUEPRINT), BlueprintsState.SelectedBlueprint.FriendlyName, BlueprintsState.SelectedBlueprintIndex + 1, BlueprintsState.LoadedBlueprints.Count), Styles_Instruction.Standard);
            }

            else
            {
                drawer.DrawText(Strings.Get(BlueprintsStrings.STRING_BLUEPRINTS_USE_NOBLUEPRINTS), Styles_Instruction.Standard);
            }

            drawer.EndShadowBar();
            drawer.EndDrawing();
        }
Esempio n. 27
0
    public override void UpdateHoverElements(List <KSelectable> selected)
    {
        ToolParameterMenu toolParameterMenu = ToolMenu.Instance.toolParameterMenu;
        string            lastEnabledFilter = toolParameterMenu.GetLastEnabledFilter();
        HoverTextScreen   instance          = HoverTextScreen.Instance;
        HoverTextDrawer   hoverTextDrawer   = instance.BeginDrawing();

        hoverTextDrawer.BeginShadowBar(false);
        DrawTitle(instance, hoverTextDrawer);
        DrawInstructions(HoverTextScreen.Instance, hoverTextDrawer);
        if (lastEnabledFilter != null && lastEnabledFilter != lastUpdatedFilter)
        {
            ConfigureTitle(instance);
        }
        hoverTextDrawer.EndShadowBar();
        hoverTextDrawer.EndDrawing();
    }
Esempio n. 28
0
 public static void Postfix(SelectToolHoverTextCard __instance, List <KSelectable> hoverObjects)
 {
     foreach (KSelectable selectable in hoverObjects)
     {
         Notepad pad = selectable.gameObject.GetComponent <Notepad>();
         if (pad != null)
         {
             HoverTextScreen instance = HoverTextScreen.Instance;
             HoverTextDrawer hover    = instance.BeginDrawing();
             hover.BeginShadowBar();
             hover.DrawIcon(Assets.GetSprite("icon_category_furniture"), 20);
             hover.DrawText(pad.activateText, __instance.ToolTitleTextStyle);
             hover.EndShadowBar();
             hover.EndDrawing();
         }
     }
 }
Esempio n. 29
0
        /// <summary>
        /// Adds the coordinates and cell number to the select tool.
        /// </summary>
        private static HoverTextDrawer DrawCoordinates(HoverTextDrawer drawer,
                                                       HoverTextConfiguration instance)
        {
            int cell = Grid.PosToCell(Camera.main.ScreenToWorldPoint(
                                          KInputManager.GetMousePos()));

            if (Grid.IsValidCell(cell))
            {
                Grid.CellToXY(cell, out int x, out int y);
                drawer.BeginShadowBar();
                drawer.DrawText(string.Format(DebugNotIncludedStrings.UI.TOOLTIPS.DNI_CELL,
                                              cell, x, y), instance.Styles_BodyText.Standard);
                drawer.EndShadowBar();
            }

            return(drawer);
        }
Esempio n. 30
0
        private static void DrawUnreachableCard(SelectToolHoverTextCard instance, List <KSelectable> overlayValidHoverObjects)
        {
            if (overlayValidHoverObjects.Count > 0)
            {
                StatusItem unreachable = Db.Get().MiscStatusItems.PickupableUnreachable;

                if (overlayValidHoverObjects.Any(x => x.HasStatusItem(unreachable)))
                {
                    HoverTextDrawer drawer = HoverTextScreen.Instance.drawer;

                    drawer.BeginShadowBar();
                    drawer.DrawIcon(unreachable.sprite.sprite, instance.Styles_BodyText.Standard.textColor, 18, -6);
                    drawer.AddIndent(8);
                    drawer.DrawText(unreachable.Name.ToUpper(), instance.Styles_Title.Standard);
                    drawer.EndShadowBar();
                }
            }
        }