Browse Source

Remove tino dots

master
Josh Gordon 4 years ago
parent
commit
18ec6cf2e6
  1. 3
      app/.gitignore
  2. 62
      app/dungeon.py
  3. 8
      app/routes.py
  4. 4
      app/templates/about.html
  5. 8
      app/templates/index.html

3
app/.gitignore

@ -1,3 +1,4 @@
__pycache__
generated_dungeon.png
colored_dungeon.png
*.pyc

62
app/dungeon.py

@ -315,33 +315,35 @@ def genGridDungeonB64(gSizeX,gSizeY,mScale,imScale,numCells=None):
#s = genGridDungeonB64(10,10,8,24)
#print(s)
"""
#driver code
g = Grid(GRID_SIZE,GRID_SIZE)
print(g)
g.addCell()
g.addCell()
print(g)
im = g.exportImage()
#print(im)
cv2.imshow("grid export",im)
im = drawWalls(im,g)
cv2.imshow("draw walls",im)
im = carveDoors(im,g)
im = scaleMap(im)
#drawFlow(im,g)
im,mask = canonicalize(im)
drawn = drawGrid(im,mask)
#cv2.imshow("Here",drawn)
#cv2.waitKey(0)
cv2.imwrite("generated_dungeon.png",drawn)
d = Dungeon(im)
print(d)
res = d.exportImage()
cv2.imshow("res",res)
cv2.waitKey(0)
"""
if len(sys.argv) > 1:
g = Grid(GRID_SIZE,GRID_SIZE)
g.addCell()
g.addCell()
g.addCell()
g.addCell()
print(g)
im = g.exportImage()
#print(im)
cv2.imshow("grid export",im)
im = drawWalls(im,g)
cv2.imshow("draw walls",im)
im = carveDoors(im,g)
im = scaleMap(im)
if "color" in sys.argv:
cv2.imwrite("colored_dungeon.png",im)
#drawFlow(im,g)
im,mask = canonicalize(im)
drawn = drawGrid(im,mask)
#cv2.imshow("Here",drawn)
#cv2.waitKey(0)
if "gen" in sys.argv:
cv2.imwrite("generated_dungeon.png",drawn)
d = Dungeon(im)
print(d)
res = d.exportImage()
cv2.imshow("res",res)
cv2.waitKey(0)

8
app/routes.py

@ -29,8 +29,8 @@ def style():
def index():
featureType = choice(["Item","Place","Spell"])
item = choice(get_items("../"+featureType+"s/*"))
return render_template('index.html',featureType=featureType,featureText=item)
links = [("marches","West Marches"),("dungeon","Dungeon Generator"),("about","About")]
return render_template('index.html',featureType=featureType,featureText=item,links=links)
@app.route('/search', methods=['POST'])
@ -181,5 +181,9 @@ def genDungeon():
# enc = enc[2:-1]
return render_template('image.html',data=enc)
@app.route("/about")
def about():
return render_template('about.html')
if __name__ == "__main__":
app.run()

4
app/templates/about.html

@ -0,0 +1,4 @@
{% extends "base.html" %}
{% block content %}
About
{% endblock %}

8
app/templates/index.html

@ -23,9 +23,11 @@
</ul>
</nav>
<a href="/marches">.</a>
<a href="/dungeon">.</a>
<ul class="headlist">
{% for (src,name) in links %}
<li><a href="/{{src}}"> {{name}} </a> {% if not loop.last %} &middot; {% endif %} </li>
{% endfor %}
</ul>
{% if searchResults is defined %}
{{ macros.itemTable(searchResults) }}

Loading…
Cancel
Save