diff --git a/src/src/assets/styles/themes/elaina.css b/src/src/assets/styles/themes/elaina.css index 241e837..d177046 100644 --- a/src/src/assets/styles/themes/elaina.css +++ b/src/src/assets/styles/themes/elaina.css @@ -36,6 +36,10 @@ html { filter: var(--play-button-filter) !important; } +.npe-header-league-logo { + filter: var(--play-button-filter) !important; +} + .stats-backdrop { opacity: 0.3!important; mix-blend-mode: difference !important; diff --git a/src/src/assets/styles/themes/rcp-fe-lol-parties.css b/src/src/assets/styles/themes/rcp-fe-lol-parties.css index f1f78c0..abeedc0 100644 --- a/src/src/assets/styles/themes/rcp-fe-lol-parties.css +++ b/src/src/assets/styles/themes/rcp-fe-lol-parties.css @@ -145,4 +145,12 @@ .confirm-button-container { filter: var(--find-match-button) !important; +} + +.tft-find-match-button-container { + filter: var(--find-match-button) !important; +} + +.parties-footer-notifications { + top: -120px !important; } \ No newline at end of file diff --git a/src/src/plugins/autoAccept.ts b/src/src/plugins/autoAccept.ts index 74e98f7..1b89d7a 100644 --- a/src/src/plugins/autoAccept.ts +++ b/src/src/plugins/autoAccept.ts @@ -17,26 +17,26 @@ export class AutoAccept { } } - fetch_or_create_champselect_buttons_container(): Element | null { - if (document.querySelector(".cs-buttons-container")) { - return document.querySelector(".cs-buttons-container") + fetch_or_create_champselect_buttons_container(): any { + try { + document.querySelector(".cs-buttons-container")?.remove() + } + catch {} + + const div = document.createElement("div") + div.className = "cs-buttons-container" + + let nor: HTMLElement | null = document.querySelector(".v2-footer-notifications.ember-view") + let tft: HTMLElement | null = document.querySelector(".parties-footer-notifications.ember-view") + + if (nor) { + nor.append(div) + return div + } + else if (tft) { + tft?.append(div) + return div } - else { - const div = document.createElement("div") - div.className = "cs-buttons-container" - - let nor: HTMLElement | null = document.querySelector(".v2-footer-notifications.ember-view") - let tft: HTMLElement | null = document.querySelector(".parties-footer-notifications.ember-view") - - if (nor) { - nor.append(div) - return div - } - else { - tft?.append(div) - return div - } - } } acceptMatchmaking = async (): Promise => { @@ -55,30 +55,39 @@ export class AutoAccept { } } + + createButton = async (element: any) => { + const newOption = document.createElement("lol-uikit-radio-input-option") + const container = this.fetch_or_create_champselect_buttons_container() + const Option2 = document.createElement("div") + + newOption.setAttribute("id", "autoAcceptQueueButton") + newOption.setAttribute("onclick", "window.autoAcceptQueueButtonSelect()") + + Option2.classList.add("auto-accept-button-text") + Option2.innerHTML = await getString("auto_accept") + + if (window.DataStore.get("auto_accept")){ + newOption.setAttribute("selected", "") + } + + if (element && !document.getElementById("autoAcceptQueueButton")) { + if (window.DataStore.get("auto_accept_button")) { + container?.append(newOption) + newOption.append(Option2) + } + } + } + main = (auto_accept_button: boolean = true) => { window.autoAcceptQueueButtonSelect = this.autoAcceptQueueButtonSelect upl.observer.subscribeToElementCreation(".v2-lobby-root-component.ember-view .v2-footer-notifications.ember-view",async (element: any) => { - const newOption = document.createElement("lol-uikit-radio-input-option") - const container = this.fetch_or_create_champselect_buttons_container() - const Option2 = document.createElement("div") - - newOption.setAttribute("id", "autoAcceptQueueButton") - newOption.setAttribute("onclick", "window.autoAcceptQueueButtonSelect()") - - Option2.classList.add("auto-accept-button-text") - Option2.innerHTML = await getString("auto_accept") - - if (window.DataStore.get("auto_accept")){ - newOption.setAttribute("selected", "") - } - - if (element && !document.getElementById("autoAcceptQueueButton")) { - if (window.DataStore.get("auto_accept_button")) { - container?.append(newOption) - newOption.append(Option2) - } - } + await this.createButton(element) + }) + + upl.observer.subscribeToElementCreation(".tft-footer-container.ember-view .parties-footer-notifications.ember-view",async (element: any) => { + await this.createButton(element) }) if (auto_accept_button) { diff --git a/src/src/plugins/customProfile.ts b/src/src/plugins/customProfile.ts index ec2487f..ef3f3de 100644 --- a/src/src/plugins/customProfile.ts +++ b/src/src/plugins/customProfile.ts @@ -146,7 +146,8 @@ export class CustomProfile { get: () => value, set: (v) => v, }) - }catch {} + } + catch {} } } } @@ -247,7 +248,7 @@ export class CustomProfile { } } } - catch{} + catch {} }) upl.observer.subscribeToElementCreation(".collection-totals",(element: any)=>{ @@ -288,7 +289,7 @@ export class CustomProfile { },3000) } } - catch{} + catch {} }) upl.observer.subscribeToElementCreation(".crystal-wrapper",(element: any)=>{ diff --git a/src/src/plugins/hideFriendlist.ts b/src/src/plugins/hideFriendlist.ts index 4c0d9b9..d240d4d 100644 --- a/src/src/plugins/hideFriendlist.ts +++ b/src/src/plugins/hideFriendlist.ts @@ -14,7 +14,8 @@ export class HideFriendList { get: () => value, set: (v) => v, }) - }catch {} + } + catch {} } } } @@ -91,7 +92,8 @@ export class HideFriendList { if (!hide) { try { document.querySelector("#centerViewport")?.remove(); - } catch {} + } + catch {} utils.addStyleWithID("centerViewport", ` .parties-game-type-select-wrapper.ember-view { transform: translateX(0px); @@ -139,7 +141,8 @@ export class HideFriendList { else { try { document.querySelector("#centerViewport")?.remove(); - } catch {} + } + catch {} utils.addStyleWithID("centerViewport", ` .parties-game-type-select-wrapper.ember-view { transform: translateX(113px); @@ -227,7 +230,8 @@ export class HideFriendList { bg[i].remove() } } - } catch {} + } + catch {} this.createSidebarBackground() }) @@ -242,11 +246,14 @@ export class HideFriendList { button[i].remove() } } - } catch {} + } + catch {} - this.createButton() - this.buttonShowHideFriendlist(window.DataStore.get("HideFriendList")) - this.showHideFriendslist(window.DataStore.get("HideFriendList")) + if (window.DataStore.get("enable-hide-top-navbar-friendlist-button")) { + this.createButton() + this.buttonShowHideFriendlist(window.DataStore.get("HideFriendList")) + this.showHideFriendslist(window.DataStore.get("HideFriendList")) + } }) } } \ No newline at end of file diff --git a/src/src/plugins/inviteAllFriends.ts b/src/src/plugins/inviteAllFriends.ts index eb14fd2..d2b7896 100644 --- a/src/src/plugins/inviteAllFriends.ts +++ b/src/src/plugins/inviteAllFriends.ts @@ -40,7 +40,7 @@ export class InviteAllFriends { log("Friends list refreshed.") } } - catch{} + catch {} } addInviteAllButton = async (): Promise => { diff --git a/src/src/plugins/lootHelper.ts b/src/src/plugins/lootHelper.ts index 88701f9..890de06 100644 --- a/src/src/plugins/lootHelper.ts +++ b/src/src/plugins/lootHelper.ts @@ -148,9 +148,12 @@ function AddContextMenu(title: any, subTitle: any, items: any[] = []) { } function OnClickRefreshButton() { - document.querySelectorAll('.loot-category-information').forEach(elem => { - elem.remove(); - }); + try { + document.querySelectorAll('.loot-category-information').forEach(elem => { + elem.remove(); + }); + } + catch {} CreateChapmsInformation() CreateSkinsInformation() } @@ -470,8 +473,7 @@ export class LootHelper { upl.observer.subscribeToElementCreation((".loot-inventory-grid "), (element: any) => { log("%cLoot helper loaded", "color: #e4c2b3") - CreateChapmsInformation() - CreateSkinsInformation() + OnClickRefreshButton() }) upl.observer.subscribeToElementCreation((".loot-display-category-tabs-container"), (element: any) => { diff --git a/src/src/services/backupAndRestoreDatastore.ts b/src/src/services/backupAndRestoreDatastore.ts index df3a466..741db39 100644 --- a/src/src/services/backupAndRestoreDatastore.ts +++ b/src/src/services/backupAndRestoreDatastore.ts @@ -6,7 +6,7 @@ import { log, error } from '../utils/themeLog'; export class BackupRestoreData { async importData(url: string): Promise { const controller = new AbortController(); - const timeoutId = setTimeout(() => controller.abort(), 2000); + const timeoutId = setTimeout(() => controller.abort(), 3000); try { const res = await fetch(url, { signal: controller.signal }); @@ -15,10 +15,11 @@ export class BackupRestoreData { return Data.default } else throw new Error(); - } catch { - let errorMsg = "Can't load default datastore from local" + } + catch (err: any) { + let errorMsg = "Can't load default datastore from local: " clearTimeout(timeoutId); - error(errorMsg); + error(errorMsg, err); window.Toast.error(errorMsg); } }; @@ -93,6 +94,6 @@ try { // Backup datastore backupRestoreData.backup() } -catch { error("Can not restore datastore") } +catch(err:any) { error("Can not restore datastore", err) } window.restoreDefaultDataStore = restoreDefaultDataStore \ No newline at end of file diff --git a/src/src/theme/applyUi.ts b/src/src/theme/applyUi.ts index 6d81e44..b2f18cc 100644 --- a/src/src/theme/applyUi.ts +++ b/src/src/theme/applyUi.ts @@ -1,6 +1,6 @@ import * as upl from 'pengu-upl' import { getThemeName } from "../otherThings" -import { log, warn } from '../utils/themeLog'; +import { log, warn, error } from '../utils/themeLog'; let filters = (await import(`//plugins/${getThemeName()}/config/filters.js`)).default; let icdata = (await import(`//plugins/${getThemeName()}/config/icons.js`)).default; @@ -19,7 +19,8 @@ function freezeProperties(object: Object, properties: any[]) { get: () => value, set: (v) => v, }) - }catch {} + } + catch {} } } } @@ -45,7 +46,7 @@ upl.observer.subscribeToElementCreation(".parallax-layer-container",(element: an class AramOnlyMode { removeNode(obj: string): void { try { document.querySelector(obj)?.remove() } - catch{ log(`Can not remove ${obj}`)} + catch (err: any) { error(`Can not remove ${obj}:`, err)} } removeOtherGamemode = () => { @@ -141,6 +142,11 @@ class NewGamesearchQueue { element.style.cssText = `height: 28px;` ) upl.observer.subscribeToElementCreation('.parties-game-search-divider', this.DisplayNone) + upl.observer.subscribeToElementCreation('.parties-game-search-map', (element: any) => + element.style.cssText = ` + filter: ${filters["PartiesStatusCard"]}; + ` + ) // lol-parties-status-card upl.observer.subscribeToElementCreation('.parties-status-card-bg-container', this.DisplayNone) @@ -166,7 +172,6 @@ class NewGamesearchQueue { margin: -3px 10px 0 0; filter: ${filters["PartiesStatusCard"]}; ` - ) // lol-parties-game-invites @@ -185,23 +190,27 @@ class TransparentSettingsDialogs { let a = element.querySelector("lol-uikit-dialog-frame").shadowRoot.querySelector("div") a.style.background = style freezeProperties(a.style,["background"]) - }catch{} + } + catch{} try{ let b = element.querySelector("lol-uikit-dialog-frame > div") b.style.background = style freezeProperties(b.style,["background"]) - }catch{} + } + catch{} try{ let a: any = document.getElementsByClassName("dialog-frame") for(let i = 0; i< a.length; i++) { let b = a[i].shadowRoot.querySelector("div") b.style.background = style } - }catch{} + } + catch{} try{ let c = element.querySelector("lol-regalia-identity-customizer-element").shadowRoot.querySelector("lol-regalia-banner-v2-element") c.remove() - }catch{} + } + catch{} // Settings try{ @@ -211,7 +220,8 @@ class TransparentSettingsDialogs { a.style.background = style freezeProperties(obj.style,["background"]) freezeProperties(a.style,["background"]) - }catch{} + } + catch{} }) } @@ -331,7 +341,7 @@ class CustomIcon { hoverCard.style.backgroundImage = "var(--Hover-card-backdrop)" } } - catch { warn("Can't change hover card backdrop.") } + catch (err: any) { error("Can't change hover card backdrop.", err) } }) } diff --git a/src/src/utils/setTime.ts b/src/src/utils/setTime.ts new file mode 100644 index 0000000..c3a21b1 --- /dev/null +++ b/src/src/utils/setTime.ts @@ -0,0 +1 @@ +window.DataStore.set("start-time", Date.now()) \ No newline at end of file