forked from Clones/Controlify
➕ Add donate button to carousel screen
This commit is contained in:
@ -71,12 +71,19 @@ public class ControllerCarouselScreen extends Screen implements ScreenController
|
|||||||
protected void init() {
|
protected void init() {
|
||||||
refreshControllers();
|
refreshControllers();
|
||||||
|
|
||||||
var artCreditText = Component.translatable("controlify.gui.carousel.art_credit", Component.literal("Andrew Grant"))
|
Component donateText = Component.translatable("controlify.gui.carousel.donate")
|
||||||
|
.withStyle(ChatFormatting.GOLD, ChatFormatting.BOLD);
|
||||||
|
FakePositionPlainTextButton donateBtn = this.addRenderableWidget(new FakePositionPlainTextButton(donateText, font, 3, 3, btn -> {
|
||||||
|
Util.getPlatform().openUri("https://ko-fi.com/isxander");
|
||||||
|
}));
|
||||||
|
donateBtn.setFakePosition(new ScreenRectangle(0, height, width, 1));
|
||||||
|
|
||||||
|
Component artCreditText = Component.translatable("controlify.gui.carousel.art_credit", Component.literal("Andrew Grant"))
|
||||||
.withStyle(ChatFormatting.DARK_GRAY);
|
.withStyle(ChatFormatting.DARK_GRAY);
|
||||||
var artCreditBtn = this.addRenderableWidget(new FakePositionPlainTextButton(artCreditText, font, width - font.width(artCreditText) - 3, 3, btn -> {
|
FakePositionPlainTextButton artCreditBtn = this.addRenderableWidget(new FakePositionPlainTextButton(artCreditText, font, width - font.width(artCreditText) - 3, 3, btn -> {
|
||||||
Util.getPlatform().openUri("https://github.com/Andrew6rant");
|
Util.getPlatform().openUri("https://github.com/Andrew6rant");
|
||||||
}));
|
}));
|
||||||
artCreditBtn.setFakePosition(new ScreenRectangle(0, height, width, 1));
|
artCreditBtn.setFakePosition(new ScreenRectangle(0, height + 1, width, 1));
|
||||||
|
|
||||||
GridLayout grid = new GridLayout().columnSpacing(10);
|
GridLayout grid = new GridLayout().columnSpacing(10);
|
||||||
GridLayout.RowHelper rowHelper = grid.createRowHelper(2);
|
GridLayout.RowHelper rowHelper = grid.createRowHelper(2);
|
||||||
|
@ -4,6 +4,7 @@
|
|||||||
"controlify.gui.carousel.entry.settings": "Settings",
|
"controlify.gui.carousel.entry.settings": "Settings",
|
||||||
"controlify.gui.carousel.entry.use": "Use",
|
"controlify.gui.carousel.entry.use": "Use",
|
||||||
"controlify.gui.carousel.entry.in_use": "Currently in use",
|
"controlify.gui.carousel.entry.in_use": "Currently in use",
|
||||||
|
"controlify.gui.carousel.donate": "Donate!",
|
||||||
"controlify.gui.carousel.art_credit": "Controller art by %s.",
|
"controlify.gui.carousel.art_credit": "Controller art by %s.",
|
||||||
|
|
||||||
"controlify.gui.global_settings.title": "Global Settings",
|
"controlify.gui.global_settings.title": "Global Settings",
|
||||||
|
Reference in New Issue
Block a user