Skip to content
This repository has been archived by the owner on Jan 19, 2022. It is now read-only.

Commit

Permalink
馃摝 Minor bug fixes + Transparency Slider for Release 1.1.1
Browse files Browse the repository at this point in the history
  • Loading branch information
whatsaxis committed Aug 26, 2021
1 parent 077f7ba commit 258ad58
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 53 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "no-lye-overlay",
"author": "WhatsAxis",
"version": "1.1.0",
"version": "1.1.1",
"description": "A Hypixel stats overlay for the No Lye Guild.",
"main": "./.webpack/main/index.js",
"scripts": {
Expand Down
4 changes: 2 additions & 2 deletions src/gamemodes/Duels/tags.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -107,8 +107,8 @@ export const columns: { [c: string]: ColumnImplemenetation } = {
[Column.WLR]: {
displayName: 'WLR',
getValue: (player: Player) => {
const wins = _(player.stats?.player?.stats?.Bedwars?.wins_bedwars)
const losses = player.stats?.player?.stats?.Bedwars?.losses_bedwars
const wins = _(player.stats?.player?.stats?.Duels?.wins)
const losses = player.stats?.player?.stats?.Duels?.losses

return wins / (losses ? losses : 1)
},
Expand Down
2 changes: 1 addition & 1 deletion src/gamemodes/Duels/title.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ interface Title {
const titles: Title[] = [
{
name: 'Rookie',
color: 'GRAY',
color: 'DARK_GRAY',
min: 50 * 2,
increment: 10 * 2,
bold: false
Expand Down
53 changes: 7 additions & 46 deletions src/useCache.tsx
Original file line number Diff line number Diff line change
@@ -1,12 +1,5 @@
import { useState } from 'react'

import UnknownFace from '../assets/images/Overlays/unknown.png'


function c() {
console.log('鈺愨晲鈺愨晲鈺愨晲鈺愨晲鈺愨晲鈺愨晲鈺愨晲鈺愨晲鈺愨晲鈺愨晲鈺愨晲鈺愨晲')
}

interface UUID {
[username: string]: string
}
Expand All @@ -33,105 +26,73 @@ export function useCache() {
// UUID Cache

const UUIDCacheIncludes = (username: string) => {
c()
console.log('[CALL] UUID Cache Includes')
if (Object.keys(UUIDCache).includes(username)) {
console.log(true)
return true
}
console.log(false)
c()

return false
}

const UUIDCacheAdd = (entry: UUIDEntry) => {
c()
console.log('[CALL] UUID Cache Add')
if (Object.keys(UUIDCache).includes(entry.username)) throw new Error('This UUID has already been cached!')

console.log('Added ' + entry.uuid + ' to UUID cache.')

setUUIDCache(c => {
let tmp = c

tmp[entry.username] = entry.uuid

return tmp
})

c()
}


const UUIDCacheGet = (username: string) => {
c()
console.log('[CALL] UUID Cache Get')
if (!Object.keys(UUIDCache).includes(username)) {
console.log(null)
return null
}
console.log(UUIDCache[username])
c()

return UUIDCache[username]
}

// Nick Cache

const NickCacheIncludes = (username: string) => {
c()
if (NickCache.includes(username)) return true
console.log('[CALL] Nick Cache Includes')
console.log(NickCache.includes(username) ? true : false)
c()

return false
}

const NickCacheAdd = (username: string) => {
c()
console.log('[CALL] Nick Cache Add')
if (NickCache.includes(username)) {
console.log('[ERROR] Already cached')
throw new Error('This nick has already been cached!')
}
console.log('[ADD] ' + username)

setNickCache(c => [...c, username])
c()

}

// Skin Cache

const SkinCacheIncludes = (username: string) => {
c()
console.log('[CALL] Skin Cache Includes')
console.log(Object.keys(SkinCache).includes(username) ? true : false)
if (Object.keys(SkinCache).includes(username)) return true
c()

return false
}

const SkinCacheAdd = (entry: SkinEntry) => {
c()
if (Object.keys(SkinCache).includes(entry.username)) throw new Error('This skin has already been cached!')

console.log('[CALL] Skin Cache Add')
console.log('[ADD] ' + entry.username)
console.log(entry.skin)

setSkinCache(c => {
let tmp = c

tmp[entry.username] = entry.skin

return tmp
})
c()

}

const SkinCacheGet = (username: string) => {
c()
console.log('[CALL] Skin Cache Get')
console.log(SkinCache[username])
c()
return SkinCache[username]
}

Expand Down
3 changes: 0 additions & 3 deletions src/useUsers.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -99,11 +99,9 @@ export function useUsers() {
useEffect(() => {
window.Main.on('server_change', (e: Electron.IpcRendererEvent) => {
clearUsers()
console.log('鈺愨晲鈺愨晲鈺愨晲鈺愨晲鈺愨晲鈺愨晲 Server Change 鈺愨晲鈺愨晲鈺愨晲鈺愨晲鈺愨晲鈺愨晲')
})

window.Main.on('who', async (e: Electron.IpcRendererEvent, Users: string[]) => {
console.log('Used /who')
const notInUsersArray = Users.filter(u => !users.some((U: Player) => U.username === u))
for (const u of notInUsersArray) {
new Promise(async (resolve, reject) => {
Expand All @@ -124,7 +122,6 @@ export function useUsers() {

window.Main.on('leave', (e: Electron.IpcRendererEvent, user: string) => {
setUsers(u => u.filter(i => i.username !== user))
console.log(user + ' left!')
})

return () => {
Expand Down

0 comments on commit 258ad58

Please sign in to comment.