auto-sync: 2026-05-13 19:10:01
This commit is contained in:
29
tasks/enduro-trails/scripts/patch_rebuild.py
Normal file
29
tasks/enduro-trails/scripts/patch_rebuild.py
Normal file
@@ -0,0 +1,29 @@
|
||||
import sys
|
||||
|
||||
path = "/home/slin/enduro-trails/prototype/static/app.js"
|
||||
with open(path, 'r') as f:
|
||||
content = f.read()
|
||||
|
||||
# Add restoreTerrainState and restoreTrailsState to rebuildMapOverlays
|
||||
old = """function rebuildMapOverlays() {
|
||||
// Re-apply recon circle if active
|
||||
if (reconMode && reconCenter) {"""
|
||||
|
||||
new = """function rebuildMapOverlays() {
|
||||
// Re-apply terrain and trails after style change
|
||||
restoreTerrainState();
|
||||
restoreTrailsState();
|
||||
|
||||
// Re-apply recon circle if active
|
||||
if (reconMode && reconCenter) {"""
|
||||
|
||||
if old not in content:
|
||||
print("ERROR: marker not found")
|
||||
sys.exit(1)
|
||||
|
||||
content = content.replace(old, new)
|
||||
|
||||
with open(path, 'w') as f:
|
||||
f.write(content)
|
||||
|
||||
print("OK - rebuildMapOverlays patched")
|
||||
Reference in New Issue
Block a user