diff --git a/bin/mkmobilelist.py b/bin/mkmobilelist.py new file mode 100755 index 0000000..12d8e53 --- /dev/null +++ b/bin/mkmobilelist.py @@ -0,0 +1,28 @@ +#!/usr/bin/env python + +import sys +import json + +import _pathfix + +from mhapi.util import get_utf8_writer + + +def mk_html_list(dict_list, keys, sort_key): + print """ +
+ +
+""" + print '' + + +if __name__ == '__main__': + with open(sys.argv[1]) as f: + data = json.load(f) + + sys.stdout = get_utf8_writer(sys.stdout) + mk_html_list(data, ("name", "name_jp"), "name") diff --git a/mhapi/db.py b/mhapi/db.py index b555a21..12233fb 100644 --- a/mhapi/db.py +++ b/mhapi/db.py @@ -45,15 +45,16 @@ class MHDB(object): # sell has the a value, but not used at the moment _decoration_select = """ - SELECT items._id, items.type, items.name, items.rarity, decorations.* + SELECT items._id, items.type, items.name, items.name_jp, + items.rarity, decorations.* FROM decorations LEFT JOIN items ON decorations._id = items._id """ # buy has the armor cost, sell is empty _armor_select = """ - SELECT items._id, items.type, items.name, items.rarity, items.buy, - armor.* + SELECT items._id, items.type, items.name, items.name_jp, + items.rarity, items.buy, armor.* FROM armor LEFT JOIN items ON armor._id = items._id """ @@ -401,7 +402,7 @@ class MHDB(object): def get_skill_trees(self): return self._query_all("skill_trees", """ - SELECT _id, name FROM skill_trees + SELECT _id, name, name_jp FROM skill_trees """, model_cls=model.SkillTree) def get_skill_tree_id(self, skill_tree_name): @@ -416,7 +417,7 @@ class MHDB(object): def get_skills(self): return self._query_all("skills", """ SELECT _id, skill_tree_id, required_skill_tree_points, - name, description + name, name_jp, description FROM skills """, model_cls=model.Skill) diff --git a/mhapi/model.py b/mhapi/model.py index 4038c22..f41d995 100644 --- a/mhapi/model.py +++ b/mhapi/model.py @@ -197,6 +197,8 @@ class WeaponSharpness(ModelBase): class ItemCraftable(RowModel): + _list_fields = ["id", "name", "name_jp"] + def __init__(self, item_row): super(ItemCraftable, self).__init__(item_row) self.create_components = None @@ -302,6 +304,8 @@ class ItemSkill(RowModel): class SkillTree(RowModel): + _list_fields = ["id", "name", "name_jp"] + def __init__(self, skill_tree_row): super(SkillTree, self).__init__(skill_tree_row) self.decoration_values = None @@ -323,13 +327,13 @@ class SkillTree(RowModel): class Skill(RowModel): - _list_fields = ["id", "name"] + _list_fields = ["id", "name", "name_jp"] _indexes = { "skill_tree_id": ["id", "required_skill_tree_points", "name", "description"] } class Weapon(ItemCraftable): - _list_fields = ["id", "wtype", "name"] + _list_fields = ["id", "wtype", "name", "name_jp"] _indexes = { "name": "id", "wtype": ["id", "name"], # subset of all data that can be used for searching and @@ -362,11 +366,11 @@ class Weapon(ItemCraftable): class Monster(RowModel): - _list_fields = ["id", "class", "name"] + _list_fields = ["id", "class", "name", "name_jp"] class Item(RowModel): - _list_fields = ["id", "type", "name"] + _list_fields = ["id", "type", "name", "name_jp"] _indexes = { "name": ["id"], "type": ["id", "name"] } diff --git a/web/skilltrees.jp.html b/web/skilltrees.jp.html new file mode 100644 index 0000000..4b06b05 --- /dev/null +++ b/web/skilltrees.jp.html @@ -0,0 +1,178 @@ + + + + + + + + + + + + + + + + + + + +
+
+ +

Skill Trees

+ + + +
+
+ + + + +