Browse Source

Quest manager updates, add continental worldmaps

master
Brandon Cornejo 4 years ago
parent
commit
5a90174869
  1. 9
      acks/quest/quest_manager.py
  2. 24
      acks/quest/templates/quest_detail.html
  3. 4
      acks/templates/worldmap.html

9
acks/quest/quest_manager.py

@ -4,7 +4,7 @@ from zipfile import ZipFile
FS_ROOT = '/srv/www/atr0phy.net/acks/quests' FS_ROOT = '/srv/www/atr0phy.net/acks/quests'
URL_ROOT = 'https://atr0phy.net/acks/quests' URL_ROOT = 'https://atr0phy.net/acks/quests'
IMG_EXTENSIONS = ('png', 'jpg', 'jpeg')
ASSET_EXTENSIONS = ('png', 'jpg', 'jpeg', 'dungeondraft_map', 'wonderdraft_map', 'wxx')
def load_quests(): def load_quests():
quest_list = {} quest_list = {}
@ -50,13 +50,18 @@ def get_quest_details(level, quest_name):
def urlify(path): def urlify(path):
return {'display': path.name, 'url': path.as_posix().replace(FS_ROOT, URL_ROOT)} return {'display': path.name, 'url': path.as_posix().replace(FS_ROOT, URL_ROOT)}
def read_coordinates(path):
return path.read_text()
for e in fs.iterdir(): for e in fs.iterdir():
if e.name.endswith(IMG_EXTENSIONS):
if e.name.endswith(ASSET_EXTENSIONS):
quest['assets'].append(urlify(e)) quest['assets'].append(urlify(e))
elif e.name == 'info.html': elif e.name == 'info.html':
quest['info'] = urlify(e) quest['info'] = urlify(e)
elif e.name == 'tsv.txt': elif e.name == 'tsv.txt':
quest['tsv'] = urlify(e) quest['tsv'] = urlify(e)
elif e.name == 'coordinates.txt':
quest['coords'] = read_coordinates(e)
print("Quest: {}".format(quest)) print("Quest: {}".format(quest))
return quest return quest

24
acks/quest/templates/quest_detail.html

@ -19,16 +19,13 @@
{% endif %} {% endif %}
<a href="{{ url_for('quest_manager.quest_download', level=quest['download'][0], quest_name=quest['download'][1]) }}" class="uk-button uk-button-default" target="_blank">Download</a> <a href="{{ url_for('quest_manager.quest_download', level=quest['download'][0], quest_name=quest['download'][1]) }}" class="uk-button uk-button-default" target="_blank">Download</a>
</div> </div>
{% if quest['coords'] %}
<div class="uk-text-center uk-margin-small">
<div><strong>Coordinates:</strong></div>
<div>{{ quest['coords'] }}</div>
</div>
{% endif %}
<ul uk-accordion="multiple: true"> <ul uk-accordion="multiple: true">
<li>
<a class="uk-accordion-title" href="#">Information</a>
<div class="uk-accordion-content">
<h3 class="uk-text-center">Quest Info</h3>
<div id="frame-container">
<iframe id="quest-frame" src="{{ quest['info']['url'] }}"></iframe>
</div>
</div>
</li>
<li class="uk-open"> <li class="uk-open">
<a class="uk-accordion-title" href="#">Assets</a> <a class="uk-accordion-title" href="#">Assets</a>
<div class="uk-accordion-content"> <div class="uk-accordion-content">
@ -51,6 +48,15 @@
</div> </div>
</div> </div>
</li> </li>
<li class="uk-open">
<a class="uk-accordion-title" href="#">Information</a>
<div class="uk-accordion-content">
<h3 class="uk-text-center">Quest Info</h3>
<div id="frame-container">
<iframe id="quest-frame" src="{{ quest['info']['url'] }}"></iframe>
</div>
</div>
</li>
</ul> </ul>
</div> </div>
{% endif %} {% endif %}

4
acks/templates/worldmap.html

@ -15,8 +15,8 @@
</ul> </ul>
<ul class="uk-switcher uk-margin" uk-lightbox> <ul class="uk-switcher uk-margin" uk-lightbox>
<li><a href="{{ url_for('static', filename='WorldMap.png') }}"><img src="{{ url_for('static', filename='WorldMap.png') }}"/></a></li> <li><a href="{{ url_for('static', filename='WorldMap.png') }}"><img src="{{ url_for('static', filename='WorldMap.png') }}"/></a></li>
<li><a href="{{ url_for('static', filename='PalismaWorld.png') }}"><img src="{{ url_for('static', filename='PalismaWorld.png') }}"/></a></li>
<li><a href="{{ url_for('static', filename='PalismaContinent.png') }}"><img src="{{ url_for('static', filename='PalismaContinent.png') }}"/></a></li>
<li><div>1 hex = 96 miles</div><a href="{{ url_for('static', filename='PalismaWorld.png') }}"><img src="{{ url_for('static', filename='PalismaWorld.png') }}"/></a></li>
<li><div>1 hex = 24 miles</div><a href="{{ url_for('static', filename='PalismaContinent.png') }}"><img src="{{ url_for('static', filename='PalismaContinent.png') }}"/></a></li>
</ul> </ul>
</div> </div>
{% endblock %} {% endblock %}

Loading…
Cancel
Save