Skip to content

Commit

Permalink
Update v4.3.4
Browse files Browse the repository at this point in the history
  • Loading branch information
Elaina69 committed Jan 19, 2025
1 parent ae5c10a commit cac9708
Show file tree
Hide file tree
Showing 10 changed files with 114 additions and 71 deletions.
4 changes: 4 additions & 0 deletions src/src/assets/styles/themes/elaina.css
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
8 changes: 8 additions & 0 deletions src/src/assets/styles/themes/rcp-fe-lol-parties.css
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
87 changes: 48 additions & 39 deletions src/src/plugins/autoAccept.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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<void> => {
Expand All @@ -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) {
Expand Down
7 changes: 4 additions & 3 deletions src/src/plugins/customProfile.ts
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,8 @@ export class CustomProfile {
get: () => value,
set: (v) => v,
})
}catch {}
}
catch {}
}
}
}
Expand Down Expand Up @@ -247,7 +248,7 @@ export class CustomProfile {
}
}
}
catch{}
catch {}
})

upl.observer.subscribeToElementCreation(".collection-totals",(element: any)=>{
Expand Down Expand Up @@ -288,7 +289,7 @@ export class CustomProfile {
},3000)
}
}
catch{}
catch {}
})

upl.observer.subscribeToElementCreation(".crystal-wrapper",(element: any)=>{
Expand Down
23 changes: 15 additions & 8 deletions src/src/plugins/hideFriendlist.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@ export class HideFriendList {
get: () => value,
set: (v) => v,
})
}catch {}
}
catch {}
}
}
}
Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -227,7 +230,8 @@ export class HideFriendList {
bg[i].remove()
}
}
} catch {}
}
catch {}

this.createSidebarBackground()
})
Expand All @@ -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"))
}
})
}
}
2 changes: 1 addition & 1 deletion src/src/plugins/inviteAllFriends.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ export class InviteAllFriends {
log("Friends list refreshed.")
}
}
catch{}
catch {}
}

addInviteAllButton = async (): Promise<void> => {
Expand Down
12 changes: 7 additions & 5 deletions src/src/plugins/lootHelper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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()
}
Expand Down Expand Up @@ -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) => {
Expand Down
11 changes: 6 additions & 5 deletions src/src/services/backupAndRestoreDatastore.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import { log, error } from '../utils/themeLog';
export class BackupRestoreData {
async importData(url: string): Promise<any> {
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 });
Expand All @@ -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);
}
};
Expand Down Expand Up @@ -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
30 changes: 20 additions & 10 deletions src/src/theme/applyUi.ts
Original file line number Diff line number Diff line change
@@ -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;
Expand All @@ -19,7 +19,8 @@ function freezeProperties(object: Object, properties: any[]) {
get: () => value,
set: (v) => v,
})
}catch {}
}
catch {}
}
}
}
Expand All @@ -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 = () => {
Expand Down Expand Up @@ -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)
Expand All @@ -166,7 +172,6 @@ class NewGamesearchQueue {
margin: -3px 10px 0 0;
filter: ${filters["PartiesStatusCard"]};
`

)

// lol-parties-game-invites
Expand All @@ -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{
Expand All @@ -211,7 +220,8 @@ class TransparentSettingsDialogs {
a.style.background = style
freezeProperties(obj.style,["background"])
freezeProperties(a.style,["background"])
}catch{}
}
catch{}

})
}
Expand Down Expand Up @@ -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) }
})
}

Expand Down
1 change: 1 addition & 0 deletions src/src/utils/setTime.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
window.DataStore.set("start-time", Date.now())

0 comments on commit cac9708

Please sign in to comment.