Skip to content

Commit

Permalink
added support for configuring scaling
Browse files Browse the repository at this point in the history
  • Loading branch information
BasiqueEvangelist committed Sep 6, 2024
1 parent 8c09b9c commit c70e2ab
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import blue.endless.jankson.Comment;
import io.wispforest.owo.config.annotation.Config;
import io.wispforest.owo.config.annotation.Hook;
import io.wispforest.owo.config.annotation.RangeConstraint;
import io.wispforest.owo.config.annotation.SectionHeader;
import net.minecraft.util.Identifier;

Expand All @@ -20,6 +21,12 @@ public class LimelightConfigModel {
@Comment("The theme used in the Limelight GUI")
public Theme theme = Theme.LIGHT;

@Comment("Percent of screen width used by the Limelight popup")
@RangeConstraint(min = 0, max = 100) public int horizontalPercent = 40;

@Comment("Percent of screen height used by the Limelight popup")
@RangeConstraint(min = 0, max = 100) public int verticalPercent = 50;

@Hook
@SectionHeader("extensions")
public Map<Identifier, Boolean> enabledExtensions = new HashMap<>();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ public class LimelightScreen extends BaseOwoScreen<FlowLayout> {

@Override
protected void build(FlowLayout rootComponent) {
FlowLayout sizeLimitFlow = Containers.verticalFlow(Sizing.fill(40), Sizing.fill(50));
FlowLayout sizeLimitFlow = Containers.verticalFlow(Sizing.fill(Limelight.CONFIG.horizontalPercent()), Sizing.fill(Limelight.CONFIG.verticalPercent()));

rootComponent
.child(sizeLimitFlow)
Expand Down
4 changes: 4 additions & 0 deletions src/client/resources/assets/limelight/lang/en_us.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,10 @@
"text.config.limelight.option.implicitWikiSearch.tooltip": "Allows you to search wikis without specifying a bang",
"text.config.limelight.option.theme": "Theme",
"text.config.limelight.option.theme.tooltip": "The theme used in the Limelight GUI",
"text.config.limelight.option.horizontalPercent": "Horizontal Percent",
"text.config.limelight.option.horizontalPercent.tooltip": "Percent of screen width used by the Limelight popup",
"text.config.limelight.option.verticalPercent": "Vertical Percent",
"text.config.limelight.option.verticalPercent.tooltip": "Percent of screen height used by the Limelight popup",

"text.config.limelight.enum.theme.light": "Light",
"text.config.limelight.enum.theme.dark": "Dark",
Expand Down

0 comments on commit c70e2ab

Please sign in to comment.