Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
"axios": "^1.2.3",
"cheerio": "^1.0.0-rc.12",
"electron-log": "^4.4.8",
"electron-overlay-window": "^3.3.0",
"electron-store": "^8.1.0",
"electron-updater": "^5.3.0",
"league-connect": "^6.0.0-rc10",
Expand All @@ -45,6 +46,7 @@
"@types/auto-launch": "^5.0.2",
"@types/lodash": "^4.14.191",
"@types/node": "^20.1.2",
"@types/qs": "^6.9.7",
"@types/react": "^18.0.26",
"@types/react-dom": "^18.0.10",
"@types/react-virtualized": "^9.21.21",
Expand All @@ -64,6 +66,7 @@
"framer-motion": "^9.1.6",
"inquirer": "^9.1.4",
"inquirer-autocomplete-prompt": "^3.0.0",
"jotai": "^2.1.0",
"polished": "^4.2.2",
"prettier": "^2.8.3",
"qs": "^6.11.1",
Expand Down
8 changes: 4 additions & 4 deletions src/main/modules/app/app.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,10 @@ export class AppModule {
resolve()
})

this.window.on('close', () => {
this.window = null
})

this.window.webContents.setWindowOpenHandler(({ url }) => {
if (url.startsWith('https:')) {
shell.openExternal(url)
Expand All @@ -123,10 +127,6 @@ export class AppModule {
this.createWindow()
})

app.on('window-all-closed', () => {
this.window = null
})

app.on('second-instance', (_, argv) => {
if (!this.IS_MAC) {
const url = argv.find(arg => arg.startsWith(`${this.PROTOCOL}://`))
Expand Down
53 changes: 26 additions & 27 deletions src/main/modules/league/league.module.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// import { BrowserWindow } from 'electron';
// import { OverlayController, OVERLAY_WINDOW_OPTS } from 'electron-overlay-window';
// import { windowManager } from 'node-window-manager';
import { BrowserWindow } from 'electron'
import { OverlayController, OVERLAY_WINDOW_OPTS } from 'electron-overlay-window'

import { initializer, singleton } from '@launchtray/tsyringe-async'
import axios from 'axios'

Expand Down Expand Up @@ -64,25 +64,24 @@ export class LeagueModule {
this.appModule.createWindow()
}

// const clientOverlayWindow = new BrowserWindow({
// ...OVERLAY_WINDOW_OPTS,
// alwaysOnTop: true,
// hasShadow: false,
// webPreferences: {
// preload: this.appModule.PRELOAD_PATH,
// },
// });
const clientOverlayWindow = new BrowserWindow({
...OVERLAY_WINDOW_OPTS,
alwaysOnTop: true,
hasShadow: false,
webPreferences: {
preload: this.appModule.PRELOAD_PATH,
},
})

// clientOverlayWindow.loadURL('http://localhost:3000/#/overlays/client');
// clientOverlayWindow.webContents.openDevTools({ mode: 'detach', activate: false });
clientOverlayWindow.loadURL('http://localhost:3000/#/overlays/client')

// OverlayController.attachByTitle(clientOverlayWindow, 'League of Legends');
// OverlayController.activateOverlay();
OverlayController.attachByTitle(clientOverlayWindow, 'League of Legends')
OverlayController.activateOverlay()

this.appModule.window?.webContents.send('league/connect-change', 'connect')

this.client.subscribe('/lol-champ-select/v1/session', data => {
this.appModule.window?.webContents.send('league/room/session', data)
this.appModule.window?.webContents.send('league/champ-select/session', data)
})

this.client.subscribe('/lol-summoner/v1/current-summoner', data => {
Expand All @@ -101,14 +100,14 @@ export class LeagueModule {

if (!autoAccept) return

// clientOverlayWindow.show();
// clientOverlayWindow.focus();
// OverlayController.focusTarget();
// clientOverlayWindow.webContents.send('league/auto-accept', {
// timer: data.timer,
// playerResponse: data.playerResponse,
// autoAcceptDelaySeconds,
// });
clientOverlayWindow.show()
clientOverlayWindow.focus()
OverlayController.focusTarget()
clientOverlayWindow.webContents.send('league/auto-accept', {
timer: data.timer,
playerResponse: data.playerResponse,
autoAcceptDelaySeconds,
})

if (data.timer < autoAcceptDelaySeconds) return

Expand All @@ -117,9 +116,9 @@ export class LeagueModule {
url: '/lol-matchmaking/v1/ready-check/accept',
})
} else {
// clientOverlayWindow.webContents.send('league/auto-accept', {
// playerResponse: data.playerResponse,
// });
clientOverlayWindow.webContents.send('league/auto-accept', {
playerResponse: data.playerResponse,
})
}
})
})
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ const ReadyTimerOverlay = ({ className }: ReadyTimerOverlayProps) => {

return (
<ReadyTimerOverlayStyled className={clsx('ReadyTimerOverlay', className)}>
자동 수락까지 {data.autoAcceptDelaySeconds! - data.timer!}초 남았습니다
자동 수락까지 <span>{data.autoAcceptDelaySeconds! - data.timer!}</span>초 남았습니다
</ReadyTimerOverlayStyled>
)
}
Expand Down
5 changes: 5 additions & 0 deletions src/renderer/src/features/overlay/ReadyTimerOverlay/styled.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,9 @@ export const ReadyTimerOverlayStyled = styled.div`
color: ${props => props.theme.colors.gold};
text-align: center;
font-family: 'BeaufortforLOL';

span {
font-family: 'NanumSquareRound';
transform: translateY(-1px);
}
`
25 changes: 24 additions & 1 deletion yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -950,6 +950,11 @@
resolved "https://registry.yarnpkg.com/@types/prop-types/-/prop-types-15.7.5.tgz#5f19d2b85a98e9558036f6a3cacc8819420f05cf"
integrity sha512-JCB8C6SnDoQf0cNycqd/35A7MjcnK+ZTqE7judS6o7utxUCg6imJg3QK2qzHKszlTjcj2cn+NwMB2i96ubpj7w==

"@types/qs@^6.9.7":
version "6.9.7"
resolved "https://registry.yarnpkg.com/@types/qs/-/qs-6.9.7.tgz#63bb7d067db107cc1e457c303bc25d511febf6cb"
integrity sha512-FGa1F62FT09qcrueBA6qYTrJPVDzah9a+493+o2PCXsesWHIn27G98TsSMs3WPNbZIEj4+VJf6saSFpvD+3Zsw==

"@types/react-dom@^18.0.10":
version "18.2.4"
resolved "https://registry.yarnpkg.com/@types/react-dom/-/react-dom-18.2.4.tgz#13f25bfbf4e404d26f62ac6e406591451acba9e0"
Expand Down Expand Up @@ -2144,6 +2149,14 @@ electron-osx-sign@^0.6.0:
minimist "^1.2.0"
plist "^3.0.1"

electron-overlay-window@^3.3.0:
version "3.3.0"
resolved "https://registry.yarnpkg.com/electron-overlay-window/-/electron-overlay-window-3.3.0.tgz#db95dd08d1b3afad32f8cc288f19bec4ff9769a9"
integrity sha512-vxoc8nxfjgS8cLEPvM/b/vrx3IJNo8eaFgDJiyswIN+8GzMy06Mj+l8W7eUOU2uC4/m4C288AcEEOeqkHxbvSQ==
dependencies:
node-gyp-build "4.x.x"
throttle-debounce "5.x.x"

electron-publish@23.6.0:
version "23.6.0"
resolved "https://registry.yarnpkg.com/electron-publish/-/electron-publish-23.6.0.tgz#ac9b469e0b07752eb89357dd660e5fb10b3d1ce9"
Expand Down Expand Up @@ -3209,6 +3222,11 @@ javascript-natural-sort@0.7.1:
resolved "https://registry.yarnpkg.com/javascript-natural-sort/-/javascript-natural-sort-0.7.1.tgz#f9e2303d4507f6d74355a73664d1440fb5a0ef59"
integrity sha512-nO6jcEfZWQXDhOiBtG2KvKyEptz7RVbpGP4vTD2hLBdmNQSsCiicO2Ioinv6UI4y9ukqnBpy+XZ9H6uLNgJTlw==

jotai@^2.1.0:
version "2.1.0"
resolved "https://registry.yarnpkg.com/jotai/-/jotai-2.1.0.tgz#b1a9525345518453802e4a64d99e2800598bab76"
integrity sha512-fR82PtHAmEQrc/daMEYGc4EteW96/b6wodtDSCzLvoJA/6y4YG70er4hh2f8CYwYjqwQ0eZUModGfG4DmwkTyQ==

js-sdsl@^4.1.4:
version "4.4.0"
resolved "https://registry.yarnpkg.com/js-sdsl/-/js-sdsl-4.4.0.tgz#8b437dbe642daa95760400b602378ed8ffea8430"
Expand Down Expand Up @@ -3542,6 +3560,11 @@ node-fetch@^2.6.7:
dependencies:
whatwg-url "^5.0.0"

node-gyp-build@4.x.x:
version "4.6.0"
resolved "https://registry.yarnpkg.com/node-gyp-build/-/node-gyp-build-4.6.0.tgz#0c52e4cbf54bbd28b709820ef7b6a3c2d6209055"
integrity sha512-NTZVKn9IylLwUzaKjkas1e4u2DLNcV4rdYagA4PWdPwW87Bi7z+BznyKSRwS/761tV/lzCGXplWsiaMjLqP2zQ==

node-releases@^2.0.8:
version "2.0.10"
resolved "https://registry.yarnpkg.com/node-releases/-/node-releases-2.0.10.tgz#c311ebae3b6a148c89b1813fd7c4d3c024ef537f"
Expand Down Expand Up @@ -4850,7 +4873,7 @@ text-table@^0.2.0:
resolved "https://registry.yarnpkg.com/text-table/-/text-table-0.2.0.tgz#7f5ee823ae805207c00af2df4a84ec3fcfa570b4"
integrity sha512-N+8UisAXDGk8PFXP4HAzVR9nbfmVJ3zYLAWiTIoqC5v5isinhr+r5uaO8+7r3BMfuNIufIsA7RdpVgacC2cSpw==

throttle-debounce@^5.0.0:
throttle-debounce@5.x.x, throttle-debounce@^5.0.0:
version "5.0.0"
resolved "https://registry.yarnpkg.com/throttle-debounce/-/throttle-debounce-5.0.0.tgz#a17a4039e82a2ed38a5e7268e4132d6960d41933"
integrity sha512-2iQTSgkkc1Zyk0MeVrt/3BvuOXYPl/R8Z0U2xxo9rjwNciaHDG3R+Lm6dh4EeUci49DanvBnuqI6jshoQQRGEg==
Expand Down