Skip to content

Commit

Permalink
Add improved side panel selector and clean up gui (#23)
Browse files Browse the repository at this point in the history
* initial right panel selector implementation

* initial right panel selector implementation

* fix build

* fix weird thing

* implement panel opening and closing

* add toggle buttons

* remove hack2

* cleanup

* gui cleanup

* reimplement multiplayer panels

* cleanup and save selected right panel

* translations and cleanup

* fix button jankiness

* move entire button declaration to AbstractRightPanel

* add "enigma is offline" message to multiplayer-only right panels when enigma is offline

* revert bad changes

* make messing up the button state impossible (in theory)

* move right panels entirely into an abstract class

* save divider location per-right-panel

* add title bars; cleanup

* fixes
- fix flashing structure panel
- fix calls panel opening with classes
- configure right panel on opening

* better consistency in UsersPanel

* cleanup to RightAngleLayerUI and general improvements

* correct javadoc

* clean up UIConfig

* docs

* cleanup to right panel types

* remove redundant gui fields

* merge multiplayer panels

* add generic getPanel()

* throw exception when missing right panel is requested

* fix panel order

* move updateStateIfCurrent check to avoid running else block if false

* better validation

* fix bug discovered by @bymartrixx

* add updateStructure(), do not show structure panel when receiving changes from server

* documentation and rename

* fix dead link

* new translations

* fix translation file indentation

* actually fix indentation, migrate existing translations

* remove debug logging

* FINAL indent fixing

* rename multiplayer panel to collab panel

* npe fix from @bymartrixx

* sometimes ctrl + f isn't enough

* use correct order in right panels

* fix crash with invalid right panel id

* fix visual corruption on buttons when switching panels through keybinds

* ACTUALLY fix right panel button ordering
  • Loading branch information
ix0rai authored Jan 6, 2023
1 parent e783663 commit eb15b89
Show file tree
Hide file tree
Showing 29 changed files with 1,380 additions and 608 deletions.
3 changes: 3 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,9 @@ indent_style = tab
[*.tiny]
indent_style = tab

[*.json]
indent_style = tab

[*.{mapping,mappings}]
indent_style = tab

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@
import cuchaz.enigma.network.Message;

public class MessageC2SPacket implements Packet<ServerPacketHandler> {

private String message;

MessageC2SPacket() {

}

public MessageC2SPacket(String message) {
Expand All @@ -30,10 +30,9 @@ public void write(DataOutput output) throws IOException {

@Override
public void handle(ServerPacketHandler handler) {
String message = this.message.trim();
if (!message.isEmpty()) {
handler.getServer().sendMessage(Message.chat(handler.getServer().getUsername(handler.getClient()), message));
String trimmedMessage = this.message.trim();
if (!trimmedMessage.isEmpty()) {
handler.getServer().sendMessage(Message.chat(handler.getServer().getUsername(handler.getClient()), trimmedMessage));
}
}

}
Loading

0 comments on commit eb15b89

Please sign in to comment.