Skip to content

Commit ade4865

Browse files
Version 1.3.9
1 parent da2af45 commit ade4865

File tree

122 files changed

+3600
-1157
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

122 files changed

+3600
-1157
lines changed

build-logic/src/main/kotlin/essential/preprocessor.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ fun Project.configurePreprocessTree(versions: File) {
6666
fabric12106.link(fabric12105, versions.resolve("1.21.6-1.21.5.txt"))
6767
neoForge12105.link(fabric12105)
6868
forge12105.link(fabric12105)
69-
fabric12105.link(fabric12104)
69+
fabric12105.link(fabric12104, versions.resolve("1.21.5-1.21.4.txt"))
7070
neoForge12104.link(fabric12104)
7171
forge12104.link(fabric12104)
7272
fabric12104.link(fabric12103, versions.resolve("1.21.4-1.21.3.txt"))

changelog/release-1.3.9.md

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
Title: Fancy Menu Compatibility
2+
Summary: Fancy Menu compatibility and Essential menu layout redesign
3+
4+
## New Versions
5+
- Added support for 1.21.8 Fabric
6+
7+
## UI
8+
- Improved the layout of our buttons on the title screen
9+
- Improved the design of various modals
10+
- Added new account switcher modal
11+
- Added loading screen for switching accounts
12+
- Removed the condensed variant of the full title screen layout
13+
- Removed the "Essential Menu", its content was merged into Essential's settings menu
14+
15+
## Bug Fixes
16+
- Fixed particles of some cosmetics not rendering properly
17+
- Fixed our buttons on the title and pause screens not supporting animated textures with "Use Minecraft button texture" setting
18+
- Fixed our buttons on the title and pause screens not supporting nine-slice textures with "Use Minecraft button texture" setting
19+
- Fixed bad performance in Social Menu related to long messages
20+
- Fixed cape being slightly darker than it should be in Minecraft 1.16 - 1.21.1
21+
- Fixed images not resizing correctly after a window resize in the Social Menu
22+
- Fixed in-solid-block overlay sometimes rendering incorrectly in Minecraft 1.8.9
23+
- Fixed some GUI components not rendering properly on MacOS in Minecraft 1.21.5 and above
24+
25+
## Compatibility
26+
- Improved compatibility with the "Fancy Menu" mod, allowing Essential's title and pause screens to be modified
27+
- Fixed screenshot preview not working with "VanillaFix" mod
28+
- Fixed drag and drop feature rendering incorrectly with "Fabric API" 0.127.0 and above

features.properties

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,5 @@ nameplate_improvements=true
33
server_discovery=true
44
updated_gifting_modal=true
55
updated_coins_purchase_modal=true
6+
modal_update=true
7+
main_menu_improvements=true

gradle.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,4 +10,4 @@ minecraftVersion=11202
1010
# TODO remove once upgrading to Loom 1.10
1111
# fabric-api 1.21.5 was built with Loom 1.10, seems to work well enough in dev with our current 1.7 though
1212
loom.ignoreDependencyLoomVersionValidation=true
13-
version=1.3.8.4
13+
version=1.3.9

gradle/libs.versions.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
[versions]
2-
universalcraft = "419"
2+
universalcraft = "425"
33
elementa = "708"
44
vigilance = "306"
55
mixinextras = "0.4.0"

gui/essential/src/main/kotlin/gg/essential/config/EssentialConfig.kt

Lines changed: 2 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -379,7 +379,7 @@ object EssentialConfig : Vigilant2(), GuiEssentialPlatform.Config {
379379

380380
subcategory("Date & Time") {
381381
selector(timeFormatState) {
382-
name = "Timestamps Format"
382+
name = "Timestamps format"
383383
description = "Choose between using 12 or 24 hour time for dates/timestamps in Essential menus."
384384
options = listOf("12 Hour", "24 Hour")
385385
}
@@ -509,17 +509,6 @@ object EssentialConfig : Vigilant2(), GuiEssentialPlatform.Config {
509509
description = "Choose the layout of the Essential buttons on the main and pause menu."
510510
options = listOf("Full", "Minimal", "Off")
511511
}
512-
switch(showQuickActionBarState) {
513-
name = "Quick actions"
514-
description =
515-
"Shows the quick action bar in the main and pause menu. Quickly toggle notifications, cosmetics, and fullscreen."
516-
visible = essentialMenuLayoutState.map { it == 0 }
517-
}
518-
switch(closerMenuSidebarState) {
519-
name = "Wide-screen menu placement"
520-
description = "Moves the minimal Essential menu closer to the Minecraft menu."
521-
visible = essentialMenuLayoutState.map { it == 1 }
522-
}
523512
switch(useVanillaButtonForRetexturing) {
524513
name = "Use Minecraft button texture"
525514
description = "Uses Minecraft’s button texture on Essential main and pause menu buttons. If you have a resource pack equipped, it will use the resource pack’s button texture."
@@ -605,7 +594,7 @@ object EssentialConfig : Vigilant2(), GuiEssentialPlatform.Config {
605594
options = listOf("3 seconds", "5 seconds", "7 seconds")
606595
}
607596
switch(screenshotSoundsState) {
608-
name = "Screenshot Sounds"
597+
name = "Screenshot sounds"
609598
description = "Plays a capture sound when taking a screenshot."
610599
}
611600
switch(enableVanillaScreenshotMessageState) {

gui/essential/src/main/kotlin/gg/essential/cosmetics/diagnostics.kt

Lines changed: 27 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ import gg.essential.gui.elementa.state.v2.State
1717
import gg.essential.gui.elementa.state.v2.memo
1818
import gg.essential.gui.elementa.state.v2.stateOf
1919
import gg.essential.mod.Model
20+
import gg.essential.mod.cosmetics.settings.CosmeticProperty
2021
import gg.essential.model.BedrockModel
2122
import gg.essential.model.file.AnimationFile
2223
import gg.essential.model.file.ParticlesFile
@@ -36,6 +37,8 @@ fun diagnose(modelLoader: ModelLoader, cosmetic: Cosmetic): State<List<Diagnosti
3637
return stateOf(existingDiagnostics)
3738
}
3839

40+
val generalDiagnostics = diagnoseCosmeticGenerally(cosmetic)
41+
3942
val variants = cosmetic.variants?.map { it.name } ?: listOf("")
4043
val variantsAndSkins = variants.flatMap { variant ->
4144
val assets = cosmetic.assets(variant)
@@ -107,12 +110,35 @@ fun diagnose(modelLoader: ModelLoader, cosmetic: Cosmetic): State<List<Diagnosti
107110
}
108111
}
109112

110-
existingDiagnostics + diagnostics
113+
existingDiagnostics + generalDiagnostics + diagnostics
111114
}
112115
}
113116

114117
data class VariantAndSkin(val variant: String, val skin: Model)
115118

119+
private fun diagnoseCosmeticGenerally(cosmetic: Cosmetic): List<Diagnostic> {
120+
val diagnostics = mutableListOf<Diagnostic>()
121+
122+
for (property in cosmetic.properties) {
123+
if (property is CosmeticProperty.UsesId) {
124+
@Suppress("DEPRECATION")
125+
val propertyId = property.id
126+
when (property) {
127+
is CosmeticProperty.IdShouldBeSelf -> if (propertyId != cosmetic.id) {
128+
val msg = "Expected `id` of `${property.type}` to be `${cosmetic.id}` but was `${propertyId}`."
129+
diagnostics.add(Diagnostic.error(msg, file = "settings.json"))
130+
}
131+
is CosmeticProperty.IdIsTarget -> {
132+
// TODO could check if target exists, but we don't currently have an good way to get all cosmetics here
133+
}
134+
else -> throw AssertionError("Type ${property.javaClass} should implement one of the above interfaces.")
135+
}
136+
}
137+
}
138+
139+
return diagnostics
140+
}
141+
116142
private fun diagnoseModel(model: BedrockModel): List<Diagnostic> {
117143
val diagnostics = model.diagnostics.toMutableList()
118144

gui/essential/src/main/kotlin/gg/essential/gui/EssentialPalette.kt

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1064,6 +1064,15 @@ object EssentialPalette {
10641064
@JvmField
10651065
val COIN_BUNDLE_0_999: ImageFactory = ResourceImageFactory("/assets/essential/textures/coin/coin_bundle_0_999.png")
10661066

1067+
@JvmField
1068+
val HOST_5X: ImageFactory = ResourceImageFactory("/assets/essential/textures/host_5x.png")
1069+
1070+
@JvmField
1071+
val SMILEY_8X: ImageFactory = ResourceImageFactory("/assets/essential/textures/account/smiley_8x8.png")
1072+
1073+
@JvmField
1074+
val SIGN_OUT_8X7: ImageFactory = ResourceImageFactory("/assets/essential/textures/account/sign_out_8x7.png")
1075+
10671076
@LoadsResources("/assets/essential/textures/friends/group_[a-z]+.png")
10681077
private fun createGroupIconFactory(name: String): ImageFactory =
10691078
ResourceImageFactory("/assets/essential/textures/friends/group_$name.png")

gui/essential/src/main/kotlin/gg/essential/gui/common/MenuButton.kt

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,8 @@ import gg.essential.gui.common.shadow.EssentialUIText
3232
import gg.essential.gui.common.shadow.ShadowIcon
3333
import gg.essential.gui.elementa.state.v2.combinators.map
3434
import gg.essential.gui.elementa.state.v2.combinators.zip
35+
import gg.essential.gui.elementa.state.v2.mutableStateOf
36+
import gg.essential.gui.elementa.state.v2.stateOf
3537
import gg.essential.gui.image.ImageFactory
3638
import gg.essential.gui.layoutdsl.LayoutScope
3739
import gg.essential.gui.layoutdsl.Modifier
@@ -86,7 +88,7 @@ class MenuButton @JvmOverloads constructor(
8688

8789
val hoveredStyleOverrides = BasicState(false) // For manually activating hovered style
8890
private val tooltipHover = hoveredState()
89-
private val styleHover = hoveredState() or hoveredStyleOverrides
91+
val styleHover = hoveredState() or hoveredStyleOverrides
9092
private val collapsed = BasicState(false).map { it }
9193
private val enabledState = BasicState(true).map { it }
9294
private var collapsedWidth = 0f
@@ -109,7 +111,7 @@ class MenuButton @JvmOverloads constructor(
109111
}
110112
val isTruncated = textState.zip(labelState).map { (text, label) -> text != label }
111113

112-
private val styleState =
114+
val styleState =
113115
styleHover.zip(enabledState).zip(this.defaultStyle.zip(this.hoverStyle.zip(this.disabledStyle))).map { (hoveredEnabled, styles) ->
114116
val (hovered, enabled) = hoveredEnabled
115117
val (standardStyle, hoveredDisableStyles) = styles
@@ -137,6 +139,8 @@ class MenuButton @JvmOverloads constructor(
137139
// For accessing enabled state value
138140
val enabled by ReadOnlyState(enabledState)
139141

142+
var drawsBackground = mutableStateOf(stateOf(true))
143+
140144
@JvmOverloads
141145
constructor(
142146
buttonText: String = "",
@@ -398,7 +402,7 @@ class MenuButton @JvmOverloads constructor(
398402
beforeDraw(matrixStack)
399403

400404
val style = styleState.get()
401-
if (style.buttonColor.alpha != 0) {
405+
if (drawsBackground.getUntracked().getUntracked() && style.buttonColor.alpha != 0) {
402406
if (shouldBeRetextured ?: (Window.of(this) == platform.pauseMenuDisplayWindow)) {
403407
val hovered = styleHover.get()
404408
val (type, texture) = ButtonTextures.currentTexture(hovered)
@@ -410,6 +414,7 @@ class MenuButton @JvmOverloads constructor(
410414
// enabled, which is handled in `drawTexturedButton`.
411415
// - DARK_GRAY is our default button state.
412416
// - GRAY is our default hover state.
417+
// This check is mirrored in [MenuButtonProxy.requiresTinting()], be sure to replicate changes there
413418
val isDefaultOrHoveredBaseColor = style.buttonColor == (if (hovered) GRAY else DARK_GRAY).buttonColor
414419

415420
drawTexturedButton(

gui/essential/src/main/kotlin/gg/essential/gui/common/NoticeFlag.kt

Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@ import gg.essential.elementa.constraints.ChildBasedSizeConstraint
1919
import gg.essential.elementa.constraints.SiblingConstraint
2020
import gg.essential.elementa.dsl.*
2121
import gg.essential.elementa.effects.OutlineEffect
22+
import gg.essential.elementa.events.UIClickEvent
23+
import gg.essential.elementa.state.toConstraint
2224
import gg.essential.gui.EssentialPalette
2325
import gg.essential.gui.common.shadow.EssentialUIText
2426
import gg.essential.gui.image.ImageFactory
@@ -27,14 +29,18 @@ import gg.essential.gui.elementa.state.v2.State
2729
import gg.essential.gui.elementa.state.v2.color.toConstraint
2830
import gg.essential.gui.elementa.state.v2.combinators.and
2931
import gg.essential.gui.elementa.state.v2.combinators.map
32+
import gg.essential.gui.elementa.state.v2.memo
33+
import gg.essential.gui.elementa.state.v2.mutableStateOf
3034
import gg.essential.gui.elementa.state.v2.stateOf
3135
import gg.essential.gui.elementa.state.v2.toV1
36+
import java.awt.Color
3237

3338
abstract class NoticeFlag(
3439
style: State<MenuButton.Style>,
3540
) : UIBlock() {
3641

37-
private val backgroundColor = style.map { it.buttonColor }
42+
val backgroundHidden = mutableStateOf(stateOf(false))
43+
private val backgroundColor = memo { if (backgroundHidden()()) Color(0, 0, 0, 0) else style().buttonColor }
3844
private val highlightColor = backgroundColor.map { it.brighter() }
3945
private val shadowColor = backgroundColor.map { it.darker() }
4046
private val hasLeft = style.map { OutlineEffect.Side.Left in it.sides }
@@ -89,6 +95,12 @@ abstract class NoticeFlag(
8995
color = backgroundColor.toConstraint()
9096
}
9197
}
98+
99+
fun runAction(){
100+
fireClickEvent(UIClickEvent(
101+
getLeft(), getTop(), 0, this, this, 1
102+
))
103+
}
92104
}
93105

94106
class TextFlag(
@@ -127,14 +139,16 @@ class TextFlag(
127139

128140
class IconFlag(
129141
style: State<MenuButton.Style>,
130-
image: State<ImageFactory>,
142+
// image is not a state as none of our current uses require dynamic icons
143+
// if this changes in future see [NoticeFlagProxy.drawBehaviourFromComponentState] as it will require adjustment
144+
image: ImageFactory,
131145
) : NoticeFlag(style) {
132146

133147
init {
134148
setWidth((100.percent boundTo contentContainer) + 7.pixels)
135149

136150
contentContainer.layout(Modifier.alignHorizontal(Alignment.Center)) {
137-
icon(image.toV1(this@IconFlag), Modifier.color(EssentialPalette.TEXT_HIGHLIGHT).shadow(EssentialPalette.BLACK))
151+
icon(image, Modifier.color(EssentialPalette.TEXT_HIGHLIGHT).shadow(EssentialPalette.BLACK))
138152
}
139153
}
140154
}

0 commit comments

Comments
 (0)