2022-01-12 04:44:08 -06:00
|
|
|
package noppes.npcs.scripted.event;
|
|
|
|
|
|
2022-06-18 12:52:23 -05:00
|
|
|
import cpw.mods.fml.common.eventhandler.Cancelable;
|
2022-01-12 04:44:08 -06:00
|
|
|
import cpw.mods.fml.common.eventhandler.Event;
|
2022-11-15 15:25:53 -05:00
|
|
|
import noppes.npcs.api.gui.ICustomGui;
|
|
|
|
|
import noppes.npcs.api.item.IItemStack;
|
|
|
|
|
import noppes.npcs.api.entity.IPlayer;
|
2022-01-12 04:44:08 -06:00
|
|
|
|
|
|
|
|
public class CustomGuiEvent extends Event {
|
|
|
|
|
public final IPlayer player;
|
|
|
|
|
public final ICustomGui gui;
|
|
|
|
|
|
|
|
|
|
public CustomGuiEvent(IPlayer player, ICustomGui gui) {
|
|
|
|
|
this.player = player;
|
|
|
|
|
this.gui = gui;
|
|
|
|
|
}
|
|
|
|
|
|
2022-11-23 23:59:01 -06:00
|
|
|
public IPlayer getPlayer() {
|
|
|
|
|
return this.player;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public ICustomGui getGui() {
|
|
|
|
|
return gui;
|
|
|
|
|
}
|
|
|
|
|
|
2022-01-12 04:44:08 -06:00
|
|
|
public static class ButtonEvent extends CustomGuiEvent {
|
|
|
|
|
public final int buttonId;
|
|
|
|
|
|
|
|
|
|
public ButtonEvent(IPlayer player, ICustomGui gui, int buttonId) {
|
|
|
|
|
super(player, gui);
|
|
|
|
|
this.buttonId = buttonId;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2022-01-14 16:09:27 -06:00
|
|
|
public static class UnfocusedEvent extends CustomGuiEvent {
|
|
|
|
|
public final int textfieldId;
|
|
|
|
|
|
|
|
|
|
public UnfocusedEvent(IPlayer player, ICustomGui gui, int textfieldId) {
|
|
|
|
|
super(player, gui);
|
|
|
|
|
this.textfieldId = textfieldId;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2022-01-12 04:44:08 -06:00
|
|
|
public static class CloseEvent extends CustomGuiEvent {
|
|
|
|
|
public CloseEvent(IPlayer player, ICustomGui gui) {
|
|
|
|
|
super(player, gui);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public static class ScrollEvent extends CustomGuiEvent {
|
|
|
|
|
public final int scrollId;
|
|
|
|
|
public final String[] selection;
|
|
|
|
|
public final boolean doubleClick;
|
|
|
|
|
public final int scrollIndex;
|
|
|
|
|
|
|
|
|
|
public ScrollEvent(IPlayer player, ICustomGui gui, int scrollId, int scrollIndex, String[] selection, boolean doubleClick) {
|
|
|
|
|
super(player, gui);
|
|
|
|
|
this.scrollId = scrollId;
|
|
|
|
|
this.selection = selection;
|
|
|
|
|
this.doubleClick = doubleClick;
|
|
|
|
|
this.scrollIndex = scrollIndex;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public static class SlotEvent extends CustomGuiEvent {
|
|
|
|
|
public final int slotId;
|
|
|
|
|
public final IItemStack stack;
|
|
|
|
|
|
|
|
|
|
public SlotEvent(IPlayer player, ICustomGui gui, int slotId, IItemStack stack) {
|
|
|
|
|
super(player, gui);
|
|
|
|
|
this.slotId = slotId;
|
|
|
|
|
this.stack = stack;
|
|
|
|
|
}
|
|
|
|
|
}
|
2022-06-18 12:52:23 -05:00
|
|
|
|
|
|
|
|
@Cancelable
|
|
|
|
|
public static class SlotClickEvent extends CustomGuiEvent {
|
|
|
|
|
public final int slotId;
|
|
|
|
|
public final IItemStack stack;
|
|
|
|
|
public final int dragType;
|
|
|
|
|
/**
|
|
|
|
|
*
|
|
|
|
|
*/
|
|
|
|
|
public final int clickType;
|
|
|
|
|
|
|
|
|
|
public SlotClickEvent(IPlayer player, ICustomGui gui, int slotId, IItemStack stack, int dragType, int clickType) {
|
|
|
|
|
super(player,gui);
|
|
|
|
|
this.slotId = slotId;
|
|
|
|
|
this.stack = stack;
|
|
|
|
|
this.dragType = dragType;
|
|
|
|
|
this.clickType = clickType;
|
|
|
|
|
}
|
|
|
|
|
}
|
2022-01-12 04:44:08 -06:00
|
|
|
}
|