Added Quests and Real Settings (yay)

This commit is contained in:
2026-07-11 09:53:19 +02:00
parent 596612880b
commit d3fc829dee
12 changed files with 666 additions and 150 deletions
@@ -0,0 +1,40 @@
package de.fullrisk.citrusDev.mixin;
import io.wispforest.owo.ui.component.SliderComponent;
import io.wispforest.owo.ui.core.OwoUIGraphics;
import net.minecraft.client.gui.GuiGraphicsExtractor;
import net.minecraft.client.gui.components.AbstractSliderButton;
import net.minecraft.client.renderer.RenderPipelines;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.Inject;
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
@Mixin(AbstractSliderButton.class)
public abstract class SliderComponentMixin {
@Inject(method = "extractWidgetRenderState", at = @At("HEAD"), cancellable = true)
private void citrusDev$renderGlassSlider(GuiGraphicsExtractor graphics, int mouseX, int mouseY, float a, CallbackInfo ci) {
Object self = this;
if (!(self instanceof SliderComponent slider)) return;
AbstractSliderButton widget = (AbstractSliderButton) self;
int x = widget.getX();
int y = widget.getY();
int w = widget.getWidth();
int h = widget.getHeight();
OwoUIGraphics owo = OwoUIGraphics.of(graphics);
// glass track
owo.fill(RenderPipelines.GUI, x, y, x + w, y + h, 0x40FFFFFF);
// handle
int handleWidth = 4;
int handleX = x + (int) (slider.value() * (w - handleWidth));
owo.fill(RenderPipelines.GUI, handleX, y, handleX + handleWidth, y + h, 0xFFFFFFFF);
ci.cancel();
}
}