-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add new Category to config, Try change config background to 'minecraf…
…t:air'
- Loading branch information
Showing
4 changed files
with
89 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
82 changes: 82 additions & 0 deletions
82
src/main/java/com/thatmg393/usefulhuds/config/gui/clothconfig/categories/COORDSCategory.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,82 @@ | ||
package com.thatmg393.usefulhuds.config.gui.clothconfig.categories; | ||
|
||
import java.util.ArrayList; | ||
|
||
import com.thatmg393.usefulhuds.config.gui.clothconfig.base.AbstractConfigCategory; | ||
import com.thatmg393.usefulhuds.utils.DisplayUtils; | ||
|
||
import me.shedaniel.clothconfig2.api.AbstractConfigListEntry; | ||
import net.minecraft.text.Text; | ||
|
||
@SuppressWarnings("rawtypes") | ||
public class COORDSCategory extends AbstractConfigCategory { | ||
public COORDSCategory() { | ||
super(Text.translatable("usefulhuds.config.COORDS.title")); | ||
} | ||
|
||
@Override | ||
public ArrayList<AbstractConfigListEntry> getEntries() { | ||
ArrayList<AbstractConfigListEntry> entries = new ArrayList<>(); | ||
|
||
entries.add( | ||
entryBuilder.startBooleanToggle( | ||
Text.translatable("usefulhuds.config.hudvisible"), | ||
config.COORDS.visible | ||
).setDefaultValue(defaultConfig.COORDS.visible) | ||
.setSaveConsumer(v -> config.COORDS.visible = v) | ||
.build() | ||
); | ||
|
||
entries.add( | ||
entryBuilder.startIntSlider( | ||
Text.translatable("usefulhuds.config.hudoffsetx"), | ||
config.COORDS.offsetX, | ||
0, DisplayUtils.getScreenScaledWH()[0] | ||
).setDefaultValue(defaultConfig.COORDS.offsetX) | ||
.setSaveConsumer(v -> config.COORDS.offsetX = v) | ||
.build() | ||
); | ||
|
||
entries.add( | ||
entryBuilder.startIntSlider( | ||
Text.translatable("usefulhuds.config.hudoffsety"), | ||
config.COORDS.offsetY, | ||
0, DisplayUtils.getScreenScaledWH()[1] | ||
).setDefaultValue(defaultConfig.COORDS.offsetX) | ||
.setSaveConsumer(v -> config.COORDS.offsetY = v) | ||
.build() | ||
); | ||
|
||
entries.add( | ||
entryBuilder.startIntSlider( | ||
Text.translatable("usefulhuds.config.hudscale"), | ||
config.COORDS.scale, | ||
1, 100 | ||
).setDefaultValue(defaultConfig.COORDS.scale) | ||
.setSaveConsumer(v -> config.COORDS.scale = v) | ||
.build() | ||
); | ||
|
||
entries.add( | ||
entryBuilder.startIntSlider( | ||
Text.translatable("usefulhuds.config.hudpaddingx"), | ||
config.COORDS.paddingX, | ||
0, 64 | ||
).setDefaultValue(defaultConfig.COORDS.paddingX) | ||
.setSaveConsumer(v -> config.COORDS.paddingX = v) | ||
.build() | ||
); | ||
|
||
entries.add( | ||
entryBuilder.startIntSlider( | ||
Text.translatable("usefulhuds.config.hudpaddingy"), | ||
config.COORDS.paddingY, | ||
0, 64 | ||
).setDefaultValue(defaultConfig.COORDS.paddingY) | ||
.setSaveConsumer(v -> config.COORDS.paddingY = v) | ||
.build() | ||
); | ||
|
||
return entries; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters