-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added description for snitches, fixed textbox bug, and scaled snitch …
…text
- Loading branch information
1 parent
3a2ab49
commit 68e75c6
Showing
12 changed files
with
222 additions
and
82 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
11 changes: 11 additions & 0 deletions
11
src/main/java/com/gmail/nuclearcat1337/snitch_master/gui/EditDescriptionGui.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
package com.gmail.nuclearcat1337.snitch_master.gui; | ||
|
||
import net.minecraft.client.gui.GuiScreen; | ||
|
||
/** | ||
* Created by Mr_Little_Kitty on 1/7/2017. | ||
*/ | ||
public class EditDescriptionGui extends GuiScreen | ||
{ | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
11 changes: 11 additions & 0 deletions
11
src/main/java/com/gmail/nuclearcat1337/snitch_master/gui/controls/ControlGui.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
package com.gmail.nuclearcat1337.snitch_master.gui.controls; | ||
|
||
import net.minecraft.client.gui.GuiControls; | ||
import net.minecraft.client.gui.GuiTextField; | ||
|
||
/** | ||
* Created by Mr_Little_Kitty on 1/7/2017. | ||
*/ | ||
public class ControlGui | ||
{ | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
88 changes: 88 additions & 0 deletions
88
.../java/com/gmail/nuclearcat1337/snitch_master/gui/snitchtable/SnitchDescriptionColumn.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,88 @@ | ||
package com.gmail.nuclearcat1337.snitch_master.gui.snitchtable; | ||
|
||
import com.gmail.nuclearcat1337.snitch_master.gui.tables.TableColumn; | ||
import com.gmail.nuclearcat1337.snitch_master.snitches.Snitch; | ||
import net.minecraft.client.Minecraft; | ||
import net.minecraft.client.gui.GuiButton; | ||
import net.minecraft.client.gui.GuiScreen; | ||
|
||
import java.util.List; | ||
|
||
/** | ||
* Created by Mr_Little_Kitty on 1/7/2017. | ||
*/ | ||
public class SnitchDescriptionColumn implements TableColumn<Snitch> | ||
{ | ||
private static Minecraft mc; | ||
|
||
public SnitchDescriptionColumn() | ||
{ | ||
mc = Minecraft.getMinecraft(); | ||
} | ||
|
||
@Override | ||
public GuiButton[] prepareEntry(Snitch item) | ||
{ | ||
return null; | ||
} | ||
|
||
@Override | ||
public String getColumnName() | ||
{ | ||
return "Description"; | ||
} | ||
|
||
@Override | ||
public boolean doBoundsCheck() | ||
{ | ||
return true; | ||
} | ||
|
||
@Override | ||
public void clicked(Snitch item, boolean leftClick, int xPos, int yPos, GuiButton[] buttons, GuiScreen parentScreen, int slotIndex) | ||
{ | ||
|
||
} | ||
|
||
@Override | ||
public void released(Snitch item, int xPos, int yPos, GuiButton[] buttons, GuiScreen parentScreen,int slotIndex) | ||
{ | ||
|
||
} | ||
|
||
@Override | ||
public void draw(Snitch snitch, int xPos, int yPos, int columnWidth, int slotHeight, GuiButton[] buttons,int slotIndex, int mouseX, int mouseY) | ||
{ | ||
String text = snitch.getDescription() == null ? "No Description" : "Hover to view"; | ||
int yFinal = yPos + ((slotHeight - mc.fontRendererObj.FONT_HEIGHT) /2); | ||
int nameWidth = mc.fontRendererObj.getStringWidth(text); | ||
int namePos = xPos + (columnWidth /2) - (nameWidth/2); | ||
mc.fontRendererObj.drawString(text, namePos ,yFinal, 16777215); | ||
} | ||
|
||
@Override | ||
public int getDrawWidth(Snitch snitch) | ||
{ | ||
String text = snitch.getDescription() == null ? "No Description" : "Hover to view"; | ||
return mc.fontRendererObj.getStringWidth(text); | ||
} | ||
|
||
|
||
@Override | ||
public List<String> hover(Snitch snitch, int xPos, int yPos) | ||
{ | ||
return snitch.getDescription(); | ||
} | ||
|
||
@Override | ||
public boolean canSort() | ||
{ | ||
return false; | ||
} | ||
|
||
@Override | ||
public int compare(Snitch snitch, Snitch other) | ||
{ | ||
return 0; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.