public WindowNewAction(IWorkspace parent, int x, int y, int w, int h, int minW, int minH)
{
super(parent, x, y, w, h, minW, minH, "window.newAction.title", true);
elements.add(new ElementTextInput(this, 10, 30, width - 20, 12, 1, "window.newAction.name"));
elements.add(new ElementTextInput(this, 10, 135, width - 20, 12, 2, "window.newAction.playerName"));
ElementSelector selector = new ElementSelector(this, 10, 65, width - 20, 12, -2, "window.newAction.entityType", "EntityPlayer");
for(Object o : EntityList.NAME_TO_CLASS.values())
{
Class<? extends Entity> clz = (Class)o;
if(EntityLivingBase.class.isAssignableFrom(clz) && Minecraft.getMinecraft().getRenderManager().getEntityClassRenderObject(clz) instanceof RenderLivingBase)
{
selector.choices.put(clz.getSimpleName(), clz);
}
}
selector.choices.put(EntityPlayer.class.getSimpleName(), EntityPlayer.class);
selector.selected = EntityPlayer.class.getSimpleName();
elements.add(selector);
elements.add(new ElementCheckBox(this, 11, 89, -1, false, 0, 0, "window.newAction.preCreate", false));
elements.add(new ElementCheckBox(this, 11, 109, -2, false, 0, 0, "window.newAction.persist", false));
elements.add(new ElementButton(this, width - 140, height - 30, 60, 16, 100, false, 1, 1, "element.button.ok"));
elements.add(new ElementButton(this, width - 70, height - 30, 60, 16, 0, false, 1, 1, "element.button.cancel"));
}
WindowNewAction.java 文件源码
java
阅读 20
收藏 0
点赞 0
评论 0
项目:Keygrip
作者:
评论列表
文章目录