Skip to content

Commit ab97639

Browse files
committed
Minor fixes and adjustments
1 parent 1b455b9 commit ab97639

File tree

2 files changed

+8
-4
lines changed

2 files changed

+8
-4
lines changed

gradle.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ minecraft16fabric = 1.16.5
1010
mappings16fabric = 1.16.5+build.4
1111

1212
mappings16forge = 1.16.5
13-
minecraft16forge = 1.16.5-36.0.46
13+
minecraft16forge = 1.16.5-36.1.0
1414

1515
minecraft8fabric = 1.8.9
1616
mappings8fabric = 1.8.9+build.202102062228

panelstudio/src/main/java/com/lukflug/panelstudio/layout/CSGOLayout.java

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
import com.lukflug.panelstudio.setting.IEnumSetting;
2222
import com.lukflug.panelstudio.setting.ILabeled;
2323
import com.lukflug.panelstudio.setting.ISetting;
24+
import com.lukflug.panelstudio.setting.Labeled;
2425
import com.lukflug.panelstudio.theme.ITheme;
2526
import com.lukflug.panelstudio.theme.ThemeTuple;
2627
import com.lukflug.panelstudio.widget.Button;
@@ -33,16 +34,18 @@ public class CSGOLayout implements ILayout,IScrollSize {
3334
protected Point position;
3435
protected int width;
3536
protected Supplier<Animation> animation;
37+
protected String enabledButton;
3638
protected boolean horizontal,moduleColumn;
3739
protected int weight;
3840
protected ChildMode colorType;
3941
protected ChildUtil util;
4042

41-
public CSGOLayout (ILabeled label, Point position, int width, int popupWidth, Supplier<Animation> animation, boolean horizontal, boolean moduleColumn, int weight, ChildMode colorType, PopupTuple popupType) {
43+
public CSGOLayout (ILabeled label, Point position, int width, int popupWidth, Supplier<Animation> animation, String enabledButton, boolean horizontal, boolean moduleColumn, int weight, ChildMode colorType, PopupTuple popupType) {
4244
this.label=label;
4345
this.position=position;
4446
this.width=width;
4547
this.animation=animation;
48+
this.enabledButton=enabledButton;
4649
this.horizontal=horizontal;
4750
this.moduleColumn=moduleColumn;
4851
this.weight=weight;
@@ -53,7 +56,7 @@ public CSGOLayout (ILabeled label, Point position, int width, int popupWidth, Su
5356
@Override
5457
public void populateGUI (IComponentAdder gui, IComponentGenerator components, IClient client, ITheme theme) {
5558
Button title=new Button(label,theme.getButtonRenderer(Void.class,0,0,true));
56-
HorizontalContainer window=new HorizontalContainer(label,theme.getContainerRenderer(0,0,true));
59+
HorizontalContainer window=new HorizontalContainer(label,theme.getContainerRenderer(0,horizontal?1:0,true));
5760
IEnumSetting catSelect;
5861
if (horizontal) {
5962
VerticalContainer container=new VerticalContainer(label,theme.getContainerRenderer(0,0,false));
@@ -66,10 +69,11 @@ public void populateGUI (IComponentAdder gui, IComponentGenerator components, IC
6669
}
6770
client.getCategories().forEach(category->{
6871
if (moduleColumn) {
69-
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());
72+
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());
7073
category.getModules().forEach(module->{
7174
VerticalContainer container=new VerticalContainer(module,theme.getContainerRenderer(1,1,false));
7275
window.addComponent(wrapColumn(container,new ThemeTuple(theme,1,1),weight),()->catSelect.getValueName()==category.getDisplayName()&&modSelect.getValueName()==module.getDisplayName());
76+
if (module.isEnabled()!=null) container.addComponent(new ToggleButton(new Labeled(enabledButton,null,()->true),module.isEnabled(),theme.getButtonRenderer(Boolean.class,1,2,false)));
7377
module.getSettings().forEach(setting->addSettingsComponent(setting,container,gui,components,new ThemeTuple(theme,2,2)));
7478
});
7579
} else {

0 commit comments

Comments
 (0)