Commit 0188a6baea52d03e56beb78a28206e00b0c4ff02

Authored by Mumfrey
1 parent f140ce29

LiteLoader 1.6.4_02 - experimental - ConfigPanel shows "<ModName> Settings" as p…

…anel title if mod returns null panel title
java/com/mumfrey/liteloader/gui/GuiConfigPanelContainer.java
... ... @@ -101,6 +101,15 @@ public class GuiConfigPanelContainer extends Gui implements ConfigPanelHost
101 101 this.mod = mod;
102 102 }
103 103  
  104 + /**
  105 + * @return
  106 + */
  107 + protected String getPanelTitle()
  108 + {
  109 + String panelTitle = this.panel.getPanelTitle();
  110 + return panelTitle != null ? panelTitle : String.format("%s Settings", this.mod.getName());
  111 + }
  112 +
104 113 /* (non-Javadoc)
105 114 * @see com.mumfrey.liteloader.modconfig.ConfigPanelHost#getMod()
106 115 */
... ... @@ -195,11 +204,7 @@ public class GuiConfigPanelContainer extends Gui implements ConfigPanelHost
195 204 this.panelTop = TOP - this.scrollBar.getValue();
196 205  
197 206 // Draw panel title
198   - String panelTitle = this.panel.getPanelTitle();
199   - if (panelTitle != null)
200   - {
201   - this.mc.fontRenderer.drawString(panelTitle, MARGIN, TOP - 14, 0xFFFFFFFF);
202   - }
  207 + this.mc.fontRenderer.drawString(this.getPanelTitle(), MARGIN, TOP - 14, 0xFFFFFFFF);
203 208  
204 209 // Draw top and bottom horizontal bars
205 210 drawRect(MARGIN, TOP - 4, this.width - MARGIN, TOP - 3, 0xFF999999);
... ...