Skip to content

Commit

Permalink
Merge pull request #26 from ProdigyMathGame/master
Browse files Browse the repository at this point in the history
Redesign Cheat GUI: Part 1
  • Loading branch information
afkvido authored May 13, 2022
2 parents 94b64bb + 7e9893b commit 239c277
Show file tree
Hide file tree
Showing 4 changed files with 85 additions and 15 deletions.
2 changes: 1 addition & 1 deletion cheatGUI/dist/bundle.js

Large diffs are not rendered by default.

32 changes: 27 additions & 5 deletions cheatGUI/src/hacks/player.ts
Original file line number Diff line number Diff line change
Expand Up @@ -585,11 +585,33 @@ new Hack(category.player, "Set Dark Tower Floor").setClick(async () => {

// Begin Get UserID
new Hack(category.player, "Get UserID").setClick(async () => {
Swal.fire({
title: "User ID",
html: `Here is your User ID: <br> <code> ${_.player.userID} </code> <br> You can use this for copying your account.`,
icon: "info"
});

const UserID : number = _.player.userID;
navigator.clipboard.writeText(UserID).then(function() {


console.log('Async: Copying to clipboard was successful!');

Swal.fire({
title: "User ID",
html: `Here is your User ID: <br> <code> ${UserID} </code> <br> You can use this for copying your account. <br> <br> Your UserID is has also been copied to your clipboard.`,
icon: "info"
});


}, function (err) {

console.error('Async: Could not copy text: ', err);

Swal.fire({
title: "User ID",
html: `Here is your User ID: <br> <code> ${UserID} </code> <br> You can use this for copying your account.`,
icon: "info"
});


});

});
// End Get UserID

Expand Down
46 changes: 41 additions & 5 deletions cheatGUI/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,10 @@ export const wrapper = document.getElementById("game-wrapper"); // Create game w
document.getElementById("cheat-menu")?.remove(); // Remove any existing menu if present
document.getElementById("menu-toggler")?.remove(); // Remove any existing menu togglers if present
menu.id = "cheat-menu"; // Set menu ID to cheat-menu


menu.style = "position: fixed;top: -10%;left: 10%;right: 10%;width: 80%;height: 80%;z-index: 2;background-color: rgba(0, 0, 0, 0.5);backdrop-filter: blur(5px);"; // Set menu style

wrapper?.prepend(menu);

export const toggler = document.createElement("button"); // Create toggler class
Expand All @@ -29,7 +33,7 @@ toggler.onclick = () => {
menu.style.top = "-100vh";
} else {
toggler.innerText = "▲";
menu.style.top = "";
menu.style.top = "10%";
}
};
toggler.onclick({} as any);
Expand All @@ -38,30 +42,58 @@ const menuleft = document.createElement("DIV");
menuleft.classList.add("menu-left");
menu.append(menuleft);

let firstCategory = true;
export const addArea = (title: string) => {
const area = document.createElement("div");

if (firstCategory == false) {
area.append(document.createElement("br"));
area.append(document.createElement("br"));
} else {
firstCategory = false;
}


area.classList.add("menu-area");
area.style.textAlign = "center";
menuleft.append(area);

const header = document.createElement("h1");
header.innerText = title;
header.style.textAlign = "center";
header.style.color = "white";

area.append(header);
return area;
};

const title = document.createElement("h1");
title.classList.add("menu-title");
title.innerText = "Prodigy Hacks";
title.style.color = "white";
title.style.textAlign = "center";
menuleft.append(title);

const disc = document.createElement("h2");
disc.style.fontSize = "30px";
disc.innerHTML = "Join our Discord <a href='https://dsc.gg/ProdigyPNP'>https://dsc.gg/ProdigyPNP</a>! <br> Press SHIFT to show/hide the menu.";
disc.style.color = "white";
disc.innerHTML = "Press SHIFT to show/hide the menu.";
menuleft.append(disc);

const subtitle = document.createElement("h3");
subtitle.style.fontSize = "20px";
subtitle.innerHTML = `On behalf of <a href="https://github.com/ProdigyPNP/ProdigyMathGameHacking/blob/master/README.md">ProdigyPNP</a>.
subtitle.innerHTML = `
<p>Join our Discord <a href='https://dsc.gg/ProdigyPNP'>https://dsc.gg/ProdigyPNP</a>!</p>
<p>
<a href="https://github.com/ProdigyPNP/ProdigyMathGameHacking/blob/master/README.md">This is free and open-source software</a>.
If you paid for this or accessed this behind a paywall/AdFly link, demand a refund. If you sell this software, or otherwise make a commercial advantage from it, you are violating
<a href = "https://github.com/ProdigyPNP/ProdigyMathGameHacking/blob/master/LICENSE.txt">our license</a>.
</p>
<hr>
This is free and open-source software. If you paid for this or accessed this behind a paywall/AdFly link, demand a refund. If you sell this software, or otherwise make a commercial advantage from it, you are violating Github conduct by not cooperating with our license.`;
`;
subtitle.style.color = "white";
menuleft.append(subtitle);

export class Hack {
Expand Down Expand Up @@ -183,16 +215,20 @@ if (localStorage.getItem("level")) {
_.player.getLevel = () => localStorage.getItem("level");
}


let shownMenu = visible.value;
document.addEventListener("keydown", function (event) {
if (event.key == "Shift") {
if (document.getElementById("cheat-menu").style.display == "block" && document.getElementById("menu-toggler").style.display == "block") {
if (shownMenu == true) {
// Cheats are shown, so let's hide them.
document.getElementById("cheat-menu").style.display = "none";
document.getElementById("menu-toggler").style.display = "none";
shownMenu = false;
} else {
// Cheats are hidden, so let's show them.
document.getElementById("cheat-menu").style.display = "block";
document.getElementById("menu-toggler").style.display = "block";
shownMenu = true;
}
}
});
Expand Down
20 changes: 16 additions & 4 deletions cheatGUI/src/style.scss
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,13 @@
padding: 10px;
border: #fffa 2px solid;
overflow-y: scroll;
resize: vertical;
resize: none;
overflow: auto;
}
.menu-left {
width: 70%;
width: 100%;
height: 100%;
float: left;
float: center;
}
#menu-toggler {
z-index: 1;
Expand Down Expand Up @@ -84,7 +84,7 @@
}
}
.menu-title {
font-family: "Arvo", sans-serif;
font-family: "Verdana", sans-serif;
font-size: 35px;
font-weight: 900;
}
Expand Down Expand Up @@ -126,3 +126,15 @@
min-width: 32em !important;
max-width: 46em !important;
}

.centeredMenu {
position: fixed;
top: -10%;
left: 10%;
right: 10%;
width: 80%;
height: 80%;
z-index: 2;
background-color: rgba(0, 0, 0, 0.5);
backdrop-filter: blur(5px);
}

0 comments on commit 239c277

Please sign in to comment.