mirror of
https://github.com/MineLittlePony/MineLittlePony.git
synced 2025-02-13 08:14:23 +01:00
Added a button to access MineLP's settings from the skin uploader
This commit is contained in:
parent
b7402c5f2b
commit
228ab92fce
5 changed files with 29 additions and 5 deletions
|
@ -19,5 +19,5 @@ org.gradle.daemon=false
|
|||
# Dependencies
|
||||
modmenu_version=1.15.+
|
||||
kirin_version=1.8.2-21w19a-SNAPSHOT
|
||||
hd_skins_version=6.4.1-21w19a-SNAPSHOT
|
||||
hd_skins_version=6.4.2-21w19a-SNAPSHOT
|
||||
mson_version=1.3.2-21w19a-SNAPSHOT
|
||||
|
|
|
@ -136,7 +136,7 @@ public class GuiPonySettings extends GameGui {
|
|||
row += 15;
|
||||
|
||||
content.addButton(new Label(RIGHT, row)).getStyle().setText("minelp.options.skins");
|
||||
SkinsProxy.instance.renderOption(this, row, RIGHT, content);
|
||||
SkinsProxy.instance.renderOption(this, parent, row, RIGHT, content);
|
||||
}
|
||||
|
||||
public TranslatableText describeCurrentScale(AbstractSlider<Float> sender) {
|
||||
|
|
|
@ -33,7 +33,7 @@ public class SkinsProxy {
|
|||
return skins.loadSkin(texture, MinecraftProfileTexture.Type.SKIN);
|
||||
}
|
||||
|
||||
public void renderOption(Screen parent, int row, int RIGHT, ScrollContainer content) {
|
||||
public void renderOption(Screen screen, @Nullable Screen parent, int row, int RIGHT, ScrollContainer content) {
|
||||
content.addButton(new Button(RIGHT, row += 20, 150, 20))
|
||||
.setEnabled(false)
|
||||
.getStyle()
|
||||
|
|
|
@ -1,7 +1,10 @@
|
|||
package com.minelittlepony.client.hdskins;
|
||||
|
||||
import com.minelittlepony.api.pony.IPonyManager;
|
||||
import com.minelittlepony.client.GuiPonySettings;
|
||||
import com.minelittlepony.client.MineLittlePony;
|
||||
import com.minelittlepony.common.client.gui.element.Button;
|
||||
import com.minelittlepony.common.client.gui.sprite.TextureSprite;
|
||||
import com.minelittlepony.hdskins.client.dummy.PlayerPreview;
|
||||
import com.minelittlepony.hdskins.client.gui.GuiSkins;
|
||||
import com.minelittlepony.hdskins.server.SkinServerList;
|
||||
|
@ -28,6 +31,23 @@ class GuiSkinsMineLP extends GuiSkins {
|
|||
super(parent, servers);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void init() {
|
||||
super.init();
|
||||
|
||||
if (!(parent instanceof GuiPonySettings)) {
|
||||
addButton(new Button(width - 25, height - 90, 20, 20))
|
||||
.onClick(sender -> client.openScreen(new GuiPonySettings(this)))
|
||||
.getStyle()
|
||||
.setIcon(new TextureSprite()
|
||||
.setPosition(2, 2)
|
||||
.setTexture(new Identifier("minelittlepony", "textures/gui/pony.png"))
|
||||
.setTextureSize(16, 16)
|
||||
.setSize(16, 16))
|
||||
.setTooltip("minelp.options.title", 0, 10);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public PlayerPreview createPreviewer() {
|
||||
return new PonyPreview();
|
||||
|
|
|
@ -16,6 +16,8 @@ import com.minelittlepony.hdskins.profile.SkinType;
|
|||
|
||||
import com.mojang.authlib.GameProfile;
|
||||
|
||||
import javax.annotation.Nullable;
|
||||
|
||||
import net.fabricmc.api.ClientModInitializer;
|
||||
import net.minecraft.client.MinecraftClient;
|
||||
import net.minecraft.client.gui.screen.Screen;
|
||||
|
@ -51,9 +53,11 @@ public class MineLPHDSkins extends SkinsProxy implements ClientModInitializer {
|
|||
}
|
||||
|
||||
@Override
|
||||
public void renderOption(Screen parent, int row, int RIGHT, ScrollContainer content) {
|
||||
public void renderOption(Screen screen, @Nullable Screen parent, int row, int RIGHT, ScrollContainer content) {
|
||||
content.addButton(new Button(RIGHT, row += 20, 150, 20))
|
||||
.onClick(button -> MinecraftClient.getInstance().openScreen(GuiSkins.create(parent, HDSkins.getInstance().getSkinServerList())))
|
||||
.onClick(button -> MinecraftClient.getInstance().openScreen(
|
||||
parent instanceof GuiSkins ? parent : GuiSkins.create(screen, HDSkins.getInstance().getSkinServerList())
|
||||
))
|
||||
.getStyle()
|
||||
.setText("minelp.options.skins.hdskins.open");;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue