- 129
- 0
Не работает код переменная MAXSide не меняется.
public class ItemMyGUI extends GuiScreen {
ResourceLocation texture2 = new ResourceLocation(ModInf.MODID.toLowerCase(),"textures/GUI/GUIitem.png");
public int Per= 1;
public static int MAXSide = 0;
public final static int L = 1;
public final int xSizeOfTexture = 283;
public final int ySizeOftexture = 142;
public ItemMyGUI(EntityPlayer player){
}
@Override
public void drawScreen(int x,int y,float f){
drawDefaultBackground();
GL11.glColor4f(1F, 1F, 1F, 1F);
Minecraft.getMinecraft().func_110434_K().func_110577_a(texture2);
int posX = (this.width - xSizeOfTexture /2);
int posY = (this.height - ySizeOftexture /2);
drawTexturedModalRect(105, 20, 0, 0, 257,257);
drawString(fontRenderer, "1 - " + Per , 120, 120, 0x99ffCC);
drawString(fontRenderer, "1 - "+MAXSide, 120, 130, 0x99ffCC);
super.drawScreen(x, y, f);
}
@Override
public boolean doesGuiPauseGame(){
return false;
}
public void initGui(){
this.buttonList.add(new GuiButton(0,203,118,12,12,"-"));
this.buttonList.add(new GuiButton(1,213,118,12,12,"+"));
}
public void actionPerformed(GuiButton button)
{
switch(button.id)
{
case 0:
{
Per=Per-L;
}
break;
default:
{
switch(button.id)
{
case 1:
{
Per=Per+L;
}
while ( BurntOut.EasyWeapon != 10){
MAXSide = MAXSide+1;
}
}
}
}
}
}
}
}
public class ItemMyGUI extends GuiScreen {
ResourceLocation texture2 = new ResourceLocation(ModInf.MODID.toLowerCase(),"textures/GUI/GUIitem.png");
public int Per= 1;
public static int MAXSide = 0;
public final static int L = 1;
public final int xSizeOfTexture = 283;
public final int ySizeOftexture = 142;
public ItemMyGUI(EntityPlayer player){
}
@Override
public void drawScreen(int x,int y,float f){
drawDefaultBackground();
GL11.glColor4f(1F, 1F, 1F, 1F);
Minecraft.getMinecraft().func_110434_K().func_110577_a(texture2);
int posX = (this.width - xSizeOfTexture /2);
int posY = (this.height - ySizeOftexture /2);
drawTexturedModalRect(105, 20, 0, 0, 257,257);
drawString(fontRenderer, "1 - " + Per , 120, 120, 0x99ffCC);
drawString(fontRenderer, "1 - "+MAXSide, 120, 130, 0x99ffCC);
super.drawScreen(x, y, f);
}
@Override
public boolean doesGuiPauseGame(){
return false;
}
public void initGui(){
this.buttonList.add(new GuiButton(0,203,118,12,12,"-"));
this.buttonList.add(new GuiButton(1,213,118,12,12,"+"));
}
public void actionPerformed(GuiButton button)
{
switch(button.id)
{
case 0:
{
Per=Per-L;
}
break;
default:
{
switch(button.id)
{
case 1:
{
Per=Per+L;
}
while ( BurntOut.EasyWeapon != 10){
MAXSide = MAXSide+1;
}
}
}
}
}
}
}
}