mirror of
https://github.com/MinecraftForge/MinecraftForge.git
synced 2026-11-16 18:45:09 +00:00
Starting work on the actual GUI. Still work to do. Needs an API.
This commit is contained in:
1 parent
b3f98d1ee0
commit
cdd9d92a4f
7 files changed
+158
-5
No files matched your search
@@ -1,13 +1,31 @@
|
||||
--- ../src-base/minecraft/net/minecraft/client/gui/GuiIngameMenu.java
|
||||
+++ ../src-work/minecraft/net/minecraft/client/gui/GuiIngameMenu.java
|
||||
@@ -29,8 +29,9 @@
|
||||
@@ -1,5 +1,6 @@
|
||||
package net.minecraft.client.gui;
|
||||
|
||||
+import cpw.mods.fml.client.FMLClientHandler;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import net.minecraft.client.gui.achievement.GuiAchievements;
|
||||
@@ -29,8 +30,9 @@
|
||||
|
||||
this.field_146292_n.add(new GuiButton(4, this.field_146294_l / 2 - 100, this.field_146295_m / 4 + 24 + b0, I18n.func_135052_a("menu.returnToGame", new Object[0])));
|
||||
this.field_146292_n.add(new GuiButton(0, this.field_146294_l / 2 - 100, this.field_146295_m / 4 + 96 + b0, 98, 20, I18n.func_135052_a("menu.options", new Object[0])));
|
||||
+ this.field_146292_n.add(new GuiButton(12, this.field_146294_l / 2 + 2, this.field_146295_m / 4 + 96 + b0, 98, 20, "Mod Options"));
|
||||
+ this.field_146292_n.add(new GuiButton(12, this.field_146294_l / 2 + 2, this.field_146295_m / 4 + 96 + b0, 98, 20, "Mod Options..."));
|
||||
GuiButton guibutton;
|
||||
- this.field_146292_n.add(guibutton = new GuiButton(7, this.field_146294_l / 2 + 2, this.field_146295_m / 4 + 96 + b0, 98, 20, I18n.func_135052_a("menu.shareToLan", new Object[0])));
|
||||
+ this.field_146292_n.add(guibutton = new GuiButton(7, this.field_146294_l / 2 - 100, this.field_146295_m / 4 + 72 + b0, 200, 20, I18n.func_135052_a("menu.shareToLan", new Object[0])));
|
||||
this.field_146292_n.add(new GuiButton(5, this.field_146294_l / 2 - 100, this.field_146295_m / 4 + 48 + b0, 98, 20, I18n.func_135052_a("gui.achievements", new Object[0])));
|
||||
this.field_146292_n.add(new GuiButton(6, this.field_146294_l / 2 + 2, this.field_146295_m / 4 + 48 + b0, 98, 20, I18n.func_135052_a("gui.stats", new Object[0])));
|
||||
guibutton.field_146124_l = this.field_146297_k.func_71356_B() && !this.field_146297_k.func_71401_C().func_71344_c();
|
||||
@@ -64,6 +66,10 @@
|
||||
break;
|
||||
case 7:
|
||||
this.field_146297_k.func_147108_a(new GuiShareToLan(this));
|
||||
+ break;
|
||||
+ case 12:
|
||||
+ FMLClientHandler.instance().showInGameModOptions(this);
|
||||
+ break;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -20,6 +20,7 @@ import java.util.Map.Entry;
|
||||
import java.util.logging.Logger;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.entity.EntityClientPlayerMP;
|
||||
import net.minecraft.client.gui.GuiIngameMenu;
|
||||
import net.minecraft.client.gui.GuiScreen;
|
||||
import net.minecraft.client.gui.GuiSelectWorld;
|
||||
import net.minecraft.client.multiplayer.WorldClient;
|
||||
@@ -508,4 +509,9 @@ public class FMLClientHandler implements IFMLSidedHandler
|
||||
{
|
||||
selectWorldGUI.func_146615_e(selectedIndex);
|
||||
}
|
||||
|
||||
public void showInGameModOptions(GuiIngameMenu guiIngameMenu)
|
||||
{
|
||||
showGuiScreen(new GuiIngameModOptions(guiIngameMenu));
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,55 @@
|
||||
package cpw.mods.fml.client;
|
||||
|
||||
import net.minecraft.client.gui.FontRenderer;
|
||||
import net.minecraft.client.gui.GuiButton;
|
||||
import net.minecraft.client.gui.GuiScreen;
|
||||
import net.minecraft.client.resources.I18n;
|
||||
|
||||
public class GuiIngameModOptions extends GuiScreen
|
||||
{
|
||||
private final GuiScreen parentScreen;
|
||||
protected String title = "Mod Options";
|
||||
private GuiModOptionList optionList;
|
||||
|
||||
public GuiIngameModOptions(GuiScreen parentScreen)
|
||||
{
|
||||
this.parentScreen = parentScreen;
|
||||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
@Override
|
||||
public void func_73866_w_()
|
||||
{
|
||||
this.optionList=new GuiModOptionList(this);
|
||||
this.optionList.registerScrollButtons(this.field_146292_n, 7, 8);
|
||||
this.field_146292_n.add(new GuiButton(200, this.field_146294_l / 2 - 100, this.field_146295_m / 6 + 168, I18n.func_135052_a("gui.done", new Object[0])));
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void func_146284_a(GuiButton p_146284_1_)
|
||||
{
|
||||
if (p_146284_1_.field_146124_l)
|
||||
{
|
||||
if (p_146284_1_.field_146127_k == 200)
|
||||
{
|
||||
this.field_146297_k.field_71474_y.func_74303_b();
|
||||
this.field_146297_k.func_147108_a(this.parentScreen);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void func_73863_a(int p_73863_1_, int p_73863_2_, float p_73863_3_)
|
||||
{
|
||||
// force a non-transparent background
|
||||
this.func_146278_c(1);
|
||||
this.optionList.drawScreen(p_73863_1_, p_73863_2_, p_73863_3_);
|
||||
this.func_73732_a(this.field_146289_q, this.title, this.field_146294_l / 2, 15, 0xFFFFFF);
|
||||
super.func_73863_a(p_73863_1_, p_73863_2_, p_73863_3_);
|
||||
}
|
||||
|
||||
FontRenderer getFontRenderer() {
|
||||
return field_146289_q;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -39,6 +39,7 @@ import com.google.common.base.Strings;
|
||||
|
||||
import cpw.mods.fml.common.Loader;
|
||||
import cpw.mods.fml.common.ModContainer;
|
||||
import cpw.mods.fml.common.ModContainer.Disableable;
|
||||
|
||||
/**
|
||||
* @author cpw
|
||||
@@ -202,6 +203,25 @@ public class GuiModList extends GuiScreen
|
||||
{
|
||||
this.getFontRenderer().func_78279_b(selectedMod.getMetadata().description, offset, shifty + 10, rightSide, 0xDDDDDD);
|
||||
}
|
||||
Disableable disableable = selectedMod.canBeDisabled();
|
||||
if (disableable == Disableable.RESTART)
|
||||
{
|
||||
disableModButton.field_146124_l = true;
|
||||
disableModButton.field_146125_m = true;
|
||||
disableModButton.packedFGColour = 0xFF3377;
|
||||
}
|
||||
else if (disableable == Disableable.YES)
|
||||
{
|
||||
disableModButton.field_146124_l = true;
|
||||
disableModButton.field_146125_m = true;
|
||||
disableModButton.packedFGColour = 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
disableModButton.packedFGColour = 0;
|
||||
disableModButton.field_146125_m = true;
|
||||
disableModButton.field_146124_l = false;
|
||||
}
|
||||
} else {
|
||||
offset = ( this.listWidth + this.field_146294_l ) / 2;
|
||||
this.func_73732_a(this.field_146289_q, selectedMod.getName(), offset, 35, 0xFFFFFF);
|
||||
|
||||
@@ -0,0 +1,47 @@
|
||||
package cpw.mods.fml.client;
|
||||
|
||||
import net.minecraft.client.renderer.Tessellator;
|
||||
|
||||
public class GuiModOptionList extends GuiScrollingList {
|
||||
|
||||
private GuiIngameModOptions parent;
|
||||
|
||||
public GuiModOptionList(GuiIngameModOptions parent)
|
||||
{
|
||||
super(parent.field_146297_k, 150, parent.field_146295_m, 32, parent.field_146295_m - 65 + 4, 10, 35);
|
||||
this.parent = parent;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected int getSize()
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void elementClicked(int index, boolean doubleClick)
|
||||
{
|
||||
// TODO Auto-generated method stub
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
protected boolean isSelected(int index)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void drawBackground()
|
||||
{
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void drawSlot(int var1, int var2, int var3, int var4, Tessellator var5)
|
||||
{
|
||||
this.parent.getFontRenderer().func_78276_b(this.parent.getFontRenderer().func_78269_a("Test 1", listWidth - 10), this.left + 3 , var3 + 2, 0xFF2222);
|
||||
this.parent.getFontRenderer().func_78276_b(this.parent.getFontRenderer().func_78269_a("TEST 2", listWidth - 10), this.left + 3 , var3 + 12, 0xFF2222);
|
||||
this.parent.getFontRenderer().func_78276_b(this.parent.getFontRenderer().func_78269_a("DISABLED", listWidth - 10), this.left + 3 , var3 + 22, 0xFF2222);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -5,7 +5,7 @@
|
||||
* are made available under the terms of the GNU Lesser Public License v2.1
|
||||
* which accompanies this distribution, and is available at
|
||||
* http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
|
||||
*
|
||||
*
|
||||
* Contributors:
|
||||
* cpw - implementation
|
||||
*/
|
||||
@@ -23,4 +23,10 @@ public class MCPDummyContainer extends DummyModContainer {
|
||||
public boolean registerBus(EventBus bus, LoadController controller) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Disableable canBeDisabled()
|
||||
{
|
||||
return Disableable.YES;
|
||||
}
|
||||
}
|
||||
@@ -37,14 +37,15 @@ public net.minecraft.util.WeightedRandom$Item field_76292_a #probability
|
||||
public net.minecraft.entity.player.EntityPlayerMP func_71117_bO()V
|
||||
public net.minecraft.entity.player.EntityPlayerMP field_71139_cq
|
||||
## EntityAITaskEntry
|
||||
#public pu #CL:EntityAITaskEntry
|
||||
public net.minecraft.entity.ai.EntityAITasks$EntityAITaskEntry
|
||||
## EntityAITasks
|
||||
#public pt.a #FD:EntityAITasks/field_75782_a #taskList
|
||||
## BlockChest
|
||||
#public ank.m(Labw;III)Z #MD:BlockChest/func_72292_n #isOcelotBlockingChest
|
||||
## EntityLiving
|
||||
##public ng.aU #FD:EntityLiving/field_70736_aM #carryoverDamage # -- MISSING MAPPING
|
||||
#public og.c #FD:EntityLiving/field_70714_bg #tasks
|
||||
public net.minecraft.entity.EntityLiving field_70714_bg #tasks
|
||||
public net.minecraft.entity.EntityLiving field_70715_bh #targetTasks
|
||||
##public ng.bG #FD:EntityLiving/field_70703_bu #isJumping # -- MISSING MAPPING
|
||||
## EntityAIOcelotSit
|
||||
#protected qg.a(Labw;III)Z #MD:EntityAIOcelotSit/func_75398_a #nearestSittableBlock
|
||||
|
||||
Reference in new issue
Block a user