diff options
| author | Benjamin Culkin <scorpress@gmail.com> | 2024-08-24 08:16:37 -0400 |
|---|---|---|
| committer | Benjamin Culkin <scorpress@gmail.com> | 2024-08-24 08:16:37 -0400 |
| commit | 70c1354a4a96698758a88c032866288f79de6f5a (patch) | |
| tree | eca51294e84b90a4cb3230bc2c7900469e784184 /src/main/java/jp/plusplus/fbs/gui/button | |
Diffstat (limited to 'src/main/java/jp/plusplus/fbs/gui/button')
16 files changed, 401 insertions, 0 deletions
diff --git a/src/main/java/jp/plusplus/fbs/gui/button/GuiButtonDestination.class b/src/main/java/jp/plusplus/fbs/gui/button/GuiButtonDestination.class Binary files differnew file mode 100644 index 0000000..ac4e2ed --- /dev/null +++ b/src/main/java/jp/plusplus/fbs/gui/button/GuiButtonDestination.class diff --git a/src/main/java/jp/plusplus/fbs/gui/button/GuiButtonDestination.java b/src/main/java/jp/plusplus/fbs/gui/button/GuiButtonDestination.java new file mode 100644 index 0000000..ea00477 --- /dev/null +++ b/src/main/java/jp/plusplus/fbs/gui/button/GuiButtonDestination.java @@ -0,0 +1,35 @@ +package jp.plusplus.fbs.gui.button;
+
+import net.minecraft.client.Minecraft;
+import net.minecraft.client.gui.FontRenderer;
+import net.minecraft.client.gui.GuiButton;
+import net.minecraft.client.renderer.OpenGlHelper;
+import org.lwjgl.opengl.GL11;
+
+/**
+ * Created by plusplus_F on 2015/10/22.
+ */
+public class GuiButtonDestination extends GuiButton {
+ public boolean selected;
+
+ public GuiButtonDestination(int p_i1020_1_, int p_i1020_2_, int p_i1020_3_) {
+ super(p_i1020_1_, p_i1020_2_, p_i1020_3_,86 ,20, "");
+ enabled=false;
+ }
+
+ public void setDisplayString(String str){
+ displayString=str;
+ enabled=!str.isEmpty();
+ }
+
+ @Override
+ public void drawButton(Minecraft p_146112_1_, int p_146112_2_, int p_146112_3_) {
+ if (this.enabled && !displayString.isEmpty()) {
+ FontRenderer fontrenderer = p_146112_1_.fontRenderer;
+ this.mouseDragged(p_146112_1_, p_146112_2_, p_146112_3_);
+ int col=selected?0xffffff:0x404040;
+
+ this.drawCenteredString(fontrenderer, this.displayString, this.xPosition + this.width / 2, this.yPosition + (this.height - 16) / 2, col);
+ }
+ }
+}
diff --git a/src/main/java/jp/plusplus/fbs/gui/button/GuiButtonEnchantment.class b/src/main/java/jp/plusplus/fbs/gui/button/GuiButtonEnchantment.class Binary files differnew file mode 100644 index 0000000..d4af4de --- /dev/null +++ b/src/main/java/jp/plusplus/fbs/gui/button/GuiButtonEnchantment.class diff --git a/src/main/java/jp/plusplus/fbs/gui/button/GuiButtonEnchantment.java b/src/main/java/jp/plusplus/fbs/gui/button/GuiButtonEnchantment.java new file mode 100644 index 0000000..e25475d --- /dev/null +++ b/src/main/java/jp/plusplus/fbs/gui/button/GuiButtonEnchantment.java @@ -0,0 +1,35 @@ +package jp.plusplus.fbs.gui.button;
+
+import jp.plusplus.fbs.FBS;
+import net.minecraft.client.Minecraft;
+import net.minecraft.client.gui.GuiButton;
+import net.minecraft.util.ResourceLocation;
+import org.lwjgl.opengl.GL11;
+
+/**
+ * Created by plusplus_F on 2015/10/21.
+ */
+public class GuiButtonEnchantment extends GuiButton {
+ public static final ResourceLocation rl = new ResourceLocation(FBS.MODID+":textures/gui/enchant.png");
+
+ public GuiButtonEnchantment(int id, int x, int y) {
+ super(id, x, y, 28, 23, "");
+ }
+
+ @Override
+ public void drawButton(Minecraft par1Minecraft, int par2, int par3) {
+ if (this.visible) {
+ par1Minecraft.getTextureManager().bindTexture(rl);
+ GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
+ boolean onMouse = par2 >= this.xPosition && par3 >= this.yPosition && par2 < this.xPosition + this.width && par3 < this.yPosition + this.height;
+
+ int drawX = 176;
+ int drawY = 0;
+
+ if (!this.enabled) drawY += height * 2;
+ else if (onMouse) drawY += height;
+
+ this.drawTexturedModalRect(this.xPosition, this.yPosition, drawX, drawY, this.width, this.height);
+ }
+ }
+}
diff --git a/src/main/java/jp/plusplus/fbs/gui/button/GuiButtonSpiritArrow.class b/src/main/java/jp/plusplus/fbs/gui/button/GuiButtonSpiritArrow.class Binary files differnew file mode 100644 index 0000000..e42576a --- /dev/null +++ b/src/main/java/jp/plusplus/fbs/gui/button/GuiButtonSpiritArrow.class diff --git a/src/main/java/jp/plusplus/fbs/gui/button/GuiButtonSpiritArrow.java b/src/main/java/jp/plusplus/fbs/gui/button/GuiButtonSpiritArrow.java new file mode 100644 index 0000000..89e342c --- /dev/null +++ b/src/main/java/jp/plusplus/fbs/gui/button/GuiButtonSpiritArrow.java @@ -0,0 +1,43 @@ +package jp.plusplus.fbs.gui.button;
+
+import jp.plusplus.fbs.FBS;
+import net.minecraft.client.Minecraft;
+import net.minecraft.client.gui.GuiButton;
+import net.minecraft.util.ResourceLocation;
+import org.lwjgl.opengl.GL11;
+
+/**
+ * Created by plusplus_F on 2015/10/22.
+ */
+public class GuiButtonSpiritArrow extends GuiButton {
+ public static final ResourceLocation rl = new ResourceLocation(FBS.MODID+":textures/gui/spiritConfig.png");
+ public boolean selected;
+
+ public GuiButtonSpiritArrow(int id, int x, int y) {
+ super(id, x, y, 10, 15, "");
+ }
+
+ @Override
+ public void drawButton(Minecraft par1Minecraft, int par2, int par3) {
+ if (this.visible) {
+ par1Minecraft.getTextureManager().bindTexture(rl);
+ GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
+ boolean onMouse = par2 >= this.xPosition && par3 >= this.yPosition && par2 < this.xPosition + this.width && par3 < this.yPosition + this.height;
+
+ int drawX = 176;
+ int drawY = 15*id;
+
+ if(id<2){
+ if (!this.enabled) drawX += width * 2;
+ else if (onMouse) drawX += width;
+ }
+ else{
+ if (!this.enabled) drawY += height * 2;
+ else if (onMouse) drawY += height;
+ }
+
+ //selected?0xffffff:0x404040
+ this.drawTexturedModalRect(this.xPosition, this.yPosition, drawX, drawY, this.width, this.height);
+ }
+ }
+}
diff --git a/src/main/java/jp/plusplus/fbs/gui/button/GuiButtonSpiritCheckBox.class b/src/main/java/jp/plusplus/fbs/gui/button/GuiButtonSpiritCheckBox.class Binary files differnew file mode 100644 index 0000000..257d8b2 --- /dev/null +++ b/src/main/java/jp/plusplus/fbs/gui/button/GuiButtonSpiritCheckBox.class diff --git a/src/main/java/jp/plusplus/fbs/gui/button/GuiButtonSpiritCheckBox.java b/src/main/java/jp/plusplus/fbs/gui/button/GuiButtonSpiritCheckBox.java new file mode 100644 index 0000000..5ebd4e1 --- /dev/null +++ b/src/main/java/jp/plusplus/fbs/gui/button/GuiButtonSpiritCheckBox.java @@ -0,0 +1,39 @@ +package jp.plusplus.fbs.gui.button;
+
+import jp.plusplus.fbs.FBS;
+import net.minecraft.client.Minecraft;
+import net.minecraft.client.gui.GuiButton;
+import net.minecraft.util.ResourceLocation;
+import net.minecraft.util.StatCollector;
+import org.lwjgl.opengl.GL11;
+
+/**
+ * Created by plusplus_F on 2015/11/14.
+ */
+public class GuiButtonSpiritCheckBox extends GuiButton {
+ public static final ResourceLocation rl = new ResourceLocation(FBS.MODID+":textures/gui/spiritConfig.png");
+ public boolean checked;
+ public String keyString;
+
+ public GuiButtonSpiritCheckBox(int id, int x, int y, String str) {
+ super(id, x, y, 10, 10, StatCollector.translateToLocal("spirit.config.fbs."+str));
+ checked=false;
+ keyString=str;
+ }
+
+ @Override
+ public void drawButton(Minecraft par1Minecraft, int par2, int par3) {
+ if (this.visible) {
+ par1Minecraft.getTextureManager().bindTexture(rl);
+ GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
+ int drawX = 176;
+ int drawY = 48;
+
+ if(checked) drawY+=10;
+
+ this.drawTexturedModalRect(this.xPosition, this.yPosition, drawX, drawY, this.width, this.height);
+ par1Minecraft.fontRenderer.drawString(displayString, xPosition + 11, yPosition + 1, 0x404040);
+ //drawString(par1Minecraft.fontRenderer, displayString, xPosition+11, yPosition+1, 0x404040);
+ }
+ }
+}
diff --git a/src/main/java/jp/plusplus/fbs/gui/button/GuiButtonSpiritLearn.class b/src/main/java/jp/plusplus/fbs/gui/button/GuiButtonSpiritLearn.class Binary files differnew file mode 100644 index 0000000..de5b8c1 --- /dev/null +++ b/src/main/java/jp/plusplus/fbs/gui/button/GuiButtonSpiritLearn.class diff --git a/src/main/java/jp/plusplus/fbs/gui/button/GuiButtonSpiritLearn.java b/src/main/java/jp/plusplus/fbs/gui/button/GuiButtonSpiritLearn.java new file mode 100644 index 0000000..280fcbe --- /dev/null +++ b/src/main/java/jp/plusplus/fbs/gui/button/GuiButtonSpiritLearn.java @@ -0,0 +1,50 @@ +package jp.plusplus.fbs.gui.button;
+
+import jp.plusplus.fbs.FBS;
+import jp.plusplus.fbs.spirit.SkillManager;
+import net.minecraft.client.Minecraft;
+import net.minecraft.client.gui.GuiButton;
+import net.minecraft.util.ResourceLocation;
+import net.minecraft.util.StatCollector;
+import org.lwjgl.opengl.GL11;
+
+/**
+ * Created by plusplus_F on 2015/11/28.
+ */
+public class GuiButtonSpiritLearn extends GuiButton {
+ public static final ResourceLocation rl = new ResourceLocation(FBS.MODID+":textures/gui/spiritConfig.png");
+
+ public String[] skillStr=new String[0];
+ public String skillName="";
+
+ public GuiButtonSpiritLearn(int id, int x, int y, String str) {
+ super(id, x, y, 34, 16, StatCollector.translateToLocal("spirit.gui.fbs.button."+str));
+ }
+
+ @Override
+ public void drawButton(Minecraft par1Minecraft, int par2, int par3) {
+ if (this.visible) {
+ par1Minecraft.getTextureManager().bindTexture(rl);
+ GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
+ boolean onMouse = par2 >= this.xPosition && par3 >= this.yPosition && par2 < this.xPosition + this.width && par3 < this.yPosition + this.height;
+
+ int drawX = 186;
+ int drawY = 48;
+
+ if(!enabled) drawY+=32;
+ else if(onMouse) drawY+=16;
+
+ this.drawTexturedModalRect(this.xPosition, this.yPosition, drawX, drawY, this.width, this.height);
+ drawCenteredString(par1Minecraft.fontRenderer, displayString, xPosition + width / 2, yPosition + (this.height - 8) / 2, enabled? 0xffffff:0xa0a0a0);
+
+ for(int i=0;i<skillStr.length;i++){
+ par1Minecraft.fontRenderer.drawString(skillStr[i], xPosition - 120, yPosition + (this.height - 8) / 2-3+par1Minecraft.fontRenderer.FONT_HEIGHT*i, 0x404040);
+ }
+ }
+ }
+
+ public void setSkill(SkillManager.SkillEntry entry, int lv) {
+ skillStr=entry.getString(lv).split("\n");
+ skillName=SkillManager.getSkill(entry.getSkillId()).getName();
+ }
+}
diff --git a/src/main/java/jp/plusplus/fbs/gui/button/GuiButtonSpiritLearnDummy.class b/src/main/java/jp/plusplus/fbs/gui/button/GuiButtonSpiritLearnDummy.class Binary files differnew file mode 100644 index 0000000..7ffcb50 --- /dev/null +++ b/src/main/java/jp/plusplus/fbs/gui/button/GuiButtonSpiritLearnDummy.class diff --git a/src/main/java/jp/plusplus/fbs/gui/button/GuiButtonSpiritLearnDummy.java b/src/main/java/jp/plusplus/fbs/gui/button/GuiButtonSpiritLearnDummy.java new file mode 100644 index 0000000..255f196 --- /dev/null +++ b/src/main/java/jp/plusplus/fbs/gui/button/GuiButtonSpiritLearnDummy.java @@ -0,0 +1,31 @@ +package jp.plusplus.fbs.gui.button;
+
+import jp.plusplus.fbs.spirit.SkillManager;
+import net.minecraft.client.Minecraft;
+import org.lwjgl.opengl.GL11;
+
+/**
+ * Created by plusplus_F on 2015/11/29.
+ */
+public class GuiButtonSpiritLearnDummy extends GuiButtonSpiritLearn {
+ public GuiButtonSpiritLearnDummy(int id, int x, int y, String str) {
+ super(id, x, y, str);
+ }
+
+ @Override
+ public void drawButton(Minecraft par1Minecraft, int par2, int par3) {
+ if (this.visible) {
+ GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
+ par1Minecraft.fontRenderer.drawString(skillStr[0], xPosition - 120, yPosition + (this.height - 8) / 2 -3, 0x404040);
+ }
+ }
+
+ public void setSkill(SkillManager.SkillData data) {
+ skillStr=new String[]{data.getString()};
+ skillName=data.getSkill().getName();
+ }
+ @Override
+ public void setSkill(SkillManager.SkillEntry entry, int lv){
+
+ }
+}
diff --git a/src/main/java/jp/plusplus/fbs/gui/button/GuiButtonSpiritMain.class b/src/main/java/jp/plusplus/fbs/gui/button/GuiButtonSpiritMain.class Binary files differnew file mode 100644 index 0000000..fa31022 --- /dev/null +++ b/src/main/java/jp/plusplus/fbs/gui/button/GuiButtonSpiritMain.class diff --git a/src/main/java/jp/plusplus/fbs/gui/button/GuiButtonSpiritMain.java b/src/main/java/jp/plusplus/fbs/gui/button/GuiButtonSpiritMain.java new file mode 100644 index 0000000..2033c8f --- /dev/null +++ b/src/main/java/jp/plusplus/fbs/gui/button/GuiButtonSpiritMain.java @@ -0,0 +1,124 @@ +package jp.plusplus.fbs.gui.button;
+
+import jp.plusplus.fbs.FBS;
+import net.minecraft.client.Minecraft;
+import net.minecraft.client.gui.FontRenderer;
+import net.minecraft.client.gui.GuiButton;
+import net.minecraft.client.renderer.RenderHelper;
+import net.minecraft.util.ResourceLocation;
+import net.minecraft.util.StatCollector;
+import org.lwjgl.opengl.GL11;
+import org.lwjgl.opengl.GL12;
+
+import java.util.ArrayList;
+import java.util.Iterator;
+import java.util.List;
+
+/**
+ * Created by plusplus_F on 2015/11/14.
+ */
+public class GuiButtonSpiritMain extends GuiButton {
+ public static final ResourceLocation rl = new ResourceLocation(FBS.MODID+":textures/gui/spiritMain.png");
+ public String rowString;
+ public String character;
+
+ public GuiButtonSpiritMain(int id, int x, int y, String str) {
+ this(id, x, y, str, "");
+ }
+ public GuiButtonSpiritMain(int id, int x, int y, String str, String character){
+ super(id, x, y, 48, 16, StatCollector.translateToLocal("spirit.gui.fbs.button."+str));
+ rowString=str;
+ this.character=character;
+ }
+
+ @Override
+ public void drawButton(Minecraft par1Minecraft, int par2, int par3) {
+ if (this.visible) {
+ par1Minecraft.getTextureManager().bindTexture(rl);
+ GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
+ boolean onMouse = par2 >= this.xPosition && par3 >= this.yPosition && par2 < this.xPosition + this.width && par3 < this.yPosition + this.height;
+
+ int drawX = 176;
+ int drawY = 0;
+
+ if(!enabled) drawY=32;
+ else if(onMouse) drawY=16;
+
+ this.drawTexturedModalRect(this.xPosition, this.yPosition, drawX, drawY, this.width, this.height);
+ drawCenteredString(par1Minecraft.fontRenderer, displayString, xPosition + width / 2, yPosition + (this.height - 8) / 2, enabled? 0xffffff:0xa0a0a0);
+ }
+ }
+
+
+ public void drawHoveringText(List p_146283_1_, int p_146283_2_, int p_146283_3_, FontRenderer font) {
+ if (!p_146283_1_.isEmpty()) {
+ GL11.glDisable(GL12.GL_RESCALE_NORMAL);
+ RenderHelper.disableStandardItemLighting();
+ GL11.glDisable(GL11.GL_LIGHTING);
+ GL11.glDisable(GL11.GL_DEPTH_TEST);
+ int width = 0;
+ Iterator iterator = p_146283_1_.iterator();
+
+ while (iterator.hasNext()) {
+ String s = (String) iterator.next();
+ int l = font.getStringWidth(s);
+
+ if (l > width) {
+ width = l;
+ }
+ }
+
+ int xMin = p_146283_2_ + 12;
+ int yMin = p_146283_3_ - 12;
+ int i1 = 8;
+
+ if (p_146283_1_.size() > 1) {
+ i1 += 2 + (p_146283_1_.size() - 1) * 10;
+ }
+
+ /*
+ if (xMin + width > this.width) {
+ xMin -= 28 + width;
+ }
+
+ if (yMin + i1 + 6 > this.height) {
+ yMin = this.height - i1 - 6;
+ }
+ */
+
+
+ //this.zLevel = 300.0F;
+ //itemRender.zLevel = 300.0F;
+ int color = -267386864;
+ this.drawGradientRect(xMin - 3, yMin - 4, xMin + width + 3, yMin - 3, color, color);
+ this.drawGradientRect(xMin - 3, yMin + i1 + 3, xMin + width + 3, yMin + i1 + 4, color, color);
+ this.drawGradientRect(xMin - 3, yMin - 3, xMin + width + 3, yMin + i1 + 3, color, color);
+ this.drawGradientRect(xMin - 4, yMin - 3, xMin - 3, yMin + i1 + 3, color, color);
+ this.drawGradientRect(xMin + width + 3, yMin - 3, xMin + width + 4, yMin + i1 + 3, color, color);
+ int k1 = 1347420415;
+ int l1 = (k1 & 16711422) >> 1 | k1 & -16777216;
+ this.drawGradientRect(xMin - 3, yMin - 3 + 1, xMin - 3 + 1, yMin + i1 + 3 - 1, k1, l1);
+ this.drawGradientRect(xMin + width + 2, yMin - 3 + 1, xMin + width + 3, yMin + i1 + 3 - 1, k1, l1);
+ this.drawGradientRect(xMin - 3, yMin - 3, xMin + width + 3, yMin - 3 + 1, k1, k1);
+ this.drawGradientRect(xMin - 3, yMin + i1 + 2, xMin + width + 3, yMin + i1 + 3, l1, l1);
+
+ for (int i2 = 0; i2 < p_146283_1_.size(); ++i2) {
+ String s1 = (String) p_146283_1_.get(i2);
+ font.drawStringWithShadow(s1, xMin, yMin, -1);
+
+ if (i2 == 0) {
+ yMin += 2;
+ }
+
+ yMin += 10;
+ }
+
+ //this.zLevel = 0.0F;
+ //itemRender.zLevel = 0.0F;
+ GL11.glEnable(GL11.GL_LIGHTING);
+ GL11.glEnable(GL11.GL_DEPTH_TEST);
+ RenderHelper.enableStandardItemLighting();
+ GL11.glEnable(GL12.GL_RESCALE_NORMAL);
+ }
+ }
+}
diff --git a/src/main/java/jp/plusplus/fbs/gui/button/GuiButtonWarp.class b/src/main/java/jp/plusplus/fbs/gui/button/GuiButtonWarp.class Binary files differnew file mode 100644 index 0000000..7d0a259 --- /dev/null +++ b/src/main/java/jp/plusplus/fbs/gui/button/GuiButtonWarp.class diff --git a/src/main/java/jp/plusplus/fbs/gui/button/GuiButtonWarp.java b/src/main/java/jp/plusplus/fbs/gui/button/GuiButtonWarp.java new file mode 100644 index 0000000..7594662 --- /dev/null +++ b/src/main/java/jp/plusplus/fbs/gui/button/GuiButtonWarp.java @@ -0,0 +1,44 @@ +package jp.plusplus.fbs.gui.button;
+
+import jp.plusplus.fbs.FBS;
+import net.minecraft.client.Minecraft;
+import net.minecraft.client.gui.GuiButton;
+import net.minecraft.util.ResourceLocation;
+import org.lwjgl.opengl.GL11;
+
+/**
+ * Created by plusplus_F on 2015/10/22.
+ */
+public class GuiButtonWarp extends GuiButton {
+ public static final ResourceLocation rl = new ResourceLocation(FBS.MODID+":textures/gui/magicWarp.png");
+ public boolean selected;
+
+ public GuiButtonWarp(int id, int x, int y, String str) {
+ super(id, x, y, id<2?10:42, 15, str);
+ }
+
+ @Override
+ public void drawButton(Minecraft par1Minecraft, int par2, int par3) {
+ if (this.visible) {
+ par1Minecraft.getTextureManager().bindTexture(rl);
+ GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
+ boolean onMouse = par2 >= this.xPosition && par3 >= this.yPosition && par2 < this.xPosition + this.width && par3 < this.yPosition + this.height;
+
+ int drawX = 176;
+ int drawY = (id<2?15*id:45*(id-2)+30);
+
+ if(id<2){
+ if (!this.enabled) drawX += width * 2;
+ else if (onMouse) drawX += width;
+ }
+ else{
+ if (!this.enabled) drawY += height * 2;
+ else if (onMouse) drawY += height;
+ }
+
+ //selected?0xffffff:0x404040
+ this.drawTexturedModalRect(this.xPosition, this.yPosition, drawX, drawY, this.width, this.height);
+ drawCenteredString(par1Minecraft.fontRenderer, displayString, xPosition+width/2, yPosition+(this.height - 8) / 2, 0xffffff);
+ }
+ }
+}
|
