Skip to content

Commit

Permalink
Prevent blank messages from being cleaned up in type-mode macros, close
Browse files Browse the repository at this point in the history
  • Loading branch information
NotRyken committed Dec 12, 2024
1 parent c8543c5 commit 761caf5
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 4 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Changelog

## 2.3.5

- Prevented blank messages from being automatically removed from type-mode macros on save

## 2.3.4

- Fixed macros becoming unresponsive on deletion of a macro with the same keybind
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -270,14 +270,15 @@ public void setShowHudMessage(Macro macro, boolean value) {

// Cleanup and validation

public void cleanup() {
void cleanup() {
macros.removeIf((macro) -> {
// Allow trailing whitespace only for TYPE mode
if (!macro.sendMode.equals(Macro.SendMode.TYPE)) {
macro.messages.forEach((msg) -> msg.string = msg.string.stripTrailing());
}
// Allow blank messages for CYCLE mode as spacers
if (!macro.sendMode.equals(Macro.SendMode.CYCLE)) {
// Allow blank messages for CYCLE mode as spacers and TYPE mode to open chat
if (!macro.sendMode.equals(Macro.SendMode.CYCLE) &&
!macro.sendMode.equals(Macro.SendMode.TYPE)) {
macro.messages.removeIf((msg) -> msg.string.isBlank());
}
return macro.messages.isEmpty();
Expand Down
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
# Neo/Forge version ranges: https://maven.apache.org/enforcer/enforcer-rules/versionRanges.html

# Project
mod_version=2.3.4+1.21
mod_version=2.3.5+1.21
mod_group=dev.terminalmc
mod_id=commandkeys
mod_name=CommandKeys
Expand Down

0 comments on commit 761caf5

Please sign in to comment.