summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Silverstone <dsilvers@digital-scurf.org>2014-11-03 22:28:55 +0000
committerDaniel Silverstone <dsilvers@digital-scurf.org>2014-11-03 22:28:55 +0000
commit1fd988e1a80b30e61c385e9375d574413d1750a5 (patch)
tree6602e83774cefdf5292edaab697403e4d43e1ba2
parentfa845586444310c21274dc73ad68538c3e75ef4b (diff)
downloadnoctis-1fd988e1a80b30e61c385e9375d574413d1750a5.tar.bz2
Add the back and top buttons, the textures are bad, the positions worse. Make TOP work.
-rw-r--r--src/main/java/net/flarn/noctis/journal/gui/JournalGui.java30
-rw-r--r--src/main/resources/assets/noctis/textures/gui/journal.pngbin10367 -> 10749 bytes
2 files changed, 26 insertions, 4 deletions
diff --git a/src/main/java/net/flarn/noctis/journal/gui/JournalGui.java b/src/main/java/net/flarn/noctis/journal/gui/JournalGui.java
index f17c83d..efc7f66 100644
--- a/src/main/java/net/flarn/noctis/journal/gui/JournalGui.java
+++ b/src/main/java/net/flarn/noctis/journal/gui/JournalGui.java
@@ -37,6 +37,8 @@ public class JournalGui extends GuiScreen {
private int subPageIdx;
private NavigationButton buttonNext;
private NavigationButton buttonPrev;
+ private NavigationButton buttonTop;
+ private NavigationButton buttonBack;
public JournalGui() {
contentModel = JournalContentModel.currentContentModel;
@@ -75,6 +77,8 @@ public class JournalGui extends GuiScreen {
this.buttonList.clear();
this.buttonList.add(buttonNext = new NavigationButton(0, getXOffset() + 120, getYOffset() + bookImageHeight - 24, NavigationButton.ButtonType.NEXT));
this.buttonList.add(buttonPrev = new NavigationButton(1, getXOffset() + 38, getYOffset() + bookImageHeight - 24, NavigationButton.ButtonType.PREV));
+ this.buttonList.add(buttonTop = new NavigationButton(2, getXOffset() + 38, getYOffset(), NavigationButton.ButtonType.TOP));
+ this.buttonList.add(buttonBack = new NavigationButton(3, getXOffset() + 120, getYOffset(), NavigationButton.ButtonType.BACK));
this.updateButtons();
}
@@ -84,6 +88,8 @@ public class JournalGui extends GuiScreen {
(entryIdx < (day.size() - 1)) ||
(pageIdx < (entry.pages.size() - 1)) ||
(subPageIdx < (countSubPages(page) - 1));
+ buttonTop.visible = buttonPrev.visible;
+ buttonBack.visible = true;
}
private int countSubPages(JournalEntry.Page page) {
@@ -149,6 +155,14 @@ public class JournalGui extends GuiScreen {
nextPage();
} else if (button == buttonPrev) {
prevPage();
+ } else if (button == buttonTop) {
+ dayIdx = 0;
+ day = contentModel.journalPageGroups.get(dayIdx);
+ entryIdx = 0;
+ entry = day.get(entryIdx);
+ pageIdx = 0;
+ page = entry.pages.get(0);
+ subPageIdx = 0;
}
updateButtons();
}
@@ -284,10 +298,18 @@ public class JournalGui extends GuiScreen {
{
k += 23;
}
-
- if (buttonType == ButtonType.PREV)
- {
- l += 13;
+ switch (buttonType) {
+ case PREV:
+ l += 13;
+ break;
+ case NEXT:
+ break;
+ case TOP:
+ l += 26;
+ break;
+ case BACK:
+ l += 39;
+ break;
}
this.drawTexturedModalRect(this.xPosition, this.yPosition, k, l, 23, 13);
diff --git a/src/main/resources/assets/noctis/textures/gui/journal.png b/src/main/resources/assets/noctis/textures/gui/journal.png
index dfd93d0..2d7e420 100644
--- a/src/main/resources/assets/noctis/textures/gui/journal.png
+++ b/src/main/resources/assets/noctis/textures/gui/journal.png
Binary files differ