[Solved] Custom Panel GUI Text

Started by Argain, August 10, 2014, 01:56:35 PM

Previous topic - Next topic

Argain

Is there a way to make custom text appear on the GUI Panel of a building?

Haplo

#1
You mean there where the power consumption and such is shown?
If so, then yes. You can override the function GetInspectionString() to show your string.

Here is an example from one of my mods:

        public override string GetInspectString()
        {
            StringBuilder stringBuilder = new StringBuilder();
            stringBuilder.Append(base.GetInspectString());

            stringBuilder.AppendLine();
            stringBuilder.Append(txtMetal + " " + countMetal.ToString() + " / " + maxMetalCount.ToString());
            stringBuilder.Append("  ");
            stringBuilder.Append(txtSilver + " " + countSilver.ToString() + " / " + maxSilverCount.ToString());

            if (productionActive)
                stringBuilder.Append(" " + txtProductionRunningSign + " " + counterUsingMetalSilver.ToString());

            return stringBuilder.ToString();
        }

Argain

Perfect! Is there a way to make the panel bigger? A bunch of the text on the bottom gets covered up :-\

Haplo

I don't know, if it's possible. My guess is, that it's hardcoded. But to be honest, I don't know.
For my mods I had to be rather creative, because you only have five lines to fill up and two or three are often already filled by the base call..
You might do the info of the base call yourself, to make it less big.