Skip to content

Commit

Permalink
Another attempt at fixing the preview
Browse files Browse the repository at this point in the history
  • Loading branch information
TerraMonster5 committed Jun 2, 2024
1 parent a758e9e commit c9e442f
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 41 deletions.
2 changes: 1 addition & 1 deletion src/pvz-preview/about.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ def __init__(self, cnf: dict={}, **kwargs) -> None:
self.title("About")
self.resizable(False, False)

ttk.Label(self, text="Version: 0.1.16").pack()
ttk.Label(self, text="Version: 0.1.19").pack()
ttk.Button(self, text="License", command=lambda: License.show(master=self)).pack()

class License(tk.Toplevel, abstracts.Singleton):
Expand Down
11 changes: 5 additions & 6 deletions src/pvz-preview/states/levelMenu.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
from ..states import State

import math
import copy
import pandas as pd

from tkinter import ttk
Expand Down Expand Up @@ -39,18 +38,18 @@ def __runSim(self) -> None:
dtype=float)

for i in range(iterations):
pvz.set_internal_spawn(copy.deepcopy(IDs))
pvz.set_internal_spawn([z for z in IDs])
pvz.Sleep(2)

zombies = list(pvz.ReadMemory("int", 0x6a9ec0, 0x768, 0x6b4, array=waves*50))

for k in range(waves):
ignoreRest = False
for j in range(50):
if (zombies[k * 50 + j] == -1):
if zombies[k * 50 + j] == -1:
ignoreRest = True
continue
if (ignoreRest):
if ignoreRest:
zombies[k * 50 + j] = -1

for k, val in enumerate(IDs):
Expand All @@ -60,11 +59,11 @@ def __runSim(self) -> None:
zombiesCountMax = pvz.ReadMemory("unsigned int", 0x6A9EC0, 0x768, 0x94)
zombiesOffset = pvz.ReadMemory("unsigned int", 0x6A9EC0, 0x768, 0x90)

for k in range(zombiesCountMax): # type: ignore
for _ in range(zombiesCountMax): # type: ignore
zombieDead = pvz.ReadMemory("bool", zombiesOffset + 0xec + j * 0x15c) # type: ignore
if not zombieDead:
zombieType = pvz.ReadMemory("int", zombiesOffset + 0x24 + j * 0x15c) # type: ignore
preview.append(int(zombieType)) # type: ignore
preview.append(zombieType) # type: ignore

for k, val in enumerate(IDs):
df.loc[i, previewNames[k]] = preview.count(val)
Expand Down
34 changes: 0 additions & 34 deletions src/test.py

This file was deleted.

0 comments on commit c9e442f

Please sign in to comment.