- 129
- 0
Как мне сделать так чтоб Easy сохранял свою переменную после перезапуска GUI
public class ItemMyGUI extends GuiScreen {
ResourceLocation texture2 = new ResourceLocation(ModInf.MODID.toLowerCase(),"textures/GUI/GUIitem.png");
int Easy = 3;
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, "Hello" + Easy , 130, 100, 0x99ff99);
super.drawScreen(x, y, f);
}
@Override
public boolean doesGuiPauseGame(){
return false;
}
public void initGui(){
this.buttonList.add(new GuiButton(0,200,200,100,20,"+1"));
}
public void actionPerformed(GuiButton button){
Easy=Easy+1;
switch(button.id){
case 0:
break;
default:
}
}
}
public class ItemMyGUI extends GuiScreen {
ResourceLocation texture2 = new ResourceLocation(ModInf.MODID.toLowerCase(),"textures/GUI/GUIitem.png");
int Easy = 3;
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, "Hello" + Easy , 130, 100, 0x99ff99);
super.drawScreen(x, y, f);
}
@Override
public boolean doesGuiPauseGame(){
return false;
}
public void initGui(){
this.buttonList.add(new GuiButton(0,200,200,100,20,"+1"));
}
public void actionPerformed(GuiButton button){
Easy=Easy+1;
switch(button.id){
case 0:
break;
default:
}
}
}