mirror of
https://github.com/JonasunderscoreJones/nicer-skies.git
synced 2025-10-22 19:29:18 +02:00
add cool stuff
This commit is contained in:
parent
38fedc823e
commit
4f838a1127
3 changed files with 0 additions and 101 deletions
|
@ -1,57 +0,0 @@
|
|||
package codes.ztereohype.example.gui;
|
||||
|
||||
import codes.ztereohype.example.NicerSkies;
|
||||
import codes.ztereohype.example.config.ConfigManager;
|
||||
import codes.ztereohype.example.gui.widget.Separator;
|
||||
import com.mojang.blaze3d.vertex.PoseStack;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.gui.components.Checkbox;
|
||||
import net.minecraft.client.gui.screens.Screen;
|
||||
import net.minecraft.network.chat.Component;
|
||||
|
||||
public class ConfigScreen extends Screen {
|
||||
private Screen lastScreen;
|
||||
private ConfigManager cm = NicerSkies.config;
|
||||
protected ConfigScreen(Screen lastScreen) {
|
||||
super(Component.literal("Nicer Skies Config"));
|
||||
this.lastScreen = lastScreen;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void init() {
|
||||
addRenderableWidget(new Checkbox(20, 60, 20, 20, Component.literal("Render nebulas"), cm.getNebulas()) {
|
||||
@Override
|
||||
public void onPress() {
|
||||
super.onPress();
|
||||
cm.setNebulas(!cm.getNebulas());
|
||||
}
|
||||
});
|
||||
addRenderableWidget(new Checkbox(20, 90, 20, 20, Component.literal("Twinlke Stars"), cm.getTwinklingStars()) {
|
||||
@Override
|
||||
public void onPress() {
|
||||
super.onPress();
|
||||
cm.setTwinklingStars(!cm.getTwinklingStars());
|
||||
}
|
||||
});
|
||||
addRenderableWidget(new Checkbox(20, 120, 20, 20, Component.literal("Custom Lightmap"), cm.getLightmapTweaked()) {
|
||||
@Override
|
||||
public void onPress() {
|
||||
super.onPress();
|
||||
cm.setLightmapTweaked(!cm.getLightmapTweaked());
|
||||
}
|
||||
});
|
||||
addRenderableOnly(new Separator(this.width / 2, 30, this.height - 40));
|
||||
|
||||
addRenderableWidget(new Slider)
|
||||
}
|
||||
|
||||
@Override
|
||||
public void render(PoseStack poseStack, int mouseX, int mouseY, float partialTick) {
|
||||
this.renderBackground(poseStack);
|
||||
super.render(poseStack, mouseX, mouseY, partialTick);
|
||||
|
||||
drawCenteredString(poseStack, this.font, this.title, this.width / 2, 10, 16777215);
|
||||
drawCenteredString(poseStack, this.font, "Toggle Features", this.width / 4, 36, 16777215);
|
||||
drawCenteredString(poseStack, this.font, "Nebula Settings", 3 * this.width / 4, 36, 16777215);
|
||||
}
|
||||
}
|
|
@ -1,14 +0,0 @@
|
|||
package codes.ztereohype.example.gui;
|
||||
|
||||
import com.terraformersmc.modmenu.api.ConfigScreenFactory;
|
||||
import com.terraformersmc.modmenu.api.ModMenuApi;
|
||||
import net.fabricmc.api.EnvType;
|
||||
import net.fabricmc.api.Environment;
|
||||
|
||||
@Environment(EnvType.CLIENT)
|
||||
public class ModMenuSettingsApi implements ModMenuApi {
|
||||
@Override
|
||||
public ConfigScreenFactory<?> getModConfigScreenFactory() {
|
||||
return ConfigScreen::new;
|
||||
}
|
||||
}
|
|
@ -1,30 +0,0 @@
|
|||
package codes.ztereohype.example.gui.widget;
|
||||
|
||||
import com.mojang.blaze3d.systems.RenderSystem;
|
||||
import com.mojang.blaze3d.vertex.PoseStack;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.gui.Font;
|
||||
import net.minecraft.client.gui.GuiComponent;
|
||||
import net.minecraft.client.gui.components.AbstractWidget;
|
||||
import net.minecraft.client.gui.components.Widget;
|
||||
import net.minecraft.client.gui.narration.NarrationElementOutput;
|
||||
import net.minecraft.client.renderer.GameRenderer;
|
||||
import net.minecraft.network.chat.Component;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
public class Separator extends GuiComponent implements Widget {
|
||||
private final int x;
|
||||
private final int y;
|
||||
private final int height;
|
||||
|
||||
public Separator(int x, int y, int height) {
|
||||
this.x = x;
|
||||
this.y = y;
|
||||
this.height = height;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void render(@NotNull PoseStack poseStack, int mouseX, int mouseY, float partialTick) {
|
||||
fill(poseStack, x, y, x + 1, y + height, 0xFFFFFFFF);
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue