hardened ui against the db not being upgraded or importer not being ran
This commit is contained in:
parent
954bd565d3
commit
eb18ad22b8
@ -353,7 +353,9 @@ class ChuniFrontend(FE_Base):
|
|||||||
async def get_available_map_icons(self, version: int, profile: Row) -> (List[dict], int):
|
async def get_available_map_icons(self, version: int, profile: Row) -> (List[dict], int):
|
||||||
items = dict()
|
items = dict()
|
||||||
rows = await self.data.static.get_map_icons(version)
|
rows = await self.data.static.get_map_icons(version)
|
||||||
if rows:
|
if rows is None:
|
||||||
|
return (items, 0) # can only happen with old db
|
||||||
|
|
||||||
force_unlocked = self.game_cfg.mods.forced_item_unlocks("map_icons")
|
force_unlocked = self.game_cfg.mods.forced_item_unlocks("map_icons")
|
||||||
|
|
||||||
user_map_icons = []
|
user_map_icons = []
|
||||||
@ -374,7 +376,9 @@ class ChuniFrontend(FE_Base):
|
|||||||
async def get_available_system_voices(self, version: int, profile: Row) -> (List[dict], int):
|
async def get_available_system_voices(self, version: int, profile: Row) -> (List[dict], int):
|
||||||
items = dict()
|
items = dict()
|
||||||
rows = await self.data.static.get_system_voices(version)
|
rows = await self.data.static.get_system_voices(version)
|
||||||
if rows:
|
if rows is None:
|
||||||
|
return (items, 0) # can only happen with old db
|
||||||
|
|
||||||
force_unlocked = self.game_cfg.mods.forced_item_unlocks("system_voices")
|
force_unlocked = self.game_cfg.mods.forced_item_unlocks("system_voices")
|
||||||
|
|
||||||
user_system_voices = []
|
user_system_voices = []
|
||||||
@ -395,7 +399,9 @@ class ChuniFrontend(FE_Base):
|
|||||||
async def get_available_nameplates(self, version: int, profile: Row) -> (List[dict], int):
|
async def get_available_nameplates(self, version: int, profile: Row) -> (List[dict], int):
|
||||||
items = dict()
|
items = dict()
|
||||||
rows = await self.data.static.get_nameplates(version)
|
rows = await self.data.static.get_nameplates(version)
|
||||||
if rows:
|
if rows is None:
|
||||||
|
return (items, 0) # can only happen with old db
|
||||||
|
|
||||||
force_unlocked = self.game_cfg.mods.forced_item_unlocks("nameplates")
|
force_unlocked = self.game_cfg.mods.forced_item_unlocks("nameplates")
|
||||||
|
|
||||||
user_nameplates = []
|
user_nameplates = []
|
||||||
@ -416,7 +422,9 @@ class ChuniFrontend(FE_Base):
|
|||||||
async def get_available_trophies(self, version: int, profile: Row) -> (List[dict], int):
|
async def get_available_trophies(self, version: int, profile: Row) -> (List[dict], int):
|
||||||
items = dict()
|
items = dict()
|
||||||
rows = await self.data.static.get_trophies(version)
|
rows = await self.data.static.get_trophies(version)
|
||||||
if rows:
|
if rows is None:
|
||||||
|
return (items, 0) # can only happen with old db
|
||||||
|
|
||||||
force_unlocked = self.game_cfg.mods.forced_item_unlocks("trophies")
|
force_unlocked = self.game_cfg.mods.forced_item_unlocks("trophies")
|
||||||
|
|
||||||
user_trophies = []
|
user_trophies = []
|
||||||
@ -437,7 +445,9 @@ class ChuniFrontend(FE_Base):
|
|||||||
async def get_available_characters(self, version: int, profile: Row) -> (List[dict], int):
|
async def get_available_characters(self, version: int, profile: Row) -> (List[dict], int):
|
||||||
items = dict()
|
items = dict()
|
||||||
rows = await self.data.static.get_characters(version)
|
rows = await self.data.static.get_characters(version)
|
||||||
if rows:
|
if rows is None:
|
||||||
|
return (items, 0) # can only happen with old db
|
||||||
|
|
||||||
force_unlocked = self.game_cfg.mods.forced_item_unlocks("character_icons")
|
force_unlocked = self.game_cfg.mods.forced_item_unlocks("character_icons")
|
||||||
|
|
||||||
user_characters = []
|
user_characters = []
|
||||||
@ -458,7 +468,9 @@ class ChuniFrontend(FE_Base):
|
|||||||
async def get_available_avatar_items(self, version: int, category: AvatarCategory, user_unlocked_items: List[int]) -> (List[dict], int):
|
async def get_available_avatar_items(self, version: int, category: AvatarCategory, user_unlocked_items: List[int]) -> (List[dict], int):
|
||||||
items = dict()
|
items = dict()
|
||||||
rows = await self.data.static.get_avatar_items(version, category.value)
|
rows = await self.data.static.get_avatar_items(version, category.value)
|
||||||
if rows:
|
if rows is None:
|
||||||
|
return (items, 0) # can only happen with old db
|
||||||
|
|
||||||
force_unlocked = self.game_cfg.mods.forced_item_unlocks("avatar_accessories")
|
force_unlocked = self.game_cfg.mods.forced_item_unlocks("avatar_accessories")
|
||||||
|
|
||||||
for row in rows:
|
for row in rows:
|
||||||
|
@ -124,6 +124,12 @@
|
|||||||
{% endif %}
|
{% endif %}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
{% if wears|length == 0 or faces|length == 0 or heads|length == 0 or skins|length == 0 or items|length == 0 or fronts|length == 0 or backs|length == 0 %}
|
||||||
|
<script>
|
||||||
|
// Server DB lacks necessary info. Maybe importer never got ran for this verison?
|
||||||
|
document.getElementById("name_wear").innerHTML = "Server DB needs upgraded or is not populated with necessary data";
|
||||||
|
</script>
|
||||||
|
{% else %}
|
||||||
<script>
|
<script>
|
||||||
{% include 'titles/chuni/templates/scripts/collapsibles.js' %}
|
{% include 'titles/chuni/templates/scripts/collapsibles.js' %}
|
||||||
|
|
||||||
@ -298,5 +304,6 @@ for (const type of types) {
|
|||||||
// Expand the first collapsible so the user can get the gist of it.
|
// Expand the first collapsible so the user can get the gist of it.
|
||||||
Collapsibles.expandFirst();
|
Collapsibles.expandFirst();
|
||||||
</script>
|
</script>
|
||||||
|
{% endif %}
|
||||||
|
|
||||||
{% endblock content %}
|
{% endblock content %}
|
@ -72,11 +72,11 @@
|
|||||||
{% if cur_version >= 6 %} <!-- MAP ICON and SYSTEM VOICE introduced in AMAZON -->
|
{% if cur_version >= 6 %} <!-- MAP ICON and SYSTEM VOICE introduced in AMAZON -->
|
||||||
<tr>
|
<tr>
|
||||||
<td>Map Icon:</td>
|
<td>Map Icon:</td>
|
||||||
<td><div id="map-icon-name">{{ map_icons[profile.mapIconId]["name"] }}</div></td>
|
<td><div id="map-icon-name">{{ map_icons[profile.mapIconId]["name"] if map_icons|length > 0 else "Server DB needs upgraded or is not populated with necessary data" }}</div></td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td>System Voice:</td>
|
<td>System Voice:</td>
|
||||||
<td><div id="system-voice-name">{{ system_voices[profile.voiceId]["name"] }}</div></td>
|
<td><div id="system-voice-name">{{ system_voices[profile.voiceId]["name"] if system_voices|length > 0 else "Server DB needs upgraded or is not populated with necessary data" }}</div></td>
|
||||||
</tr>
|
</tr>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
</table>
|
</table>
|
||||||
|
@ -91,6 +91,12 @@
|
|||||||
{% endif %}
|
{% endif %}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
{% if nameplates|length == 0 or characters|length == 0 %}
|
||||||
|
<script>
|
||||||
|
// Server DB lacks necessary info. Maybe importer never got ran for this verison?
|
||||||
|
document.getElementById("name_nameplate").innerHTML = "Server DB needs upgraded or is not populated with necessary data";
|
||||||
|
</script>
|
||||||
|
{% else %}
|
||||||
<script>
|
<script>
|
||||||
{% include 'titles/chuni/templates/scripts/collapsibles.js' %}
|
{% include 'titles/chuni/templates/scripts/collapsibles.js' %}
|
||||||
|
|
||||||
@ -252,5 +258,5 @@ for (const type of types) {
|
|||||||
|
|
||||||
Collapsibles.expandAll();
|
Collapsibles.expandAll();
|
||||||
</script>
|
</script>
|
||||||
|
{% endif %}
|
||||||
{% endblock content %}
|
{% endblock content %}
|
Loading…
x
Reference in New Issue
Block a user