-
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
14 changed files
with
226 additions
and
52 deletions.
There are no files selected for viewing
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
Now with config! | ||
|
||
**Added**: | ||
- Implement CompleteConfig to allow players to configure levels and limit breaks. | ||
- Configuration UI in game client for single player (using cloth config and mod menu) | ||
- Configuration files in client config directory | ||
- Configuration files in server config directory | ||
- Server configuration synced to client during multiplayer sessions | ||
|
||
**Full Changelog**: https://github.com/eth0net/enchant-menu/compare/v1.1.1+fabric-1.19...v1.2.0-beta+fabric-1.19 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
98 changes: 98 additions & 0 deletions
98
src/main/kotlin/com/github/eth0net/enchantmenu/config/EnchantMenuConfig.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,98 @@ | ||
package com.github.eth0net.enchantmenu.config | ||
|
||
import com.github.eth0net.enchantmenu.EnchantMenu | ||
import me.lortseam.completeconfig.api.ConfigContainer | ||
import me.lortseam.completeconfig.api.ConfigContainer.Transitive | ||
import me.lortseam.completeconfig.api.ConfigEntries | ||
import me.lortseam.completeconfig.api.ConfigEntry | ||
import me.lortseam.completeconfig.api.ConfigEntry.BoundedInteger | ||
import me.lortseam.completeconfig.api.ConfigEntry.Slider | ||
import me.lortseam.completeconfig.api.ConfigGroup | ||
import me.lortseam.completeconfig.data.Config | ||
|
||
object EnchantMenuConfig : Config(EnchantMenu.MOD_ID), ConfigContainer { | ||
@Transitive | ||
@ConfigEntries(includeAll = true) | ||
object Levels : ConfigGroup { | ||
@BoundedInteger(min = 1, max = 100) | ||
@Slider | ||
var minimum = 1 | ||
set(value) { | ||
field = if (value < 1) { | ||
1 | ||
} else if (value > maximum) { | ||
maximum | ||
} else { | ||
value | ||
} | ||
} | ||
|
||
@BoundedInteger(min = 1, max = 100) | ||
@Slider | ||
var maximum = 10 | ||
set(value) { | ||
field = if (value < minimum) { | ||
minimum | ||
} else if (value > 100) { | ||
100 | ||
} else { | ||
value | ||
} | ||
} | ||
|
||
@BoundedInteger(min = 1, max = 100) | ||
@Slider | ||
var default = minimum | ||
set(value) { | ||
field = if (value < minimum) { | ||
minimum | ||
} else if (value > maximum) { | ||
maximum | ||
} else { | ||
value | ||
} | ||
} | ||
} | ||
|
||
@Transitive | ||
object AllowLimitBreaks : ConfigGroup { | ||
@ConfigEntry | ||
var incompatible = true | ||
fun toggleIncompatible() { | ||
incompatible = !incompatible | ||
} | ||
|
||
@ConfigEntry | ||
var level = true | ||
fun toggleLevel() { | ||
level = !level | ||
} | ||
|
||
@ConfigEntry | ||
var treasure = true | ||
fun toggleTreasure() { | ||
treasure = !treasure | ||
} | ||
} | ||
|
||
@Transitive | ||
object AutoLimitBreaks : ConfigGroup { | ||
@ConfigEntry | ||
var incompatible = false | ||
fun toggleIncompatible() { | ||
incompatible = !incompatible | ||
} | ||
|
||
@ConfigEntry | ||
var level = false | ||
fun toggleLevel() { | ||
level = !level | ||
} | ||
|
||
@ConfigEntry | ||
var treasure = false | ||
fun toggleTreasure() { | ||
treasure = !treasure | ||
} | ||
} | ||
} |
15 changes: 8 additions & 7 deletions
15
src/main/kotlin/com/github/eth0net/enchantmenu/network/channel/Channel.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,11 @@ | ||
package com.github.eth0net.enchantmenu.network.channel | ||
|
||
import com.github.eth0net.enchantmenu.util.Identifier | ||
import com.github.eth0net.enchantmenu.EnchantMenu.id | ||
|
||
internal val MenuChannel = Identifier("toggle_menu_channel") | ||
internal val DecrementLevelChannel = Identifier("decrement_level_channel") | ||
internal val IncrementLevelChannel = Identifier("increment_level_channel") | ||
internal val ToggleIncompatibleChannel = Identifier("toggle_incompatible_channel") | ||
internal val ToggleLevelChannel = Identifier("toggle_level_channel") | ||
internal val ToggleTreasureChannel = Identifier("toggle_treasure_channel") | ||
internal val MenuChannel = id("toggle_menu_channel") | ||
internal val ConfigSyncChannel = id("config_sync_channel") | ||
internal val DecrementLevelChannel = id("decrement_level_channel") | ||
internal val IncrementLevelChannel = id("increment_level_channel") | ||
internal val ToggleIncompatibleChannel = id("toggle_incompatible_channel") | ||
internal val ToggleLevelChannel = id("toggle_level_channel") | ||
internal val ToggleTreasureChannel = id("toggle_treasure_channel") |
Oops, something went wrong.