generated from FabricMC/fabric-example-mod
-
Notifications
You must be signed in to change notification settings - Fork 50
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
# Conflicts: # gradle.properties # src/main/java/io/github/cottonmc/cotton/gui/impl/modmenu/ModMenuSupport.java # src/main/java/io/github/cottonmc/cotton/gui/widget/WLabel.java # src/main/java/io/github/cottonmc/cotton/gui/widget/WTextField.java
- Loading branch information
Showing
28 changed files
with
91 additions
and
139 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
14 changes: 6 additions & 8 deletions
14
GuiTest/src/main/java/io/github/cottonmc/test/client/InsetsTestGui.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,22 +1,20 @@ | ||
package io.github.cottonmc.test.client; | ||
|
||
import net.minecraft.text.Text; | ||
|
||
import io.github.cottonmc.cotton.gui.client.LightweightGuiDescription; | ||
import io.github.cottonmc.cotton.gui.widget.WButton; | ||
import io.github.cottonmc.cotton.gui.widget.WGridPanel; | ||
|
||
import io.github.cottonmc.cotton.gui.widget.WLabel; | ||
|
||
import io.github.cottonmc.cotton.gui.widget.data.Insets; | ||
|
||
import net.minecraft.text.LiteralText; | ||
|
||
public class InsetsTestGui extends LightweightGuiDescription { | ||
public InsetsTestGui() { | ||
WGridPanel root = (WGridPanel) rootPanel; | ||
|
||
root.add(new WLabel(new LiteralText("Insets demo")), 0, 0); | ||
root.add(new WButton(new LiteralText("Default")).setOnClick(() -> root.setInsets(Insets.ROOT_PANEL)), 0, 1, 2, 1); | ||
root.add(new WButton(new LiteralText("None")).setOnClick(() -> root.setInsets(Insets.NONE)), 2, 1, 2, 1); | ||
root.add(new WButton(new LiteralText("Large")).setOnClick(() -> root.setInsets(new Insets(16))), 4, 1, 2, 1); | ||
root.add(new WLabel(Text.literal("Insets demo")), 0, 0); | ||
root.add(new WButton(Text.literal("Default")).setOnClick(() -> root.setInsets(Insets.ROOT_PANEL)), 0, 1, 2, 1); | ||
root.add(new WButton(Text.literal("None")).setOnClick(() -> root.setInsets(Insets.NONE)), 2, 1, 2, 1); | ||
root.add(new WButton(Text.literal("Large")).setOnClick(() -> root.setInsets(new Insets(16))), 4, 1, 2, 1); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
19 changes: 9 additions & 10 deletions
19
src/main/java/io/github/cottonmc/cotton/gui/impl/client/NarrationMessages.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,29 +1,28 @@ | ||
package io.github.cottonmc.cotton.gui.impl.client; | ||
|
||
import net.minecraft.text.Text; | ||
import net.minecraft.text.TranslatableText; | ||
|
||
public final class NarrationMessages { | ||
public static final String ITEM_SLOT_TITLE_KEY = "widget.libgui.item_slot.narration.title"; | ||
public static final String LABELED_SLIDER_TITLE_KEY = "widget.libgui.labeled_slider.narration.title"; | ||
public static final Text SCROLL_BAR_TITLE = new TranslatableText("widget.libgui.scroll_bar.narration.title"); | ||
public static final Text SCROLL_BAR_TITLE = Text.translatable("widget.libgui.scroll_bar.narration.title"); | ||
public static final String SLIDER_MESSAGE_KEY = "widget.libgui.slider.narration.title"; | ||
public static final Text SLIDER_USAGE = new TranslatableText("widget.libgui.slider.narration.usage"); | ||
public static final Text SLIDER_USAGE = Text.translatable("widget.libgui.slider.narration.usage"); | ||
public static final String TAB_TITLE_KEY = "widget.libgui.tab.narration.title"; | ||
public static final String TAB_POSITION_KEY = "widget.libgui.tab.narration.position"; | ||
public static final String TEXT_FIELD_TITLE_KEY = "widget.libgui.text_field.narration.title"; | ||
public static final String TEXT_FIELD_SUGGESTION_KEY = "widget.libgui.text_field.narration.suggestion"; | ||
public static final String TOGGLE_BUTTON_NAMED_KEY = "widget.libgui.toggle_button.narration.named"; | ||
public static final Text TOGGLE_BUTTON_OFF = new TranslatableText("widget.libgui.toggle_button.narration.off"); | ||
public static final Text TOGGLE_BUTTON_ON = new TranslatableText("widget.libgui.toggle_button.narration.on"); | ||
public static final Text TOGGLE_BUTTON_OFF = Text.translatable("widget.libgui.toggle_button.narration.off"); | ||
public static final Text TOGGLE_BUTTON_ON = Text.translatable("widget.libgui.toggle_button.narration.on"); | ||
public static final String TOGGLE_BUTTON_UNNAMED_KEY = "widget.libgui.toggle_button.narration.unnamed"; | ||
|
||
public static final class Vanilla { | ||
public static final Text BUTTON_USAGE_FOCUSED = new TranslatableText("narration.button.usage.focused"); | ||
public static final Text BUTTON_USAGE_HOVERED = new TranslatableText("narration.button.usage.hovered"); | ||
public static final Text COMPONENT_LIST_USAGE = new TranslatableText("narration.component_list.usage"); | ||
public static final Text INVENTORY = new TranslatableText("container.inventory"); | ||
public static final Text BUTTON_USAGE_FOCUSED = Text.translatable("narration.button.usage.focused"); | ||
public static final Text BUTTON_USAGE_HOVERED = Text.translatable("narration.button.usage.hovered"); | ||
public static final Text COMPONENT_LIST_USAGE = Text.translatable("narration.component_list.usage"); | ||
public static final Text INVENTORY = Text.translatable("container.inventory"); | ||
public static final String SCREEN_POSITION_KEY = "narrator.position.screen"; | ||
public static final Text HOTBAR = new TranslatableText("options.attack.hotbar"); | ||
public static final Text HOTBAR = Text.translatable("options.attack.hotbar"); | ||
} | ||
} |
Oops, something went wrong.