Pondering too fast

- Added a button to slow down ponder scenes while any text is shown on screen
This commit is contained in:
simibubi 2021-03-28 01:52:04 +01:00
parent fcae7e5c9a
commit 76bd3b3f50
18 changed files with 108 additions and 58 deletions

View file

@ -403,19 +403,19 @@ a3a11524cd3515fc01d905767b4b7ea782adaf03 assets/create/blockstates/yellow_seat.j
7f39521b211441f5c3e06d60c5978cebe16cacfb assets/create/blockstates/zinc_block.json
b7181bcd8182b2f17088e5aa881f374c9c65470c assets/create/blockstates/zinc_ore.json
ce0e5405da381a86625b908c569c5dbe347abdba assets/create/lang/en_ud.json
442123de75c67a2b562194981d62c6a6de053593 assets/create/lang/en_us.json
1a5739ce1ab4a923dcf5a7ed12f16af394aed719 assets/create/lang/unfinished/de_de.json
4f21f855b45e8b44aedcae94e5a41c797d05af45 assets/create/lang/unfinished/es_es.json
e971082462cd5a92a08c3a1481e8e7c6e1afcea1 assets/create/lang/unfinished/es_mx.json
64a39634a36da998fd11553340cd1fc652129ce9 assets/create/lang/unfinished/fr_fr.json
afb72ad7e2713819b3cda0110a41dcdbbcc0bb0b assets/create/lang/unfinished/it_it.json
583b4bddc044614efb1b08f9bfb36a49e0a67e4f assets/create/lang/unfinished/ja_jp.json
9baa3052e1a9440e1cb6d46950d2227f2be3435e assets/create/lang/unfinished/ko_kr.json
7701f3b29b3e92a9943c15000beb9df02143fe90 assets/create/lang/unfinished/nl_nl.json
9f935fe569d793f6ee581ebc24bff5740c91fbab assets/create/lang/unfinished/pt_br.json
9ede4dc1051fea0bcabc30da1d133c0048d29641 assets/create/lang/unfinished/ru_ru.json
2442b5fe4ed2d92ab3081e7422bfecdf1ac06610 assets/create/lang/unfinished/zh_cn.json
56268c452b57cf072f35839ebfa130213a966730 assets/create/lang/unfinished/zh_tw.json
e847bb88a7cf6bfa81f03f87f106a85c7e351da8 assets/create/lang/en_us.json
950f435754c82bb46d0f0bbd7fb0ea5c2a6db2be assets/create/lang/unfinished/de_de.json
953669a0880eb087bff8c6a0f31ab593826410ac assets/create/lang/unfinished/es_es.json
49dcba9e9e74421dc74e24a27f6876a9f9e4bafa assets/create/lang/unfinished/es_mx.json
db5fa9ea3a940cc378657db43d7de6f71abb8da3 assets/create/lang/unfinished/fr_fr.json
144bbca783790c63c1671388227a00780c23e5ba assets/create/lang/unfinished/it_it.json
8ebf781c5e3d8dd78eed9c1445d39a643dd1e2b1 assets/create/lang/unfinished/ja_jp.json
46f41cb9e6870bbb8aa4d58525f7ab07f5e911ff assets/create/lang/unfinished/ko_kr.json
eb16433d9ba6c3f9748074f48c22368c81cc52b3 assets/create/lang/unfinished/nl_nl.json
a4aa6902f68a6e4c2c0ce38dee6623e80a6cc65e assets/create/lang/unfinished/pt_br.json
8f889340f518084c90eba259ddbe822601462c4a assets/create/lang/unfinished/ru_ru.json
737e73147690f40aaae5ed51d24e3016fa9d778c assets/create/lang/unfinished/zh_cn.json
34826633b870307b430c64ec62695852b27cb872 assets/create/lang/unfinished/zh_tw.json
846200eb548d3bfa2e77b41039de159b4b6cfb45 assets/create/models/block/acacia_window.json
1930fa3a3c98d53dd19e4ee7f55bc27fd47aa281 assets/create/models/block/acacia_window_pane_noside.json
1763ea2c9b981d187f5031ba608f3d5d3be3986a assets/create/models/block/acacia_window_pane_noside_alt.json

