mirror of
https://github.com/KAMKEEL/CustomNPC-Plus.git
synced 2026-11-13 00:47:50 +00:00
Shitty test command do not fucking use xd
This commit is contained in:
1 parent
a1549abff1
commit
43c0a8e296
3 files changed
+65
No files matched your search
@@ -0,0 +1,25 @@
|
||||
package kamkeel.npcs.command;
|
||||
|
||||
import kamkeel.npcs.controllers.data.ability.Ability;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.command.CommandException;
|
||||
import net.minecraft.command.ICommandSender;
|
||||
import somehussar.gui.AnnotatedGui;
|
||||
|
||||
public class TestGui extends CommandKamkeelBase {
|
||||
|
||||
@Override
|
||||
public void processCommand(ICommandSender sender, String[] args) throws CommandException {
|
||||
Minecraft.getMinecraft().displayGuiScreen(new AnnotatedGui(Ability.class));
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getDescription() {
|
||||
return "";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getCommandName() {
|
||||
return "mytestgui";
|
||||
}
|
||||
}
|
||||
@@ -27,15 +27,20 @@ import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.entity.Entity;
|
||||
import somehussar.gui.annotationHandling.GuiEditable;
|
||||
|
||||
@GuiEditable
|
||||
public abstract class Ability implements IAbility {
|
||||
|
||||
// ═══════════════════════════════════════════════════════════════════
|
||||
// CONFIGURATION (saved to NBT)
|
||||
// ═══════════════════════════════════════════════════════════════════
|
||||
|
||||
@GuiEditable.Field("id")
|
||||
protected String id;
|
||||
@GuiEditable.Field("name")
|
||||
protected String name;
|
||||
@GuiEditable.Field("test")
|
||||
protected String typeId; // e.g., "ability.cnpc.slam" (also used as lang key)
|
||||
|
||||
// Selection
|
||||
|
||||
@@ -0,0 +1,35 @@
|
||||
package somehussar.gui;
|
||||
|
||||
import noppes.npcs.client.gui.util.GuiNPCInterface;
|
||||
import noppes.npcs.client.gui.util.GuiNpcLabel;
|
||||
import somehussar.gui.annotationHandling.GuiFieldHandler;
|
||||
import somehussar.gui.annotationHandling.field.EditableField;
|
||||
|
||||
public class AnnotatedGui extends GuiNPCInterface {
|
||||
private final GuiFieldHandler.ClassMetadata metadata;
|
||||
|
||||
public AnnotatedGui(Class<?> type) {
|
||||
metadata = GuiFieldHandler.getMetadata(type);
|
||||
setBackground("menubg.png");
|
||||
xSize = 256;
|
||||
ySize = 216;
|
||||
closeOnEsc = true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void initGui() {
|
||||
super.initGui();
|
||||
if (metadata == null)
|
||||
return;
|
||||
|
||||
int i = 0;
|
||||
for (EditableField field : metadata.getDeclaredFields()) {
|
||||
addLabel(new GuiNpcLabel(i++, field.getName(), guiLeft+8, guiTop+i*15+5));
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void save() {
|
||||
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user