Refactor voice chat, bot logging, and in-game settings menu - #10
Open
Arcdashckr wants to merge 3 commits into
Open
Refactor voice chat, bot logging, and in-game settings menu#10Arcdashckr wants to merge 3 commits into
Arcdashckr wants to merge 3 commits into
Conversation
Regardless of the name of the voice channel created, it always checks its ID. Four team roles (blue, green, red, yellow) can be selected, and the cabinets have separate channels. I added tabs to the in-game settings menu and tidied it up a bit. I also tried removing the mute and deafen buttons, but it didn't really work.
Rework voice-chat configuration and bot behavior: rename and reorganize Bot/User config fields (Team default 'None', Muted/Deafen, EnableVoiceHotkeys, keybinds, category/channel IDs), update config.json schema, and add many i18n keys. Improve Discord bot startup and logging with robust error handling, translations, and StardewModdingAPI log level mapping. Add retries and a channel-ID overload to MoveToVoice, MergeLocations logic, Reset/Broadcast location channels, and safer channel creation flow. Extend messaging and ModEntry handling: new MessageTypes (PlayerWarpedWithChannel, LocationChannelsSynced), broadcast/receive location channel maps, send warp messages with channel IDs when available, and GMCM UI rework (separate pages for user/voice-chat/bot, keybinds and options).
Move per-save state out of global config into dedicated per-save JSON files (data/{SaveName}_{SaveId}/players.json and channels.json). Add in-memory caches (LocationChannelsCache, PlayerDataCache) and helper methods to read/write per-save files, sanitize save folder names, and keep CurrentSaveDataFolder. Persist player mute/deafen state and channel mappings per save; update Bot and ModEntry logic to use caches, persist changes, and attempt safe moves on return-to-title. Refactor several nullability/signature checks and tighten error handling (try/catch around file and lookup ops), remove GMCM options for mute/deafen (now per-save), and update README to reflect new behavior and configuration. Also minor logging formatting cleanups and informational messages adjusted.
Open
Owner
|
@Arcdashckr Can you change the base branch to merge it into the tests branch? EDIT: Forget it, I can change it. |
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This PR significantly refactors the voice chat persistence, configuration structure, and Discord bot/channel synchronization logic.
Per-save persistence overhaul
Moved runtime voice/chat state out of the global config into dedicated per-save JSON files:
data/{SaveName}_{SaveId}/players.jsondata/{SaveName}_{SaveId}/channels.jsonAdded in-memory caches for faster and safer access:
LocationChannelsCachePlayerDataCacheAdded helper utilities for:
CurrentSaveDataFolder)Player mute/deafen state and location channel mappings are now persisted independently for each save.
Added safer handling when returning to title, including best-effort save-folder migration/move logic.
Voice chat & bot configuration rework
Reorganized and renamed config fields for clarity and consistency:
None)Updated the
config.jsonschema and expanded i18n coverage with many new translation keys.Removed GMCM mute/deafen options since those settings are now save-specific.
Discord bot improvements
Improved startup flow, logging, and error handling.
Added safer channel creation and lookup logic with additional try/catch coverage.
Added retries and channel-ID overload support to
MoveToVoice.Improved location synchronization logic:
Voice channels are now tracked strictly by Discord channel ID instead of channel name.
Added support for:
Networking & messaging
Added new message types:
PlayerWarpedWithChannelLocationChannelsSyncedWarp/location updates can now include channel IDs when available.
Improved synchronization of location channel maps across connected players.
UI & UX
Reworked the GMCM layout into separate pages:
Added keybind configuration pages and cleaned up the in-game settings UI.
Minor logging/message formatting cleanup and improved informational messages throughout the mod.
Miscellaneous