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);
                }
            }
        }
Example #2
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();
        }
    }
        private void DrawTextCard()
        {
            int cell = Grid.PosToCell(Camera.main.ScreenToWorldPoint(KInputManager.GetMousePos()));

            if (!Grid.IsValidCell(cell))
            {
                return;
            }

            HoverTextScreen screen = HoverTextScreen.Instance;
            Sprite          dash   = screen.GetSprite("dash");

            HoverTextDrawer txt = screen.BeginDrawing();

            txt.BeginShadowBar();

            if (!Grid.IsVisible(cell))
            {
                txt.DrawIcon(screen.GetSprite("iconWarning"));
                txt.DrawText(UI.TOOLS.GENERIC.UNKNOWN, Styles_BodyText.Standard);
            }
            else
            {
                DrawTitle(screen, txt);
                DrawInstructions(screen, txt);

                var standard = Styles_BodyText.Standard;
                if (!InspectTool.Instance.Dragging)
                {
                    var element = ElementInfo.FromCellNumber(cell);

                    txt.NewLine();
                    txt.DrawText(element.NameUppercase, ToolTitleTextStyle);

                    txt.NewLine();
                    txt.DrawIcon(dash);
                    txt.DrawText(element.Category, standard);

                    txt.NewLine();
                    txt.DrawIcon(dash);
                    string[] array = WorldInspector.MassStringsReadOnly(cell);
                    txt.DrawText(array[0], Styles_Values.Property.Standard);
                    txt.DrawText(array[1], Styles_Values.Property_Decimal.Standard);
                    txt.DrawText(array[2], Styles_Values.Property.Standard);
                    txt.DrawText(array[3], Styles_Values.Property.Standard);

                    txt.NewLine();
                    txt.DrawIcon(dash);
                    txt.DrawText(GameUtil.GetFormattedTemperature(element.Temperature), standard);

                    txt.NewLine();
                    txt.DrawIcon(dash);
                    txt.DrawText(element.GetFormattedTotalRelativeHeat(InspectToolSettings.Instance.RelativeTemp), standard);

                    if (Grid.Solid[cell] && Diggable.IsDiggable(cell))
                    {
                        txt.NewLine();
                        txt.DrawIcon(dash);
                        txt.DrawText(GameUtil.GetHardnessString(Grid.Element[cell]), standard);
                    }
                }
                else
                {
                    txt.NewLine();
                    txt.DrawText(((string)InspectToolStrings.HOVER_TEXT_TITLE).ToUpper(), ToolTitleTextStyle);

                    var elements = ElementInspector.ElementData;
                    if (elements != null && elements.Length > 0)
                    {
                        foreach (var e in elements)
                        {
                            txt.NewLine();
                            txt.DrawIcon(dash);
                            txt.DrawText(e, standard);
                        }
                    }
                    else
                    {
                        txt.NewLine();
                        txt.DrawText(InspectToolStrings.HOVER_TEXT_NO_ELEMENTS, standard);
                    }
                }
            }

            txt.EndShadowBar();
            txt.EndDrawing();
        }