aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJuuxel <6596629+Juuxel@users.noreply.github.com>2020-07-01 11:42:57 +0300
committerJuuxel <6596629+Juuxel@users.noreply.github.com>2020-07-01 11:42:57 +0300
commit533233843d8a05a95b152019344974b07175d8ba (patch)
treec37d56101b00ae9962f17eeaa1ad9508573a6408
parent85439b23e481df505d9cfa30264efe7149c9befc (diff)
downloadLibGui-533233843d8a05a95b152019344974b07175d8ba.tar.gz
LibGui-533233843d8a05a95b152019344974b07175d8ba.tar.bz2
LibGui-533233843d8a05a95b152019344974b07175d8ba.zip
Fix player inventories not having slot peers
-rw-r--r--src/main/java/io/github/cottonmc/cotton/gui/widget/WPanel.java7
-rw-r--r--src/main/java/io/github/cottonmc/cotton/gui/widget/WPlayerInvPanel.java2
-rw-r--r--src/main/java/io/github/cottonmc/cotton/gui/widget/WWidget.java2
3 files changed, 10 insertions, 1 deletions
diff --git a/src/main/java/io/github/cottonmc/cotton/gui/widget/WPanel.java b/src/main/java/io/github/cottonmc/cotton/gui/widget/WPanel.java
index 259e93d..10725ee 100644
--- a/src/main/java/io/github/cottonmc/cotton/gui/widget/WPanel.java
+++ b/src/main/java/io/github/cottonmc/cotton/gui/widget/WPanel.java
@@ -175,6 +175,13 @@ public abstract class WPanel extends WWidget {
return this;
}
+ /**
+ * {@inheritDoc}
+ *
+ * <p>Subclasses should call {@code super.validate(c)} to ensure that children are validated.
+ *
+ * @param c the host GUI description
+ */
@Override
public void validate(GuiDescription c) {
super.validate(c);
diff --git a/src/main/java/io/github/cottonmc/cotton/gui/widget/WPlayerInvPanel.java b/src/main/java/io/github/cottonmc/cotton/gui/widget/WPlayerInvPanel.java
index 91fa547..3879e1f 100644
--- a/src/main/java/io/github/cottonmc/cotton/gui/widget/WPlayerInvPanel.java
+++ b/src/main/java/io/github/cottonmc/cotton/gui/widget/WPlayerInvPanel.java
@@ -82,9 +82,9 @@ public class WPlayerInvPanel extends WPlainPanel {
@Override
public void validate(GuiDescription c) {
+ super.validate(c);
if (c != null && label instanceof WLabel) {
((WLabel) label).setColor(c.getTitleColor());
}
}
}
-
diff --git a/src/main/java/io/github/cottonmc/cotton/gui/widget/WWidget.java b/src/main/java/io/github/cottonmc/cotton/gui/widget/WWidget.java
index 824a5b2..e615c53 100644
--- a/src/main/java/io/github/cottonmc/cotton/gui/widget/WWidget.java
+++ b/src/main/java/io/github/cottonmc/cotton/gui/widget/WWidget.java
@@ -362,6 +362,8 @@ public class WWidget {
/**
* Creates component peers, lays out children, and initializes animation data for this Widget and all its children.
* The host container must clear any heavyweight peers from its records before this method is called.
+ *
+ * @param host the host GUI description
*/
public void validate(GuiDescription host) {
this.host = host;