View file

@ -1829,6 +1829,7 @@
"create.ponder.previous": "Previous Scene",
"create.ponder.replay": "Replay",
"create.ponder.think_back": "Think Back",
"create.ponder.slow_text": "Comfy Reading",
"create.ponder.shared.movement_anchors": "With the help of Chassis or Super Glue, larger structures can be moved.",
"create.ponder.shared.rpm32": "32 RPM",
"create.ponder.shared.sneak_and": "Sneak +",

View file

@ -1,5 +1,5 @@
{
"_": "Missing Localizations: 1506",
"_": "Missing Localizations: 1507",
"_": "->------------------------] Game Elements [------------------------<-",
@ -1830,6 +1830,7 @@
"create.ponder.previous": "UNLOCALIZED: Previous Scene",
"create.ponder.replay": "UNLOCALIZED: Replay",
"create.ponder.think_back": "UNLOCALIZED: Think Back",
"create.ponder.slow_text": "UNLOCALIZED: Comfy Reading",
"create.ponder.shared.movement_anchors": "UNLOCALIZED: With the help of Chassis or Super Glue, larger structures can be moved.",
"create.ponder.shared.rpm32": "UNLOCALIZED: 32 RPM",
"create.ponder.shared.sneak_and": "UNLOCALIZED: Sneak +",

View file

@ -1,5 +1,5 @@
{
"_": "Missing Localizations: 541",
"_": "Missing Localizations: 542",
"_": "->------------------------] Game Elements [------------------------<-",
@ -1830,6 +1830,7 @@
"create.ponder.previous": "UNLOCALIZED: Previous Scene",
"create.ponder.replay": "UNLOCALIZED: Replay",
"create.ponder.think_back": "UNLOCALIZED: Think Back",
"create.ponder.slow_text": "UNLOCALIZED: Comfy Reading",
"create.ponder.shared.movement_anchors": "UNLOCALIZED: With the help of Chassis or Super Glue, larger structures can be moved.",
"create.ponder.shared.rpm32": "UNLOCALIZED: 32 RPM",
"create.ponder.shared.sneak_and": "UNLOCALIZED: Sneak +",

View file

@ -1,5 +1,5 @@
{
"_": "Missing Localizations: 1436",
"_": "Missing Localizations: 1437",
"_": "->------------------------] Game Elements [------------------------<-",
@ -1830,6 +1830,7 @@
"create.ponder.previous": "UNLOCALIZED: Previous Scene",
"create.ponder.replay": "UNLOCALIZED: Replay",
"create.ponder.think_back": "UNLOCALIZED: Think Back",
"create.ponder.slow_text": "UNLOCALIZED: Comfy Reading",
"create.ponder.shared.movement_anchors": "UNLOCALIZED: With the help of Chassis or Super Glue, larger structures can be moved.",
"create.ponder.shared.rpm32": "UNLOCALIZED: 32 RPM",
"create.ponder.shared.sneak_and": "UNLOCALIZED: Sneak +",

View file

@ -1,5 +1,5 @@
{
"_": "Missing Localizations: 1218",
"_": "Missing Localizations: 1219",
"_": "->------------------------] Game Elements [------------------------<-",
@ -1830,6 +1830,7 @@
"create.ponder.previous": "UNLOCALIZED: Previous Scene",
"create.ponder.replay": "UNLOCALIZED: Replay",
"create.ponder.think_back": "UNLOCALIZED: Think Back",
"create.ponder.slow_text": "UNLOCALIZED: Comfy Reading",
"create.ponder.shared.movement_anchors": "UNLOCALIZED: With the help of Chassis or Super Glue, larger structures can be moved.",
"create.ponder.shared.rpm32": "UNLOCALIZED: 32 RPM",
"create.ponder.shared.sneak_and": "UNLOCALIZED: Sneak +",

View file

@ -1,5 +1,5 @@
{
"_": "Missing Localizations: 558",
"_": "Missing Localizations: 559",
"_": "->------------------------] Game Elements [------------------------<-",
@ -1830,6 +1830,7 @@
"create.ponder.previous": "UNLOCALIZED: Previous Scene",
"create.ponder.replay": "UNLOCALIZED: Replay",
"create.ponder.think_back": "UNLOCALIZED: Think Back",
"create.ponder.slow_text": "UNLOCALIZED: Comfy Reading",
"create.ponder.shared.movement_anchors": "UNLOCALIZED: With the help of Chassis or Super Glue, larger structures can be moved.",
"create.ponder.shared.rpm32": "UNLOCALIZED: 32 RPM",
"create.ponder.shared.sneak_and": "UNLOCALIZED: Sneak +",

View file

@ -1,5 +1,5 @@
{
"_": "Missing Localizations: 565",
"_": "Missing Localizations: 566",
"_": "->------------------------] Game Elements [------------------------<-",
@ -1830,6 +1830,7 @@
"create.ponder.previous": "UNLOCALIZED: Previous Scene",
"create.ponder.replay": "UNLOCALIZED: Replay",
"create.ponder.think_back": "UNLOCALIZED: Think Back",
"create.ponder.slow_text": "UNLOCALIZED: Comfy Reading",
"create.ponder.shared.movement_anchors": "UNLOCALIZED: With the help of Chassis or Super Glue, larger structures can be moved.",
"create.ponder.shared.rpm32": "UNLOCALIZED: 32 RPM",
"create.ponder.shared.sneak_and": "UNLOCALIZED: Sneak +",

View file

@ -1,5 +1,5 @@
{
"_": "Missing Localizations: 611",
"_": "Missing Localizations: 612",
"_": "->------------------------] Game Elements [------------------------<-",
@ -1830,6 +1830,7 @@
"create.ponder.previous": "UNLOCALIZED: Previous Scene",
"create.ponder.replay": "UNLOCALIZED: Replay",
"create.ponder.think_back": "UNLOCALIZED: Think Back",
"create.ponder.slow_text": "UNLOCALIZED: Comfy Reading",
"create.ponder.shared.movement_anchors": "UNLOCALIZED: With the help of Chassis or Super Glue, larger structures can be moved.",
"create.ponder.shared.rpm32": "UNLOCALIZED: 32 RPM",
"create.ponder.shared.sneak_and": "UNLOCALIZED: Sneak +",

View file

@ -1,5 +1,5 @@
{
"_": "Missing Localizations: 1705",
"_": "Missing Localizations: 1706",
"_": "->------------------------] Game Elements [------------------------<-",
@ -1830,6 +1830,7 @@
"create.ponder.previous": "UNLOCALIZED: Previous Scene",
"create.ponder.replay": "UNLOCALIZED: Replay",
"create.ponder.think_back": "UNLOCALIZED: Think Back",
"create.ponder.slow_text": "UNLOCALIZED: Comfy Reading",
"create.ponder.shared.movement_anchors": "UNLOCALIZED: With the help of Chassis or Super Glue, larger structures can be moved.",
"create.ponder.shared.rpm32": "UNLOCALIZED: 32 RPM",
"create.ponder.shared.sneak_and": "UNLOCALIZED: Sneak +",

View file

@ -1,5 +1,5 @@
{
"_": "Missing Localizations: 1771",
"_": "Missing Localizations: 1772",
"_": "->------------------------] Game Elements [------------------------<-",
@ -1830,6 +1830,7 @@
"create.ponder.previous": "UNLOCALIZED: Previous Scene",
"create.ponder.replay": "UNLOCALIZED: Replay",
"create.ponder.think_back": "UNLOCALIZED: Think Back",
"create.ponder.slow_text": "UNLOCALIZED: Comfy Reading",
"create.ponder.shared.movement_anchors": "UNLOCALIZED: With the help of Chassis or Super Glue, larger structures can be moved.",
"create.ponder.shared.rpm32": "UNLOCALIZED: 32 RPM",
"create.ponder.shared.sneak_and": "UNLOCALIZED: Sneak +",

View file

@ -1,5 +1,5 @@
{
"_": "Missing Localizations: 561",
"_": "Missing Localizations: 562",
"_": "->------------------------] Game Elements [------------------------<-",
@ -1830,6 +1830,7 @@
"create.ponder.previous": "UNLOCALIZED: Previous Scene",
"create.ponder.replay": "UNLOCALIZED: Replay",
"create.ponder.think_back": "UNLOCALIZED: Think Back",
"create.ponder.slow_text": "UNLOCALIZED: Comfy Reading",
"create.ponder.shared.movement_anchors": "UNLOCALIZED: With the help of Chassis or Super Glue, larger structures can be moved.",
"create.ponder.shared.rpm32": "UNLOCALIZED: 32 RPM",
"create.ponder.shared.sneak_and": "UNLOCALIZED: Sneak +",

View file

@ -1,5 +1,5 @@
{
"_": "Missing Localizations: 559",
"_": "Missing Localizations: 560",
"_": "->------------------------] Game Elements [------------------------<-",
@ -1830,6 +1830,7 @@
"create.ponder.previous": "UNLOCALIZED: Previous Scene",
"create.ponder.replay": "UNLOCALIZED: Replay",
"create.ponder.think_back": "UNLOCALIZED: Think Back",
"create.ponder.slow_text": "UNLOCALIZED: Comfy Reading",
"create.ponder.shared.movement_anchors": "UNLOCALIZED: With the help of Chassis or Super Glue, larger structures can be moved.",
"create.ponder.shared.rpm32": "UNLOCALIZED: 32 RPM",
"create.ponder.shared.sneak_and": "UNLOCALIZED: Sneak +",

View file

@ -1,5 +1,5 @@
{
"_": "Missing Localizations: 564",
"_": "Missing Localizations: 565",
"_": "->------------------------] Game Elements [------------------------<-",
@ -1830,6 +1830,7 @@
"create.ponder.previous": "UNLOCALIZED: Previous Scene",
"create.ponder.replay": "UNLOCALIZED: Replay",
"create.ponder.think_back": "UNLOCALIZED: Think Back",
"create.ponder.slow_text": "UNLOCALIZED: Comfy Reading",
"create.ponder.shared.movement_anchors": "UNLOCALIZED: With the help of Chassis or Super Glue, larger structures can be moved.",
"create.ponder.shared.rpm32": "UNLOCALIZED: 32 RPM",
"create.ponder.shared.sneak_and": "UNLOCALIZED: Sneak +",

View file

@ -123,7 +123,8 @@ public class AllIcons implements IScreenRenderable {
I_MTD_RIGHT = next(),
I_MTD_SCAN = next(),
I_MTD_REPLAY = next(),
I_MTD_USER_MODE = next();
I_MTD_USER_MODE = next(),
I_MTD_SLOW_MODE = next();
public AllIcons(int x, int y) {
iconX = x * 16;

View file

@ -80,6 +80,7 @@ public class PonderLocalization {
addGeneral(object, PonderUI.PREVIOUS, "Previous Scene");
addGeneral(object, PonderUI.REPLAY, "Replay");
addGeneral(object, PonderUI.THINK_BACK, "Think Back");
addGeneral(object, PonderUI.SLOW_TEXT, "Comfy Reading");
shared.forEach((k, v) -> object.addProperty(Create.ID + "." + langKeyForShared(k), v));
tag.forEach((k, v) -> {

View file

@ -1,5 +1,7 @@
package com.simibubi.create.foundation.ponder;
import static com.simibubi.create.foundation.ponder.PonderLocalization.LANG_PREFIX;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
@ -21,6 +23,7 @@ import com.simibubi.create.foundation.ponder.content.PonderChapter;
import com.simibubi.create.foundation.ponder.content.PonderIndex;
import com.simibubi.create.foundation.ponder.content.PonderTag;
import com.simibubi.create.foundation.ponder.content.PonderTagScreen;
import com.simibubi.create.foundation.ponder.elements.TextWindowElement;
import com.simibubi.create.foundation.ponder.ui.PonderButton;
import com.simibubi.create.foundation.renderState.SuperRenderTypeBuffer;
import com.simibubi.create.foundation.utility.ColorHelper;
@ -58,14 +61,15 @@ public class PonderUI extends NavigatableSimiScreen {
public static int ponderTicks;
public static float ponderPartialTicksPaused;
public static final String PONDERING = PonderLocalization.LANG_PREFIX + "pondering";
public static final String IDENTIFY_MODE = PonderLocalization.LANG_PREFIX + "identify_mode";
public static final String IN_CHAPTER = PonderLocalization.LANG_PREFIX + "in_chapter";
public static final String IDENTIFY = PonderLocalization.LANG_PREFIX + "identify";
public static final String PREVIOUS = PonderLocalization.LANG_PREFIX + "previous";
public static final String CLOSE = PonderLocalization.LANG_PREFIX + "close";
public static final String NEXT = PonderLocalization.LANG_PREFIX + "next";
public static final String REPLAY = PonderLocalization.LANG_PREFIX + "replay";
public static final String PONDERING = LANG_PREFIX + "pondering";
public static final String IDENTIFY_MODE = LANG_PREFIX + "identify_mode";
public static final String IN_CHAPTER = LANG_PREFIX + "in_chapter";
public static final String IDENTIFY = LANG_PREFIX + "identify";
public static final String PREVIOUS = LANG_PREFIX + "previous";
public static final String CLOSE = LANG_PREFIX + "close";
public static final String NEXT = LANG_PREFIX + "next";
public static final String REPLAY = LANG_PREFIX + "replay";
public static final String SLOW_TEXT = LANG_PREFIX + "slow_text";
private List<PonderScene> scenes;
private List<PonderTag> tags;
@ -76,6 +80,7 @@ public class PonderUI extends NavigatableSimiScreen {
PonderChapter chapter = null;
private boolean userViewMode;
private boolean slowTextMode;
private boolean identifyMode;
private ItemStack hoveredTooltipItem;
private BlockPos hoveredBlockPos;
@ -90,10 +95,13 @@ public class PonderUI extends NavigatableSimiScreen {
private int index = 0;
private PonderTag referredToByTag;
private PonderButton left, right, scan, chap, userMode, close, replay;
private PonderButton left, right, scan, chap, userMode, close, replay, slowMode;
private PonderProgressBar progressBar;
private int skipCooling = 0;
private int extendedTickLength = 0;
private int extendedTickTimer = 0;
public static PonderUI of(ResourceLocation id) {
return new PonderUI(PonderRegistry.compile(id));
}
@ -196,8 +204,13 @@ public class PonderUI extends NavigatableSimiScreen {
.shortcut(bindings.keyBindDrop)
.fade(0, -1));
widgets.add(slowMode = new PonderButton(width - 20 - 31, bY, () -> {
slowTextMode = !slowTextMode;
}).showing(AllIcons.I_MTD_SLOW_MODE)
.fade(0, -1));
if (PonderIndex.EDITOR_MODE) {
widgets.add(userMode = new PonderButton(width - 20 - 31, bY, () -> {
widgets.add(userMode = new PonderButton(width - 50 - 31, bY, () -> {
userViewMode = !userViewMode;
}).showing(AllIcons.I_MTD_USER_MODE)
.fade(0, -1));
@ -250,16 +263,32 @@ public class PonderUI extends NavigatableSimiScreen {
referredToByTag = null;
}
PonderScene activeScene = scenes.get(index);
if (!identifyMode) {
ponderTicks++;
if (skipCooling == 0)
activeScene.tick();
}
lazyIndex.tickChaser();
fadeIn.tickChaser();
finishingFlash.tickChaser();
PonderScene activeScene = scenes.get(index);
extendedTickLength = 0;
if (slowTextMode)
activeScene.forEachVisible(TextWindowElement.class, twe -> extendedTickLength = 2);
if (extendedTickTimer == 0) {
if (!identifyMode) {
ponderTicks++;
if (skipCooling == 0)
activeScene.tick();
}
if (!identifyMode) {
float lazyIndexValue = lazyIndex.getValue();
if (Math.abs(lazyIndexValue - index) > 1 / 512f)
scenes.get(lazyIndexValue < index ? index - 1 : index + 1)
.tick();
}
extendedTickTimer = extendedTickLength;
} else
extendedTickTimer--;
progressBar.tick();
if (activeScene.currentTime == activeScene.totalTime - 1)
@ -272,13 +301,6 @@ public class PonderUI extends NavigatableSimiScreen {
}
}
if (!identifyMode) {
float lazyIndexValue = lazyIndex.getValue();
if (Math.abs(lazyIndexValue - index) > 1 / 512f)
scenes.get(lazyIndexValue < index ? index - 1 : index + 1)
.tick();
}
updateIdentifiedItem(activeScene);
}
@ -357,6 +379,7 @@ public class PonderUI extends NavigatableSimiScreen {
@Override
protected void renderWindow(int mouseX, int mouseY, float partialTicks) {
partialTicks = getPartialTicks();
RenderSystem.enableBlend();
renderVisibleScenes(mouseX, mouseY,
skipCooling > 0 ? 0 : identifyMode ? ponderPartialTicksPaused : partialTicks);
@ -388,7 +411,7 @@ public class PonderUI extends NavigatableSimiScreen {
RenderSystem.enableDepthTest();
RenderSystem.pushMatrix();
// has to be outside of MS transforms, important for vertex sorting
RenderSystem.translated(0, 0, 800);
@ -400,8 +423,6 @@ public class PonderUI extends NavigatableSimiScreen {
story.renderScene(buffer, ms, partialTicks);
buffer.draw();
RenderSystem.popMatrix();
MutableBoundingBox bounds = story.getBounds();
RenderSystem.pushMatrix();
RenderSystem.multMatrix(ms.peek()
@ -492,8 +513,8 @@ public class PonderUI extends NavigatableSimiScreen {
}
RenderSystem.popMatrix();
ms.pop();
RenderSystem.popMatrix();
}
protected void renderWidgets(int mouseX, int mouseY, float partialTicks) {
@ -547,7 +568,7 @@ public class PonderUI extends NavigatableSimiScreen {
drawRightAlignedString(font, Lang.translate(IN_CHAPTER), 0, 0, tooltipColor);
drawRightAlignedString(font,
Lang.translate(PonderLocalization.LANG_PREFIX + "chapter." + chapter.getId()), 0, 12, 0xffeeeeee);
Lang.translate(LANG_PREFIX + "chapter." + chapter.getId()), 0, 12, 0xffeeeeee);
RenderSystem.popMatrix();
}
@ -594,6 +615,11 @@ public class PonderUI extends NavigatableSimiScreen {
else
userMode.dim();
}
if (slowTextMode)
slowMode.flash();
else
slowMode.dim();
{
// Scene overlay
@ -680,6 +706,10 @@ public class PonderUI extends NavigatableSimiScreen {
drawCenteredString(font, Lang.translate(NEXT), right.x + 10, tooltipY, tooltipColor);
if (replay.isHovered())
drawCenteredString(font, Lang.translate(REPLAY), replay.x + 10, tooltipY, tooltipColor);
if (slowMode.isHovered())
drawCenteredString(font, Lang.translate(SLOW_TEXT), slowMode.x + 5, tooltipY, tooltipColor);
if (PonderIndex.EDITOR_MODE && userMode.isHovered())
drawCenteredString(font, "Editor View", userMode.x + 10, tooltipY, tooltipColor);
RenderSystem.popMatrix();
}
@ -794,7 +824,7 @@ public class PonderUI extends NavigatableSimiScreen {
@Override
protected String getBreadcrumbTitle() {
if (chapter != null)
return Lang.translate(PonderLocalization.LANG_PREFIX + "chapter." + chapter.getId());
return Lang.translate(LANG_PREFIX + "chapter." + chapter.getId());
return stack.getItem()
.getName()
@ -922,13 +952,18 @@ public class PonderUI extends NavigatableSimiScreen {
}
public static float getPartialTicks() {
float renderPartialTicks = Minecraft.getInstance()
.getRenderPartialTicks();
if (Minecraft.getInstance().currentScreen instanceof PonderUI) {
PonderUI ui = (PonderUI) Minecraft.getInstance().currentScreen;
if (ui.identifyMode)
return ponderPartialTicksPaused;
return (renderPartialTicks + (ui.extendedTickLength - ui.extendedTickTimer)) / (ui.extendedTickLength + 1);
}
return Minecraft.getInstance()
.getRenderPartialTicks();
return renderPartialTicks;
}
@Override

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.8 KiB

After

Width:  |  Height:  |  Size: 2.9 KiB