From ef74d9eef957414d565998ecba6a395c37ceaef4 Mon Sep 17 00:00:00 2001 From: simibubi <31564874+simibubi@users.noreply.github.com> Date: Fri, 25 Jun 2021 00:55:40 +0200 Subject: [PATCH] =?UTF-8?q?Ponder=20=C3=A0=20la=20carte?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - An overview of Ponder Tags can now be opened from the game menu --- src/generated/resources/.cache/cache | 28 +- .../resources/assets/create/lang/en_us.json | 40 +-- .../assets/create/lang/unfinished/de_de.json | 10 +- .../assets/create/lang/unfinished/es_es.json | 10 +- .../assets/create/lang/unfinished/es_mx.json | 10 +- .../assets/create/lang/unfinished/fr_fr.json | 10 +- .../assets/create/lang/unfinished/it_it.json | 10 +- .../assets/create/lang/unfinished/ja_jp.json | 10 +- .../assets/create/lang/unfinished/ko_kr.json | 10 +- .../assets/create/lang/unfinished/nl_nl.json | 10 +- .../assets/create/lang/unfinished/pl_pl.json | 10 +- .../assets/create/lang/unfinished/pt_br.json | 10 +- .../assets/create/lang/unfinished/ru_ru.json | 10 +- .../assets/create/lang/unfinished/zh_cn.json | 10 +- .../assets/create/lang/unfinished/zh_tw.json | 10 +- .../create/foundation/data/LangMerger.java | 1 + .../gui/mainMenu/CreateMainMenuScreen.java | 30 ++- .../ponder/NavigatableSimiScreen.java | 21 +- .../foundation/ponder/PonderLocalization.java | 8 + .../foundation/ponder/content/PonderTag.java | 56 ++-- .../ponder/content/PonderTagIndexScreen.java | 241 ++++++++++++++++++ .../foundation/ponder/ui/PonderButton.java | 10 + .../assets/create/lang/default/messages.json | 3 +- 23 files changed, 456 insertions(+), 112 deletions(-) create mode 100644 src/main/java/com/simibubi/create/foundation/ponder/content/PonderTagIndexScreen.java diff --git a/src/generated/resources/.cache/cache b/src/generated/resources/.cache/cache index efd45e4e7..00cdfc444 100644 --- a/src/generated/resources/.cache/cache +++ b/src/generated/resources/.cache/cache @@ -408,20 +408,20 @@ a3a11524cd3515fc01d905767b4b7ea782adaf03 assets/create/blockstates/yellow_seat.j 7f39521b211441f5c3e06d60c5978cebe16cacfb assets/create/blockstates/zinc_block.json b7181bcd8182b2f17088e5aa881f374c9c65470c assets/create/blockstates/zinc_ore.json c71f5246d2cb8e9913d1552d23fcc82c43cde7a0 assets/create/lang/en_ud.json -889f34e50ce99ae3c6619291c23142ff71ae38f3 assets/create/lang/en_us.json -e812308072ad329e34a0fd6d95ac5b41f11cb958 assets/create/lang/unfinished/de_de.json -4676d6c19867f69ec1e3c893268a911354cecee7 assets/create/lang/unfinished/es_es.json -1232f29b7d8fca6caf239b02511ac577fca091ad assets/create/lang/unfinished/es_mx.json -5efa3706923408ce876fa098c8223e11b2bc2290 assets/create/lang/unfinished/fr_fr.json -68211f73c593e13e7d8cd3f6a44ce801f89960e6 assets/create/lang/unfinished/it_it.json -f1ce9909471803d91fc775e1c27f6840f77a7a63 assets/create/lang/unfinished/ja_jp.json -f69b0c7b92c73c3077fe6fdc293dd25ba302ba35 assets/create/lang/unfinished/ko_kr.json -23462c4581ef9ea973e0992d68a3eb12293a7bc4 assets/create/lang/unfinished/nl_nl.json -915ef1e9a3b1ef6874f231a17b0e9d1828469534 assets/create/lang/unfinished/pl_pl.json -df7f0a20aed2b69fb07cc03adf9bc52d691b12c1 assets/create/lang/unfinished/pt_br.json -02b6dbc33718b29b9091e73fab5f0cce5839ffa8 assets/create/lang/unfinished/ru_ru.json -743986765d2c04c9f21253ec30642f760a5fa90b assets/create/lang/unfinished/zh_cn.json -dc946930a91b3ce51b34cba15fb5e063f495196f assets/create/lang/unfinished/zh_tw.json +1e395855b99f48b50dc6eed77ba715237867bebf assets/create/lang/en_us.json +ca34a1523c0b9787666923c189167cf239e85f1c assets/create/lang/unfinished/de_de.json +3ba4235fbc33ee28e7a6ef779d391a00858f0f52 assets/create/lang/unfinished/es_es.json +049ca87082069d80b22dd204296a14f67c01931a assets/create/lang/unfinished/es_mx.json +df29299d27809d115f352ae82935d6b406d08754 assets/create/lang/unfinished/fr_fr.json +0bb18404e068bbfc0332474fc78f5ce0440ee295 assets/create/lang/unfinished/it_it.json +0250be349a9364792717bb8d9bc680c6faa6291f assets/create/lang/unfinished/ja_jp.json +a70d2a2a75879a8ea0dea59964c2b20ae67033fd assets/create/lang/unfinished/ko_kr.json +1294137911d5b8e9aba264f1a1ce80644250354a assets/create/lang/unfinished/nl_nl.json +66f09bc9549c733d4bc3d8d31005f119efd952eb assets/create/lang/unfinished/pl_pl.json +4474c63c836597d1751bf86ee0166a3ca5e01db6 assets/create/lang/unfinished/pt_br.json +a95d5f9b37ec32a7c477c21f21d035471ea6ad24 assets/create/lang/unfinished/ru_ru.json +11c5105e97c88463511b200afebbcbdc58f1d116 assets/create/lang/unfinished/zh_cn.json +044db0d49cdcde32ba69bf34fa4117b8c9b5d40c assets/create/lang/unfinished/zh_tw.json 487a511a01b2a4531fb672f917922312db78f958 assets/create/models/block/acacia_window.json b48060cba1a382f373a05bf0039054053eccf076 assets/create/models/block/acacia_window_pane_noside.json 3066db1bf03cffa1a9c7fbacf47ae586632f4eb3 assets/create/models/block/acacia_window_pane_noside_alt.json diff --git a/src/generated/resources/assets/create/lang/en_us.json b/src/generated/resources/assets/create/lang/en_us.json index b7d247bc3..35c57fd5f 100644 --- a/src/generated/resources/assets/create/lang/en_us.json +++ b/src/generated/resources/assets/create/lang/en_us.json @@ -51,7 +51,6 @@ "block.create.chiseled_scoria": "Chiseled Scoria", "block.create.chiseled_weathered_limestone": "Chiseled Weathered Limestone", "block.create.chocolate": "Chocolate", - "block.create.chromatic_projector": "Chromatic Projector", "block.create.chute": "Chute", "block.create.clockwork_bearing": "Clockwork Bearing", "block.create.clutch": "Clutch", @@ -677,7 +676,8 @@ "create.menu.return": "Return to Menu", "create.menu.configure": "Configure...", - "create.menu.getting_started": "Getting Started", + "create.menu.ponder_index": "Ponder Index", + "create.menu.only_ingame": "Available in the Pause Menu", "create.menu.project_page": "Project Page", "create.menu.report_bugs": "Report Issues", "create.menu.support": "Support Us", @@ -1400,37 +1400,6 @@ "item.create.minecart_coupling.tooltip.condition1": "When Used on Minecart", "item.create.minecart_coupling.tooltip.behaviour1": "_Couples_ two Minecarts together, attempting to keep them at a _constant distance_ while moving.", - "create.tooltip.wip": "WIP", - "create.tooltip.workInProgress": "Work in progress!", - "create.tooltip.randomWipDescription0": "Please keep this item away from children.", - "create.tooltip.randomWipDescription1": "A baby panda dies every time you use this item. Every. Time.", - "create.tooltip.randomWipDescription2": "Use at your own risk.", - "create.tooltip.randomWipDescription3": "This is not the item you are looking for, *finger-wiggles* please disperse.", - "create.tooltip.randomWipDescription4": "This item will self-destruct in 10 seconds. 10, 9, 8...", - "create.tooltip.randomWipDescription5": "Believe me, it's useless.", - "create.tooltip.randomWipDescription6": "By using this item, you hereby consent to our disclaimer and agree to its terms.", - "create.tooltip.randomWipDescription7": "This one maybe isn't for you. What about that one?", - "create.tooltip.randomWipDescription8": "Use it and regret your decision immediately.", - - "create.gui.chromatic_projector.title": "Chromatic Projector", - "create.gui.chromatic_projector.filter.invert": "Invert", - "create.gui.chromatic_projector.filter.sepia": "Sepia", - "create.gui.chromatic_projector.filter.grayscale": "Grayscale", - "create.gui.chromatic_projector.filter.saturate": "Saturate", - "create.gui.chromatic_projector.filter.hue_shift": "Hue shift", - "create.gui.chromatic_projector.filter.darken": "Darken", - "create.gui.chromatic_projector.filter.contrast": "Contrast", - "create.gui.chromatic_projector.filter.end": "End", - "create.gui.chromatic_projector.filter": "Filter", - "create.gui.chromatic_projector.surface": "Surface", - "create.gui.chromatic_projector.field": "Field", - "create.gui.chromatic_projector.strength": "Strength", - "create.gui.chromatic_projector.radius": "Radius", - "create.gui.chromatic_projector.feather": "Feather", - "create.gui.chromatic_projector.density": "Density", - "create.gui.chromatic_projector.fade": "Fade", - "create.gui.chromatic_projector.blend": "Blend", - "_": "->------------------------] Ponder Content [------------------------<-", @@ -1446,6 +1415,11 @@ "create.ponder.replay": "Replay", "create.ponder.think_back": "Think Back", "create.ponder.slow_text": "Comfy Reading", + "create.ponder.exit": "Exit", + "create.ponder.welcome": "Welcome to Ponder", + "create.ponder.categories": "Available Categories in Create", + "create.ponder.index_description": "Click one of the icons to learn about its associated Items and Blocks", + "create.ponder.index_title": "Ponder Index", "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 +", diff --git a/src/generated/resources/assets/create/lang/unfinished/de_de.json b/src/generated/resources/assets/create/lang/unfinished/de_de.json index cf2f65ec6..5a8b4c644 100644 --- a/src/generated/resources/assets/create/lang/unfinished/de_de.json +++ b/src/generated/resources/assets/create/lang/unfinished/de_de.json @@ -1,5 +1,5 @@ { - "_": "Missing Localizations: 1041", + "_": "Missing Localizations: 1047", "_": "->------------------------] Game Elements [------------------------<-", @@ -677,7 +677,8 @@ "create.menu.return": "UNLOCALIZED: Return to Menu", "create.menu.configure": "UNLOCALIZED: Configure...", - "create.menu.getting_started": "UNLOCALIZED: Getting Started", + "create.menu.ponder_index": "UNLOCALIZED: Ponder Index", + "create.menu.only_ingame": "UNLOCALIZED: Available in the Pause Menu", "create.menu.project_page": "UNLOCALIZED: Project Page", "create.menu.report_bugs": "UNLOCALIZED: Report Issues", "create.menu.support": "UNLOCALIZED: Support Us", @@ -1415,6 +1416,11 @@ "create.ponder.replay": "UNLOCALIZED: Replay", "create.ponder.think_back": "UNLOCALIZED: Think Back", "create.ponder.slow_text": "UNLOCALIZED: Comfy Reading", + "create.ponder.exit": "UNLOCALIZED: Exit", + "create.ponder.welcome": "UNLOCALIZED: Welcome to Ponder", + "create.ponder.categories": "UNLOCALIZED: Available Categories in Create", + "create.ponder.index_description": "UNLOCALIZED: Click one of the icons to learn about its associated Items and Blocks", + "create.ponder.index_title": "UNLOCALIZED: Ponder Index", "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 +", diff --git a/src/generated/resources/assets/create/lang/unfinished/es_es.json b/src/generated/resources/assets/create/lang/unfinished/es_es.json index dde4c9959..70d619aa7 100644 --- a/src/generated/resources/assets/create/lang/unfinished/es_es.json +++ b/src/generated/resources/assets/create/lang/unfinished/es_es.json @@ -1,5 +1,5 @@ { - "_": "Missing Localizations: 802", + "_": "Missing Localizations: 808", "_": "->------------------------] Game Elements [------------------------<-", @@ -677,7 +677,8 @@ "create.menu.return": "UNLOCALIZED: Return to Menu", "create.menu.configure": "UNLOCALIZED: Configure...", - "create.menu.getting_started": "UNLOCALIZED: Getting Started", + "create.menu.ponder_index": "UNLOCALIZED: Ponder Index", + "create.menu.only_ingame": "UNLOCALIZED: Available in the Pause Menu", "create.menu.project_page": "UNLOCALIZED: Project Page", "create.menu.report_bugs": "UNLOCALIZED: Report Issues", "create.menu.support": "UNLOCALIZED: Support Us", @@ -1415,6 +1416,11 @@ "create.ponder.replay": "UNLOCALIZED: Replay", "create.ponder.think_back": "UNLOCALIZED: Think Back", "create.ponder.slow_text": "UNLOCALIZED: Comfy Reading", + "create.ponder.exit": "UNLOCALIZED: Exit", + "create.ponder.welcome": "UNLOCALIZED: Welcome to Ponder", + "create.ponder.categories": "UNLOCALIZED: Available Categories in Create", + "create.ponder.index_description": "UNLOCALIZED: Click one of the icons to learn about its associated Items and Blocks", + "create.ponder.index_title": "UNLOCALIZED: Ponder Index", "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 +", diff --git a/src/generated/resources/assets/create/lang/unfinished/es_mx.json b/src/generated/resources/assets/create/lang/unfinished/es_mx.json index 2f0b634a6..243fcaba9 100644 --- a/src/generated/resources/assets/create/lang/unfinished/es_mx.json +++ b/src/generated/resources/assets/create/lang/unfinished/es_mx.json @@ -1,5 +1,5 @@ { - "_": "Missing Localizations: 1408", + "_": "Missing Localizations: 1414", "_": "->------------------------] Game Elements [------------------------<-", @@ -677,7 +677,8 @@ "create.menu.return": "UNLOCALIZED: Return to Menu", "create.menu.configure": "UNLOCALIZED: Configure...", - "create.menu.getting_started": "UNLOCALIZED: Getting Started", + "create.menu.ponder_index": "UNLOCALIZED: Ponder Index", + "create.menu.only_ingame": "UNLOCALIZED: Available in the Pause Menu", "create.menu.project_page": "UNLOCALIZED: Project Page", "create.menu.report_bugs": "UNLOCALIZED: Report Issues", "create.menu.support": "UNLOCALIZED: Support Us", @@ -1415,6 +1416,11 @@ "create.ponder.replay": "UNLOCALIZED: Replay", "create.ponder.think_back": "UNLOCALIZED: Think Back", "create.ponder.slow_text": "UNLOCALIZED: Comfy Reading", + "create.ponder.exit": "UNLOCALIZED: Exit", + "create.ponder.welcome": "UNLOCALIZED: Welcome to Ponder", + "create.ponder.categories": "UNLOCALIZED: Available Categories in Create", + "create.ponder.index_description": "UNLOCALIZED: Click one of the icons to learn about its associated Items and Blocks", + "create.ponder.index_title": "UNLOCALIZED: Ponder Index", "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 +", diff --git a/src/generated/resources/assets/create/lang/unfinished/fr_fr.json b/src/generated/resources/assets/create/lang/unfinished/fr_fr.json index 2123b64db..777e549f3 100644 --- a/src/generated/resources/assets/create/lang/unfinished/fr_fr.json +++ b/src/generated/resources/assets/create/lang/unfinished/fr_fr.json @@ -1,5 +1,5 @@ { - "_": "Missing Localizations: 1293", + "_": "Missing Localizations: 1299", "_": "->------------------------] Game Elements [------------------------<-", @@ -677,7 +677,8 @@ "create.menu.return": "UNLOCALIZED: Return to Menu", "create.menu.configure": "UNLOCALIZED: Configure...", - "create.menu.getting_started": "UNLOCALIZED: Getting Started", + "create.menu.ponder_index": "UNLOCALIZED: Ponder Index", + "create.menu.only_ingame": "UNLOCALIZED: Available in the Pause Menu", "create.menu.project_page": "UNLOCALIZED: Project Page", "create.menu.report_bugs": "UNLOCALIZED: Report Issues", "create.menu.support": "UNLOCALIZED: Support Us", @@ -1415,6 +1416,11 @@ "create.ponder.replay": "UNLOCALIZED: Replay", "create.ponder.think_back": "UNLOCALIZED: Think Back", "create.ponder.slow_text": "UNLOCALIZED: Comfy Reading", + "create.ponder.exit": "UNLOCALIZED: Exit", + "create.ponder.welcome": "UNLOCALIZED: Welcome to Ponder", + "create.ponder.categories": "UNLOCALIZED: Available Categories in Create", + "create.ponder.index_description": "UNLOCALIZED: Click one of the icons to learn about its associated Items and Blocks", + "create.ponder.index_title": "UNLOCALIZED: Ponder Index", "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 +", diff --git a/src/generated/resources/assets/create/lang/unfinished/it_it.json b/src/generated/resources/assets/create/lang/unfinished/it_it.json index 59bbe295c..964b6a4cf 100644 --- a/src/generated/resources/assets/create/lang/unfinished/it_it.json +++ b/src/generated/resources/assets/create/lang/unfinished/it_it.json @@ -1,5 +1,5 @@ { - "_": "Missing Localizations: 819", + "_": "Missing Localizations: 825", "_": "->------------------------] Game Elements [------------------------<-", @@ -677,7 +677,8 @@ "create.menu.return": "UNLOCALIZED: Return to Menu", "create.menu.configure": "UNLOCALIZED: Configure...", - "create.menu.getting_started": "UNLOCALIZED: Getting Started", + "create.menu.ponder_index": "UNLOCALIZED: Ponder Index", + "create.menu.only_ingame": "UNLOCALIZED: Available in the Pause Menu", "create.menu.project_page": "UNLOCALIZED: Project Page", "create.menu.report_bugs": "UNLOCALIZED: Report Issues", "create.menu.support": "UNLOCALIZED: Support Us", @@ -1415,6 +1416,11 @@ "create.ponder.replay": "UNLOCALIZED: Replay", "create.ponder.think_back": "UNLOCALIZED: Think Back", "create.ponder.slow_text": "UNLOCALIZED: Comfy Reading", + "create.ponder.exit": "UNLOCALIZED: Exit", + "create.ponder.welcome": "UNLOCALIZED: Welcome to Ponder", + "create.ponder.categories": "UNLOCALIZED: Available Categories in Create", + "create.ponder.index_description": "UNLOCALIZED: Click one of the icons to learn about its associated Items and Blocks", + "create.ponder.index_title": "UNLOCALIZED: Ponder Index", "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 +", diff --git a/src/generated/resources/assets/create/lang/unfinished/ja_jp.json b/src/generated/resources/assets/create/lang/unfinished/ja_jp.json index 01507a43e..68f830609 100644 --- a/src/generated/resources/assets/create/lang/unfinished/ja_jp.json +++ b/src/generated/resources/assets/create/lang/unfinished/ja_jp.json @@ -1,5 +1,5 @@ { - "_": "Missing Localizations: 185", + "_": "Missing Localizations: 191", "_": "->------------------------] Game Elements [------------------------<-", @@ -677,7 +677,8 @@ "create.menu.return": "UNLOCALIZED: Return to Menu", "create.menu.configure": "UNLOCALIZED: Configure...", - "create.menu.getting_started": "UNLOCALIZED: Getting Started", + "create.menu.ponder_index": "UNLOCALIZED: Ponder Index", + "create.menu.only_ingame": "UNLOCALIZED: Available in the Pause Menu", "create.menu.project_page": "UNLOCALIZED: Project Page", "create.menu.report_bugs": "UNLOCALIZED: Report Issues", "create.menu.support": "UNLOCALIZED: Support Us", @@ -1415,6 +1416,11 @@ "create.ponder.replay": "最初から", "create.ponder.think_back": "戻る", "create.ponder.slow_text": "熟考(スロー再生)", + "create.ponder.exit": "UNLOCALIZED: Exit", + "create.ponder.welcome": "UNLOCALIZED: Welcome to Ponder", + "create.ponder.categories": "UNLOCALIZED: Available Categories in Create", + "create.ponder.index_description": "UNLOCALIZED: Click one of the icons to learn about its associated Items and Blocks", + "create.ponder.index_title": "UNLOCALIZED: Ponder Index", "create.ponder.shared.movement_anchors": "シャーシや超粘着剤を使えば大きな構造物も動かせます", "create.ponder.shared.rpm32": "32 RPM", "create.ponder.shared.sneak_and": "スニーク +", diff --git a/src/generated/resources/assets/create/lang/unfinished/ko_kr.json b/src/generated/resources/assets/create/lang/unfinished/ko_kr.json index 15d71da3c..c564341a9 100644 --- a/src/generated/resources/assets/create/lang/unfinished/ko_kr.json +++ b/src/generated/resources/assets/create/lang/unfinished/ko_kr.json @@ -1,5 +1,5 @@ { - "_": "Missing Localizations: 872", + "_": "Missing Localizations: 878", "_": "->------------------------] Game Elements [------------------------<-", @@ -677,7 +677,8 @@ "create.menu.return": "UNLOCALIZED: Return to Menu", "create.menu.configure": "UNLOCALIZED: Configure...", - "create.menu.getting_started": "UNLOCALIZED: Getting Started", + "create.menu.ponder_index": "UNLOCALIZED: Ponder Index", + "create.menu.only_ingame": "UNLOCALIZED: Available in the Pause Menu", "create.menu.project_page": "UNLOCALIZED: Project Page", "create.menu.report_bugs": "UNLOCALIZED: Report Issues", "create.menu.support": "UNLOCALIZED: Support Us", @@ -1415,6 +1416,11 @@ "create.ponder.replay": "UNLOCALIZED: Replay", "create.ponder.think_back": "UNLOCALIZED: Think Back", "create.ponder.slow_text": "UNLOCALIZED: Comfy Reading", + "create.ponder.exit": "UNLOCALIZED: Exit", + "create.ponder.welcome": "UNLOCALIZED: Welcome to Ponder", + "create.ponder.categories": "UNLOCALIZED: Available Categories in Create", + "create.ponder.index_description": "UNLOCALIZED: Click one of the icons to learn about its associated Items and Blocks", + "create.ponder.index_title": "UNLOCALIZED: Ponder Index", "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 +", diff --git a/src/generated/resources/assets/create/lang/unfinished/nl_nl.json b/src/generated/resources/assets/create/lang/unfinished/nl_nl.json index 978592ff8..77cd9bd86 100644 --- a/src/generated/resources/assets/create/lang/unfinished/nl_nl.json +++ b/src/generated/resources/assets/create/lang/unfinished/nl_nl.json @@ -1,5 +1,5 @@ { - "_": "Missing Localizations: 1676", + "_": "Missing Localizations: 1682", "_": "->------------------------] Game Elements [------------------------<-", @@ -677,7 +677,8 @@ "create.menu.return": "UNLOCALIZED: Return to Menu", "create.menu.configure": "UNLOCALIZED: Configure...", - "create.menu.getting_started": "UNLOCALIZED: Getting Started", + "create.menu.ponder_index": "UNLOCALIZED: Ponder Index", + "create.menu.only_ingame": "UNLOCALIZED: Available in the Pause Menu", "create.menu.project_page": "UNLOCALIZED: Project Page", "create.menu.report_bugs": "UNLOCALIZED: Report Issues", "create.menu.support": "UNLOCALIZED: Support Us", @@ -1415,6 +1416,11 @@ "create.ponder.replay": "UNLOCALIZED: Replay", "create.ponder.think_back": "UNLOCALIZED: Think Back", "create.ponder.slow_text": "UNLOCALIZED: Comfy Reading", + "create.ponder.exit": "UNLOCALIZED: Exit", + "create.ponder.welcome": "UNLOCALIZED: Welcome to Ponder", + "create.ponder.categories": "UNLOCALIZED: Available Categories in Create", + "create.ponder.index_description": "UNLOCALIZED: Click one of the icons to learn about its associated Items and Blocks", + "create.ponder.index_title": "UNLOCALIZED: Ponder Index", "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 +", diff --git a/src/generated/resources/assets/create/lang/unfinished/pl_pl.json b/src/generated/resources/assets/create/lang/unfinished/pl_pl.json index 0e3b3687c..b6c455931 100644 --- a/src/generated/resources/assets/create/lang/unfinished/pl_pl.json +++ b/src/generated/resources/assets/create/lang/unfinished/pl_pl.json @@ -1,5 +1,5 @@ { - "_": "Missing Localizations: 161", + "_": "Missing Localizations: 167", "_": "->------------------------] Game Elements [------------------------<-", @@ -677,7 +677,8 @@ "create.menu.return": "UNLOCALIZED: Return to Menu", "create.menu.configure": "UNLOCALIZED: Configure...", - "create.menu.getting_started": "UNLOCALIZED: Getting Started", + "create.menu.ponder_index": "UNLOCALIZED: Ponder Index", + "create.menu.only_ingame": "UNLOCALIZED: Available in the Pause Menu", "create.menu.project_page": "UNLOCALIZED: Project Page", "create.menu.report_bugs": "UNLOCALIZED: Report Issues", "create.menu.support": "UNLOCALIZED: Support Us", @@ -1415,6 +1416,11 @@ "create.ponder.replay": "Powtórka", "create.ponder.think_back": "Powrót", "create.ponder.slow_text": "Komfortowe czytanie", + "create.ponder.exit": "UNLOCALIZED: Exit", + "create.ponder.welcome": "UNLOCALIZED: Welcome to Ponder", + "create.ponder.categories": "UNLOCALIZED: Available Categories in Create", + "create.ponder.index_description": "UNLOCALIZED: Click one of the icons to learn about its associated Items and Blocks", + "create.ponder.index_title": "UNLOCALIZED: Ponder Index", "create.ponder.shared.movement_anchors": "Z pomocą stelaży lub Super Glue, większe struktury mogą być przesuwane.", "create.ponder.shared.rpm32": "32 Ob/min", "create.ponder.shared.sneak_and": "Skradanie +", diff --git a/src/generated/resources/assets/create/lang/unfinished/pt_br.json b/src/generated/resources/assets/create/lang/unfinished/pt_br.json index 127b8734f..b84a265e7 100644 --- a/src/generated/resources/assets/create/lang/unfinished/pt_br.json +++ b/src/generated/resources/assets/create/lang/unfinished/pt_br.json @@ -1,5 +1,5 @@ { - "_": "Missing Localizations: 1717", + "_": "Missing Localizations: 1723", "_": "->------------------------] Game Elements [------------------------<-", @@ -677,7 +677,8 @@ "create.menu.return": "UNLOCALIZED: Return to Menu", "create.menu.configure": "UNLOCALIZED: Configure...", - "create.menu.getting_started": "UNLOCALIZED: Getting Started", + "create.menu.ponder_index": "UNLOCALIZED: Ponder Index", + "create.menu.only_ingame": "UNLOCALIZED: Available in the Pause Menu", "create.menu.project_page": "UNLOCALIZED: Project Page", "create.menu.report_bugs": "UNLOCALIZED: Report Issues", "create.menu.support": "UNLOCALIZED: Support Us", @@ -1415,6 +1416,11 @@ "create.ponder.replay": "UNLOCALIZED: Replay", "create.ponder.think_back": "UNLOCALIZED: Think Back", "create.ponder.slow_text": "UNLOCALIZED: Comfy Reading", + "create.ponder.exit": "UNLOCALIZED: Exit", + "create.ponder.welcome": "UNLOCALIZED: Welcome to Ponder", + "create.ponder.categories": "UNLOCALIZED: Available Categories in Create", + "create.ponder.index_description": "UNLOCALIZED: Click one of the icons to learn about its associated Items and Blocks", + "create.ponder.index_title": "UNLOCALIZED: Ponder Index", "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 +", diff --git a/src/generated/resources/assets/create/lang/unfinished/ru_ru.json b/src/generated/resources/assets/create/lang/unfinished/ru_ru.json index 263a1a00f..83fd713ac 100644 --- a/src/generated/resources/assets/create/lang/unfinished/ru_ru.json +++ b/src/generated/resources/assets/create/lang/unfinished/ru_ru.json @@ -1,5 +1,5 @@ { - "_": "Missing Localizations: 718", + "_": "Missing Localizations: 724", "_": "->------------------------] Game Elements [------------------------<-", @@ -677,7 +677,8 @@ "create.menu.return": "UNLOCALIZED: Return to Menu", "create.menu.configure": "UNLOCALIZED: Configure...", - "create.menu.getting_started": "UNLOCALIZED: Getting Started", + "create.menu.ponder_index": "UNLOCALIZED: Ponder Index", + "create.menu.only_ingame": "UNLOCALIZED: Available in the Pause Menu", "create.menu.project_page": "UNLOCALIZED: Project Page", "create.menu.report_bugs": "UNLOCALIZED: Report Issues", "create.menu.support": "UNLOCALIZED: Support Us", @@ -1415,6 +1416,11 @@ "create.ponder.replay": "Воспроизвести снова", "create.ponder.think_back": "Подумать о предыдущем", "create.ponder.slow_text": "Удобное чтение", + "create.ponder.exit": "UNLOCALIZED: Exit", + "create.ponder.welcome": "UNLOCALIZED: Welcome to Ponder", + "create.ponder.categories": "UNLOCALIZED: Available Categories in Create", + "create.ponder.index_description": "UNLOCALIZED: Click one of the icons to learn about its associated Items and Blocks", + "create.ponder.index_title": "UNLOCALIZED: Ponder Index", "create.ponder.shared.movement_anchors": "С помощью Суперклея или Шасси, более крупные структуры могут быть сдивинуты.", "create.ponder.shared.rpm32": "32 об./мин.", "create.ponder.shared.sneak_and": "Красться +", diff --git a/src/generated/resources/assets/create/lang/unfinished/zh_cn.json b/src/generated/resources/assets/create/lang/unfinished/zh_cn.json index 6b6a40d8e..1a15b4ab6 100644 --- a/src/generated/resources/assets/create/lang/unfinished/zh_cn.json +++ b/src/generated/resources/assets/create/lang/unfinished/zh_cn.json @@ -1,5 +1,5 @@ { - "_": "Missing Localizations: 202", + "_": "Missing Localizations: 208", "_": "->------------------------] Game Elements [------------------------<-", @@ -677,7 +677,8 @@ "create.menu.return": "UNLOCALIZED: Return to Menu", "create.menu.configure": "UNLOCALIZED: Configure...", - "create.menu.getting_started": "UNLOCALIZED: Getting Started", + "create.menu.ponder_index": "UNLOCALIZED: Ponder Index", + "create.menu.only_ingame": "UNLOCALIZED: Available in the Pause Menu", "create.menu.project_page": "UNLOCALIZED: Project Page", "create.menu.report_bugs": "UNLOCALIZED: Report Issues", "create.menu.support": "UNLOCALIZED: Support Us", @@ -1415,6 +1416,11 @@ "create.ponder.replay": "重放", "create.ponder.think_back": "回想", "create.ponder.slow_text": "舒适阅读", + "create.ponder.exit": "UNLOCALIZED: Exit", + "create.ponder.welcome": "UNLOCALIZED: Welcome to Ponder", + "create.ponder.categories": "UNLOCALIZED: Available Categories in Create", + "create.ponder.index_description": "UNLOCALIZED: Click one of the icons to learn about its associated Items and Blocks", + "create.ponder.index_title": "UNLOCALIZED: Ponder Index", "create.ponder.shared.movement_anchors": "有了底盘和强力胶,移动起大型结构轻轻松松。", "create.ponder.shared.rpm32": "32 RPM", "create.ponder.shared.sneak_and": "潜行 +", diff --git a/src/generated/resources/assets/create/lang/unfinished/zh_tw.json b/src/generated/resources/assets/create/lang/unfinished/zh_tw.json index 052d383a7..97bad0fc8 100644 --- a/src/generated/resources/assets/create/lang/unfinished/zh_tw.json +++ b/src/generated/resources/assets/create/lang/unfinished/zh_tw.json @@ -1,5 +1,5 @@ { - "_": "Missing Localizations: 197", + "_": "Missing Localizations: 203", "_": "->------------------------] Game Elements [------------------------<-", @@ -677,7 +677,8 @@ "create.menu.return": "UNLOCALIZED: Return to Menu", "create.menu.configure": "UNLOCALIZED: Configure...", - "create.menu.getting_started": "UNLOCALIZED: Getting Started", + "create.menu.ponder_index": "UNLOCALIZED: Ponder Index", + "create.menu.only_ingame": "UNLOCALIZED: Available in the Pause Menu", "create.menu.project_page": "UNLOCALIZED: Project Page", "create.menu.report_bugs": "UNLOCALIZED: Report Issues", "create.menu.support": "UNLOCALIZED: Support Us", @@ -1415,6 +1416,11 @@ "create.ponder.replay": "重放", "create.ponder.think_back": "返回", "create.ponder.slow_text": "降低文字顯示速度", + "create.ponder.exit": "UNLOCALIZED: Exit", + "create.ponder.welcome": "UNLOCALIZED: Welcome to Ponder", + "create.ponder.categories": "UNLOCALIZED: Available Categories in Create", + "create.ponder.index_description": "UNLOCALIZED: Click one of the icons to learn about its associated Items and Blocks", + "create.ponder.index_title": "UNLOCALIZED: Ponder Index", "create.ponder.shared.movement_anchors": "有了機殼底盤和強力膠就可以移動大型結構", "create.ponder.shared.rpm32": "32 RPM", "create.ponder.shared.sneak_and": "潛行 +", diff --git a/src/main/java/com/simibubi/create/foundation/data/LangMerger.java b/src/main/java/com/simibubi/create/foundation/data/LangMerger.java index b1f717bfa..1f92db23c 100644 --- a/src/main/java/com/simibubi/create/foundation/data/LangMerger.java +++ b/src/main/java/com/simibubi/create/foundation/data/LangMerger.java @@ -60,6 +60,7 @@ public class LangMerger implements IDataProvider { private void populateLangIgnore() { // Key prefixes added here will NOT be transferred to lang templates langIgnore.add("create.ponder.debug_"); // Ponder debug scene text + langIgnore.add("create.gui.chromatic_projector"); } private boolean shouldIgnore(String key) { diff --git a/src/main/java/com/simibubi/create/foundation/gui/mainMenu/CreateMainMenuScreen.java b/src/main/java/com/simibubi/create/foundation/gui/mainMenu/CreateMainMenuScreen.java index 8688b3492..2731dfa4f 100644 --- a/src/main/java/com/simibubi/create/foundation/gui/mainMenu/CreateMainMenuScreen.java +++ b/src/main/java/com/simibubi/create/foundation/gui/mainMenu/CreateMainMenuScreen.java @@ -13,6 +13,8 @@ import com.simibubi.create.foundation.gui.AllGuiTextures; import com.simibubi.create.foundation.gui.BoxElement; import com.simibubi.create.foundation.gui.GuiGameElement; import com.simibubi.create.foundation.gui.ScreenOpener; +import com.simibubi.create.foundation.item.TooltipHelper; +import com.simibubi.create.foundation.ponder.content.PonderTagIndexScreen; import com.simibubi.create.foundation.utility.Iterate; import com.simibubi.create.foundation.utility.Lang; import com.simibubi.create.foundation.utility.MatrixStacker; @@ -42,6 +44,7 @@ public class CreateMainMenuScreen extends AbstractSimiScreen { private RenderSkybox vanillaPanorama = new RenderSkybox(MainMenuScreen.PANORAMA_RESOURCES); private RenderSkybox panorama = new RenderSkybox(PANORAMA_RESOURCES); private long firstRenderTime; + private Button gettingStarted; public CreateMainMenuScreen(Screen parent) { this.parent = parent; @@ -62,7 +65,7 @@ public class CreateMainMenuScreen extends AbstractSimiScreen { protected void renderWindow(MatrixStack ms, int mouseX, int mouseY, float partialTicks) { float f = (float) (Util.milliTime() - this.firstRenderTime) / 1000.0F; float alpha = MathHelper.clamp(f, 0.0F, 1.0F); - + if (parent instanceof MainMenuScreen) { if (alpha < 1) vanillaPanorama.render(partialTicks, 1); @@ -111,7 +114,8 @@ public class CreateMainMenuScreen extends AbstractSimiScreen { ms.push(); ms.translate(0, 0, 200); drawCenteredText(ms, textRenderer, new StringTextComponent(Create.NAME).formatted(TextFormatting.BOLD) - .append(new StringTextComponent(" v" + Create.VERSION).formatted(TextFormatting.BOLD, TextFormatting.WHITE)), + .append( + new StringTextComponent(" v" + Create.VERSION).formatted(TextFormatting.BOLD, TextFormatting.WHITE)), width / 2, 89, 0xff_E4BB67); ms.pop(); @@ -133,15 +137,14 @@ public class CreateMainMenuScreen extends AbstractSimiScreen { int bShortWidth = 98; int bLongWidth = 200; - addButton(new Button(center - 100, yStart + 92, bLongWidth, bHeight, Lang.translate("menu.return"), - $ -> onClose())); + addButton( + new Button(center - 100, yStart + 92, bLongWidth, bHeight, Lang.translate("menu.return"), $ -> onClose())); addButton(new Button(center - 100, yStart + 24 + -16, bLongWidth, bHeight, Lang.translate("menu.configure"), $ -> linkTo(BaseConfigScreen.forCreate(this)))); - Button gettingStarted = new Button(center + 2, yStart + 48 + -16, bShortWidth, bHeight, - Lang.translate("menu.getting_started"), $ -> { - }); - gettingStarted.active = false; + gettingStarted = new Button(center + 2, yStart + 48 + -16, bShortWidth, bHeight, + Lang.translate("menu.ponder_index"), $ -> linkTo(new PonderTagIndexScreen())); + gettingStarted.active = !(parent instanceof MainMenuScreen); addButton(gettingStarted); String projectLink = "https://www.curseforge.com/minecraft/mc-mods/create"; @@ -160,6 +163,15 @@ public class CreateMainMenuScreen extends AbstractSimiScreen { protected void renderWindowForeground(MatrixStack ms, int mouseX, int mouseY, float partialTicks) { super.renderWindowForeground(ms, mouseX, mouseY, partialTicks); buttons.forEach(w -> w.render(ms, mouseX, mouseY, partialTicks)); + + if (parent instanceof MainMenuScreen) { + if (mouseX < gettingStarted.x || mouseX > gettingStarted.x + 98) + return; + if (mouseY < gettingStarted.y || mouseY > gettingStarted.y + 20) + return; + renderTooltip(ms, TooltipHelper.cutTextComponent(Lang.translate("menu.only_ingame"), TextFormatting.GRAY, + TextFormatting.GRAY), mouseX, mouseY); + } } public void tick() { @@ -180,7 +192,7 @@ public class CreateMainMenuScreen extends AbstractSimiScreen { this.client.displayGuiScreen(this); }, url, true)); } - + @Override public boolean isPauseScreen() { return true; diff --git a/src/main/java/com/simibubi/create/foundation/ponder/NavigatableSimiScreen.java b/src/main/java/com/simibubi/create/foundation/ponder/NavigatableSimiScreen.java index 59d350155..3ff97cfbb 100644 --- a/src/main/java/com/simibubi/create/foundation/ponder/NavigatableSimiScreen.java +++ b/src/main/java/com/simibubi/create/foundation/ponder/NavigatableSimiScreen.java @@ -10,11 +10,13 @@ import org.lwjgl.glfw.GLFW; import com.mojang.blaze3d.matrix.MatrixStack; import com.mojang.blaze3d.systems.RenderSystem; +import com.simibubi.create.AllItems; import com.simibubi.create.foundation.gui.AbstractSimiScreen; import com.simibubi.create.foundation.gui.IScreenRenderable; import com.simibubi.create.foundation.gui.ScreenOpener; import com.simibubi.create.foundation.gui.Theme; import com.simibubi.create.foundation.gui.UIRenderHelper; +import com.simibubi.create.foundation.ponder.content.PonderTagIndexScreen; import com.simibubi.create.foundation.ponder.content.PonderTagScreen; import com.simibubi.create.foundation.ponder.ui.PonderButton; import com.simibubi.create.foundation.utility.Lang; @@ -25,6 +27,7 @@ import net.minecraft.client.Minecraft; import net.minecraft.client.gui.screen.Screen; import net.minecraft.item.ItemStack; import net.minecraft.util.math.MathHelper; +import net.minecraft.util.text.TranslationTextComponent; public abstract class NavigatableSimiScreen extends AbstractSimiScreen { @@ -73,14 +76,15 @@ public abstract class NavigatableSimiScreen extends AbstractSimiScreen { IScreenRenderable icon = null; ItemStack altIcon = null; + if (screen instanceof PonderTagIndexScreen) + altIcon = AllItems.WRENCH.asStack(); if (screen instanceof PonderUI) altIcon = ((PonderUI) screen).stack; if (screen instanceof PonderTagScreen) icon = ((PonderTagScreen) screen).getTag(); - widgets.add(backTrack = new PonderButton(31, height - 31 - 20) - .enableFade(0, 5) - .withCallback(() -> ScreenOpener.openPreviousScreen(this, Optional.empty()))); + widgets.add(backTrack = new PonderButton(31, height - 31 - 20).enableFade(0, 5) + .withCallback(() -> ScreenOpener.openPreviousScreen(this, Optional.empty()))); backTrack.fade(1); if (icon != null) @@ -99,7 +103,9 @@ public abstract class NavigatableSimiScreen extends AbstractSimiScreen { ms.push(); ms.translate(0, 0, 500); if (backTrack.isHovered()) { - textRenderer.draw(ms, Lang.translate(THINK_BACK), 15, height - 16, Theme.i(Theme.Key.TEXT_DARKER)); + TranslationTextComponent translate = Lang.translate(backTrackingLangKey()); + textRenderer.draw(ms, translate, 41 - textRenderer.getWidth(translate) / 2, height - 16, + Theme.i(Theme.Key.TEXT_DARKER)); if (MathHelper.epsilonEquals(arrowAnimation.getValue(), arrowAnimation.getChaseTarget())) { arrowAnimation.setValue(1); arrowAnimation.setValue(1);// called twice to also set the previous value to 1 @@ -108,6 +114,10 @@ public abstract class NavigatableSimiScreen extends AbstractSimiScreen { ms.pop(); } + protected String backTrackingLangKey() { + return THINK_BACK; + } + @Override protected void renderWindowBackground(MatrixStack ms, int mouseX, int mouseY, float partialTicks) { if (backTrack != null) { @@ -115,7 +125,8 @@ public abstract class NavigatableSimiScreen extends AbstractSimiScreen { int maxX = backTrack.x + backTrack.getWidth(); if (x + 30 < backTrack.x) - UIRenderHelper.breadcrumbArrow(ms, x + 30, height - 51, 0, maxX - (x + 30), 20, 5, Theme.p(Theme.Key.PONDER_BACK_ARROW)); + UIRenderHelper.breadcrumbArrow(ms, x + 30, height - 51, 0, maxX - (x + 30), 20, 5, + Theme.p(Theme.Key.PONDER_BACK_ARROW)); UIRenderHelper.breadcrumbArrow(ms, x, height - 51, 0, 30, 20, 5, Theme.p(Theme.Key.PONDER_BACK_ARROW)); UIRenderHelper.breadcrumbArrow(ms, x - 30, height - 51, 0, 30, 20, 5, Theme.p(Theme.Key.PONDER_BACK_ARROW)); diff --git a/src/main/java/com/simibubi/create/foundation/ponder/PonderLocalization.java b/src/main/java/com/simibubi/create/foundation/ponder/PonderLocalization.java index 64d61230b..d5b6a52cc 100644 --- a/src/main/java/com/simibubi/create/foundation/ponder/PonderLocalization.java +++ b/src/main/java/com/simibubi/create/foundation/ponder/PonderLocalization.java @@ -7,6 +7,7 @@ import com.google.gson.JsonElement; import com.google.gson.JsonObject; import com.simibubi.create.Create; import com.simibubi.create.foundation.ponder.content.PonderIndex; +import com.simibubi.create.foundation.ponder.content.PonderTagIndexScreen; import com.simibubi.create.foundation.ponder.content.PonderTagScreen; import com.simibubi.create.foundation.utility.Couple; import com.simibubi.create.foundation.utility.Lang; @@ -86,6 +87,13 @@ public class PonderLocalization { addGeneral(object, PonderUI.THINK_BACK, "Think Back"); addGeneral(object, PonderUI.SLOW_TEXT, "Comfy Reading"); + addGeneral(object, PonderTagIndexScreen.EXIT, "Exit"); + addGeneral(object, PonderTagIndexScreen.WELCOME, "Welcome to Ponder"); + addGeneral(object, PonderTagIndexScreen.CATEGORIES, "Available Categories in Create"); + addGeneral(object, PonderTagIndexScreen.DESCRIPTION, + "Click one of the icons to learn about its associated Items and Blocks"); + addGeneral(object, PonderTagIndexScreen.TITLE, "Ponder Index"); + shared.forEach((k, v) -> object.addProperty(Create.ID + "." + langKeyForShared(k), v)); tag.forEach((k, v) -> { object.addProperty(Create.ID + "." + langKeyForTag(k), v.getFirst()); diff --git a/src/main/java/com/simibubi/create/foundation/ponder/content/PonderTag.java b/src/main/java/com/simibubi/create/foundation/ponder/content/PonderTag.java index ab9a6b172..db8f3385f 100644 --- a/src/main/java/com/simibubi/create/foundation/ponder/content/PonderTag.java +++ b/src/main/java/com/simibubi/create/foundation/ponder/content/PonderTag.java @@ -1,5 +1,8 @@ package com.simibubi.create.foundation.ponder.content; +import java.util.ArrayList; +import java.util.List; + import com.mojang.blaze3d.matrix.MatrixStack; import com.simibubi.create.AllBlocks; import com.simibubi.create.AllItems; @@ -19,59 +22,60 @@ import net.minecraftforge.api.distmarker.OnlyIn; public class PonderTag implements IScreenRenderable { - // - + public static final List LISTED_TAGS = new ArrayList<>(); + public static final PonderTag KINETIC_RELAYS = new PonderTag("kinetic_relays").item(AllBlocks.COGWHEEL.get(), true, false) - .defaultLang("Kinetic Blocks", "Components which help relaying Rotational Force elsewhere"), + .defaultLang("Kinetic Blocks", "Components which help relaying Rotational Force elsewhere") + .addToIndex(), KINETIC_SOURCES = new PonderTag("kinetic_sources").item(AllBlocks.WATER_WHEEL.get(), true, false) - .defaultLang("Kinetic Sources", "Components which generate Rotational Force"), + .defaultLang("Kinetic Sources", "Components which generate Rotational Force") + .addToIndex(), KINETIC_APPLIANCES = new PonderTag("kinetic_appliances").item(AllBlocks.MECHANICAL_PRESS.get(), true, false) - .defaultLang("Kinetic Appliances", "Components which make use of Rotational Force"), + .defaultLang("Kinetic Appliances", "Components which make use of Rotational Force") + .addToIndex(), FLUIDS = new PonderTag("fluids").item(AllBlocks.FLUID_PIPE.get(), true, false) - .defaultLang("Fluid Manipulators", "Components which help relaying and making use of Fluids"), + .defaultLang("Fluid Manipulators", "Components which help relaying and making use of Fluids") + .addToIndex(), LOGISTICS = new PonderTag("logistics").item(Blocks.CHEST, true, false) - .defaultLang("Item Transportation", "Components which help moving items around"), + .defaultLang("Item Transportation", "Components which help moving items around") + .addToIndex(), REDSTONE = new PonderTag("redstone").item(Items.REDSTONE, true, false) - .defaultLang("Logic Components", "Components which help with redstone engineering"), + .defaultLang("Logic Components", "Components which help with redstone engineering") + .addToIndex(), DECORATION = new PonderTag("decoration").item(Items.ROSE_BUSH, true, false) .defaultLang("Aesthetics", "Components used mostly for decorative purposes"), CREATIVE = new PonderTag("creative").item(AllBlocks.CREATIVE_CRATE.get(), true, false) - .defaultLang("Creative Mode", "Components not usually available for Survival Mode"), + .defaultLang("Creative Mode", "Components not usually available for Survival Mode") + .addToIndex(), MOVEMENT_ANCHOR = new PonderTag("movement_anchor").item(AllBlocks.MECHANICAL_PISTON.get(), true, false) .defaultLang("Movement Anchors", - "Components which allow the creation of moving contraptions, animating an attached structure in a variety of ways"), + "Components which allow the creation of moving contraptions, animating an attached structure in a variety of ways") + .addToIndex(), CONTRAPTION_ACTOR = new PonderTag("contraption_actor").item(AllBlocks.MECHANICAL_HARVESTER.get(), true, false) .defaultLang("Contraption Actors", - "Components which expose special behaviour when attached to a moving contraption"), + "Components which expose special behaviour when attached to a moving contraption") + .addToIndex(), CONTRAPTION_ASSEMBLY = new PonderTag("contraption_assembly").item(AllItems.SUPER_GLUE.get(), true, false) .defaultLang("Block Attachment Utility", - "Tools and Components used to assemble structures moved as an animated Contraption"), + "Tools and Components used to assemble structures moved as an animated Contraption") + .addToIndex(), SAILS = new PonderTag("windmill_sails").item(AllBlocks.WINDMILL_BEARING.get(), true, true) .defaultLang("Sails for Windmill Bearings", "Blocks that count towards the strength of a Windmill Contraption when assembled. Each of these have equal efficiency in doing so."), -// FLUID_TRANSFER = new PonderTag("fluid_transfer").idAsIcon(), -// -// OPEN_INVENTORY = new PonderTag("open_inventory").item(AllBlocks.BASIN.get() -// .asItem()), -// -// REDSTONE_CONTROL = new PonderTag("redstone_control").item(Items.REDSTONE, true, false), -// -// ITEM_TRANSFER = new PonderTag("item_transfer").idAsIcon(), - ARM_TARGETS = new PonderTag("arm_targets").item(AllBlocks.MECHANICAL_ARM.get()) .defaultLang("Targets for Mechanical Arms", "Components which can be selected as inputs or outputs to the Mechanical Arm"); @@ -80,8 +84,6 @@ public class PonderTag implements IScreenRenderable { public static final PonderTag ALL = new PonderTag("_all"); } - // - private final String id; private ResourceLocation icon; private ItemStack itemIcon = ItemStack.EMPTY; @@ -118,6 +120,11 @@ public class PonderTag implements IScreenRenderable { return icon(id); } + public PonderTag addToIndex() { + LISTED_TAGS.add(this); + return this; + } + public PonderTag icon(String location) { this.icon = new ResourceLocation(com.simibubi.create.Create.ID, "textures/ponder/tag/" + location + ".png"); return this; @@ -145,7 +152,8 @@ public class PonderTag implements IScreenRenderable { .getTextureManager() .bindTexture(icon); ms.scale(0.25f, 0.25f, 1); - // x and y offset, blit z offset, tex x and y, tex width and height, entire tex sheet width and height + // x and y offset, blit z offset, tex x and y, tex width and height, entire tex + // sheet width and height AbstractGui.drawTexture(ms, 0, 0, 0, 0, 0, 64, 64, 64, 64); } else if (!itemIcon.isEmpty()) { ms.translate(-4, -4, 0); diff --git a/src/main/java/com/simibubi/create/foundation/ponder/content/PonderTagIndexScreen.java b/src/main/java/com/simibubi/create/foundation/ponder/content/PonderTagIndexScreen.java new file mode 100644 index 000000000..7da30d021 --- /dev/null +++ b/src/main/java/com/simibubi/create/foundation/ponder/content/PonderTagIndexScreen.java @@ -0,0 +1,241 @@ +package com.simibubi.create.foundation.ponder.content; + +import java.util.List; +import java.util.Optional; + +import com.mojang.blaze3d.matrix.MatrixStack; +import com.mojang.blaze3d.systems.RenderSystem; +import com.simibubi.create.AllItems; +import com.simibubi.create.foundation.gui.AllIcons; +import com.simibubi.create.foundation.gui.BoxElement; +import com.simibubi.create.foundation.gui.GuiGameElement; +import com.simibubi.create.foundation.gui.ScreenOpener; +import com.simibubi.create.foundation.gui.Theme; +import com.simibubi.create.foundation.gui.UIRenderHelper; +import com.simibubi.create.foundation.item.TooltipHelper; +import com.simibubi.create.foundation.ponder.NavigatableSimiScreen; +import com.simibubi.create.foundation.ponder.PonderLocalization; +import com.simibubi.create.foundation.ponder.PonderUI; +import com.simibubi.create.foundation.ponder.ui.LayoutHelper; +import com.simibubi.create.foundation.ponder.ui.PonderButton; +import com.simibubi.create.foundation.utility.FontHelper; +import com.simibubi.create.foundation.utility.Lang; + +import net.minecraft.client.MainWindow; +import net.minecraft.client.gui.widget.Widget; +import net.minecraft.client.renderer.Rectangle2d; +import net.minecraft.util.math.MathHelper; +import net.minecraft.util.text.ITextComponent; +import net.minecraft.util.text.StringTextComponent; +import net.minecraft.util.text.TextFormatting; + +public class PonderTagIndexScreen extends NavigatableSimiScreen { + + public static final String EXIT = PonderLocalization.LANG_PREFIX + "exit"; + public static final String TITLE = PonderLocalization.LANG_PREFIX + "index_title"; + public static final String WELCOME = PonderLocalization.LANG_PREFIX + "welcome"; + public static final String CATEGORIES = PonderLocalization.LANG_PREFIX + "categories"; + public static final String DESCRIPTION = PonderLocalization.LANG_PREFIX + "index_description"; + + private final double itemXmult = 0.5; + protected Rectangle2d itemArea; + protected Rectangle2d chapterArea; + private final double mainYmult = 0.15; + + private PonderTag hoveredItem = null; + + // The ponder entry point from the menu. May be changed to include general + // chapters in the future + public PonderTagIndexScreen() {} + + @Override + protected void init() { + widgets.clear(); + super.init(); + + List tags = PonderTag.LISTED_TAGS; + int rowCount = MathHelper.clamp((int) Math.ceil(tags.size() / 11d), 1, 3); + LayoutHelper layout = LayoutHelper.centeredHorizontal(tags.size(), rowCount, 28, 28, 8); + itemArea = layout.getArea(); + int itemCenterX = (int) (width * itemXmult); + int itemCenterY = getItemsY(); + + for (PonderTag i : tags) { + PonderButton b = + new PonderButton(itemCenterX + layout.getX() + 4, itemCenterY + layout.getY() + 4).showingTag(i) + .withCallback((mouseX, mouseY) -> { + centerScalingOn(mouseX, mouseY); + ScreenOpener.transitionTo(new PonderTagScreen(i)); + }); + widgets.add(b); + layout.next(); + } + + widgets.add(backTrack = new PonderButton(31, height - 31 - 20).enableFade(0, 5) + .showing(AllIcons.I_MTD_CLOSE) + .withCallback(() -> ScreenOpener.openPreviousScreen(this, Optional.empty()))); + backTrack.fade(1); + } + + @Override + public void tick() { + super.tick(); + PonderUI.ponderTicks++; + + hoveredItem = null; + MainWindow w = client.getWindow(); + double mouseX = client.mouseHelper.getMouseX() * w.getScaledWidth() / w.getWidth(); + double mouseY = client.mouseHelper.getMouseY() * w.getScaledHeight() / w.getHeight(); + for (Widget widget : widgets) { + if (widget == backTrack) + continue; + if (widget instanceof PonderButton) + if (widget.isMouseOver(mouseX, mouseY)) + hoveredItem = ((PonderButton) widget).getTag(); + } + } + + @Override + protected String backTrackingLangKey() { + return EXIT; + } + + @Override + protected void renderWindow(MatrixStack ms, int mouseX, int mouseY, float partialTicks) { + renderItems(ms, mouseX, mouseY, partialTicks); + + ms.push(); + ms.translate(width / 2 - 120, height * mainYmult - 40, 0); + + ms.push(); + // ms.translate(0, 0, 800); + int x = 31 + 20 + 8; + int y = 31; + + String title = Lang.translate(WELCOME) + .getString(); + + int streakHeight = 35; + UIRenderHelper.streak(ms, 0, x - 4, y - 12 + streakHeight / 2, streakHeight, 240); + // PonderUI.renderBox(ms, 21, 21, 30, 30, false); + new BoxElement().withBackground(Theme.c(Theme.Key.PONDER_BACKGROUND_FLAT)) + .gradientBorder(Theme.p(Theme.Key.PONDER_IDLE)) + .at(21, 21, 100) + .withBounds(30, 30) + .render(ms); + + textRenderer.draw(ms, title, x + 8, y + 1, Theme.i(Theme.Key.TEXT)); +// y += 8; +// x += 0; +// ms.translate(x, y, 0); +// ms.translate(0, 0, 5); +// textRenderer.draw(ms, title, 0, 0, Theme.i(Theme.Key.TEXT)); + ms.pop(); + + ms.push(); + ms.translate(23, 23, 10); + ms.scale(1.66f, 1.66f, 1.66f); + ms.translate(-4, -4, 0); + ms.scale(1.5f, 1.5f, 1.5f); + GuiGameElement.of(AllItems.WRENCH.asStack()) + .render(ms); + ms.pop(); + ms.pop(); + + ms.push(); + int w = (int) (width * .45); + x = (width - w) / 2; + y = getItemsY() - 10 + Math.max(itemArea.getHeight(), 48); + + String desc = Lang.translate(DESCRIPTION) + .getString(); + int h = textRenderer.getWordWrappedHeight(desc, w); + + // PonderUI.renderBox(ms, x - 3, y - 3, w + 6, h + 6, false); + new BoxElement().withBackground(Theme.c(Theme.Key.PONDER_BACKGROUND_FLAT)) + .gradientBorder(Theme.p(Theme.Key.PONDER_IDLE)) + .at(x - 3, y - 3, 90) + .withBounds(w + 6, h + 6) + .render(ms); + + ms.translate(0, 0, 100); + FontHelper.drawSplitString(ms, textRenderer, desc, x, y, w, Theme.i(Theme.Key.TEXT)); + ms.pop(); + } + + protected void renderItems(MatrixStack ms, int mouseX, int mouseY, float partialTicks) { + List tags = PonderTag.LISTED_TAGS; + if (tags.isEmpty()) + return; + + int x = (int) (width * itemXmult); + int y = getItemsY(); + + String relatedTitle = Lang.translate(CATEGORIES) + .getString(); + int stringWidth = textRenderer.getStringWidth(relatedTitle); + + ms.push(); + ms.translate(x, y, 0); + // PonderUI.renderBox(ms, (sWidth - stringWidth) / 2 - 5, itemArea.getY() - 21, + // stringWidth + 10, 10, false); + new BoxElement().withBackground(Theme.c(Theme.Key.PONDER_BACKGROUND_FLAT)) + .gradientBorder(Theme.p(Theme.Key.PONDER_IDLE)) + .at((sWidth - stringWidth) / 2f - 5, itemArea.getY() - 21, 100) + .withBounds(stringWidth + 10, 10) + .render(ms); + + ms.translate(0, 0, 200); + +// UIRenderHelper.streak(0, itemArea.getX() - 10, itemArea.getY() - 20, 20, 180, 0x101010); + drawCenteredString(ms, textRenderer, relatedTitle, sWidth / 2, itemArea.getY() - 20, Theme.i(Theme.Key.TEXT)); + + ms.translate(0, 0, -200); + + UIRenderHelper.streak(ms, 0, 0, 0, itemArea.getHeight() + 10, itemArea.getWidth() / 2 + 75); + UIRenderHelper.streak(ms, 180, 0, 0, itemArea.getHeight() + 10, itemArea.getWidth() / 2 + 75); + + ms.pop(); + + } + + public int getItemsY() { + return (int) (mainYmult * height + 85); + } + + @Override + protected void renderWindowForeground(MatrixStack ms, int mouseX, int mouseY, float partialTicks) { + ms.push(); + RenderSystem.disableRescaleNormal(); + RenderSystem.disableDepthTest(); + + ms.translate(0, 0, 200); + if (hoveredItem != null) { + List list = TooltipHelper.cutStringTextComponent(hoveredItem.getDescription(), + TextFormatting.GRAY, TextFormatting.GRAY); + list.add(0, new StringTextComponent(hoveredItem.getTitle())); + renderTooltip(ms, list, mouseX, mouseY); + } + RenderSystem.enableDepthTest(); + RenderSystem.enableRescaleNormal(); + ms.pop(); + } + + @Override + protected String getBreadcrumbTitle() { + return Lang.translate(TITLE) + .getString(); + } + + @Override + public boolean isPauseScreen() { + return true; + } + + @Override + public void removed() { + super.removed(); + hoveredItem = null; + } + +} diff --git a/src/main/java/com/simibubi/create/foundation/ponder/ui/PonderButton.java b/src/main/java/com/simibubi/create/foundation/ponder/ui/PonderButton.java index e3e675053..f7af4e2bb 100644 --- a/src/main/java/com/simibubi/create/foundation/ponder/ui/PonderButton.java +++ b/src/main/java/com/simibubi/create/foundation/ponder/ui/PonderButton.java @@ -11,6 +11,7 @@ import com.simibubi.create.foundation.gui.Theme; import com.simibubi.create.foundation.gui.Theme.Key; import com.simibubi.create.foundation.gui.widgets.BoxWidget; import com.simibubi.create.foundation.gui.widgets.ElementWidget; +import com.simibubi.create.foundation.ponder.content.PonderTag; import com.simibubi.create.foundation.utility.AnimationTickHolder; import com.simibubi.create.foundation.utility.ColorHelper; import com.simibubi.create.foundation.utility.animation.LerpedFloat; @@ -23,6 +24,7 @@ import net.minecraft.util.math.MathHelper; public class PonderButton extends BoxWidget { protected ItemStack item; + protected PonderTag tag; protected KeyBinding shortcut; protected LerpedFloat flash = LerpedFloat.linear().startWithValue(0).chase(0, 0.1f, LerpedFloat.Chaser.EXP); @@ -43,6 +45,10 @@ public class PonderButton extends BoxWidget { return (T) this; } + public T showingTag(PonderTag tag) { + return showing(this.tag = tag); + } + public T showing(ItemStack item) { this.item = item; return super.showingElement(GuiGameElement.of(item) @@ -103,6 +109,10 @@ public class PonderButton extends BoxWidget { public ItemStack getItem() { return item; } + + public PonderTag getTag() { + return tag; + } @Override public Key getDisabledTheme() { diff --git a/src/main/resources/assets/create/lang/default/messages.json b/src/main/resources/assets/create/lang/default/messages.json index d952edec3..985208e30 100644 --- a/src/main/resources/assets/create/lang/default/messages.json +++ b/src/main/resources/assets/create/lang/default/messages.json @@ -14,7 +14,8 @@ "create.menu.return": "Return to Menu", "create.menu.configure": "Configure...", - "create.menu.getting_started": "Getting Started", + "create.menu.ponder_index": "Ponder Index", + "create.menu.only_ingame": "Available in the Pause Menu", "create.menu.project_page": "Project Page", "create.menu.report_bugs": "Report Issues", "create.menu.support": "Support Us",