diff --git a/gradle.properties b/gradle.properties index b1c8060..ad0038a 100644 --- a/gradle.properties +++ b/gradle.properties @@ -10,7 +10,7 @@ minecraft16fabric = 1.16.5 mappings16fabric = 1.16.5+build.4 mappings16forge = 1.16.5 -minecraft16forge = 1.16.5-36.0.46 +minecraft16forge = 1.16.5-36.1.0 minecraft8fabric = 1.8.9 mappings8fabric = 1.8.9+build.202102062228 diff --git a/panelstudio/src/main/java/com/lukflug/panelstudio/layout/CSGOLayout.java b/panelstudio/src/main/java/com/lukflug/panelstudio/layout/CSGOLayout.java index 290239b..e24c744 100644 --- a/panelstudio/src/main/java/com/lukflug/panelstudio/layout/CSGOLayout.java +++ b/panelstudio/src/main/java/com/lukflug/panelstudio/layout/CSGOLayout.java @@ -21,6 +21,7 @@ import com.lukflug.panelstudio.setting.IEnumSetting; import com.lukflug.panelstudio.setting.ILabeled; import com.lukflug.panelstudio.setting.ISetting; +import com.lukflug.panelstudio.setting.Labeled; import com.lukflug.panelstudio.theme.ITheme; import com.lukflug.panelstudio.theme.ThemeTuple; import com.lukflug.panelstudio.widget.Button; @@ -33,16 +34,18 @@ public class CSGOLayout implements ILayout,IScrollSize { protected Point position; protected int width; protected Supplier animation; + protected String enabledButton; protected boolean horizontal,moduleColumn; protected int weight; protected ChildMode colorType; protected ChildUtil util; - public CSGOLayout (ILabeled label, Point position, int width, int popupWidth, Supplier animation, boolean horizontal, boolean moduleColumn, int weight, ChildMode colorType, PopupTuple popupType) { + public CSGOLayout (ILabeled label, Point position, int width, int popupWidth, Supplier animation, String enabledButton, boolean horizontal, boolean moduleColumn, int weight, ChildMode colorType, PopupTuple popupType) { this.label=label; this.position=position; this.width=width; this.animation=animation; + this.enabledButton=enabledButton; this.horizontal=horizontal; this.moduleColumn=moduleColumn; this.weight=weight; @@ -53,7 +56,7 @@ public CSGOLayout (ILabeled label, Point position, int width, int popupWidth, Su @Override public void populateGUI (IComponentAdder gui, IComponentGenerator components, IClient client, ITheme theme) { Button title=new Button(label,theme.getButtonRenderer(Void.class,0,0,true)); - HorizontalContainer window=new HorizontalContainer(label,theme.getContainerRenderer(0,0,true)); + HorizontalContainer window=new HorizontalContainer(label,theme.getContainerRenderer(0,horizontal?1:0,true)); IEnumSetting catSelect; if (horizontal) { VerticalContainer container=new VerticalContainer(label,theme.getContainerRenderer(0,0,false)); @@ -66,10 +69,11 @@ public void populateGUI (IComponentAdder gui, IComponentGenerator components, IC } client.getCategories().forEach(category->{ if (moduleColumn) { - IEnumSetting modSelect=addContainer(category,category.getModules().map(mod->mod),window,new ThemeTuple(theme,1,1),false,button->wrapColumn(button,new ThemeTuple(theme,1,1),1),()->catSelect.getValueName()==category.getDisplayName()); + IEnumSetting modSelect=addContainer(category,category.getModules().map(mod->mod),window,new ThemeTuple(theme,1,1),false,button->wrapColumn(button,new ThemeTuple(theme,0,1),1),()->catSelect.getValueName()==category.getDisplayName()); category.getModules().forEach(module->{ VerticalContainer container=new VerticalContainer(module,theme.getContainerRenderer(1,1,false)); window.addComponent(wrapColumn(container,new ThemeTuple(theme,1,1),weight),()->catSelect.getValueName()==category.getDisplayName()&&modSelect.getValueName()==module.getDisplayName()); + if (module.isEnabled()!=null) container.addComponent(new ToggleButton(new Labeled(enabledButton,null,()->true),module.isEnabled(),theme.getButtonRenderer(Boolean.class,1,2,false))); module.getSettings().forEach(setting->addSettingsComponent(setting,container,gui,components,new ThemeTuple(theme,2,2))); }); } else {