From 1224213cab2594eb9b18f97c238af148d662063d Mon Sep 17 00:00:00 2001 From: Kae <80987908+Novaenia@users.noreply.github.com> Date: Mon, 29 Jul 2024 14:59:52 +1000 Subject: [PATCH] Change the Songbook search field to be more compatible with UI mods It's at the top of the list now. Closes #90 --- .../windowconfig/songbook.config.patch | 22 ------------------- .../windowconfig/songbook_search_patch.lua | 12 ++++++++++ .../opensb/scripts/opensb/assets/postload.lua | 5 +++++ 3 files changed, 17 insertions(+), 22 deletions(-) delete mode 100644 assets/opensb/interface/windowconfig/songbook.config.patch create mode 100644 assets/opensb/interface/windowconfig/songbook_search_patch.lua diff --git a/assets/opensb/interface/windowconfig/songbook.config.patch b/assets/opensb/interface/windowconfig/songbook.config.patch deleted file mode 100644 index 0ef4c54..0000000 --- a/assets/opensb/interface/windowconfig/songbook.config.patch +++ /dev/null @@ -1,22 +0,0 @@ -{ - "paneLayout" : { - "group" : { - "position" : [8, 71] - }, - "search" : { - "type" : "textbox", - "position" : [86, 71], - "hint" : "Search", - "maxWidth" : 50 - }, - "lblBandInput" : { - "position" : [3, 68] - }, - "lblSearchInput" : { - "type" : "image", - "file" : "/interface/songbook/band.png", - "position" : [81, 68], - "zlevel" : -3 - } - } -} \ No newline at end of file diff --git a/assets/opensb/interface/windowconfig/songbook_search_patch.lua b/assets/opensb/interface/windowconfig/songbook_search_patch.lua new file mode 100644 index 0000000..474c2c1 --- /dev/null +++ b/assets/opensb/interface/windowconfig/songbook_search_patch.lua @@ -0,0 +1,12 @@ +function patch(config) + local scrollBG = config.paneLayout.scrollBG + local scrollSize = assets.image(scrollBG.file):size() + config.paneLayout.search = { + type = "textbox", + position = {scrollBG.position[1] + 3, + scrollBG.position[2] + scrollSize[2] - 10}, + hint = "^#999;Type here to search for a song", + maxWidth = scrollSize[1] - 6 + } + return config +end \ No newline at end of file diff --git a/assets/opensb/scripts/opensb/assets/postload.lua b/assets/opensb/scripts/opensb/assets/postload.lua index baf3081..256e199 100644 --- a/assets/opensb/scripts/opensb/assets/postload.lua +++ b/assets/opensb/scripts/opensb/assets/postload.lua @@ -25,3 +25,8 @@ local path = "/objects/opensb/object.patch.lua" for i = 1, #objects do assets.patch(objects[i], path) end + +assets.patch( + "/interface/windowconfig/songbook.config", + "/interface/windowconfig/songbook_search_patch.lua" +) \ No newline at end of file