From 67a53fdd2d9112fe3f3bd1d8ee1424ff5cc7e072 Mon Sep 17 00:00:00 2001 From: HorizonCode Date: Thu, 27 Oct 2022 11:00:10 +0200 Subject: [PATCH 1/8] readd rebuild script for get-window-by-name --- package.json | 1 + 1 file changed, 1 insertion(+) diff --git a/package.json b/package.json index 0566d46..57a75aa 100644 --- a/package.json +++ b/package.json @@ -32,6 +32,7 @@ }, "scripts": { "start": "electron .", + "rebuild": "electron-rebuild -f -w get-window-by-name", "pack-win": "electron-builder --x64", "pack-win32": "electron-builder --ia32", "pack-winarm": "electron-builder --arm64", From 89cdc8f316fad92a9264e1eeabf1a135cd0b4a66 Mon Sep 17 00:00:00 2001 From: HorizonCode Date: Thu, 27 Oct 2022 13:58:15 +0200 Subject: [PATCH 2/8] preperations for the patch method --- app.js | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/app.js b/app.js index d88f5e6..c9cd328 100644 --- a/app.js +++ b/app.js @@ -14,6 +14,7 @@ let osuWindowInfo; let isIngame; const platform = process.platform; let linuxWMCtrlFound = false; +let osuLoaded = false; const run = () => { const gotTheLock = app.requestSingleInstanceLock() @@ -28,6 +29,10 @@ const run = () => { const firstInstance = osuWindowInfo[0]; if (firstInstance) { if (firstInstance.processTitle && firstInstance.processTitle.length > 0) { + if (!osuLoaded) { + osuLoaded = true; + //TODO: do patch + } const windowTitle = firstInstance.processTitle; let rpcOsuVersion = ""; let currentMap = undefined; @@ -40,7 +45,7 @@ const run = () => { const splitArray = [components.shift(), components.join(' - ')]; rpcOsuVersion = splitArray[0]; currentMap = splitArray[1]; - if(currentMap.endsWith(".osu")){ + if (currentMap.endsWith(".osu")) { rpc.updateState("Editing..."); currentMap = currentMap.substring(0, currentMap.length - 4); } else rpc.updateState("Playing..."); @@ -48,10 +53,12 @@ const run = () => { rpc.updateStatus(currentMap, rpcOsuVersion); } else { + if (osuLoaded) osuLoaded = false; rpc.updateState("Idle in Launcher..."); rpc.updateStatus(undefined, undefined); } } else { + if (osuLoaded) osuLoaded = false; rpc.updateState("Idle in Launcher..."); rpc.updateStatus(undefined, undefined); } @@ -82,10 +89,10 @@ const run = () => { const splitArray = [components.shift(), components.join(' - ')]; rpcOsuVersion = splitArray[0]; currentMap = splitArray[1]; - if(currentMap.endsWith(".osu")){ + if (currentMap.endsWith(".osu")) { rpc.updateState("Editing..."); currentMap = currentMap.substring(0, currentMap.length - 4); - } + } else rpc.updateState("Playing..."); } @@ -119,9 +126,9 @@ const run = () => { await tryLogin(mainWindow); await doUpdateCheck(mainWindow); if (platform === "linux") { - try{ - await terminalUtil.execCommand(`osu-stable -h`); - }catch(err){ + try { + await terminalUtil.execCommand(`osu-stable -h`); + } catch (err) { mainWindow.webContents.send('status_update', { type: "package-issue", message: "Seems like you dont have the osu AUR Package installed, please install it." From 3e4186d3a7c8c46aa1190e52ca8061289c8332a1 Mon Sep 17 00:00:00 2001 From: HorizonCode Date: Thu, 27 Oct 2022 14:30:46 +0200 Subject: [PATCH 3/8] added checkbox for patching --- assets/checkbox.css | 85 +++++++++++++++++++++++++++++++++++++++++++++ assets/launcher.css | 11 +++++- html/index.html | 14 +++++--- 3 files changed, 105 insertions(+), 5 deletions(-) create mode 100644 assets/checkbox.css diff --git a/assets/checkbox.css b/assets/checkbox.css new file mode 100644 index 0000000..9f96335 --- /dev/null +++ b/assets/checkbox.css @@ -0,0 +1,85 @@ +[type="checkbox"]:not(:checked), +[type="checkbox"]:checked { + position: absolute; + left: 0; + opacity: 0.01; +} + +[type="checkbox"]:not(:checked)+label, +[type="checkbox"]:checked+label { + position: relative; + padding-left: 2.3em; + font-size: 1.05em; + line-height: 1.7; + cursor: pointer; +} + +/* checkbox aspect */ +[type="checkbox"]:not(:checked)+label:before, +[type="checkbox"]:checked+label:before { + content: ''; + position: absolute; + left: 0; + top: 0; + width: 1.4em; + height: 1.4em; + border: 1px solid #565656; + background: #4c4c4c; + border-radius: .2em; + box-shadow: inset 0 1px 3px rgba(0, 0, 0, .1), 0 0 0 hsla(var(--main-accent), 93%, 48%, 20%); + -webkit-transition: all .275s; + transition: all .275s; +} + +/* checked mark aspect */ +[type="checkbox"]:not(:checked)+label:after, +[type="checkbox"]:checked+label:after { + content: '✕'; + position: absolute; + top: .525em; + left: .18em; + font-size: 1.375em; + font-weight: bolder; + color: hsl(var(--main-accent), 93%, 48%); + line-height: 0; + -webkit-transition: all .2s; + transition: all .2s; +} + +/* checked mark aspect changes */ +[type="checkbox"]:not(:checked)+label:after { + opacity: 0; + -webkit-transform: scale(0) rotate(45deg); + transform: scale(0) rotate(45deg); +} + +[type="checkbox"]:checked+label:after { + opacity: 1; + -webkit-transform: scale(1) rotate(0); + transform: scale(1) rotate(0); + translate: -1.5px -1px; +} + +/* Disabled checkbox */ +[type="checkbox"]:disabled:not(:checked)+label:before, +[type="checkbox"]:disabled:checked+label:before { + box-shadow: none; + border-color: #565656; + background-color: #4c4c4c; + cursor: not-allowed; +} + +[type="checkbox"]:disabled:checked+label:after { + color: #777; +} + +[type="checkbox"]:disabled+label { + color: #aaa; + cursor: not-allowed; +} + +/* Accessibility */ +[type="checkbox"]:checked:focus+label:before, +[type="checkbox"]:not(:checked):focus+label:before { + box-shadow: inset 0 1px 3px rgba(0, 0, 0, .1), 0 0 0 6px hsla(var(--main-accent), 93%, 48%, 20%); +} \ No newline at end of file diff --git a/assets/launcher.css b/assets/launcher.css index 424c962..224c5b6 100644 --- a/assets/launcher.css +++ b/assets/launcher.css @@ -23,6 +23,15 @@ width: 100%; } +.launch-button-section { + display: flex; + flex-direction: column; +} + +.launch-button-section button { + margin-bottom: 10px; +} + .loading-section, .login-section { margin-top: 35px; @@ -48,7 +57,7 @@ } .folder-section { - margin-top: 45px; + margin-top: 13px; display: flex; flex-flow: column; justify-content: center; diff --git a/html/index.html b/html/index.html index dc86598..3d211f6 100644 --- a/html/index.html +++ b/html/index.html @@ -8,6 +8,7 @@ +