/*
 * Copyright (c) 2018 modmuss50 and Gigabit101
 *
 *
 *
 * Permission is hereby granted, free of charge, to any person obtaining a copy
 * of this software and associated documentation files (the "Software"), to deal
 * in the Software without restriction, including without limitation the rights
 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
 * copies of the Software, and to permit persons to whom the Software is
 * furnished to do so, subject to the following conditions:
 *
 *
 *
 * The above copyright notice and this permission notice shall be included in
 * all copies or substantial portions of the Software.
 *
 *
 *
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL THE
 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
 * THE SOFTWARE.
 */

package reborncore.client.gui.builder.widget;

import net.minecraft.client.gui.widget.ButtonWidget;
import reborncore.client.gui.builder.GuiBase;

/**
 * @author drcrazy
 */
public class GuiButtonUpDown extends GuiButtonExtended {

	GuiBase.Layer layer;
	GuiBase<?> gui;

	public GuiButtonUpDown(int x, int y, GuiBase<?> gui, GuiBase.Layer layer, ButtonWidget.PressAction pressAction) {
		super(x, y, 12, 12, "", pressAction);
		this.layer = layer;
		this.gui = gui;
	}

	@Override
	public boolean mouseClicked(double mouseX, double mouseY, int mouseButton) {
		if (layer == GuiBase.Layer.FOREGROUND) {
			mouseX -= gui.getGuiLeft();
			mouseY -= gui.getGuiTop();
		}
		if (this.active && this.visible && mouseX >= this.x && mouseY >= this.y && mouseX < this.x + this.width && mouseY < this.y + this.height) {
			return true;
		}
		return false;
	}

	@Override
	public void render(int mouseX, int mouseY, float partialTicks) {

	}
}

@@ -1378,30 +1378,8 @@
  %7B%0A%0A
-%09GuiBase.Layer layer;%0A
 %09Gui
@@ -1449,29 +1449,8 @@
 gui,
- GuiBase.Layer layer,
  But
@@ -1530,30 +1530,8 @@
 n);%0A
-%09%09this.layer = layer;%0A
 %09%09th
@@ -1552,387 +1552,8 @@
 %09%7D%0A%0A
-%09@Override%0A%09public boolean mouseClicked(double mouseX, double mouseY, int mouseButton) %7B%0A%09%09if (layer == GuiBase.Layer.FOREGROUND) %7B%0A%09%09%09mouseX -= gui.getGuiLeft();%0A%09%09%09mouseY -= gui.getGuiTop();%0A%09%09%7D%0A%09%09if (this.active && this.visible && mouseX %3E= this.x && mouseY %3E= this.y && mouseX %3C this.x + this.width && mouseY %3C this.y + this.height) %7B%0A%09%09%09return true;%0A%09%09%7D%0A%09%09return false;%0A%09%7D%0A%0A
 %09@Ov
@@ -1625,14 +1625,13 @@
 icks) %7B%0A
-%0A
 %09%7D%0A%7D%0A

Fix GuiButtonUpDown