-
Notifications
You must be signed in to change notification settings - Fork 0
/
generateHTML.py
32 lines (30 loc) · 1.23 KB
/
generateHTML.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
import numpy as np
import cv2
import matplotlib.pyplot as plt
import os
baseFolder = "assets/tiles/loiElficKingdom/"
setName = "loiElficKingdom"
pieceType = "tile"
single = "yes"
snap = "no"
flippable = "no"
onMapZIndex = "2"
input_path = 'C:/xampp/htdocs/wordpress/dungeon-saga-quest-builder/assets/tiles/loiElficKingdom'
output_path = 'C:/xampp/htdocs/wordpress/dungeon-saga-quest-builder/assets/tiles/output.txt'
file = open(output_path,"w+")
file.write("<div class=\"sidenav\" id=\"" + setName + "\" style=\"visibility: hidden;\">\n")
for filename in os.listdir(input_path):
image = filename.split('.')[0]
idName = ""
if(single == "yes"):
idName = image
else:
idName = image + "_1"
file.write(
"<image src=\"" + baseFolder + filename + "\" set=\"" + setName +
"\" image=\"" + image + "\" flippable=\"" + flippable +
"\" orientation=\"0\" onMapZIndex=\"" + onMapZIndex +
"\" single=\"" + single + "\"pieceType=\"" + pieceType +
"\" snap=\"" + snap + "\" oncontextmenu=\"return false;\" id=\"" + idName +
"\"style=\"position: absolute; cursor: move; width: 100%;\" onMap=\"no\"></image>\n")
file.write("</div>\n")