mirror of
https://github.com/KAMKEEL/CustomNPC-Plus.git
synced 2026-11-17 02:55:26 +00:00
Better Texture Selection GUI
This commit is contained in:
1 parent
4369f99225
commit
8203fc7d6b
4 files changed
+346
-2
No files matched your search
@@ -5,6 +5,7 @@ import cpw.mods.fml.relauncher.SideOnly;
|
||||
import noppes.npcs.client.gui.SubGuiColorSelector;
|
||||
import noppes.npcs.client.gui.select.GuiAnimationSelection;
|
||||
import noppes.npcs.client.gui.select.GuiSoundSelection;
|
||||
import noppes.npcs.client.gui.select.GuiTexturePathSelection;
|
||||
import noppes.npcs.client.gui.util.SubGuiInterface;
|
||||
import noppes.npcs.controllers.AnimationController;
|
||||
import noppes.npcs.controllers.data.Animation;
|
||||
@@ -175,6 +176,20 @@ public class FieldDef {
|
||||
.clearable(() -> setter.accept(""));
|
||||
}
|
||||
|
||||
public static FieldDef textureSubGui(String label, Supplier<String> getter, Consumer<String> setter) {
|
||||
return subGuiField(label,
|
||||
() -> new GuiTexturePathSelection(getter.get()),
|
||||
gui -> {
|
||||
GuiTexturePathSelection t = (GuiTexturePathSelection) gui;
|
||||
if (t.selectedResource != null) setter.accept(t.selectedResource.toString());
|
||||
})
|
||||
.buttonLabel(() -> {
|
||||
String s = getter.get();
|
||||
return s == null || s.isEmpty() ? "gui.none" : s;
|
||||
})
|
||||
.clearable(() -> setter.accept(""));
|
||||
}
|
||||
|
||||
public static FieldDef animSubGui(String label,
|
||||
Supplier<Integer> idGetter, Consumer<Integer> idSetter,
|
||||
Supplier<String> nameGetter, Consumer<String> nameSetter) {
|
||||
|
||||
Reference in new issue
Block a user