Skip to content

Commit d14a22a

Browse files
Version 1.3.5.2
1 parent d0cee53 commit d14a22a

File tree

91 files changed

+1167
-692
lines changed

Some content is hidden

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

91 files changed

+1167
-692
lines changed

build-logic/build.gradle.kts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ dependencies {
3636
implementation("org.ow2.asm:asm-commons:9.3")
3737
implementation ("com.google.guava:guava:30.1.1-jre")
3838

39-
implementation("gg.essential:essential-gradle-toolkit:0.6.3")
39+
implementation("gg.essential:essential-gradle-toolkit:0.6.4")
4040
}
4141

4242
gradlePlugin {

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,7 @@ fun Project.universalLibs() {
6363
compileOnly("org.lwjgl:lwjgl-opengl:3.3.1")
6464
// Depending on 1.8.9 for all of these because that's the oldest version we support
6565
compileOnly("com.google.code.gson:gson:2.2.4")
66+
compileOnly("com.google.guava:guava:17.0")
6667
compileOnly("commons-codec:commons-codec:1.9")
6768
compileOnly("org.apache.httpcomponents:httpclient:4.3.3") // TODO ideally switch to one of the libs we bundle
6869
// These versions are configured in gradle/libs.versions.toml

changelog/release-1.3.5.2.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
Title: Bug Patch
2+
Summary: Minor bug fixes
3+
4+
## Wardrobe
5+
- Added emote sound settings
6+
7+
## Bug Fixes
8+
- Fixed crash when unbinding the zoom key in 1.21.2+
9+
- Fixed emotes unlocked via bundles permanently playing on the player
10+
- Fixed incorrect small purchase banner positioning

elementa/statev2/src/main/kotlin/gg/essential/gui/elementa/state/v2/collections/utils.kt

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ package gg.essential.gui.elementa.state.v2.collections
1313

1414
import gg.essential.elementa.state.v2.ReferenceHolder
1515
import gg.essential.gui.elementa.state.v2.ListState
16+
import gg.essential.gui.elementa.state.v2.effect
1617

1718
// FIXME this is assuming there are no duplicate keys (good enough for now)
1819
fun <T, K, V> ListState<T>.asMap(owner: ReferenceHolder, block: (T) -> Pair<K, V>): Map<K, V> {
@@ -41,6 +42,35 @@ fun <T, K, V> ListState<T>.asMap(owner: ReferenceHolder, block: (T) -> Pair<K, V
4142
return map
4243
}
4344

45+
fun <T> ListState<T>.effectOnChange(
46+
referenceHolder: ReferenceHolder,
47+
onChange: (TrackedList.Change<T>) -> Unit,
48+
) {
49+
var oldList = trackedListOf<T>()
50+
effect(referenceHolder) {
51+
val newList = this@effectOnChange()
52+
val changes = newList.getChangesSince(oldList).also { oldList = newList }
53+
for (change in changes) {
54+
onChange(change)
55+
}
56+
}
57+
}
58+
59+
fun <T> ListState<T>.effectOnChange(
60+
referenceHolder: ReferenceHolder,
61+
add: (IndexedValue<T>) -> Unit,
62+
remove: (IndexedValue<T>) -> Unit,
63+
clear: (List<T>) -> Unit = { list -> list.forEach { remove(IndexedValue(0, it)) } },
64+
) {
65+
effectOnChange(referenceHolder) { change ->
66+
when (change) {
67+
is TrackedList.Add -> add(change.element)
68+
is TrackedList.Remove -> remove(change.element)
69+
is TrackedList.Clear -> clear(change.oldElements)
70+
}
71+
}
72+
}
73+
4474
fun <T> trackedListOf(vararg elements: T) : TrackedList<T> = MutableTrackedList(elements.toMutableList())
4575

4676
fun <T> mutableTrackedListOf(vararg elements: T): MutableTrackedList<T> = MutableTrackedList(elements.toMutableList())

gradle.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,4 +7,4 @@ org.gradle.configureondemand=true
77
org.gradle.parallel.threads=128
88
org.gradle.jvmargs=-Xmx16G
99
minecraftVersion=11202
10-
version=1.3.5.1
10+
version=1.3.5.2

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

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -179,6 +179,14 @@ object EssentialConfig : Vigilant2(), GuiEssentialPlatform.Config {
179179
val disableEmotesState = property("Emotes.General.Disable Emotes", false)
180180
var disableEmotes by disableEmotesState
181181

182+
enum class AllowEmoteSounds(val label: String) {
183+
FROM_EVERYONE("From everyone"),
184+
FROM_MYSELF_AND_FRIENDS("From myself & friends"),
185+
FROM_MYSELF_ONLY("From myself only"),
186+
FROM_NOBODY("From nobody")
187+
}
188+
val allowEmoteSounds = property("Emotes.General.Allow emote sounds", AllowEmoteSounds.FROM_EVERYONE)
189+
182190
val essentialScreenshotsState = property("Quality of Life.Screenshots.Essential Screenshots", true)
183191
var essentialScreenshots: Boolean
184192
get() = essentialEnabled && essentialScreenshotsState.get()
@@ -250,6 +258,8 @@ object EssentialConfig : Vigilant2(), GuiEssentialPlatform.Config {
250258
enum class PreviouslyLaunchedWithContainer { Unknown, Yes, No }
251259
val previouslyLaunchedWithContainer = property("Hidden.previously_launched_with_container", PreviouslyLaunchedWithContainer.Unknown)
252260

261+
val playEmoteSoundsInWardrobe = property("Hidden.play_emote_sounds_in_wardrobe", true)
262+
253263
override val migrations = listOf(
254264
Migration { config ->
255265
val overrideGuiScale = config.remove("general.general.gui_scale") as Boolean? ?: return@Migration
@@ -378,6 +388,12 @@ object EssentialConfig : Vigilant2(), GuiEssentialPlatform.Config {
378388
description = "Show emote animations on yourself and other players."
379389
}
380390

391+
selector(allowEmoteSounds) {
392+
name = "Allow emote sounds"
393+
description = "Select who you can hear emote sounds from."
394+
options = AllowEmoteSounds.entries.map { it.label }
395+
}
396+
381397
switch(thirdPersonEmotesState) {
382398
name = "Play emotes in third person view"
383399
description = "Emotes will be shown in third-person view. You can still toggle between front and back view."

gui/essential/src/main/kotlin/gg/essential/gui/layoutdsl/effects.kt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ import gg.essential.gui.common.LoadingIcon
2525
import gg.essential.gui.common.shadow.ShadowEffect
2626
import gg.essential.gui.common.shadow.ShadowIcon
2727
import gg.essential.gui.elementa.state.v2.combinators.map
28+
import gg.essential.gui.elementa.state.v2.combinators.zip
2829
import java.awt.Color
2930
import gg.essential.gui.elementa.state.v2.State as StateV2
3031

@@ -38,6 +39,8 @@ fun Modifier.effect(effect: () -> Effect) = this then {
3839

3940
fun Modifier.outline(color: Color, width: Float, drawInsideChildren: Boolean = false) = effect { OutlineEffect(color, width, drawInsideChildren = drawInsideChildren) }
4041
fun Modifier.outline(color: State<Color>, width: State<Float>, drawInsideChildren: Boolean = false) = effect { OutlineEffect(color, width, drawInsideChildren = drawInsideChildren) }
42+
// TODO: Implement this properly with statev2
43+
fun Modifier.outline(color: StateV2<Color>, width: StateV2<Float>, drawInsideChildren: Boolean = false) = then(color.zip(width).map { (color, width) -> outline(color, width, drawInsideChildren) })
4144

4245
fun Modifier.shadow(color: Color? = null) = this then {
4346
when (this) {

gui/essential/src/main/kotlin/gg/essential/gui/overlay/LayerPriority.kt

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,15 @@
1212
package gg.essential.gui.overlay
1313

1414
enum class LayerPriority {
15+
/**
16+
* Layer which is logically positioned below the currently active screen.
17+
*
18+
* Note that this does not yet have dedicated input events and will instead use the same events as
19+
* [AboveScreenContent] (i.e. it will handle events before the screen and can cancel them). This is not intentional
20+
* and will change in the future if someone has an actual need for it.
21+
*/
22+
BelowScreen,
23+
1524
/**
1625
* Layer which is logically positioned below most of the content of the currently active screen.
1726
*
File renamed without changes.

src/main/kotlin/gg/essential/gui/wardrobe/Item.kt renamed to gui/essential/src/main/kotlin/gg/essential/gui/wardrobe/Item.kt

File renamed without changes.

0 commit comments

Comments
 (0)