aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/io
diff options
context:
space:
mode:
authorJuuxel <6596629+Juuxel@users.noreply.github.com>2020-05-09 14:11:31 +0300
committerJuuxel <6596629+Juuxel@users.noreply.github.com>2020-05-09 14:13:20 +0300
commite1809045a90f73c9c11f10982abec7d37e998360 (patch)
tree8b0a387abe492879f39ce9116c2203e8423aced3 /src/main/java/io
parentb3d673df2fa83bc092ec2ba37eb936a4255b1b59 (diff)
downloadLibGui-e1809045a90f73c9c11f10982abec7d37e998360.tar.gz
LibGui-e1809045a90f73c9c11f10982abec7d37e998360.tar.bz2
LibGui-e1809045a90f73c9c11f10982abec7d37e998360.zip
Docs
Diffstat (limited to 'src/main/java/io')
-rw-r--r--src/main/java/io/github/cottonmc/cotton/gui/CottonInventoryController.java3
-rw-r--r--src/main/java/io/github/cottonmc/cotton/gui/EmptyInventory.java3
-rw-r--r--src/main/java/io/github/cottonmc/cotton/gui/GuiDescription.java9
-rw-r--r--src/main/java/io/github/cottonmc/cotton/gui/widget/WAbstractSlider.java22
4 files changed, 37 insertions, 0 deletions
diff --git a/src/main/java/io/github/cottonmc/cotton/gui/CottonInventoryController.java b/src/main/java/io/github/cottonmc/cotton/gui/CottonInventoryController.java
index 2721ff3..21a1dcb 100644
--- a/src/main/java/io/github/cottonmc/cotton/gui/CottonInventoryController.java
+++ b/src/main/java/io/github/cottonmc/cotton/gui/CottonInventoryController.java
@@ -22,6 +22,9 @@ import net.minecraft.screen.slot.Slot;
import net.minecraft.screen.slot.SlotActionType;
import net.minecraft.world.World;
+/**
+ * A screen handler-based GUI description for GUIs with slots.
+ */
public class CottonInventoryController extends ScreenHandler implements GuiDescription {
protected Inventory blockInventory;
diff --git a/src/main/java/io/github/cottonmc/cotton/gui/EmptyInventory.java b/src/main/java/io/github/cottonmc/cotton/gui/EmptyInventory.java
index 84eee0f..7376c92 100644
--- a/src/main/java/io/github/cottonmc/cotton/gui/EmptyInventory.java
+++ b/src/main/java/io/github/cottonmc/cotton/gui/EmptyInventory.java
@@ -4,6 +4,9 @@ import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.inventory.Inventory;
import net.minecraft.item.ItemStack;
+/**
+ * An empty inventory that cannot hold any items.
+ */
public class EmptyInventory implements Inventory {
public static final EmptyInventory INSTANCE = new EmptyInventory();
diff --git a/src/main/java/io/github/cottonmc/cotton/gui/GuiDescription.java b/src/main/java/io/github/cottonmc/cotton/gui/GuiDescription.java
index 3239179..a0b75cc 100644
--- a/src/main/java/io/github/cottonmc/cotton/gui/GuiDescription.java
+++ b/src/main/java/io/github/cottonmc/cotton/gui/GuiDescription.java
@@ -8,6 +8,15 @@ import net.fabricmc.api.EnvType;
import net.fabricmc.api.Environment;
import net.minecraft.screen.PropertyDelegate;
+/**
+ * A GUI description represents a GUI without depending on screens.
+ *
+ * <p>GUI descriptions contain the root panel and the property delegate of the GUI.
+ * They also manage the focused widget.
+ *
+ * @see io.github.cottonmc.cotton.gui.client.LightweightGuiDescription
+ * @see CottonInventoryController
+ */
public interface GuiDescription {
public WPanel getRootPanel();
public int getTitleColor();
diff --git a/src/main/java/io/github/cottonmc/cotton/gui/widget/WAbstractSlider.java b/src/main/java/io/github/cottonmc/cotton/gui/widget/WAbstractSlider.java
index 3367b1d..17b88c1 100644
--- a/src/main/java/io/github/cottonmc/cotton/gui/widget/WAbstractSlider.java
+++ b/src/main/java/io/github/cottonmc/cotton/gui/widget/WAbstractSlider.java
@@ -348,6 +348,16 @@ public abstract class WAbstractSlider extends WWidget {
: (ch == GLFW.GLFW_KEY_RIGHT || ch == GLFW.GLFW_KEY_UP);
}
+ /**
+ * The direction enum represents all four directions a slider can face.
+ *
+ * <p>For example, a slider whose value grows towards the right faces right.
+ *
+ * <p>The default direction for vertical sliders is {@link #UP} and
+ * the one for horizontal sliders is {@link #RIGHT}.
+ *
+ * @since 2.0.0
+ */
public enum Direction {
UP(Axis.VERTICAL, false),
DOWN(Axis.VERTICAL, true),
@@ -362,10 +372,22 @@ public abstract class WAbstractSlider extends WWidget {
this.inverted = inverted;
}
+ /**
+ * Gets the direction's axis.
+ *
+ * @return the axis
+ */
public Axis getAxis() {
return axis;
}
+ /**
+ * Returns whether this slider is inverted.
+ *
+ * <p>An inverted slider will have reversed keyboard control.
+ *
+ * @return whether this slider is inverted
+ */
public boolean isInverted() {
return inverted;
}