Skip to content

Commit

Permalink
Fixed the last few things before release
Browse files Browse the repository at this point in the history
  • Loading branch information
GirafiStudios committed Jun 10, 2019
1 parent 808df8a commit ee13962
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 21 deletions.
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
minecraft_version=1.14.2
forge_version=26.0.14
mod_version=1.7.3
mod_version=1.8.0

org.gradle.jvmargs=-Xmx4G
org.gradle.daemon=false
1 change: 0 additions & 1 deletion src/main/java/dmillerw/menu/gui/menu/MenuItemScreen.java
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,6 @@ public void init() {

this.textTitle = new TextFieldWidget(this.font, this.width / 2 - 150, 50, 300, 20, "minemenu.menuItem.title");
this.textTitle.setMaxStringLength(32767);
this.textTitle.changeFocus(false);
this.textTitle.setText(EditSessionData.title != null && !EditSessionData.title.isEmpty() ? EditSessionData.title : "");

this.buttonPickIcon.icon = EditSessionData.icon;
Expand Down
8 changes: 4 additions & 4 deletions src/main/java/dmillerw/menu/gui/menu/PickIconScreen.java
Original file line number Diff line number Diff line change
Expand Up @@ -139,18 +139,18 @@ public boolean mouseClicked(double mouseX, double mouseY, int button) {
}

@Override
public boolean mouseScrolled(double mouseX, double mouseY, double mouseZ) { //TODO Test
mouseY = -mouseY;
public boolean mouseScrolled(double mouseX, double mouseY, double wheel) {
wheel = -wheel;

if (mouseY < 0) {
if (wheel < 0) {
listScrollIndex -= 2;
if (listScrollIndex < 0) {
listScrollIndex = 0;
}
return true;
}

if (mouseY > 0) {
if (wheel > 0) {
listScrollIndex += 2;
if (listScrollIndex > Math.max(0, (stacks.size() / MAX_COLUMN)) - MAX_ROW) {
listScrollIndex = Math.max(0, (stacks.size() / MAX_COLUMN) - MAX_ROW);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ public class CategoryEntry extends KeyBindingList.Entry {

@Override
public void render(int p_render_1_, int p_render_2_, int p_render_3_, int p_render_4_, int p_render_5_, int p_render_6_, int p_render_7_, boolean p_render_8_, float p_render_9_) {
GuiControlList.this.mc.fontRenderer.drawString(this.category, (float) (Objects.requireNonNull(GuiControlList.this.mc.field_71462_r).width / 2 - this.width / 2), (float) p_render_2_ - GuiControlList.this.mc.fontRenderer.FONT_HEIGHT - 1, 16777215);
GuiControlList.this.mc.fontRenderer.drawString(this.category, (float)(Objects.requireNonNull(GuiControlList.this.minecraft.field_71462_r).width / 2 - this.width / 2), (float)(p_render_2_ + p_render_5_ - GuiControlList.this.mc.fontRenderer.FONT_HEIGHT - 1), 16777215);
}

@Override
Expand Down
16 changes: 2 additions & 14 deletions src/main/java/dmillerw/menu/handler/KeyboardHandler.java
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ public void fireKey(KeyBinding key) {
KeyBinding.setKeyBindState(key.getKey(), true);
KeyReflectionHelper.setPressTime(key, 1);

//this.setFocus(); //TODO
ignoreNextTick = true;
}

public void toggleKey(KeyBinding key) {
Expand All @@ -52,26 +52,14 @@ public void toggleKey(KeyBinding key) {
TOGGLED_KEYS.remove(key);
KeyBinding.setKeyBindState(key.getKey(), false);
}
//this.setFocus(); //TODO
}

/*private void setFocus() {
Minecraft mc = Minecraft.getInstance();
boolean old = mc.isGameFocused();
//mc.mouseHelper.grabMouse();
//mc.mouseHelper.ungrabMouse();
mc.focusChanged(true);
mc.focusChanged(old);
ignoreNextTick = true;
}*/
}

@SubscribeEvent
public static void onClientTick(TickEvent.ClientTickEvent event) {
if (event.phase == TickEvent.Phase.END) {
return;
}

Minecraft mc = Minecraft.getInstance();

if (mc.world == null) {
Expand Down

0 comments on commit ee13962

Please sign in to comment.