Skip to content

Commit

Permalink
1.2.24
Browse files Browse the repository at this point in the history
  • Loading branch information
Razviar committed Sep 26, 2023
1 parent b438486 commit 5970703
Show file tree
Hide file tree
Showing 14 changed files with 111 additions and 69 deletions.
70 changes: 37 additions & 33 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 6 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "marvelsnaptracker",
"productName": "Marvel Snap Tracker",
"version": "1.2.22",
"version": "1.2.24",
"description": "Marvel Snap Tracker",
"main": "./.webpack/main",
"scripts": {
Expand All @@ -24,15 +24,15 @@
"forge": "./forge.config.js"
},
"dependencies": {
"@types/find": "0.2.1",
"@types/find": "0.2.2",
"auto-launch": "5.0.6",
"axios": "1.5.0",
"date-fns": "2.30.0",
"electron-is-dev": "2.0.0",
"error-stack-parser": "2.1.4",
"find-process": "1.4.7",
"form-data": "4.0.0",
"jsonrepair": "3.2.0",
"jsonrepair": "3.2.2",
"lodash": "4.17.21",
"moment": "2.29.4",
"node-abi": "3.47.0",
Expand All @@ -51,13 +51,13 @@
"@electron-forge/plugin-webpack": "6.4.2",
"@electron-forge/publisher-github": "6.4.2",
"@marshallofsound/webpack-asset-relocator-loader": "0.5.0",
"@types/auto-launch": "5.0.2",
"@types/lodash": "4.14.198",
"@types/auto-launch": "5.0.3",
"@types/lodash": "4.14.199",
"copy-webpack-plugin": "11.0.0",
"csp-html-webpack-plugin": "5.1.0",
"css-loader": "6.8.1",
"dotenv-webpack": "8.0.1",
"electron": "26.2.0",
"electron": "26.2.2",
"file-loader": "6.2.0",
"fork-ts-checker-webpack-plugin": "8.0.0",
"node-loader": "2.0.0",
Expand Down
2 changes: 1 addition & 1 deletion src/app/game_state.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ import {exec, execFile} from 'child_process';
import {BrowserWindow} from 'electron';
import electronIsDev from 'electron-is-dev';
import psList from 'ps-list';
import {getBots} from 'root/api/bots';

import {getBots} from 'root/api/bots';
import {getCards} from 'root/api/cards';
import {registerHotkeys, unRegisterHotkeys} from 'root/app/hotkeys';
import {WindowLocator} from 'root/app/locatewindow';
Expand Down
8 changes: 4 additions & 4 deletions src/windows/home/functions/messages.ts
Original file line number Diff line number Diff line change
Expand Up @@ -173,8 +173,8 @@ export function installHomeMessages(): void {

onMessageFromIpcMain('sync-process', (res) => {
if (res.mode === 'needauth') {
sendMessageToIpcMain('open-link', `https://marvelsnap.pro//sync/?request=${res.request}`);
HomePageElements.directSyncLink.innerHTML = `<div class="directSyncLink">https://marvelsnap.pro//sync/?request=${res.request}</div>`;
sendMessageToIpcMain('open-link', `https://marvelsnap.pro/sync/?request=${res.request}`);
HomePageElements.directSyncLink.innerHTML = `<div class="directSyncLink">https://marvelsnap.pro/sync/?request=${res.request}</div>`;
tokenWaiter(res.request);
currentCreds.numberOfSyncAttempts = 0;
} else if (res.mode === 'hasauth') {
Expand All @@ -183,7 +183,7 @@ export function installHomeMessages(): void {
});

onMessageFromIpcMain('token-waiter-responce', (response) => {
console.log('token-waiter-responce', response);
//console.log('token-waiter-responce', response);
if (response.res && response.res.token && response.res.token !== '') {
login(response.res.token, response.res.uid, response.res.nick);
} else {
Expand All @@ -192,7 +192,7 @@ export function installHomeMessages(): void {
currentCreds.numberOfSyncAttempts++;
setTimeout(() => {
tokenWaiter(response.request);
}, 1000);
}, 5000);
}
}
});
Expand Down
11 changes: 5 additions & 6 deletions src/windows/home/home.ts
Original file line number Diff line number Diff line change
@@ -1,22 +1,21 @@
// tslint:disable: no-any no-unsafe-any no-import-side-effect
import 'pretty-checkbox/dist/pretty-checkbox.min.css';

import {NetworkStatusMessage} from 'root/lib/messages';
import 'root/windows/css.css';
import 'root/windows/fa-brands-400.woff2';
import 'root/windows/fa-regular-400.woff2';
import 'root/windows/fa-solid-900.woff2';
import 'root/windows/rP2Hp2ywxg089UriCZ2IHSeH.woff2';
import 'root/windows/rP2Hp2ywxg089UriCZOIHQ.woff2';
import 'root/windows/fontawesome.css';
import 'root/windows/home/home.css';
import 'root/windows/home/icons.css';
import {NetworkStatusMessage} from 'root/lib/messages';
import {controlClick} from 'root/windows/home/functions/controlclick';
import {installHomeMessages} from 'root/windows/home/functions/messages';
import {setHkClick} from 'root/windows/home/functions/setHkClick';
import {settingsChecker} from 'root/windows/home/functions/settingsChecker';
import {tabclick} from 'root/windows/home/functions/tabclick';
import 'root/windows/home/home.css';
import 'root/windows/home/icons.css';
import {onMessageFromIpcMain, sendMessageToIpcMain} from 'root/windows/messages';
import 'root/windows/rP2Hp2ywxg089UriCZ2IHSeH.woff2';
import 'root/windows/rP2Hp2ywxg089UriCZOIHQ.woff2';

export const HomePageElements = {
header: document.getElementById('header') as HTMLElement,
Expand Down
2 changes: 1 addition & 1 deletion src/windows/overlay/functions/checkbot.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import {currentMatch, overlayConfig} from 'root/windows/overlay/overlay';

export function CheckBottiness(): string {
let nick = currentMatch.opponentNick;
const nick = currentMatch.opponentNick;
let botLikness = 0;
let LSTM = false;

Expand Down
6 changes: 3 additions & 3 deletions src/windows/overlay/functions/drawdeck.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import {HoverEventListener} from 'root/windows/overlay/functions/hovereventlistener';
import {makeCard} from 'root/windows/overlay/functions/makecard';
import {sortDeck} from 'root/windows/overlay/functions/sortdeck';
import {currentMatch, overlayConfig, overlayElements} from 'root/windows/overlay/overlay';
Expand Down Expand Up @@ -30,10 +31,9 @@ export function drawDeck(): void {
overlayElements.MainOut.innerHTML = output;
if (!overlayConfig.ovlSettings?.hidemy) {
overlayElements.MainDeckFrame.classList.remove('hidden');
//toggleButtonClass(overlayElements.ToggleMe, overlayElements.MainDeckFrame.classList.contains('hidden'));
}
/*const AllCards = document.getElementsByClassName('DcDrow');
const AllCards = document.getElementsByClassName('DcDrow');
Array.from(AllCards).forEach((theCard) => {
HoverEventListener(theCard);
});*/
});
}
40 changes: 40 additions & 0 deletions src/windows/overlay/functions/hovereventlistener.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
import {overlayConfig, overlayElements} from 'root/windows/overlay/overlay';

export const HoverEventListener = (theCard: Element) => {
//console.log(theCard);
if (!overlayConfig.allCards) {
return;
}
const cardsdb = overlayConfig.allCards;
if (theCard.getAttribute('listener') !== 'true') {
theCard.addEventListener('mouseenter', (event: Event) => {
const cl: HTMLElement = event.target as HTMLElement;
const cid = cl.getAttribute('data-cid') as string;
const side = cl.getAttribute('data-side') as string;
const Card = cardsdb[cid.toLowerCase()];
//console.log(cid);

if (Card === undefined) {
return;
}
if (side === 'me') {
overlayElements.CardHint.innerHTML = `<strong>${Card.name}</strong>. ${Card.description}`;
} else {
overlayElements.CardHintOpp.innerHTML = `<strong>${Card.name}</strong>. ${Card.description}`;
}
});

theCard.addEventListener('mouseleave', (event: Event) => {
const cl: HTMLElement = event.target as HTMLElement;
const side = cl.getAttribute('data-side') as string;

if (side === 'opp') {
overlayElements.CardHint.innerHTML = `Hover over the card to see it's details`;
} else {
overlayElements.CardHintOpp.innerHTML = `Hover over the card to see it's details`;
}
});

theCard.setAttribute('listener', 'true');
}
};
2 changes: 1 addition & 1 deletion src/windows/overlay/functions/makecard.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ export function makeCardBack(cardBackDefId: string, side: boolean): string {
const cardHeight = cardWidth * 1.3;

return `
<div class="DcDrow CardMainWrapper" data-side="${
<div class="CardMainWrapper" data-side="${
side ? 'me' : 'opp'
}" style="width: ${cardWidth}px; height:${cardHeight}px;">
<div class="CardPicRenderer" style="width: ${cardWidth}px; height:${cardHeight}px; background-image: url('https://static.marvelsnap.pro/cardbacks/${cardBackDefId}.webp?anticache=${formattedToday}')"></div>
Expand Down
5 changes: 3 additions & 2 deletions src/windows/overlay/functions/updateoppdeck.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import {SnapCard} from 'root/models/snap_deck';
import {CheckBottiness} from 'root/windows/overlay/functions/checkbot';
import {HoverEventListener} from 'root/windows/overlay/functions/hovereventlistener';
import {makeCard, makeCardBack} from 'root/windows/overlay/functions/makecard';
import {sortDeck} from 'root/windows/overlay/functions/sortdeck';
import {currentMatch, overlayConfig, overlayElements} from 'root/windows/overlay/overlay';
Expand Down Expand Up @@ -110,8 +111,8 @@ export function updateOppDeck(highlight: string[]): void {
});
}, overlayConfig.highlightTimeout);

/* const AllCards = document.getElementsByClassName('DcDrow');
const AllCards = document.getElementsByClassName('DcDrow');
Array.from(AllCards).forEach((theCard) => {
HoverEventListener(theCard);
});*/
});
}
Loading

0 comments on commit 5970703

Please sign in to comment.