diff options
-rw-r--r-- | assets/opensb/interface/windowconfig/charselection.config.patch | 9 | ||||
-rw-r--r-- | source/frontend/StarCharSelection.cpp | 4 |
2 files changed, 12 insertions, 1 deletions
diff --git a/assets/opensb/interface/windowconfig/charselection.config.patch b/assets/opensb/interface/windowconfig/charselection.config.patch index bc6bffa..27447bb 100644 --- a/assets/opensb/interface/windowconfig/charselection.config.patch +++ b/assets/opensb/interface/windowconfig/charselection.config.patch @@ -10,6 +10,13 @@ "type": "textbox", "hint": "Search...", "position": [ 130, 244 ], - "maxWidth": 75 + "maxWidth": 68 + }, + "clearSearch": { + "type": "button", + "base": "/interface/x.png", + "hover": "/interface/xhover.png", + "pressed": "/interface/xpress.png", + "position": [ 200, 242 ] } } diff --git a/source/frontend/StarCharSelection.cpp b/source/frontend/StarCharSelection.cpp index 2bf4f93..6cbfb9b 100644 --- a/source/frontend/StarCharSelection.cpp +++ b/source/frontend/StarCharSelection.cpp @@ -36,6 +36,10 @@ CharSelectionPane::CharSelectionPane(PlayerStoragePtr playerStorage, m_search = convert<TextBoxWidget>(obj)->getText().trim().toLower(); updateCharacterPlates(); }); + guiReader.registerCallback("clearSearch", [=](Widget*) { + auto searchCharacter = fetchChild<TextBoxWidget>("searchCharacter"); + searchCharacter->setText(""); + }); guiReader.construct(root.assets()->json("/interface/windowconfig/charselection.config"), this); } |