Skip to content
This repository has been archived by the owner on Jan 18, 2024. It is now read-only.

Commit

Permalink
Merge remote-tracking branch 'origin/1.9.4' into 1.10.2
Browse files Browse the repository at this point in the history
Conflicts:
	gradle.properties
	src/main/java/com/kamesuta/mc/bnnwidget/component/MButton.java
  • Loading branch information
Kamesuta committed Oct 4, 2016
2 parents c1138fc + fe58a6a commit cc78fa0
Show file tree
Hide file tree
Showing 32 changed files with 625 additions and 413 deletions.
4 changes: 2 additions & 2 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ group=com.kamesuta.mc
modid=signpic
modname=SignPicture
version_major=2
version_minor=2
version_micro=2
version_minor=3
version_micro=0
version_minecraft=1.10.2
version_forge=12.18.1.2011
version_minforge=12.18.1.2011
Expand Down
25 changes: 17 additions & 8 deletions info/info.json
Original file line number Diff line number Diff line change
@@ -1,27 +1,36 @@
{
"versions": {
"1.7.10": {
"version": "2.3.0",
"remote": "https://github.com/Team-Fruit/SignPicture/releases/download/1.7.10-2.3.0/SignPicture-1.7.10-2.3.0-universal.jar",
"local": "SignPicture-1.7.10-2.3.0-universal.jar",
"message": "Config & Prevent Anti-AutoSign Mode added. SignPicture 2.3.0 Released.",
"message_local": {
"ja_JP": "Anti-AutoSign回避モードとコンフィグの追加 SignPicture 2.3.0 リリース!"
}
},
"1.8.9": {
"version": "2.2.2",
"remote": "https://github.com/Team-Fruit/SignPicture/releases/download/1.7.10-2.2.2/SignPicture-1.7.10-2.2.2-universal.jar",
"local": "SignPicture-1.7.10-2.2.2-universal.jar",
"remote": "https://github.com/Team-Fruit/SignPicture/releases/download/1.8.9-2.2.2/SignPicture-1.8.9-2.2.2-universal.jar",
"local": "SignPicture-1.8.9-2.2.2-universal.jar",
"message": "Offset And Rotations! More freely images! SignPicture 2.2.2 Released!",
"message_local": {
"ja_JP": "オフセットと回転機能実装! さらに自由自在に画像を貼ろう! SignPicture 2.2.2 リリース!"
}
},
"1.8": {
"1.9.4": {
"version": "2.1.5",
"remote": "https://github.com/Team-Fruit/SignPicture/releases/download/1.8-2.1.5/SignPicture-1.8-2.1.5-universal.jar",
"local": "SignPicture-1.8-2.1.5-universal.jar",
"remote": "https://github.com/Team-Fruit/SignPicture/releases/download/1.9.4-2.1.5/SignPicture-1.9.4-2.1.5-universal.jar",
"local": "SignPicture-1.9.4-2.1.5-universal.jar",
"message": "GUI Update! SignPicture 2.1.5 Released!",
"message_local": {
"ja_JP": "遂にSignPictureにGUIが! SignPicture 2.1.5リリース!!"
}
},
"1.9": {
"1.10.2": {
"version": "2.1.5",
"remote": "https://github.com/Team-Fruit/SignPicture/releases/download/1.9-2.1.5/SignPicture-1.9-2.1.5-universal.jar",
"local": "SignPicture-1.9-2.1.5-universal.jar",
"remote": "https://github.com/Team-Fruit/SignPicture/releases/download/1.10.2-2.1.5/SignPicture-1.10.2-2.1.5-universal.jar",
"local": "SignPicture-1.10.2-2.1.5-universal.jar",
"message": "GUI Update! SignPicture 2.1.5 Released!",
"message_local": {
"ja_JP": "遂にSignPictureにGUIが! SignPicture 2.1.5リリース!!"
Expand Down
37 changes: 22 additions & 15 deletions src/main/java/com/kamesuta/mc/bnnwidget/WGui.java
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,17 @@ public static void drawCenteredString(final String text, final float x, final fl
GlStateManager.popMatrix();
}

/**
* Renders the specified text to the screen.
*/
public static void drawStringWithShadow(final String text, final float x, final float y, final int color)
{
GlStateManager.pushMatrix();
GlStateManager.translate(x, y, 0f);
font().drawStringWithShadow(text, 0, 0, color);
GlStateManager.popMatrix();
}

/**
* Renders the specified text to the screen.
*/
Expand Down Expand Up @@ -237,7 +248,7 @@ public static void drawCenteredString(final String text, final Area a, final int
*/
public static void drawString(final String text, final Area a, final int color)
{
drawString(text, a.x1(), a.y1(), color);
drawStringWithShadow(text, a.x1(), a.y1(), color);
}

/**
Expand Down Expand Up @@ -277,38 +288,34 @@ public static void translate(final Area p) {
GlStateManager.translate(p.x1(), p.y1(), 0f);
}

public static void drawString(final String text, final int x, final int y, final int colour, final boolean shadow) {
public static void drawString(final String text, final float x, final float y, final int colour, final boolean shadow) {
if (shadow)
font().drawStringWithShadow(text, x, y, colour);
drawStringWithShadow(text, x, y, colour);
else
font().drawString(text, x, y, colour);
}

public static void drawString(final String text, final int x, final int y, final int colour) {
drawString(text, x, y, colour, true);
drawString(text, x, y, colour);
}

public static void drawStringC(final String text, final int x, final int y, final int w, final int h, final int colour, final boolean shadow) {
public static void drawStringC(final String text, final float x, final float y, final float w, final float h, final int colour, final boolean shadow) {
drawString(text, x + (w - getStringWidth(text)) / 2, y + (h - 8) / 2, colour, shadow);
}

public static void drawStringC(final String text, final int x, final int y, final int w, final int h, final int colour) {
public static void drawStringC(final String text, final float x, final float y, final float w, final float h, final int colour) {
drawStringC(text, x, y, w, h, colour, true);
}

public static void drawStringC(final String text, final int x, final int y, final int colour, final boolean shadow) {
public static void drawStringC(final String text, final float x, final float y, final int colour, final boolean shadow) {
drawString(text, x - getStringWidth(text) / 2, y, colour, shadow);
}

public static void drawStringC(final String text, final int x, final int y, final int colour) {
drawStringC(text, x, y, colour, true);
public static void drawStringC(final String text, final float f, final float g, final int colour) {
drawStringC(text, f, g, colour, true);
}

public static void drawStringR(final String text, final int x, final int y, final int colour, final boolean shadow) {
public static void drawStringR(final String text, final float x, final float y, final int colour, final boolean shadow) {
drawString(text, x - getStringWidth(text), y, colour, shadow);
}

public static void drawStringR(final String text, final int x, final int y, final int colour) {
public static void drawStringR(final String text, final float x, final float y, final int colour) {
drawStringR(text, x, y, colour, true);
}

Expand Down
4 changes: 1 addition & 3 deletions src/main/java/com/kamesuta/mc/bnnwidget/WPanel.java
Original file line number Diff line number Diff line change
Expand Up @@ -124,9 +124,7 @@ public boolean onCloseRequest() {
boolean closable = true;
for (final Iterator<WCommon> itr = this.widgets.iterator(); itr.hasNext();) {
final WCommon widget = itr.next();
if (widget.onCloseRequest())
itr.remove();
else {
if (!widget.onCloseRequest()) {
this.removelist.offer(widget);
closable = false;
}
Expand Down
8 changes: 4 additions & 4 deletions src/main/java/com/kamesuta/mc/bnnwidget/component/MLabel.java
Original file line number Diff line number Diff line change
Expand Up @@ -19,15 +19,15 @@ public MLabel(final R position, final String text) {
}

public void setText(final String s) {
if (StringUtils.equals(s, this.text)) {
if (StringUtils.equals(s, getText())) {
return;
}
final String oldText = this.text;
final String oldText = getText();
this.text = s;
onTextChanged(oldText);
}

public final String getText() {
public String getText() {
return this.text;
}

Expand All @@ -42,6 +42,6 @@ public void draw(final WEvent ev, final Area pgp, final Point p, final float fra

protected void drawText(final Area a) {
RenderHelper.startTexture();
drawString(this.text, a.x1(), a.y1() + (a.h()-font().FONT_HEIGHT) / 2, this.textcolor);
drawStringC(getText(), a.x1()+a.w()/2, a.y1() + (a.h()-font().FONT_HEIGHT) / 2, this.textcolor);
}
}
Loading

0 comments on commit cc78fa0

Please sign in to comment.