Skip to content

Commit

Permalink
added zombie fail popup for future update and a commit hash on the ma…
Browse files Browse the repository at this point in the history
…in menu

Co-authored-by: ClaytonTDM <[email protected]>
  • Loading branch information
ROBlNET13 and ClaytonTDM committed Dec 14, 2024
1 parent 2ef8f97 commit 493ee08
Show file tree
Hide file tree
Showing 6 changed files with 148 additions and 1 deletion.
23 changes: 23 additions & 0 deletions .github/workflows/versionfile.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
name: Create Version File

on: [push]

jobs:
create-version-file:
runs-on: ubuntu-latest

steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Create v.txt with commit hash
run: |
echo "${{ github.sha }}" > v.txt
- name: Commit and push v.txt
run: |
git config user.name github-actions
git config user.email [email protected]
git add v.txt
git commit -m "Add v.txt with commit hash" || exit 0
git push
57 changes: 57 additions & 0 deletions game/Custom.css
Original file line number Diff line number Diff line change
Expand Up @@ -395,4 +395,61 @@ td {
100% {
transform: translateY(-100px);
}
}

#dZombieFail .list div {
position: relative;
width: 100%;
}

#dZombieFail .button {
position: absolute;
cursor: pointer;
top: 410px;
font-family: 宋体;
color: #f93;
font-size: 24px;
font-weight: 700;
}

#dZombieFail .button {
left: 150px;
top: 404px;
}

#dZombieFailAD {
left: 0;
height: 100%;
}

#dZombieFail {
position: absolute;
left: 233px;
top: 20px;
width: 434px;
display: none;
font-weight: bold;
}

#dZombieFail .list {
position: absolute;
left: 0;
top: 90px;
z-index: 200;
width: 100%;
text-align: center;
}

#dZombieFail .list .hidden {
cursor: pointer;
height: 20px;
color: #f93;
font-size: 16px;
line-height: 20px;
}

#dZombieFail .list .pause {
color: #000;
font-size: 18px;
line-height: 30px;
}
30 changes: 30 additions & 0 deletions game/iframe.html
Original file line number Diff line number Diff line change
Expand Up @@ -262,6 +262,36 @@
Back To Game
</div>
</div>
<div id="dZombieFail">
<table
border="0"
width="434"
cellspacing="0"
cellpadding="0"
height="484"
>
<tr>
<td width="107" height="142" valign="bottom">
<img
border="0"
src="images/interface/dialog_topleft.png"
width="423"
height="401"
/>
</td>
</tr>
</table>
<div class="list">
<div
class="hidden"
onclick="SetNone($('dSurface'),$('dZombieFail'))"
></div>
<div id="dZombieFailAD"></div>
</div>
<div class="button" onclick="ResetGame($('dMenu0'))">
Back To Game
</div>
</div>
<div id="dSurfaceBack">
<div id="dHelp" onclick="HiddenHelp()"></div>
<div id="dOptionsMenuback">
Expand Down
12 changes: 11 additions & 1 deletion game/js/Cfunction.js
Original file line number Diff line number Diff line change
Expand Up @@ -2756,6 +2756,16 @@ var $User = (function () {
);
oSym.Stop();
}),
(GameOverZombies = function (c, a) {
var b = oSym;
StopMusic();
PlayAudio("losemusic");
b.Stop();
//innerText(c, "Speed");
SetBlock($("dSurface"), $("dZombieFail"));
oSym.Stop();
}),

(PrepareGrowPlants = function (a) {
var b = function () {
PlayAudio("readysetplant");
Expand Down Expand Up @@ -2908,7 +2918,7 @@ var $User = (function () {
document.cookie = a + "=0;";
}),
(WordUTF8 =
'<div id="dLogo" style="position:absolute;width:900px;height:600px;z-index:1"><div id="LogoWord" style="position:absolute;color:#FF0;top:300px;width:100%;height:100px"><span style="position:absolute;width:305px;height:150px;left:285px;top:5px;cursor:pointer" onclick="PlayAudio(\'gravebutton\');SetBlock($(\'dSurface\'),$(\'iSurfaceBackground\'));ShowNameDiv()"></span><div style="position:absolute;font-size:14px;left:660px;text-align:center;width:140px;top:185px;line-height:1.5;font-weight:bold"><span style="cursor:pointer"><span id="" style=""></span></span></div></div><div style="position:absolute;width:74px;height:41px;left:807px;top:502px;cursor:pointer;z-index:300" onclick="SetVisible($(\'dProcess\'))"></div><img src="" style="position:absolute;left:550px;top:-40px"></div>');
'<div id="dLogo" style="position:absolute;width:900px;height:600px;z-index:1"><span id="commit" style="position: absolute;color: #ffffff0f;bottom: 0;user-select: none;"></span><div id="LogoWord" style="position:absolute;color:#FF0;top:300px;width:100%;height:100px"><span style="position:absolute;width:305px;height:150px;left:285px;top:5px;cursor:pointer" onclick="PlayAudio(\'gravebutton\');SetBlock($(\'dSurface\'),$(\'iSurfaceBackground\'));ShowNameDiv()"></span><div style="position:absolute;font-size:14px;left:660px;text-align:center;width:140px;top:185px;line-height:1.5;font-weight:bold"><span style="cursor:pointer"><span id="" style=""></span></span></div></div><div style="position:absolute;width:74px;height:41px;left:807px;top:502px;cursor:pointer;z-index:300" onclick="SetVisible($(\'dProcess\'))"></div><img src="" style="position:absolute;left:550px;top:-40px"></div>');

(ShowNameDiv = function () {
oSym.Start();
Expand Down
26 changes: 26 additions & 0 deletions game/js/Custom.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,29 @@
function waitForElm(selector) {
return new Promise(resolve => {
if (document.querySelector(selector)) {
return resolve(document.querySelector(selector));
}

const observer = new MutationObserver(mutations => {
if (document.querySelector(selector)) {
observer.disconnect();
resolve(document.querySelector(selector));
}
});

// If you get "parameter 1 is not of type 'Node'" error, see https://stackoverflow.com/a/77855838/492336
observer.observe(document.body, {
childList: true,
subtree: true
});
});
}
// wait for #commit to exist
waitForElm('#commit').then(elm => {
// set the innertext to that of the contents of ../v.txt
fetch('../v.txt').then(response => response.text()).then(text => elm.innerText = text);
});

const saveWhitelist = [
1,
2,
Expand Down
1 change: 1 addition & 0 deletions v.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
2ef8f974d2f5737be7b75c8948a4771d0f37ee1e

0 comments on commit 493ee08

Please sign in to comment.