├── .gitignore ├── LICENSE ├── PaperBlossoms ├── PaperBlossoms.pro ├── data │ ├── README.md │ ├── i18n │ │ ├── i18n_de.csv │ │ ├── i18n_en.csv │ │ ├── i18n_es.csv │ │ ├── i18n_fr.csv │ │ └── i18n_test.csv │ ├── json │ │ ├── advantages_disadvantages.json │ │ ├── armor.json │ │ ├── bonds.json │ │ ├── clans.json │ │ ├── item_patterns.json │ │ ├── personal_effects.json │ │ ├── qualities.json │ │ ├── question_8.json │ │ ├── regions.json │ │ ├── rings.json │ │ ├── samurai_heritage.json │ │ ├── schools.json │ │ ├── skill_groups.json │ │ ├── techniques.json │ │ ├── titles.json │ │ ├── upbringings.json │ │ └── weapons.json │ ├── json_schema │ │ ├── advantages_disadvantages.schema.json │ │ ├── armor.schema.json │ │ ├── bonds.schema.json │ │ ├── clans.schema.json │ │ ├── item_patterns.schema.json │ │ ├── personal_effects.schema.json │ │ ├── qualities.schema.json │ │ ├── regions.schema.json │ │ ├── rings.schema.json │ │ ├── samurai_heritage.schema.json │ │ ├── schools.schema.json │ │ ├── skill_groups.schema.json │ │ ├── techniques.schema.json │ │ ├── titles.schema.json │ │ ├── upbringings.schema.json │ │ └── weapons.schema.json │ ├── paperblossoms.db │ ├── scripts │ │ ├── add_default_snippets_to_schema.py │ │ ├── add_enums.py │ │ ├── export_import_user_db.py │ │ ├── json_to_db.py │ │ └── validate_json.py │ └── vscode_workspace_settings.json ├── lgpl-3.0.txt ├── paperblossoms_de.qm ├── paperblossoms_de.ts ├── paperblossoms_en.qm ├── paperblossoms_en.ts ├── paperblossoms_es.qm ├── paperblossoms_es.ts ├── paperblossoms_fr.qm ├── paperblossoms_fr.ts ├── paperblossoms_pl.ts ├── resources.qrc ├── resources │ ├── Bradley Hand Bold.ttf │ ├── colorRings.png │ ├── colorRingsMed.png │ ├── noun_sakura_1565590_grad4_crop.svg │ ├── pink-sakura-01-hi.ico │ ├── pink-sakura-01-hi.png │ ├── sakura.icns │ ├── sakura.ico │ ├── sakura.png │ └── sakura_PNG37.png ├── src │ ├── character.cpp │ ├── character.h │ ├── characterwizard │ │ ├── newcharacterwizard.cpp │ │ ├── newcharacterwizard.h │ │ ├── newcharwizardpage1.cpp │ │ ├── newcharwizardpage1.h │ │ ├── newcharwizardpage2.cpp │ │ ├── newcharwizardpage2.h │ │ ├── newcharwizardpage3.cpp │ │ ├── newcharwizardpage3.h │ │ ├── newcharwizardpage4.cpp │ │ ├── newcharwizardpage4.h │ │ ├── newcharwizardpage5.cpp │ │ ├── newcharwizardpage5.h │ │ ├── newcharwizardpage6.cpp │ │ ├── newcharwizardpage6.h │ │ ├── newcharwizardpage7.cpp │ │ └── newcharwizardpage7.h │ ├── clicklabel.cpp │ ├── clicklabel.h │ ├── dependency │ │ ├── databasedependency.cpp │ │ ├── databasedependency.h │ │ ├── dependencybuilder.cpp │ │ └── dependencybuilder.h │ ├── dialog │ │ ├── aboutdialog.cpp │ │ ├── aboutdialog.h │ │ ├── addadvancedialog.cpp │ │ ├── addadvancedialog.h │ │ ├── addbonddialog.cpp │ │ ├── addbonddialog.h │ │ ├── adddisadvdialog.cpp │ │ ├── adddisadvdialog.h │ │ ├── additemdialog.cpp │ │ ├── additemdialog.h │ │ ├── addtitledialog.cpp │ │ ├── addtitledialog.h │ │ ├── dblocalisationeditordialog.cpp │ │ ├── dblocalisationeditordialog.h │ │ ├── edituserdescriptionsdialog.cpp │ │ ├── edituserdescriptionsdialog.h │ │ ├── renderdialog.cpp │ │ └── renderdialog.h │ ├── dynamicchoicewidget.cpp │ ├── dynamicchoicewidget.h │ ├── enums.h │ ├── main.cpp │ ├── mainwindow.cpp │ ├── mainwindow.h │ ├── pboutputdata.cpp │ ├── pboutputdata.h │ ├── repository │ │ ├── abstractrepository.cpp │ │ ├── abstractrepository.h │ │ ├── advantagesrepository.cpp │ │ ├── advantagesrepository.h │ │ ├── bondsrepository.cpp │ │ ├── bondsrepository.h │ │ ├── clansrepository.cpp │ │ ├── clansrepository.h │ │ ├── dataaccesslayer.cpp │ │ ├── dataaccesslayer.h │ │ ├── familiesRepository.h │ │ ├── familiesrepository.cpp │ │ ├── hertiagesrepository.cpp │ │ ├── hertiagesrepository.h │ │ ├── inventoryrepository.cpp │ │ ├── inventoryrepository.h │ │ ├── regionsrepository.cpp │ │ ├── regionsrepository.h │ │ ├── ringsrepository.cpp │ │ ├── ringsrepository.h │ │ ├── schoolsrepository.cpp │ │ ├── schoolsrepository.h │ │ ├── skillsrepository.cpp │ │ ├── skillsrepository.h │ │ ├── techniquesrepository.cpp │ │ ├── techniquesrepository.h │ │ ├── titlesrepository.cpp │ │ ├── titlesrepository.h │ │ ├── upbringingsrepository.cpp │ │ └── upbringingsrepository.h │ ├── ringviewer.cpp │ ├── ringviewer.h │ ├── tabs │ │ ├── advancementpage.cpp │ │ ├── backgroundpage.cpp │ │ ├── bondspage.cpp │ │ ├── characterdatapage.cpp │ │ ├── equipmentpage.cpp │ │ └── personaltraitspage.cpp │ └── tools │ │ ├── common.cpp │ │ ├── developer.cpp │ │ ├── export.cpp │ │ ├── file.cpp │ │ └── import.cpp ├── templates │ └── PB_TEMPLATE.html └── ui │ ├── aboutdialog.ui │ ├── addadvancedialog.ui │ ├── addbonddialog.ui │ ├── adddisadvdialog.ui │ ├── additemdialog.ui │ ├── addtitledialog.ui │ ├── dblocalisationeditordialog.ui │ ├── dynamicchoicewidget.ui │ ├── edituserdescriptionsdialog.ui │ ├── mainwindow.ui │ ├── newcharwizardpage1.ui │ ├── newcharwizardpage2.ui │ ├── newcharwizardpage3.ui │ ├── newcharwizardpage4.ui │ ├── newcharwizardpage5.ui │ ├── newcharwizardpage6.ui │ ├── newcharwizardpage7.ui │ ├── renderdialog.ui │ └── ringviewer.ui ├── PaperBlossomsSolution.pro ├── README.md ├── TestPaperBlossoms ├── .gitignore ├── TestPaperBlossoms.pro ├── export_sample │ ├── user_advantages_disadvantages.csv │ ├── user_armor.csv │ ├── user_armor_qualities.csv │ ├── user_armor_resistance.csv │ ├── user_clans.csv │ ├── user_curriculum.csv │ ├── user_descriptions.csv │ ├── user_families.csv │ ├── user_family_rings.csv │ ├── user_family_skills.csv │ ├── user_personal_effect_qualities.csv │ ├── user_personal_effects.csv │ ├── user_qualities.csv │ ├── user_school_rings.csv │ ├── user_school_starting_outfit.csv │ ├── user_school_starting_skills.csv │ ├── user_school_starting_techniques.csv │ ├── user_school_techniques_available.csv │ ├── user_schools.csv │ ├── user_skills.csv │ ├── user_techniques.csv │ ├── user_title_advancements.csv │ ├── user_titles.csv │ ├── user_weapon_qualities.csv │ └── user_weapons.csv ├── testresources.qrc └── tst_testmain.cpp ├── _config.yml └── _layouts └── default.html /.gitignore: -------------------------------------------------------------------------------- 1 | *.user 2 | *.autosave 3 | *.ipynb 4 | Old_testdb.db 5 | **.vscode 6 | PaperBlossoms.pro.user.4.8-pre1 7 | *.DS_Store 8 | .vs -------------------------------------------------------------------------------- /PaperBlossoms/data/i18n/i18n_en.csv: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dashnine/PaperBlossoms/bfca0f065a946f1e3206716acd362763b4322856/PaperBlossoms/data/i18n/i18n_en.csv -------------------------------------------------------------------------------- /PaperBlossoms/data/json/bonds.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "name": "Family", 4 | "ability": "Strong roots grow deep", 5 | "reference": { 6 | "book": "CoS", 7 | "page": 136 8 | } 9 | }, 10 | { 11 | "name": "Comrade", 12 | "ability": "Just like old times", 13 | "reference": { 14 | "book": "CoS", 15 | "page": 137 16 | } 17 | }, 18 | { 19 | "name": "Lover", 20 | "ability": "With you, the storm subsides", 21 | "reference": { 22 | "book": "CoS", 23 | "page": 137 24 | } 25 | }, 26 | { 27 | "name": "Rival", 28 | "ability": "I will surpass you!", 29 | "reference": { 30 | "book": "CoS", 31 | "page": 138 32 | } 33 | }, 34 | { 35 | "name": "Nemesis", 36 | "ability": "They were responsible!", 37 | "reference": { 38 | "book": "CoS", 39 | "page": 138 40 | } 41 | }, 42 | { 43 | "name": "Old Flame", 44 | "ability": "It's always like this with you...", 45 | "reference": { 46 | "book": "PoW", 47 | "page": 188 48 | } 49 | }, 50 | { 51 | "name": "Partner", 52 | "ability": "Always got your back", 53 | "reference": { 54 | "book": "PoW", 55 | "page": 189 56 | } 57 | }, 58 | { 59 | "name": "Protector", 60 | "ability": "Under my protection", 61 | "reference": { 62 | "book": "PoW", 63 | "page": 189 64 | } 65 | }, 66 | { 67 | "name": "Ward", 68 | "ability": "I've been learning", 69 | "reference": { 70 | "book": "PoW", 71 | "page": 189 72 | } 73 | }, 74 | { 75 | "name": "Wanderers' Fellowship", 76 | "ability": "Sworn to duty and to death", 77 | "reference": { 78 | "book": "PoW", 79 | "page": 191 80 | } 81 | } 82 | ] -------------------------------------------------------------------------------- /PaperBlossoms/data/json/item_patterns.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "name": "Kakita Pattern", 4 | "reference": { 5 | "page": 109, 6 | "book": "SL" 7 | }, 8 | "xp_cost": 6, 9 | "rarity_modifier": 4 10 | }, 11 | { 12 | "name": "Kenzō Blade", 13 | "reference": { 14 | "book": "SL", 15 | "page": 109 16 | }, 17 | "xp_cost": 8, 18 | "rarity_modifier": 5 19 | }, 20 | { 21 | "name": "Shirogane Jade Inlay", 22 | "reference": { 23 | "book": "SL", 24 | "page": 109 25 | }, 26 | "xp_cost": 3, 27 | "rarity_modifier": 2 28 | }, 29 | { 30 | "name": "Uchema's Technique", 31 | "reference": { 32 | "book": "SL", 33 | "page": 109 34 | }, 35 | "xp_cost": 4, 36 | "rarity_modifier": 3 37 | }, 38 | { 39 | "name": "Yasunori Steel", 40 | "reference": { 41 | "book": "SL", 42 | "page": 109 43 | }, 44 | "xp_cost": 5, 45 | "rarity_modifier": 4 46 | }, 47 | { 48 | "name": "Spirit of the Qamarist Pattern", 49 | "reference": { 50 | "book": "PoW", 51 | "page": 117 52 | }, 53 | "xp_cost": 5, 54 | "rarity_modifier": 4 55 | }, 56 | { 57 | "name": "Ghostlands Yodhaniya Pattern", 58 | "reference": { 59 | "book": "PoW", 60 | "page": 117 61 | }, 62 | "xp_cost": 6, 63 | "rarity_modifier": 4 64 | }, 65 | { 66 | "name": "Kökejin's Heart of the Wind Pattern", 67 | "reference": { 68 | "book": "PoW", 69 | "page": 117 70 | }, 71 | "xp_cost": 8, 72 | "rarity_modifier": 5 73 | }, 74 | { 75 | "name": "Agasha Pattern", 76 | "reference": { 77 | "book": "CR", 78 | "page": 105 79 | }, 80 | "xp_cost": 6, 81 | "rarity_modifier": 4 82 | }, 83 | { 84 | "name": "Akodo Pattern", 85 | "reference": { 86 | "book": "FoV", 87 | "page": 93 88 | }, 89 | "xp_cost": 6, 90 | "rarity_modifier": 4 91 | }, 92 | { 93 | "name": "Burning Water Pattern", 94 | "reference": { 95 | "book": "FoV", 96 | "page": 93 97 | }, 98 | "xp_cost": 6, 99 | "rarity_modifier": 4 100 | }, 101 | { 102 | "name": "Concealment Pattern", 103 | "reference": { 104 | "book": "FoV", 105 | "page": 93 106 | }, 107 | "xp_cost": 6, 108 | "rarity_modifier": 4 109 | }, 110 | { 111 | "name": "Deadly Fangs Pattern", 112 | "reference": { 113 | "book": "FoV", 114 | "page": 94 115 | }, 116 | "xp_cost": 7, 117 | "rarity_modifier": 4 118 | }, 119 | { 120 | "name": "Fearsome Snarl Pattern", 121 | "reference": { 122 | "book": "FoV", 123 | "page": 94 124 | }, 125 | "xp_cost": 3, 126 | "rarity_modifier": 1 127 | }, 128 | { 129 | "name": "Ichir\u014d Pattern", 130 | "reference": { 131 | "book": "FoV", 132 | "page": 94 133 | }, 134 | "xp_cost": 4, 135 | "rarity_modifier": -1 136 | }, 137 | { 138 | "name": "Mountain Silk Pattern", 139 | "reference": { 140 | "book": "FoV", 141 | "page": 94 142 | }, 143 | "xp_cost": 6, 144 | "rarity_modifier": 3 145 | }, 146 | { 147 | "name": "Screaming Fire Pattern", 148 | "reference": { 149 | "book": "FoV", 150 | "page": 94 151 | }, 152 | "xp_cost": 6, 153 | "rarity_modifier": 4 154 | }, 155 | { 156 | "name": "Toriyama's Endurance Pattern", 157 | "reference": { 158 | "book": "FoV", 159 | "page": 94 160 | }, 161 | "xp_cost": 3, 162 | "rarity_modifier": 3 163 | } 164 | ] -------------------------------------------------------------------------------- /PaperBlossoms/data/json/qualities.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "name": "Ceremonial", 4 | "reference": { 5 | "book": "Core", 6 | "page": 240 7 | } 8 | }, 9 | { 10 | "name": "Concealable", 11 | "reference": { 12 | "book": "Core", 13 | "page": 240 14 | } 15 | }, 16 | { 17 | "name": "Cumbersome", 18 | "reference": { 19 | "book": "Core", 20 | "page": 240 21 | } 22 | }, 23 | { 24 | "name": "Damaged", 25 | "reference": { 26 | "book": "Core", 27 | "page": 240 28 | } 29 | }, 30 | { 31 | "name": "Destroyed", 32 | "reference": { 33 | "book": "Core", 34 | "page": 240 35 | } 36 | }, 37 | { 38 | "name": "Durable", 39 | "reference": { 40 | "book": "Core", 41 | "page": 240 42 | } 43 | }, 44 | { 45 | "name": "Forbidden", 46 | "reference": { 47 | "book": "Core", 48 | "page": 240 49 | } 50 | }, 51 | { 52 | "name": "Mundane", 53 | "reference": { 54 | "book": "Core", 55 | "page": 240 56 | } 57 | }, 58 | { 59 | "name": "Prepare", 60 | "reference": { 61 | "book": "Core", 62 | "page": 240 63 | } 64 | }, 65 | { 66 | "name": "Razor-edged", 67 | "reference": { 68 | "book": "Core", 69 | "page": 241 70 | } 71 | }, 72 | { 73 | "name": "Resplendent", 74 | "reference": { 75 | "book": "Core", 76 | "page": 241 77 | } 78 | }, 79 | { 80 | "name": "Sacred", 81 | "reference": { 82 | "book": "Core", 83 | "page": 241 84 | } 85 | }, 86 | { 87 | "name": "Snaring", 88 | "reference": { 89 | "book": "Core", 90 | "page": 241 91 | } 92 | }, 93 | { 94 | "name": "Subtle", 95 | "reference": { 96 | "book": "Core", 97 | "page": 241 98 | } 99 | }, 100 | { 101 | "name": "Unholy", 102 | "reference": { 103 | "book": "Core", 104 | "page": 241 105 | } 106 | }, 107 | { 108 | "name": "Wargear", 109 | "reference": { 110 | "book": "Core", 111 | "page": 241 112 | } 113 | }, 114 | { 115 | "name": "Forbidden to non-shugenja", 116 | "reference": { 117 | "book": "FoV", 118 | "page": 90 119 | } 120 | } 121 | ] -------------------------------------------------------------------------------- /PaperBlossoms/data/json/question_8.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "option": "Your character's belief in living by an orthodox interpretation of Bushidō is very staunch.", 4 | "outcome": { 5 | "attribute": "Glory", 6 | "value": 10 7 | } 8 | }, 9 | { 10 | "option": "Your character diverges from some or all common beliefs about how samurai should behave honorably, gain 1 rank in one of the following skills to reflect past behavior that was unbefitting of a samurai or deeply defied the norm.", 11 | "outcome": { 12 | "type": "Skills", 13 | "values": [ 14 | "Commerce", 15 | "Labor", 16 | "Medicine", 17 | "Seafaring", 18 | "Skulduggery", 19 | "Survival" 20 | ] 21 | } 22 | } 23 | ] -------------------------------------------------------------------------------- /PaperBlossoms/data/json/regions.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "name": "Urban region", 4 | "ring_increase": "Air", 5 | "skill_increase": "Commerce", 6 | "glory": 29, 7 | "type": "Rōnin", 8 | "reference": { 9 | "book": "PoW", 10 | "page": 32 11 | } 12 | }, 13 | { 14 | "name": "Rural farmland region", 15 | "ring_increase": "Earth", 16 | "skill_increase": "Fitness", 17 | "glory": 34, 18 | "type": "Rōnin", 19 | "reference": { 20 | "book": "PoW", 21 | "page": 33 22 | } 23 | }, 24 | { 25 | "name": "Sea, river or lake region", 26 | "ring_increase": "Water", 27 | "skill_increase": "Seafaring", 28 | "glory": 32, 29 | "type": "Rōnin", 30 | "reference": { 31 | "book": "PoW", 32 | "page": 34 33 | } 34 | }, 35 | { 36 | "name": "Forest region", 37 | "ring_increase": "Earth", 38 | "skill_increase": "Survival", 39 | "glory": 30, 40 | "type": "Rōnin", 41 | "reference": { 42 | "book": "PoW", 43 | "page": 35 44 | } 45 | }, 46 | { 47 | "name": "Mountain region", 48 | "ring_increase": "Void", 49 | "skill_increase": "Meditation", 50 | "glory": 33, 51 | "type": "Rōnin", 52 | "reference": { 53 | "book": "PoW", 54 | "page": 36 55 | } 56 | }, 57 | { 58 | "name": "Haunted region", 59 | "ring_increase": "Fire", 60 | "skill_increase": "Command", 61 | "glory": 28, 62 | "type": "Rōnin", 63 | "reference": { 64 | "book": "PoW", 65 | "page": 37 66 | } 67 | }, 68 | { 69 | "name": "Ujik of the Plains of Wind and Stone", 70 | "ring_increase": "Water", 71 | "skill_increase": "Survival", 72 | "glory": 30, 73 | "type": "Gaijin", 74 | "subtype": "Ujik", 75 | "reference": { 76 | "book": "PoW", 77 | "page": 39 78 | } 79 | }, 80 | { 81 | "name": "Qamarists in the Cradle of the World", 82 | "ring_increase": "Fire", 83 | "skill_increase": "Theology", 84 | "glory": 29, 85 | "type": "Gaijin", 86 | "subtype": "Qamarist", 87 | "reference": { 88 | "book": "PoW", 89 | "page": 40 90 | } 91 | }, 92 | { 93 | "name": "Yodha of the Ghostlands", 94 | "ring_increase": "Earth", 95 | "skill_increase": "Theology", 96 | "glory": 29, 97 | "type": "Gaijin", 98 | "subtype": "Ivory Kingdoms", 99 | "reference": { 100 | "book": "PoW", 101 | "page": 41 102 | } 103 | }, 104 | { 105 | "name": "The Sheelavaan of Bhavyatapura", 106 | "ring_increase": "Air", 107 | "skill_increase": "Courtesy", 108 | "glory": 28, 109 | "type": "Gaijin", 110 | "subtype": "Ivory Kingdoms", 111 | "reference": { 112 | "book": "PoW", 113 | "page": 42 114 | } 115 | } 116 | ] -------------------------------------------------------------------------------- /PaperBlossoms/data/json/rings.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "name": "Air", 4 | "outstanding_quality": "Grace, eloquence or empathy" 5 | }, 6 | { 7 | "name": "Earth", 8 | "outstanding_quality": "Thoroughness, patience or calm" 9 | }, 10 | { 11 | "name": "Fire", 12 | "outstanding_quality": "Creativity, passion or drive" 13 | }, 14 | { 15 | "name": "Water", 16 | "outstanding_quality": "Adaptability, friendliness or awareness" 17 | }, 18 | { 19 | "name": "Void", 20 | "outstanding_quality": "Self-awareness, insight or mysticism" 21 | } 22 | ] -------------------------------------------------------------------------------- /PaperBlossoms/data/json/skill_groups.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "name": "Artisan skills", 4 | "skills": [ 5 | "Aesthetics", 6 | "Composition", 7 | "Design", 8 | "Smithing" 9 | ] 10 | }, 11 | { 12 | "name": "Social skills", 13 | "skills": [ 14 | "Command", 15 | "Courtesy", 16 | "Games", 17 | "Performance" 18 | ] 19 | }, 20 | { 21 | "name": "Scholar skills", 22 | "skills": [ 23 | "Culture", 24 | "Government", 25 | "Medicine", 26 | "Sentiment", 27 | "Theology" 28 | ] 29 | }, 30 | { 31 | "name": "Martial skills", 32 | "skills": [ 33 | "Fitness", 34 | "Martial Arts [Melee]", 35 | "Martial Arts [Ranged]", 36 | "Martial Arts [Unarmed]", 37 | "Meditation", 38 | "Tactics" 39 | ] 40 | }, 41 | { 42 | "name": "Trade skills", 43 | "skills": [ 44 | "Commerce", 45 | "Labor", 46 | "Seafaring", 47 | "Skulduggery", 48 | "Survival" 49 | ] 50 | } 51 | ] -------------------------------------------------------------------------------- /PaperBlossoms/data/json_schema/bonds.schema.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "http://json-schema.org/draft-07/schema#", 3 | "title": "Bonds", 4 | "description": "List of bond types", 5 | "type": "array", 6 | "items": { 7 | "description": "Type of bond", 8 | "type": "object", 9 | "properties": { 10 | "name": { 11 | "description": "Name of bond type", 12 | "type": "string" 13 | }, 14 | "ability": { 15 | "description": "Bond ability", 16 | "type": "string" 17 | }, 18 | "reference": { 19 | "description": "Page reference for bond", 20 | "type": "object", 21 | "properties": { 22 | "book": { 23 | "description": "Book in which reference can be found", 24 | "type": "string", 25 | "enum": [ 26 | "CR", 27 | "CoS", 28 | "Core", 29 | "DT", 30 | "EE", 31 | "FoV", 32 | "GMK", 33 | "Mantis", 34 | "PoW", 35 | "SL" 36 | ] 37 | }, 38 | "page": { 39 | "description": "Page on which reference can be found", 40 | "type": "integer" 41 | } 42 | }, 43 | "required": [ 44 | "book", 45 | "page" 46 | ], 47 | "defaultSnippets": [ 48 | { 49 | "label": "New Page reference for bond", 50 | "body": { 51 | "book": "$1", 52 | "page": "^$2" 53 | } 54 | } 55 | ] 56 | } 57 | }, 58 | "required": [ 59 | "name", 60 | "ability", 61 | "reference" 62 | ], 63 | "defaultSnippets": [ 64 | { 65 | "label": "New Type of bond", 66 | "body": { 67 | "name": "$1", 68 | "ability": "$2", 69 | "reference": "^$3" 70 | } 71 | } 72 | ] 73 | } 74 | } -------------------------------------------------------------------------------- /PaperBlossoms/data/json_schema/item_patterns.schema.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "http://json-schema.org/draft-07/schema#", 3 | "title": "Item patterns", 4 | "description": "List of item patterns", 5 | "type": "array", 6 | "items": { 7 | "description": "Item pattern", 8 | "type": "object", 9 | "properties": { 10 | "name": { 11 | "description": "Name of item pattern", 12 | "type": "string" 13 | }, 14 | "reference": { 15 | "description": "Page reference for item pattern", 16 | "type": "object", 17 | "properties": { 18 | "book": { 19 | "description": "Book in which reference can be found", 20 | "type": "string", 21 | "enum": [ 22 | "CR", 23 | "CoS", 24 | "Core", 25 | "DT", 26 | "EE", 27 | "FoV", 28 | "GMK", 29 | "Mantis", 30 | "PoW", 31 | "SL" 32 | ] 33 | }, 34 | "page": { 35 | "description": "Page on which reference can be found", 36 | "type": "integer" 37 | } 38 | }, 39 | "required": [ 40 | "book", 41 | "page" 42 | ], 43 | "defaultSnippets": [ 44 | { 45 | "label": "New Page reference for item pattern", 46 | "body": { 47 | "book": "$1", 48 | "page": "^$2" 49 | } 50 | } 51 | ] 52 | }, 53 | "xp_cost": { 54 | "description": "XP cost of item pattern", 55 | "type": "integer" 56 | }, 57 | "rarity_modifier": { 58 | "description": "Rarity modifier endowed by item pattern", 59 | "type": "integer" 60 | } 61 | }, 62 | "defaultSnippets": [ 63 | { 64 | "label": "New Item pattern", 65 | "body": { 66 | "name": "$1", 67 | "reference": "^$2", 68 | "xp_cost": "^$3", 69 | "rarity_modifier": "^$4" 70 | } 71 | } 72 | ] 73 | } 74 | } -------------------------------------------------------------------------------- /PaperBlossoms/data/json_schema/qualities.schema.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "http://json-schema.org/draft-07/schema#", 3 | "title": "Item qualities", 4 | "description": "List of item qualities", 5 | "type": "array", 6 | "items": { 7 | "description": "Item quality", 8 | "type": "object", 9 | "properties": { 10 | "name": { 11 | "description": "Name of item quality", 12 | "type": "string" 13 | }, 14 | "reference": { 15 | "description": "Page reference for item quality", 16 | "type": "object", 17 | "properties": { 18 | "book": { 19 | "description": "Book in which reference can be found", 20 | "type": "string", 21 | "enum": [ 22 | "CR", 23 | "CoS", 24 | "Core", 25 | "DT", 26 | "EE", 27 | "GMK", 28 | "Mantis", 29 | "PoW", 30 | "SL", 31 | "FoV" 32 | ] 33 | }, 34 | "page": { 35 | "description": "Page on which reference can be found", 36 | "type": "integer" 37 | } 38 | }, 39 | "required": [ 40 | "book", 41 | "page" 42 | ], 43 | "defaultSnippets": [ 44 | { 45 | "label": "New Page reference for item quality", 46 | "body": { 47 | "book": "$1", 48 | "page": "^$2" 49 | } 50 | } 51 | ] 52 | } 53 | }, 54 | "required": [ 55 | "name", 56 | "reference" 57 | ], 58 | "defaultSnippets": [ 59 | { 60 | "label": "New Item quality", 61 | "body": { 62 | "name": "$1", 63 | "reference": "^$2" 64 | } 65 | } 66 | ] 67 | } 68 | } -------------------------------------------------------------------------------- /PaperBlossoms/data/json_schema/rings.schema.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "http://json-schema.org/draft-07/schema#", 3 | "title": "Rings", 4 | "description": "Defines the schema for rings.json", 5 | "type": "array", 6 | "items": { 7 | "description": "Ring", 8 | "type": "object", 9 | "properties": { 10 | "name": { 11 | "description": "Name of the ring", 12 | "type": "string" 13 | }, 14 | "outstanding_quality": { 15 | "description": "Question 4 quality associated with given ring", 16 | "type": "string" 17 | } 18 | }, 19 | "required": [ 20 | "name", 21 | "outstanding_quality" 22 | ], 23 | "defaultSnippets": [ 24 | { 25 | "label": "New Ring", 26 | "body": { 27 | "name": "$1", 28 | "outstanding_quality": "$2" 29 | } 30 | } 31 | ] 32 | } 33 | } -------------------------------------------------------------------------------- /PaperBlossoms/data/json_schema/skill_groups.schema.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "http://json-schema.org/draft-07/schema#", 3 | "title": "Skills", 4 | "description": "Defines the schema for skill_groups.json", 5 | "type": "array", 6 | "items": { 7 | "description": "Skill group", 8 | "type": "object", 9 | "properties": { 10 | "name": { 11 | "description": "Name of skill group", 12 | "type": "string" 13 | }, 14 | "skills": { 15 | "description": "List of skills", 16 | "type": "array", 17 | "items": { 18 | "description": "Name of skill", 19 | "type": "string" 20 | } 21 | } 22 | }, 23 | "required": [ 24 | "name", 25 | "skills" 26 | ], 27 | "defaultSnippets": [ 28 | { 29 | "label": "New Skill group", 30 | "body": { 31 | "name": "$1", 32 | "skills": "^$2" 33 | } 34 | } 35 | ] 36 | } 37 | } -------------------------------------------------------------------------------- /PaperBlossoms/data/paperblossoms.db: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dashnine/PaperBlossoms/bfca0f065a946f1e3206716acd362763b4322856/PaperBlossoms/data/paperblossoms.db -------------------------------------------------------------------------------- /PaperBlossoms/data/scripts/add_default_snippets_to_schema.py: -------------------------------------------------------------------------------- 1 | import sys 2 | import json 3 | 4 | # Helper to generate placeholder text based on property type 5 | def get_placeholder(property_type, idx): 6 | 7 | if property_type == 'string': 8 | return('$' + str(idx)) 9 | 10 | if property_type == 'array': 11 | return('^[${}]'.format(str(idx))) 12 | 13 | return('^$' + str(idx)) 14 | 15 | 16 | # Recursively add defaultSnippets property to objects in schema 17 | def add_snippet(schema_object): 18 | 19 | if schema_object['type'] == 'array': 20 | schema_object['items'] = add_snippet(schema_object['items']) 21 | 22 | if schema_object['type'] in ('string', 'boolean', 'integer'): 23 | return(schema_object) 24 | 25 | if schema_object['type'] == 'object': 26 | property_types = { 27 | object_property: schema_object['properties'][object_property]['type'] 28 | for object_property in schema_object['properties'] 29 | } 30 | 31 | snippet_body = { 32 | object_property: get_placeholder(property_types[object_property], idx) 33 | for idx, object_property in enumerate(property_types, start = 1) 34 | } 35 | 36 | schema_object['defaultSnippets'] = [{ 37 | 'label': 'New ' + schema_object['description'], 38 | 'body': snippet_body 39 | }] 40 | 41 | for object_property in property_types: 42 | schema_object['properties'][object_property] = add_snippet(schema_object['properties'][object_property]) 43 | 44 | return(schema_object) 45 | 46 | 47 | # Load, add defaultSnippets and overwrite schema file 48 | def add_snippet_to_schema(schema_filename): 49 | with open(schema_filename, encoding = 'utf8') as f: 50 | schema = json.load(f) 51 | schema = add_snippet(schema) 52 | with open(schema_filename, 'w', encoding = 'utf8') as f: 53 | json.dump(schema, f, indent = 4) 54 | 55 | 56 | def main(): 57 | add_snippet_to_schema(sys.argv[1]) 58 | 59 | 60 | if __name__ == '__main__': 61 | main() -------------------------------------------------------------------------------- /PaperBlossoms/data/scripts/export_import_user_db.py: -------------------------------------------------------------------------------- 1 | import argparse 2 | import os 3 | import sqlite3 4 | 5 | 6 | # Connect to original and custom dbs 7 | def connect_db(action, orig_file, custom_file): 8 | 9 | # If exporting, delete custom file if it already exists 10 | if action == 'export': 11 | try: 12 | os.remove(custom_file) 13 | print('Deleted existing', custom_file) 14 | except: 15 | pass 16 | 17 | # Connect to original db as main schema 18 | conn = sqlite3.connect(orig_file) 19 | 20 | # Attach custom db as a different schema 21 | conn.execute('ATTACH DATABASE "{filename}" AS custom'.format(filename = custom_file)) 22 | 23 | return conn 24 | 25 | 26 | # Get cursor to all user tables 27 | def get_user_tables(conn, target_schema): 28 | cursor = conn.cursor() 29 | cursor.execute( 30 | '''SELECT * FROM {target_schema}.sqlite_master 31 | WHERE type = 'table' AND name LIKE "user_%"'''.format(target_schema = target_schema) 32 | ) 33 | 34 | return cursor 35 | 36 | 37 | # Export user tables 38 | def export_user_tables(conn, cursor): 39 | for row in cursor: 40 | conn.execute( 41 | '''CREATE TABLE custom.{tbl_name} AS 42 | SELECT * FROM {tbl_name}'''.format(tbl_name = row[2]) 43 | ) 44 | 45 | conn.commit() 46 | 47 | 48 | # Import user tables 49 | def import_user_tables(conn, cursor): 50 | for row in cursor: 51 | try: 52 | conn.execute( 53 | '''INSERT INTO {tbl_name} 54 | SELECT * FROM custom.{tbl_name}'''.format(tbl_name = row[2]) 55 | ) 56 | except: 57 | print('Failed to import', row[2], '-- skipping!') 58 | 59 | conn.commit() 60 | 61 | 62 | def main(action, orig_file, custom_file): 63 | 64 | # Open database connections 65 | conn = connect_db(action, orig_file, custom_file) 66 | 67 | # Get all user tables 68 | cursor = get_user_tables(conn, 'main' if action == 'export' else 'custom') 69 | 70 | # Export or import user tables 71 | if action == 'export': 72 | export_user_tables(conn, cursor) 73 | else: 74 | import_user_tables(conn, cursor) 75 | 76 | conn.close() 77 | 78 | if __name__ == '__main__': 79 | parser = argparse.ArgumentParser(description = 'Utility to export and import the custom user tables in the paperblossoms db via another sqlite file.') 80 | parser.add_argument('action', choices = ['export', 'import'], help = 'Which action you want to take, either "export" from or "import" into the paperblossoms db') 81 | parser.add_argument('orig_db', help = 'Filepath for original db, paperblossoms.db') 82 | parser.add_argument('custom_db', help = 'Filepath for exported db with custom user tables') 83 | args = parser.parse_args() 84 | 85 | main(args.action, args.orig_db, args.custom_db) 86 | -------------------------------------------------------------------------------- /PaperBlossoms/data/scripts/validate_json.py: -------------------------------------------------------------------------------- 1 | import pathlib 2 | import json 3 | import jsonschema 4 | 5 | 6 | 7 | # Validates specified json against specified schema. Will raise informative error 8 | # if json fails schema validation. 9 | def validate_schema(json_filepath, schema_filepath): 10 | with open(json_filepath, encoding = 'utf8') as f: 11 | instance = json.load(f) 12 | with open(schema_filepath, encoding = 'utf8') as f: 13 | schema = json.load(f) 14 | 15 | try: 16 | jsonschema.validate(instance, schema) 17 | print('Validated ' + json_filepath.name) 18 | except jsonschema.exceptions.ValidationError as err: 19 | print('Could not validate ' + json_filepath.name + '!') 20 | print(err.message) 21 | 22 | return None 23 | 24 | 25 | def main(): 26 | 27 | # Get path to data directory 28 | data_dir = pathlib.Path(__file__).parents[1] 29 | 30 | # Loop through all json schemas 31 | for schema_filepath in list(data_dir.joinpath('json_schema').glob('*')): 32 | validate_schema( 33 | json_filepath=( 34 | data_dir 35 | .joinpath('json') 36 | .joinpath(schema_filepath.stem.split('.')[0] + '.json') 37 | ), 38 | schema_filepath = schema_filepath 39 | ) 40 | 41 | if __name__ == '__main__': 42 | main() 43 | -------------------------------------------------------------------------------- /PaperBlossoms/data/vscode_workspace_settings.json: -------------------------------------------------------------------------------- 1 | { 2 | "python.pythonPath": "/usr/bin/python3", 3 | "python.linting.pylintEnabled": true, 4 | "python.linting.enabled": true, 5 | "editor.tabCompletion": "on", 6 | "json.schemas": [ 7 | { 8 | "fileMatch": [ 9 | "skill_groups.json" 10 | ], 11 | "url": "./PaperBlossoms/data/json_schema/skill_groups.schema.json" 12 | }, 13 | { 14 | "fileMatch": [ 15 | "advantages_disadvantages.json" 16 | ], 17 | "url": "./PaperBlossoms/data/json_schema/advantages_disadvantages.schema.json" 18 | }, 19 | { 20 | "fileMatch": [ 21 | "titles.json" 22 | ], 23 | "url": "./PaperBlossoms/data/json_schema/titles.schema.json" 24 | }, 25 | { 26 | "fileMatch": [ 27 | "clans.json" 28 | ], 29 | "url": "./PaperBlossoms/data/json_schema/clans.schema.json" 30 | }, 31 | { 32 | "fileMatch": [ 33 | "personal_effects.json" 34 | ], 35 | "url": "./PaperBlossoms/data/json_schema/personal_effects.schema.json" 36 | }, 37 | { 38 | "fileMatch": [ 39 | "samurai_heritage.json" 40 | ], 41 | "url": "./PaperBlossoms/data/json_schema/samurai_heritage.schema.json" 42 | }, 43 | { 44 | "fileMatch": [ 45 | "armor.json" 46 | ], 47 | "url": "./PaperBlossoms/data/json_schema/armor.schema.json" 48 | }, 49 | { 50 | "fileMatch": [ 51 | "schools.json" 52 | ], 53 | "url": "./PaperBlossoms/data/json_schema/schools.schema.json" 54 | }, 55 | { 56 | "fileMatch": [ 57 | "techniques.json" 58 | ], 59 | "url": "./PaperBlossoms/data/json_schema/techniques.schema.json" 60 | }, 61 | { 62 | "fileMatch": [ 63 | "qualities.json" 64 | ], 65 | "url": "./PaperBlossoms/data/json_schema/qualities.schema.json" 66 | }, 67 | { 68 | "fileMatch": [ 69 | "rings.json" 70 | ], 71 | "url": "./PaperBlossoms/data/json_schema/rings.schema.json" 72 | }, 73 | { 74 | "fileMatch": [ 75 | "weapons.json" 76 | ], 77 | "url": "./PaperBlossoms/data/json_schema/weapons.schema.json" 78 | }, 79 | { 80 | "fileMatch": [ 81 | "item_patterns.json" 82 | ], 83 | "url": "./PaperBlossoms/data/json_schema/item_patterns.schema.json" 84 | }, 85 | { 86 | "fileMatch": [ 87 | "bonds.json" 88 | ], 89 | "url": "./PaperBlossoms/data/json_schema/bonds.schema.json" 90 | }, 91 | { 92 | "fileMatch": [ 93 | "regions.json" 94 | ], 95 | "url": "./PaperBlossoms/data/json_schema/regions.schema.json" 96 | } 97 | ], 98 | "editor.suggest.localityBonus": true, 99 | "editor.suggestSelection": "recentlyUsedByPrefix" 100 | } -------------------------------------------------------------------------------- /PaperBlossoms/paperblossoms_de.qm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dashnine/PaperBlossoms/bfca0f065a946f1e3206716acd362763b4322856/PaperBlossoms/paperblossoms_de.qm -------------------------------------------------------------------------------- /PaperBlossoms/paperblossoms_en.qm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dashnine/PaperBlossoms/bfca0f065a946f1e3206716acd362763b4322856/PaperBlossoms/paperblossoms_en.qm -------------------------------------------------------------------------------- /PaperBlossoms/paperblossoms_es.qm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dashnine/PaperBlossoms/bfca0f065a946f1e3206716acd362763b4322856/PaperBlossoms/paperblossoms_es.qm -------------------------------------------------------------------------------- /PaperBlossoms/paperblossoms_fr.qm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dashnine/PaperBlossoms/bfca0f065a946f1e3206716acd362763b4322856/PaperBlossoms/paperblossoms_fr.qm -------------------------------------------------------------------------------- /PaperBlossoms/resources.qrc: -------------------------------------------------------------------------------- 1 | 2 | 3 | resources/colorRings.png 4 | resources/colorRingsMed.png 5 | resources/sakura_PNG37.png 6 | resources/pink-sakura-01-hi.png 7 | resources/pink-sakura-01-hi.ico 8 | resources/Bradley Hand Bold.ttf 9 | resources/sakura.icns 10 | 11 | 12 | data/paperblossoms.db 13 | templates/PB_TEMPLATE.html 14 | 15 | 16 | 17 | paperblossoms_es.qm 18 | paperblossoms_fr.qm 19 | paperblossoms_en.qm 20 | paperblossoms_de.qm 21 | data/i18n/i18n_test.csv 22 | data/i18n/i18n_en.csv 23 | data/i18n/i18n_de.csv 24 | data/i18n/i18n_es.csv 25 | data/i18n/i18n_fr.csv 26 | 27 | 28 | -------------------------------------------------------------------------------- /PaperBlossoms/resources/Bradley Hand Bold.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dashnine/PaperBlossoms/bfca0f065a946f1e3206716acd362763b4322856/PaperBlossoms/resources/Bradley Hand Bold.ttf -------------------------------------------------------------------------------- /PaperBlossoms/resources/colorRings.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dashnine/PaperBlossoms/bfca0f065a946f1e3206716acd362763b4322856/PaperBlossoms/resources/colorRings.png -------------------------------------------------------------------------------- /PaperBlossoms/resources/colorRingsMed.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dashnine/PaperBlossoms/bfca0f065a946f1e3206716acd362763b4322856/PaperBlossoms/resources/colorRingsMed.png -------------------------------------------------------------------------------- /PaperBlossoms/resources/pink-sakura-01-hi.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dashnine/PaperBlossoms/bfca0f065a946f1e3206716acd362763b4322856/PaperBlossoms/resources/pink-sakura-01-hi.ico -------------------------------------------------------------------------------- /PaperBlossoms/resources/pink-sakura-01-hi.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dashnine/PaperBlossoms/bfca0f065a946f1e3206716acd362763b4322856/PaperBlossoms/resources/pink-sakura-01-hi.png -------------------------------------------------------------------------------- /PaperBlossoms/resources/sakura.icns: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dashnine/PaperBlossoms/bfca0f065a946f1e3206716acd362763b4322856/PaperBlossoms/resources/sakura.icns -------------------------------------------------------------------------------- /PaperBlossoms/resources/sakura.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dashnine/PaperBlossoms/bfca0f065a946f1e3206716acd362763b4322856/PaperBlossoms/resources/sakura.ico -------------------------------------------------------------------------------- /PaperBlossoms/resources/sakura.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dashnine/PaperBlossoms/bfca0f065a946f1e3206716acd362763b4322856/PaperBlossoms/resources/sakura.png -------------------------------------------------------------------------------- /PaperBlossoms/resources/sakura_PNG37.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dashnine/PaperBlossoms/bfca0f065a946f1e3206716acd362763b4322856/PaperBlossoms/resources/sakura_PNG37.png -------------------------------------------------------------------------------- /PaperBlossoms/src/character.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * ******************************************************************* 3 | * This file is part of the Paper Blossoms application 4 | * (https://github.com/dashnine/PaperBlossoms). 5 | * Copyright (c) 2019 Kyle Hankins (dashnine) 6 | * 7 | * This program is free software: you can redistribute it and/or modify 8 | * it under the terms of the GNU General Public License as published by 9 | * the Free Software Foundation, version 3. 10 | * 11 | * This program is distributed in the hope that it will be useful, but 12 | * WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 14 | * General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with this program. If not, see . 18 | * 19 | * The Legend of the Five Rings Roleplaying Game is the creation 20 | * and property of Fantasy Flight Games. 21 | * ******************************************************************* 22 | */ 23 | 24 | #include "character.h" 25 | #include 26 | 27 | 28 | Character::Character() 29 | { 30 | clear(); 31 | } 32 | 33 | Character::~Character(){ 34 | } 35 | 36 | void Character::clear(){ 37 | name ="" ; 38 | titles.clear(); 39 | clan =""; 40 | family =""; 41 | school =""; 42 | ninjo =""; 43 | giri =""; 44 | baseskills.clear(); 45 | skillranks.clear(); 46 | baserings.clear(); 47 | ringranks.clear(); 48 | honor =0; 49 | glory =0; 50 | status =0; 51 | koku =0; 52 | bu =0; 53 | zeni =0; 54 | rank =0; 55 | techniques.clear(); 56 | adv_disadv.clear(); 57 | equipment.clear(); 58 | abilities.clear(); 59 | heritage =""; 60 | notes =""; 61 | advanceStack.clear(); 62 | portrait.load(""); 63 | portrait = portrait.scaled(0,0); 64 | totalXP = 0; 65 | 66 | } 67 | -------------------------------------------------------------------------------- /PaperBlossoms/src/character.h: -------------------------------------------------------------------------------- 1 | /* 2 | * ******************************************************************* 3 | * This file is part of the Paper Blossoms application 4 | * (https://github.com/dashnine/PaperBlossoms). 5 | * Copyright (c) 2019 Kyle Hankins (dashnine) 6 | * 7 | * This program is free software: you can redistribute it and/or modify 8 | * it under the terms of the GNU General Public License as published by 9 | * the Free Software Foundation, version 3. 10 | * 11 | * This program is distributed in the hope that it will be useful, but 12 | * WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 14 | * General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with this program. If not, see . 18 | * 19 | * The Legend of the Five Rings Roleplaying Game is the creation 20 | * and property of Fantasy Flight Games. 21 | * ******************************************************************* 22 | */ 23 | 24 | #ifndef CHARACTER_H 25 | #define CHARACTER_H 26 | 27 | #include 28 | #include 29 | #include 30 | #include 31 | #include 32 | 33 | class Character 34 | { 35 | public: 36 | Character(); 37 | ~Character(); 38 | 39 | QString name; 40 | QStringList titles; 41 | 42 | QString clan; 43 | QString family; 44 | QString school; 45 | 46 | QString ninjo; 47 | QString giri; 48 | 49 | QMap baseskills; 50 | QMap skillranks; 51 | QMap baserings; 52 | QMap ringranks; 53 | 54 | int honor; 55 | int glory; 56 | int status; 57 | int koku; //wealth 58 | int bu; //wealth 59 | int zeni; //wealth 60 | int rank; 61 | 62 | QStringList techniques; 63 | 64 | QStringList adv_disadv; 65 | 66 | QList abilities; 67 | QList equipment; 68 | QList bonds; 69 | 70 | QString heritage; 71 | QStringList advanceStack; 72 | 73 | QString notes; 74 | 75 | int totalXP; 76 | 77 | void clear(); 78 | 79 | QImage portrait; 80 | }; 81 | 82 | #endif // CHARACTER_H 83 | -------------------------------------------------------------------------------- /PaperBlossoms/src/characterwizard/newcharacterwizard.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * ******************************************************************* 3 | * This file is part of the Paper Blossoms application 4 | * (https://github.com/dashnine/PaperBlossoms). 5 | * Copyright (c) 2019 Kyle Hankins (dashnine) 6 | * 7 | * This program is free software: you can redistribute it and/or modify 8 | * it under the terms of the GNU General Public License as published by 9 | * the Free Software Foundation, version 3. 10 | * 11 | * This program is distributed in the hope that it will be useful, but 12 | * WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 14 | * General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with this program. If not, see . 18 | * 19 | * The Legend of the Five Rings Roleplaying Game is the creation 20 | * and property of Fantasy Flight Games. 21 | * ******************************************************************* 22 | */ 23 | 24 | #include "newcharacterwizard.h" 25 | #include "newcharwizardpage1.h" 26 | #include "newcharwizardpage2.h" 27 | #include "newcharwizardpage3.h" 28 | #include "newcharwizardpage4.h" 29 | #include "newcharwizardpage5.h" 30 | #include "newcharwizardpage6.h" 31 | #include "newcharwizardpage7.h" 32 | #include "../character.h" 33 | #include 34 | #include 35 | #include "../dependency/databasedependency.h" 36 | 37 | 38 | NewCharacterWizard::NewCharacterWizard(DatabaseDependency* deps, QWizard *parent) : QWizard(parent) 39 | { 40 | this->addPage(new NewCharWizardPage1(deps)); 41 | this->addPage(new NewCharWizardPage2(deps)); 42 | this->addPage(new NewCharWizardPage3(deps)); 43 | this->addPage(new NewCharWizardPage4(deps)); 44 | this->addPage(new NewCharWizardPage5(deps)); 45 | this->addPage(new NewCharWizardPage6(deps)); 46 | this->addPage(new NewCharWizardPage7(deps, &character)); //pass in a character to set values 47 | 48 | this->setWindowTitle(tr("Twenty Questions")); 49 | } 50 | 51 | Character NewCharacterWizard::getCharacter(){ 52 | return character; 53 | } 54 | -------------------------------------------------------------------------------- /PaperBlossoms/src/characterwizard/newcharacterwizard.h: -------------------------------------------------------------------------------- 1 | /* 2 | * ******************************************************************* 3 | * This file is part of the Paper Blossoms application 4 | * (https://github.com/dashnine/PaperBlossoms). 5 | * Copyright (c) 2019 Kyle Hankins (dashnine) 6 | * 7 | * This program is free software: you can redistribute it and/or modify 8 | * it under the terms of the GNU General Public License as published by 9 | * the Free Software Foundation, version 3. 10 | * 11 | * This program is distributed in the hope that it will be useful, but 12 | * WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 14 | * General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with this program. If not, see . 18 | * 19 | * The Legend of the Five Rings Roleplaying Game is the creation 20 | * and property of Fantasy Flight Games. 21 | * ******************************************************************* 22 | */ 23 | 24 | #ifndef NEWCHARACTERWIZARD_H 25 | #define NEWCHARACTERWIZARD_H 26 | 27 | #include 28 | #include 29 | #include "../dependency/databasedependency.h" 30 | #include "../dependency/databasedependency.h" 31 | #include "../character.h" 32 | #include 33 | 34 | class NewCharacterWizard : public QWizard 35 | { 36 | Q_OBJECT 37 | public: 38 | explicit NewCharacterWizard(DatabaseDependency* deps, QWizard *parent = nullptr); 39 | 40 | Character getCharacter(); 41 | private: 42 | QList techBoxes; //link to technique boxes, since they're dynamic. 43 | Character character; 44 | 45 | signals: 46 | 47 | public slots: 48 | }; 49 | 50 | #endif // NEWCHARACTERWIZARD_H 51 | -------------------------------------------------------------------------------- /PaperBlossoms/src/characterwizard/newcharwizardpage1.h: -------------------------------------------------------------------------------- 1 | /* 2 | * ******************************************************************* 3 | * This file is part of the Paper Blossoms application 4 | * (https://github.com/dashnine/PaperBlossoms). 5 | * Copyright (c) 2019 Kyle Hankins (dashnine) 6 | * 7 | * This program is free software: you can redistribute it and/or modify 8 | * it under the terms of the GNU General Public License as published by 9 | * the Free Software Foundation, version 3. 10 | * 11 | * This program is distributed in the hope that it will be useful, but 12 | * WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 14 | * General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with this program. If not, see . 18 | * 19 | * The Legend of the Five Rings Roleplaying Game is the creation 20 | * and property of Fantasy Flight Games. 21 | * ******************************************************************* 22 | */ 23 | 24 | #ifndef NEWCHARWIZARDPAGE1_H 25 | #define NEWCHARWIZARDPAGE1_H 26 | 27 | #include 28 | #include 29 | #include "../dependency/databasedependency.h" 30 | 31 | namespace Ui { 32 | class NewCharWizardPage1; 33 | } 34 | 35 | class NewCharWizardPage1 : public QWizardPage 36 | { 37 | Q_OBJECT 38 | 39 | public: 40 | explicit NewCharWizardPage1(DatabaseDependency* deps, QWidget *parent = 0); 41 | ~NewCharWizardPage1(); 42 | QStringListModel* clanModel; 43 | QStringListModel* familyModel; 44 | QStringListModel* famRingModel; 45 | 46 | //Path of Waves Support 47 | QStringListModel* regionModel; 48 | QStringListModel* upbringingModel; 49 | QStringListModel* upbringingRingModel; 50 | QStringListModel* upbringingSkillModel1; 51 | QStringListModel* upbringingSkillModel2; 52 | QStringListModel* upbringingSkillModel3; 53 | 54 | 55 | private slots: 56 | void on_nc1_clan_ComboBox_currentIndexChanged(const QString &arg1); 57 | 58 | void on_nc1_family_ComboBox_currentIndexChanged(const QString &arg1); 59 | 60 | void on_nc1_ring_ComboBox_currentIndexChanged(const QString &arg1); 61 | 62 | void on_characterType_comboBox_currentIndexChanged(const QString &arg1); 63 | 64 | void on_nc1_region_ComboBox_currentIndexChanged(const QString &arg1); 65 | 66 | void on_nc1_upbringing_ComboBox_currentIndexChanged(const QString &arg1); 67 | 68 | void on_nc1_skill1_ComboBox_currentIndexChanged(const QString &arg1); 69 | 70 | void on_nc1_skill2_ComboBox_currentIndexChanged(const QString &arg1); 71 | 72 | void on_nc1_skill3_ComboBox_currentIndexChanged(const QString &arg1); 73 | 74 | void on_nc1_upbringing_ring_ComboBox_currentIndexChanged(const QString &arg1); 75 | 76 | private: 77 | Ui::NewCharWizardPage1 *ui; 78 | DatabaseDependency* deps; 79 | void regenSummary(); 80 | QMap calcCurrentRings(); 81 | QMap calcSkills(); 82 | void setSamuraiVisibilty(bool isSamurai); 83 | bool validatePage(); 84 | }; 85 | 86 | #endif // NEWCHARWIZARDPAGE1_H 87 | -------------------------------------------------------------------------------- /PaperBlossoms/src/characterwizard/newcharwizardpage2.h: -------------------------------------------------------------------------------- 1 | /* 2 | * ******************************************************************* 3 | * This file is part of the Paper Blossoms application 4 | * (https://github.com/dashnine/PaperBlossoms). 5 | * Copyright (c) 2019 Kyle Hankins (dashnine) 6 | * 7 | * This program is free software: you can redistribute it and/or modify 8 | * it under the terms of the GNU General Public License as published by 9 | * the Free Software Foundation, version 3. 10 | * 11 | * This program is distributed in the hope that it will be useful, but 12 | * WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 14 | * General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with this program. If not, see . 18 | * 19 | * The Legend of the Five Rings Roleplaying Game is the creation 20 | * and property of Fantasy Flight Games. 21 | * ******************************************************************* 22 | */ 23 | 24 | #ifndef NEWCHARWIZARDPAGE2_H 25 | #define NEWCHARWIZARDPAGE2_H 26 | 27 | #include 28 | #include "../dependency/databasedependency.h" 29 | #include 30 | #include 31 | #include 32 | #include 33 | #include 34 | 35 | namespace Ui { 36 | class NewCharWizardPage2; 37 | } 38 | 39 | class NewCharWizardPage2 : public QWizardPage 40 | { 41 | Q_OBJECT 42 | 43 | public: 44 | explicit NewCharWizardPage2(DatabaseDependency *deps, QWidget *parent = 0); 45 | ~NewCharWizardPage2(); 46 | QStringListModel* schoolModel; 47 | QStringListModel* skillOptModel; 48 | QStringListModel* skillSelModel; 49 | QStringListModel* ringModel; 50 | 51 | private slots: 52 | void on_nc2_unrestrictedSchool_checkBox_toggled(const bool checked); 53 | void on_nc2_school_ComboBox_currentIndexChanged(const QString &arg1); 54 | void on_nc2_skillAdd_pushButton_clicked(); 55 | void on_nc2_skillRem_pushButton_clicked(); 56 | 57 | 58 | 59 | void equipSelectionChanged(const QString newText); 60 | void schoolRingSelectionChanged(const QString newText); 61 | void on_nc2_kitsune_comboBox_currentTextChanged(const QString &arg1); 62 | 63 | void on_nc2_skillOpt_listview_doubleClicked(const QModelIndex &index); 64 | 65 | void on_nc2_skillSel_listview_doubleClicked(const QModelIndex &index); 66 | 67 | 68 | void on_nc2_schoolSpecialtRing_ComboBox_currentIndexChanged(const QString &arg1); 69 | 70 | private: 71 | Ui::NewCharWizardPage2 *ui; 72 | DatabaseDependency* deps; 73 | void initializePage(); 74 | bool validatePage(); 75 | bool settingupequip; 76 | void handleSpecCases(const QString speccase); 77 | void doEquip(const QString school); 78 | void doAddSkill(); 79 | void doRemSkill(); 80 | QMap calcSkills(); 81 | QMap calcCurrentRings(); 82 | void regenSummary(); 83 | }; 84 | 85 | #endif // NEWCHARWIZARDPAGE2_H 86 | -------------------------------------------------------------------------------- /PaperBlossoms/src/characterwizard/newcharwizardpage3.h: -------------------------------------------------------------------------------- 1 | /* 2 | * ******************************************************************* 3 | * This file is part of the Paper Blossoms application 4 | * (https://github.com/dashnine/PaperBlossoms). 5 | * Copyright (c) 2019 Kyle Hankins (dashnine) 6 | * 7 | * This program is free software: you can redistribute it and/or modify 8 | * it under the terms of the GNU General Public License as published by 9 | * the Free Software Foundation, version 3. 10 | * 11 | * This program is distributed in the hope that it will be useful, but 12 | * WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 14 | * General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with this program. If not, see . 18 | * 19 | * The Legend of the Five Rings Roleplaying Game is the creation 20 | * and property of Fantasy Flight Games. 21 | * ******************************************************************* 22 | */ 23 | 24 | #ifndef NEWCHARWIZARDPAGE3_H 25 | #define NEWCHARWIZARDPAGE3_H 26 | 27 | #include 28 | #include "../dependency/databasedependency.h" 29 | #include 30 | 31 | namespace Ui { 32 | class NewCharWizardPage3; 33 | } 34 | 35 | class NewCharWizardPage3 : public QWizardPage 36 | { 37 | Q_OBJECT 38 | 39 | public: 40 | explicit NewCharWizardPage3(DatabaseDependency *deps, QWidget *parent = 0); 41 | ~NewCharWizardPage3(); 42 | 43 | private slots: 44 | void on_nc3_q7_neg_radioButton_toggled(const bool checked); 45 | 46 | void on_nc3_q8_neg_radioButton_toggled(const bool checked); 47 | 48 | void on_nc3_q7_comboBox_currentIndexChanged(const QString &arg1); 49 | 50 | void on_nc3_q8_comboBox_currentIndexChanged(const QString &arg1); 51 | 52 | 53 | 54 | void on_nc3_q8_mid_radioButton_toggled(bool checked); 55 | 56 | private: 57 | Ui::NewCharWizardPage3 *ui; 58 | void initializePage(); 59 | QButtonGroup q7group; 60 | QButtonGroup q8group; 61 | 62 | DatabaseDependency* deps; 63 | 64 | bool validatePage(); 65 | void regenSummary(); 66 | QMap calcCurrentRings(); 67 | QMap calcSkills(); 68 | }; 69 | 70 | #endif // NEWCHARWIZARDPAGE3_H 71 | -------------------------------------------------------------------------------- /PaperBlossoms/src/characterwizard/newcharwizardpage4.h: -------------------------------------------------------------------------------- 1 | /* 2 | * ******************************************************************* 3 | * This file is part of the Paper Blossoms application 4 | * (https://github.com/dashnine/PaperBlossoms). 5 | * Copyright (c) 2019 Kyle Hankins (dashnine) 6 | * 7 | * This program is free software: you can redistribute it and/or modify 8 | * it under the terms of the GNU General Public License as published by 9 | * the Free Software Foundation, version 3. 10 | * 11 | * This program is distributed in the hope that it will be useful, but 12 | * WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 14 | * General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with this program. If not, see . 18 | * 19 | * The Legend of the Five Rings Roleplaying Game is the creation 20 | * and property of Fantasy Flight Games. 21 | * ******************************************************************* 22 | */ 23 | 24 | #ifndef NEWCHARWIZARDPAGE4_H 25 | #define NEWCHARWIZARDPAGE4_H 26 | 27 | #include 28 | #include "../dependency/databasedependency.h" 29 | namespace Ui { 30 | class NewCharWizardPage4; 31 | } 32 | 33 | class NewCharWizardPage4 : public QWizardPage 34 | { 35 | Q_OBJECT 36 | 37 | public: 38 | explicit NewCharWizardPage4(DatabaseDependency *deps, QWidget *parent = 0); 39 | ~NewCharWizardPage4(); 40 | 41 | private slots: 42 | void on_nc4_q13_adv_radioButton_toggled(const bool checked); 43 | 44 | void on_nc4_q13_disadv_radioButton_toggled(const bool checked); 45 | 46 | void on_nc4_q13_skill_comboBox_currentIndexChanged(const QString &arg1); 47 | 48 | private: 49 | Ui::NewCharWizardPage4 *ui; 50 | DatabaseDependency* deps; 51 | void initializePage(); 52 | bool validatePage(); 53 | void regenSummary(); 54 | QMap calcCurrentRings(); 55 | QMap calcSkills(); 56 | }; 57 | 58 | #endif // NEWCHARWIZARDPAGE4_H 59 | -------------------------------------------------------------------------------- /PaperBlossoms/src/characterwizard/newcharwizardpage5.h: -------------------------------------------------------------------------------- 1 | /* 2 | * ******************************************************************* 3 | * This file is part of the Paper Blossoms application 4 | * (https://github.com/dashnine/PaperBlossoms). 5 | * Copyright (c) 2019 Kyle Hankins (dashnine) 6 | * 7 | * This program is free software: you can redistribute it and/or modify 8 | * it under the terms of the GNU General Public License as published by 9 | * the Free Software Foundation, version 3. 10 | * 11 | * This program is distributed in the hope that it will be useful, but 12 | * WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 14 | * General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with this program. If not, see . 18 | * 19 | * The Legend of the Five Rings Roleplaying Game is the creation 20 | * and property of Fantasy Flight Games. 21 | * ******************************************************************* 22 | */ 23 | 24 | #ifndef NEWCHARWIZARDPAGE5_H 25 | #define NEWCHARWIZARDPAGE5_H 26 | #include "../dependency/databasedependency.h" 27 | 28 | #include 29 | 30 | namespace Ui { 31 | class NewCharWizardPage5; 32 | } 33 | 34 | class NewCharWizardPage5 : public QWizardPage 35 | { 36 | Q_OBJECT 37 | 38 | public: 39 | explicit NewCharWizardPage5(DatabaseDependency *deps, QWidget *parent = 0); 40 | ~NewCharWizardPage5(); 41 | 42 | private: 43 | Ui::NewCharWizardPage5 *ui; 44 | DatabaseDependency* deps; 45 | void initializePage(); 46 | void regenSummary(); 47 | QMap calcCurrentRings(); 48 | QMap calcSkills(); 49 | }; 50 | 51 | #endif // NEWCHARWIZARDPAGE5_H 52 | -------------------------------------------------------------------------------- /PaperBlossoms/src/characterwizard/newcharwizardpage6.h: -------------------------------------------------------------------------------- 1 | /* 2 | * ******************************************************************* 3 | * This file is part of the Paper Blossoms application 4 | * (https://github.com/dashnine/PaperBlossoms). 5 | * Copyright (c) 2019 Kyle Hankins (dashnine) 6 | * 7 | * This program is free software: you can redistribute it and/or modify 8 | * it under the terms of the GNU General Public License as published by 9 | * the Free Software Foundation, version 3. 10 | * 11 | * This program is distributed in the hope that it will be useful, but 12 | * WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 14 | * General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with this program. If not, see . 18 | * 19 | * The Legend of the Five Rings Roleplaying Game is the creation 20 | * and property of Fantasy Flight Games. 21 | * ******************************************************************* 22 | */ 23 | 24 | #ifndef NEWCHARWIZARDPAGE6_H 25 | #define NEWCHARWIZARDPAGE6_H 26 | 27 | #include 28 | #include "../dependency/databasedependency.h" 29 | #include 30 | 31 | namespace Ui { 32 | class NewCharWizardPage6; 33 | } 34 | 35 | class NewCharWizardPage6 : public QWizardPage 36 | { 37 | Q_OBJECT 38 | 39 | public: 40 | explicit NewCharWizardPage6(DatabaseDependency *deps, QWidget *parent = 0); 41 | ~NewCharWizardPage6(); 42 | 43 | private slots: 44 | void on_nc6_q18_ancestor1_rollButton_clicked(); 45 | 46 | void on_nc6_q18_ancestor2_rollButton_clicked(); 47 | 48 | void on_nc6_q18_ancestor1_comboBox_currentIndexChanged(const QString &arg1); 49 | 50 | void on_nc6_q18_ancestor2_comboBox_currentIndexChanged(const QString &arg1); 51 | 52 | void on_nc6_q18_ancestor1_radioButton_toggled(bool checked); 53 | void on_nc6_q18_ancestor2_radioButton_toggled(bool checked); 54 | 55 | void on_nc6_q18_otherComboBox_currentIndexChanged(const QString &arg1); 56 | 57 | void on_nc6_q18_otherrollButton_clicked(); 58 | 59 | void on_heritagetable_comboBox_currentIndexChanged(const QString &arg1); 60 | 61 | void on_nc6_q18_special1_comboBox_currentIndexChanged(const QString &arg1); 62 | 63 | void on_nc6_q18_special2_comboBox_currentIndexChanged(const QString &arg1); 64 | 65 | void on_nc6_q17_comboBox_currentIndexChanged(const QString &arg1); 66 | 67 | private: 68 | Ui::NewCharWizardPage6 *ui; 69 | DatabaseDependency* deps; 70 | void initializePage(); 71 | void doPopulateEffects(); 72 | void buildq18UI(); 73 | QComboBox* curAncestorBox; 74 | QMap calcCurrentRings(); 75 | void regenSummary(); 76 | QMap calcSkills(); 77 | QMap calcSumRings(); 78 | }; 79 | 80 | #endif // NEWCHARWIZARDPAGE6_H 81 | -------------------------------------------------------------------------------- /PaperBlossoms/src/characterwizard/newcharwizardpage7.h: -------------------------------------------------------------------------------- 1 | /* 2 | * ******************************************************************* 3 | * This file is part of the Paper Blossoms application 4 | * (https://github.com/dashnine/PaperBlossoms). 5 | * Copyright (c) 2019 Kyle Hankins (dashnine) 6 | * 7 | * This program is free software: you can redistribute it and/or modify 8 | * it under the terms of the GNU General Public License as published by 9 | * the Free Software Foundation, version 3. 10 | * 11 | * This program is distributed in the hope that it will be useful, but 12 | * WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 14 | * General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with this program. If not, see . 18 | * 19 | * The Legend of the Five Rings Roleplaying Game is the creation 20 | * and property of Fantasy Flight Games. 21 | * ******************************************************************* 22 | */ 23 | 24 | #ifndef NEWCHARWIZARDPAGE7_H 25 | #define NEWCHARWIZARDPAGE7_H 26 | 27 | #include 28 | #include "../dependency/databasedependency.h" 29 | #include "../character.h" 30 | 31 | namespace Ui { 32 | class NewCharWizardPage7; 33 | } 34 | 35 | class NewCharWizardPage7 : public QWizardPage 36 | { 37 | Q_OBJECT 38 | 39 | public: 40 | explicit NewCharWizardPage7(DatabaseDependency *deps, Character* character, QWidget *parent = 0); 41 | ~NewCharWizardPage7(); 42 | 43 | private slots: 44 | void ringsChanged(const QString dynamicRingString); 45 | void on_nc7_repRing_1_comboBox_currentIndexChanged(const QString &arg1); 46 | 47 | void on_nc7_repRing_2_comboBox_currentIndexChanged(const QString &arg1); 48 | 49 | void on_nc7_repSkill_1_comboBox_currentIndexChanged(const QString &arg1); 50 | 51 | void on_nc7_repSkill_2_comboBox_currentIndexChanged(const QString &arg1); 52 | 53 | void on_nc7_repSkill_3_comboBox_currentIndexChanged(const QString &arg1); 54 | 55 | private: 56 | Ui::NewCharWizardPage7 *ui; 57 | DatabaseDependency* deps; 58 | Character* character; 59 | void initializePage(); 60 | QMap calcSkills(); 61 | QMap calcRings(); 62 | bool validatePage(); 63 | int ring_overflow; 64 | int skill_overflow; 65 | void setVis(); 66 | QList populateItemFields(const QString name, const QString type, const QString cust_qual_1="", const QString cust_qual_2="") const; 67 | }; 68 | 69 | #endif // NEWCHARWIZARDPAGE7_H 70 | -------------------------------------------------------------------------------- /PaperBlossoms/src/clicklabel.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * ******************************************************************* 3 | * This file is part of the Paper Blossoms application 4 | * (https://github.com/dashnine/PaperBlossoms). 5 | * Copyright (c) 2019 Kyle Hankins (dashnine) 6 | * 7 | * This program is free software: you can redistribute it and/or modify 8 | * it under the terms of the GNU General Public License as published by 9 | * the Free Software Foundation, version 3. 10 | * 11 | * This program is distributed in the hope that it will be useful, but 12 | * WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 14 | * General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with this program. If not, see . 18 | * 19 | * The Legend of the Five Rings Roleplaying Game is the creation 20 | * and property of Fantasy Flight Games. 21 | * ******************************************************************* 22 | */ 23 | 24 | #include "clicklabel.h" 25 | #include 26 | 27 | ClickLabel::ClickLabel(QWidget* parent, Qt::WindowFlags f) 28 | : QLabel(parent) { 29 | Q_UNUSED(f) 30 | } 31 | 32 | ClickLabel::~ClickLabel() {} 33 | 34 | void ClickLabel::mousePressEvent(QMouseEvent* event) { 35 | Q_UNUSED(event) 36 | emit clicked(); 37 | } 38 | -------------------------------------------------------------------------------- /PaperBlossoms/src/clicklabel.h: -------------------------------------------------------------------------------- 1 | /* 2 | * ******************************************************************* 3 | * This file is part of the Paper Blossoms application 4 | * (https://github.com/dashnine/PaperBlossoms). 5 | * Copyright (c) 2019 Kyle Hankins (dashnine) 6 | * 7 | * This program is free software: you can redistribute it and/or modify 8 | * it under the terms of the GNU General Public License as published by 9 | * the Free Software Foundation, version 3. 10 | * 11 | * This program is distributed in the hope that it will be useful, but 12 | * WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 14 | * General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with this program. If not, see . 18 | * 19 | * The Legend of the Five Rings Roleplaying Game is the creation 20 | * and property of Fantasy Flight Games. 21 | * ******************************************************************* 22 | */ 23 | 24 | #ifndef CLICKABLELABEL_H 25 | #define CLICKABLELABEL_H 26 | 27 | #include 28 | #include 29 | #include 30 | 31 | class ClickLabel : public QLabel { 32 | Q_OBJECT 33 | 34 | public: 35 | explicit ClickLabel(QWidget* parent = Q_NULLPTR, Qt::WindowFlags f = Qt::WindowFlags()); 36 | ~ClickLabel(); 37 | 38 | signals: 39 | void clicked(); 40 | 41 | protected: 42 | void mousePressEvent(QMouseEvent* event); 43 | 44 | }; 45 | 46 | #endif // CLICKABLELABEL_H 47 | -------------------------------------------------------------------------------- /PaperBlossoms/src/dependency/databasedependency.cpp: -------------------------------------------------------------------------------- 1 | #include "databasedependency.h" 2 | 3 | DatabaseDependency::DatabaseDependency( 4 | DataAccessLayer *dal, 5 | AdvantagesRepository *advantagesRepository, 6 | BondsRepository *bondsRepository, 7 | ClansRepository *clansRepository, 8 | FamiliesRepository *familiesRepository, 9 | HertiagesRepository *hertiagesRepository, 10 | InventoryRepository *inventoryRepository, 11 | RegionsRepository *regionsRepository, 12 | RingsRepository *ringsRepository, 13 | SchoolsRepository *schoolsRepository, 14 | SkillsRepository *skillsRepository, 15 | TechniquesRepository *techniquesRepository, 16 | TitlesRepository *titlesRepository, 17 | UpbringingsRepository *upbringingsRepository 18 | ) { 19 | this->dal = dal; 20 | this->advantagesRepository = advantagesRepository; 21 | this->bondsRepository = bondsRepository; 22 | this->clansRepository = clansRepository; 23 | this->familiesRepository = familiesRepository; 24 | this->hertiagesRepository = hertiagesRepository; 25 | this->inventoryRepository = inventoryRepository; 26 | this->regionsRepository = regionsRepository; 27 | this->ringsRepository = ringsRepository; 28 | this->schoolsRepository = schoolsRepository; 29 | this->skillsRepository = skillsRepository; 30 | this->techniquesRepository = techniquesRepository; 31 | this->titlesRepository = titlesRepository; 32 | this->upbringingsRepository = upbringingsRepository; 33 | } 34 | -------------------------------------------------------------------------------- /PaperBlossoms/src/dependency/databasedependency.h: -------------------------------------------------------------------------------- 1 | #ifndef DATABASEDEPENDENCY_H 2 | #define DATABASEDEPENDENCY_H 3 | 4 | #include "../repository/advantagesrepository.h" 5 | #include "../repository/bondsrepository.h" 6 | #include "../repository/clansrepository.h" 7 | #include "../repository/dataaccesslayer.h" 8 | #include "../repository/familiesRepository.h" 9 | #include "../repository/hertiagesrepository.h" 10 | #include "../repository/inventoryrepository.h" 11 | #include "../repository/regionsrepository.h" 12 | #include "../repository/ringsrepository.h" 13 | #include "../repository/schoolsrepository.h" 14 | #include "../repository/skillsrepository.h" 15 | #include "../repository/techniquesrepository.h" 16 | #include "../repository/titlesrepository.h" 17 | #include "../repository/upbringingsrepository.h" 18 | 19 | class DatabaseDependency { 20 | public: 21 | DatabaseDependency( 22 | DataAccessLayer *dal, 23 | AdvantagesRepository *advantagesRepository, 24 | BondsRepository *bondsRepository, 25 | ClansRepository *clansRepository, 26 | FamiliesRepository *familiesRepository, 27 | HertiagesRepository *hertiagesRepository, 28 | InventoryRepository *inventoryRepository, 29 | RegionsRepository *regionsRepository, 30 | RingsRepository *ringsRepository, 31 | SchoolsRepository *schoolsRepository, 32 | SkillsRepository *skillsRepository, 33 | TechniquesRepository *techniquesRepository, 34 | TitlesRepository *titlesRepository, 35 | UpbringingsRepository *upbringingsRepository 36 | ); 37 | 38 | DataAccessLayer *dal; 39 | AdvantagesRepository *advantagesRepository; 40 | BondsRepository *bondsRepository; 41 | ClansRepository *clansRepository; 42 | FamiliesRepository *familiesRepository; 43 | HertiagesRepository *hertiagesRepository; 44 | InventoryRepository *inventoryRepository; 45 | RegionsRepository *regionsRepository; 46 | RingsRepository *ringsRepository; 47 | SchoolsRepository *schoolsRepository; 48 | SkillsRepository *skillsRepository; 49 | TechniquesRepository *techniquesRepository; 50 | TitlesRepository *titlesRepository; 51 | UpbringingsRepository *upbringingsRepository; 52 | }; 53 | 54 | #endif // DATABASEDEPENDENCY_H 55 | -------------------------------------------------------------------------------- /PaperBlossoms/src/dependency/dependencybuilder.cpp: -------------------------------------------------------------------------------- 1 | #include "dependencybuilder.h" 2 | #include "databasedependency.h" 3 | #include "../repository/advantagesrepository.h" 4 | #include "../repository/bondsrepository.h" 5 | #include "../repository/clansrepository.h" 6 | #include "../repository/dataaccesslayer.h" 7 | #include "../repository/familiesRepository.h" 8 | #include "../repository/hertiagesrepository.h" 9 | #include "../repository/inventoryrepository.h" 10 | #include "../repository/regionsrepository.h" 11 | #include "../repository/ringsrepository.h" 12 | #include "../repository/schoolsrepository.h" 13 | #include "../repository/skillsrepository.h" 14 | #include "../repository/techniquesrepository.h" 15 | #include "../repository/titlesrepository.h" 16 | #include "../repository/upbringingsrepository.h" 17 | 18 | DependencyBuilder::DependencyBuilder() { 19 | 20 | } 21 | 22 | DatabaseDependency* DependencyBuilder::build(QString locale) { 23 | DataAccessLayer *dal = new DataAccessLayer(locale); 24 | 25 | return new DatabaseDependency( 26 | dal, 27 | new AdvantagesRepository(dal), 28 | new BondsRepository(dal), 29 | new ClansRepository(dal), 30 | new FamiliesRepository(dal), 31 | new HertiagesRepository(dal), 32 | new InventoryRepository(dal), 33 | new RegionsRepository(dal), 34 | new RingsRepository(dal), 35 | new SchoolsRepository(dal), 36 | new SkillsRepository(dal), 37 | new TechniquesRepository(dal), 38 | new TitlesRepository(dal), 39 | new UpbringingsRepository(dal) 40 | ); 41 | } 42 | -------------------------------------------------------------------------------- /PaperBlossoms/src/dependency/dependencybuilder.h: -------------------------------------------------------------------------------- 1 | #ifndef DEPENDENCYBUILDER_H 2 | #define DEPENDENCYBUILDER_H 3 | 4 | #include "databasedependency.h" 5 | 6 | class DependencyBuilder 7 | { 8 | public: 9 | DependencyBuilder(); 10 | 11 | DatabaseDependency* build(QString locale); 12 | }; 13 | 14 | #endif // DEPENDENCYBUILDER_H 15 | -------------------------------------------------------------------------------- /PaperBlossoms/src/dialog/aboutdialog.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * ******************************************************************* 3 | * This file is part of the Paper Blossoms application 4 | * (https://github.com/dashnine/PaperBlossoms). 5 | * Copyright (c) 2019 Kyle Hankins (dashnine) 6 | * 7 | * This program is free software: you can redistribute it and/or modify 8 | * it under the terms of the GNU General Public License as published by 9 | * the Free Software Foundation, version 3. 10 | * 11 | * This program is distributed in the hope that it will be useful, but 12 | * WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 14 | * General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with this program. If not, see . 18 | * 19 | * The Legend of the Five Rings Roleplaying Game is the creation 20 | * and property of Fantasy Flight Games. 21 | * ******************************************************************* 22 | */ 23 | 24 | #include "aboutdialog.h" 25 | #include "ui_aboutdialog.h" 26 | #include 27 | 28 | AboutDialog::AboutDialog(QWidget *parent) : 29 | QDialog(parent), 30 | ui(new Ui::AboutDialog) 31 | { 32 | ui->setupUi(this); 33 | this->setWindowIcon(QIcon(":/images/resources/sakura.png")); 34 | ui->versionlabel->setText("Version: 1.4.0 (Compiled "+ QString(__DATE__) + QString(__TIME__)+")"); 35 | } 36 | 37 | AboutDialog::~AboutDialog() 38 | { 39 | delete ui; 40 | } 41 | -------------------------------------------------------------------------------- /PaperBlossoms/src/dialog/aboutdialog.h: -------------------------------------------------------------------------------- 1 | /* 2 | * ******************************************************************* 3 | * This file is part of the Paper Blossoms application 4 | * (https://github.com/dashnine/PaperBlossoms). 5 | * Copyright (c) 2019 Kyle Hankins (dashnine) 6 | * 7 | * This program is free software: you can redistribute it and/or modify 8 | * it under the terms of the GNU General Public License as published by 9 | * the Free Software Foundation, version 3. 10 | * 11 | * This program is distributed in the hope that it will be useful, but 12 | * WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 14 | * General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with this program. If not, see . 18 | * 19 | * The Legend of the Five Rings Roleplaying Game is the creation 20 | * and property of Fantasy Flight Games. 21 | * ******************************************************************* 22 | */ 23 | 24 | #ifndef ABOUTDIALOG_H 25 | #define ABOUTDIALOG_H 26 | 27 | #include 28 | 29 | namespace Ui { 30 | class AboutDialog; 31 | } 32 | 33 | class AboutDialog : public QDialog 34 | { 35 | Q_OBJECT 36 | 37 | public: 38 | explicit AboutDialog(QWidget *parent = 0); 39 | ~AboutDialog(); 40 | 41 | private: 42 | Ui::AboutDialog *ui; 43 | }; 44 | 45 | #endif // ABOUTDIALOG_H 46 | -------------------------------------------------------------------------------- /PaperBlossoms/src/dialog/addadvancedialog.h: -------------------------------------------------------------------------------- 1 | /* 2 | * ******************************************************************* 3 | * This file is part of the Paper Blossoms application 4 | * (https://github.com/dashnine/PaperBlossoms). 5 | * Copyright (c) 2019 Kyle Hankins (dashnine) 6 | * 7 | * This program is free software: you can redistribute it and/or modify 8 | * it under the terms of the GNU General Public License as published by 9 | * the Free Software Foundation, version 3. 10 | * 11 | * This program is distributed in the hope that it will be useful, but 12 | * WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 14 | * General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with this program. If not, see . 18 | * 19 | * The Legend of the Five Rings Roleplaying Game is the creation 20 | * and property of Fantasy Flight Games. 21 | * ******************************************************************* 22 | */ 23 | 24 | #ifndef ADDADVANCEDIALOG_H 25 | #define ADDADVANCEDIALOG_H 26 | 27 | #include 28 | #include 29 | #include "../dependency/databasedependency.h" 30 | #include "../character.h" 31 | #include 32 | 33 | namespace Ui { 34 | class AddAdvanceDialog; 35 | } 36 | 37 | class AddAdvanceDialog : public QDialog 38 | { 39 | Q_OBJECT 40 | 41 | public: 42 | explicit AddAdvanceDialog(DatabaseDependency* deps, Character *character, QString sel = "", QString option = "", QWidget *parent = 0); 43 | ~AddAdvanceDialog(); 44 | 45 | QString getResult() const; 46 | private slots: 47 | void on_advtype_currentIndexChanged(const QString &arg1); 48 | 49 | void on_advchooser_combobox_currentIndexChanged(const QString &arg1); 50 | 51 | void on_curriculum_radioButton_clicked(); 52 | 53 | void on_title_radioButton_clicked(); 54 | 55 | void on_detailTableView_clicked(const QModelIndex &index); 56 | 57 | void on_free_radioButton_toggled(const bool checked); 58 | 59 | void on_halfxp_checkBox_toggled(bool checked); 60 | 61 | void on_restrictioncheckBox_toggled(bool checked); 62 | 63 | private: 64 | Ui::AddAdvanceDialog *ui; 65 | DatabaseDependency* deps; 66 | Character* character; 67 | 68 | bool removerestrictions; 69 | 70 | void validatePage(); 71 | QStandardItemModel techModel; 72 | QSortFilterProxyModel proxyModel; 73 | QSqlQueryModel curriculumModel; 74 | void populateTechModel(); 75 | void addTechRow(QStringList tech); 76 | }; 77 | 78 | #endif // ADDADVANCEDIALOG_H 79 | -------------------------------------------------------------------------------- /PaperBlossoms/src/dialog/addbonddialog.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * ******************************************************************* 3 | * This file is part of the Paper Blossoms application 4 | * (https://github.com/dashnine/PaperBlossoms). 5 | * Copyright (c) 2019 Kyle Hankins (dashnine) 6 | * 7 | * This program is free software: you can redistribute it and/or modify 8 | * it under the terms of the GNU General Public License as published by 9 | * the Free Software Foundation, version 3. 10 | * 11 | * This program is distributed in the hope that it will be useful, but 12 | * WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 14 | * General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with this program. If not, see . 18 | * 19 | * The Legend of the Five Rings Roleplaying Game is the creation 20 | * and property of Fantasy Flight Games. 21 | * ******************************************************************* 22 | */ 23 | 24 | #include "addbonddialog.h" 25 | #include "ui_addbonddialog.h" 26 | 27 | AddBondDialog::AddBondDialog(DatabaseDependency* deps, Character* character, QString type,QWidget *parent) : 28 | QDialog(parent), 29 | ui(new Ui::AddBondDialog) 30 | { 31 | ui->setupUi(this); 32 | this->setWindowIcon(QIcon(":/images/resources/sakura.png")); 33 | this->character = character; 34 | this->deps = deps; 35 | ui->passionwarning->setVisible(type=="Bonds"); 36 | 37 | ui->traitComboBox->addItems(deps->bondsRepository->qsl_getbonds()); 38 | } 39 | 40 | AddBondDialog::~AddBondDialog() 41 | { 42 | delete ui; 43 | } 44 | 45 | QStringList AddBondDialog::getResult() const { 46 | QStringList resultlist; 47 | resultlist.append(deps->bondsRepository->qsl_getbond(ui->traitComboBox->currentText())); 48 | if(resultlist.count()>0) resultlist.insert(1,"1"); //a new bond is always rank 1 49 | return resultlist; 50 | } 51 | -------------------------------------------------------------------------------- /PaperBlossoms/src/dialog/addbonddialog.h: -------------------------------------------------------------------------------- 1 | /* 2 | * ******************************************************************* 3 | * This file is part of the Paper Blossoms application 4 | * (https://github.com/dashnine/PaperBlossoms). 5 | * Copyright (c) 2019 Kyle Hankins (dashnine) 6 | * 7 | * This program is free software: you can redistribute it and/or modify 8 | * it under the terms of the GNU General Public License as published by 9 | * the Free Software Foundation, version 3. 10 | * 11 | * This program is distributed in the hope that it will be useful, but 12 | * WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 14 | * General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with this program. If not, see . 18 | * 19 | * The Legend of the Five Rings Roleplaying Game is the creation 20 | * and property of Fantasy Flight Games. 21 | * ******************************************************************* 22 | */ 23 | 24 | #ifndef ADDBONDDIALOG_H 25 | #define ADDBONDDIALOG_H 26 | 27 | #include 28 | #include "../dependency/databasedependency.h" 29 | #include "../character.h" 30 | 31 | namespace Ui { 32 | class AddBondDialog; 33 | } 34 | 35 | class AddBondDialog : public QDialog 36 | { 37 | Q_OBJECT 38 | 39 | public: 40 | explicit AddBondDialog(DatabaseDependency* deps, Character *character, QString type, QWidget *parent = 0); 41 | ~AddBondDialog(); 42 | 43 | QStringList getResult() const; 44 | private: 45 | Ui::AddBondDialog *ui; 46 | DatabaseDependency* deps; 47 | Character* character; 48 | }; 49 | 50 | #endif // ADDDBONDDIALOG_H 51 | -------------------------------------------------------------------------------- /PaperBlossoms/src/dialog/adddisadvdialog.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * ******************************************************************* 3 | * This file is part of the Paper Blossoms application 4 | * (https://github.com/dashnine/PaperBlossoms). 5 | * Copyright (c) 2019 Kyle Hankins (dashnine) 6 | * 7 | * This program is free software: you can redistribute it and/or modify 8 | * it under the terms of the GNU General Public License as published by 9 | * the Free Software Foundation, version 3. 10 | * 11 | * This program is distributed in the hope that it will be useful, but 12 | * WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 14 | * General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with this program. If not, see . 18 | * 19 | * The Legend of the Five Rings Roleplaying Game is the creation 20 | * and property of Fantasy Flight Games. 21 | * ******************************************************************* 22 | */ 23 | 24 | #include "adddisadvdialog.h" 25 | #include "ui_adddisadvdialog.h" 26 | 27 | AddDisAdvDialog::AddDisAdvDialog(DatabaseDependency* deps, Character* character, QString type,QWidget *parent) : 28 | QDialog(parent), 29 | ui(new Ui::AddDisAdvDialog) 30 | { 31 | ui->setupUi(this); 32 | this->setWindowIcon(QIcon(":/images/resources/sakura.png")); 33 | this->character = character; 34 | this->deps = deps; 35 | ui->passionwarning->setVisible(type=="Passions"); 36 | 37 | ui->traitComboBox->addItems(deps->advantagesRepository->qsl_getadvdisadv(type)); 38 | } 39 | 40 | AddDisAdvDialog::~AddDisAdvDialog() 41 | { 42 | delete ui; 43 | } 44 | 45 | QString AddDisAdvDialog::getResult() const { 46 | return ui->traitComboBox->currentText(); 47 | } 48 | -------------------------------------------------------------------------------- /PaperBlossoms/src/dialog/adddisadvdialog.h: -------------------------------------------------------------------------------- 1 | /* 2 | * ******************************************************************* 3 | * This file is part of the Paper Blossoms application 4 | * (https://github.com/dashnine/PaperBlossoms). 5 | * Copyright (c) 2019 Kyle Hankins (dashnine) 6 | * 7 | * This program is free software: you can redistribute it and/or modify 8 | * it under the terms of the GNU General Public License as published by 9 | * the Free Software Foundation, version 3. 10 | * 11 | * This program is distributed in the hope that it will be useful, but 12 | * WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 14 | * General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with this program. If not, see . 18 | * 19 | * The Legend of the Five Rings Roleplaying Game is the creation 20 | * and property of Fantasy Flight Games. 21 | * ******************************************************************* 22 | */ 23 | 24 | #ifndef ADDDISADVDIALOG_H 25 | #define ADDDISADVDIALOG_H 26 | 27 | #include 28 | #include "../dependency/databasedependency.h" 29 | #include "../character.h" 30 | 31 | namespace Ui { 32 | class AddDisAdvDialog; 33 | } 34 | 35 | class AddDisAdvDialog : public QDialog 36 | { 37 | Q_OBJECT 38 | 39 | public: 40 | explicit AddDisAdvDialog(DatabaseDependency* deps, Character *character, QString type, QWidget *parent = 0); 41 | ~AddDisAdvDialog(); 42 | 43 | QString getResult() const; 44 | private: 45 | Ui::AddDisAdvDialog *ui; 46 | DatabaseDependency* deps; 47 | Character* character; 48 | }; 49 | 50 | #endif // ADDDISADVDIALOG_H 51 | -------------------------------------------------------------------------------- /PaperBlossoms/src/dialog/additemdialog.h: -------------------------------------------------------------------------------- 1 | /* 2 | * ******************************************************************* 3 | * This file is part of the Paper Blossoms application 4 | * (https://github.com/dashnine/PaperBlossoms). 5 | * Copyright (c) 2019 Kyle Hankins (dashnine) 6 | * 7 | * This program is free software: you can redistribute it and/or modify 8 | * it under the terms of the GNU General Public License as published by 9 | * the Free Software Foundation, version 3. 10 | * 11 | * This program is distributed in the hope that it will be useful, but 12 | * WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 14 | * General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with this program. If not, see . 18 | * 19 | * The Legend of the Five Rings Roleplaying Game is the creation 20 | * and property of Fantasy Flight Games. 21 | * ******************************************************************* 22 | */ 23 | 24 | #ifndef ADDITEMDIALOG_H 25 | #define ADDITEMDIALOG_H 26 | 27 | #include 28 | #include "../dependency/databasedependency.h" 29 | #include "../character.h" 30 | #include 31 | 32 | namespace Ui { 33 | class AddItemDialog; 34 | } 35 | 36 | class AddItemDialog : public QDialog 37 | { 38 | Q_OBJECT 39 | 40 | public: 41 | explicit AddItemDialog(DatabaseDependency* deps, Character *character, QString type, QWidget *parent = 0); 42 | ~AddItemDialog(); 43 | 44 | QList getResult() const; 45 | private slots: 46 | void on_itemtemplate_combobox_currentIndexChanged(const QString &arg1); 47 | 48 | void on_qual_add_pushButton_clicked(); 49 | 50 | void on_qual_rem_pushButton_clicked(); 51 | 52 | void on_pattern_add_pushButton_clicked(); 53 | 54 | private: 55 | Ui::AddItemDialog *ui; 56 | DatabaseDependency* deps; 57 | Character* character; 58 | QString type; 59 | QStringListModel qualities; 60 | void clearFields(); 61 | }; 62 | 63 | #endif // ADDITEMDIALOG_H 64 | -------------------------------------------------------------------------------- /PaperBlossoms/src/dialog/addtitledialog.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * ******************************************************************* 3 | * This file is part of the Paper Blossoms application 4 | * (https://github.com/dashnine/PaperBlossoms). 5 | * Copyright (c) 2019 Kyle Hankins (dashnine) 6 | * 7 | * This program is free software: you can redistribute it and/or modify 8 | * it under the terms of the GNU General Public License as published by 9 | * the Free Software Foundation, version 3. 10 | * 11 | * This program is distributed in the hope that it will be useful, but 12 | * WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 14 | * General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with this program. If not, see . 18 | * 19 | * The Legend of the Five Rings Roleplaying Game is the creation 20 | * and property of Fantasy Flight Games. 21 | * ******************************************************************* 22 | */ 23 | 24 | #include "addtitledialog.h" 25 | #include "ui_addtitledialog.h" 26 | 27 | AddTitleDialog::AddTitleDialog(DatabaseDependency* deps, Character* character, QWidget *parent) : 28 | QDialog(parent), 29 | ui(new Ui::AddTitleDialog) 30 | { 31 | ui->setupUi(this); 32 | this->setWindowIcon(QIcon(":/images/resources/sakura.png")); 33 | this->deps = deps; 34 | this->character = character; 35 | ui->title_combobox->addItems(deps->titlesRepository->qsl_gettitles()); 36 | title = ""; 37 | ui->title_combobox->setCurrentIndex(-1); 38 | } 39 | 40 | AddTitleDialog::~AddTitleDialog() 41 | { 42 | delete ui; 43 | } 44 | 45 | void AddTitleDialog::on_title_combobox_currentIndexChanged(const QString &arg1) 46 | { 47 | 48 | title = arg1; 49 | 50 | ui->reference_label->setText(deps->titlesRepository->qs_gettitleref(arg1)); 51 | ui->xp_label->setText(deps->titlesRepository->qs_gettitlexp(arg1)); 52 | ui->ability_label->setText(deps->titlesRepository->qs_gettitleability(arg1)); 53 | } 54 | 55 | QString AddTitleDialog::getResult() const { 56 | return title; 57 | } 58 | -------------------------------------------------------------------------------- /PaperBlossoms/src/dialog/addtitledialog.h: -------------------------------------------------------------------------------- 1 | #ifndef ADDTITLEDIALOG_H 2 | #define ADDTITLEDIALOG_H 3 | 4 | #include 5 | #include "../dependency/databasedependency.h" 6 | #include "../character.h" 7 | 8 | namespace Ui { 9 | class AddTitleDialog; 10 | } 11 | 12 | class AddTitleDialog : public QDialog 13 | { 14 | Q_OBJECT 15 | 16 | public: 17 | explicit AddTitleDialog(DatabaseDependency* deps, Character *character, QWidget *parent = 0); 18 | ~AddTitleDialog(); 19 | 20 | QString getResult() const; 21 | private slots: 22 | void on_title_combobox_currentIndexChanged(const QString &arg1); 23 | 24 | private: 25 | Ui::AddTitleDialog *ui; 26 | DatabaseDependency* deps; 27 | Character* character; 28 | 29 | QString title; 30 | }; 31 | 32 | #endif // ADDTITLEDIALOG_H 33 | -------------------------------------------------------------------------------- /PaperBlossoms/src/dialog/dblocalisationeditordialog.cpp: -------------------------------------------------------------------------------- 1 | #include "dblocalisationeditordialog.h" 2 | #include "ui_dblocalisationeditordialog.h" 3 | #include 4 | #include 5 | #include 6 | #include 7 | #include 8 | #include 9 | 10 | DBLocalisationEditorDialog::DBLocalisationEditorDialog(DatabaseDependency* deps,QWidget *parent) : 11 | QDialog(parent), 12 | ui(new Ui::DBLocalisationEditorDialog) 13 | { 14 | ui->setupUi(this); 15 | 16 | this->deps = deps; 17 | 18 | 19 | this->model = new QSqlTableModel(); 20 | model->setTable("i18n"); 21 | model->setEditStrategy(QSqlTableModel::OnManualSubmit); 22 | model->select(); 23 | model->setHeaderData(0, Qt::Horizontal, tr("string")); 24 | model->setHeaderData(1, Qt::Horizontal, tr("string_tr")); 25 | 26 | this->simodel = new QStandardItemModel; 27 | 28 | foreach (QStringList row, deps->dal->ql_gettrtemplate()) { 29 | 30 | //generate row and add it to model 31 | QList itemrow; 32 | itemrow << new QStandardItem(row.at(0)); 33 | itemrow << new QStandardItem(row.at(1)); 34 | simodel->appendRow(itemrow); 35 | } 36 | 37 | ui->descTableView->setModel(this->model); 38 | //ui->optionComboBox->addItems(dal->qsl_getdescribablenames()); 39 | ui->apply_pushbutton->setEnabled(false); 40 | ui->descTableView->resizeColumnToContents(1); 41 | connect(model,SIGNAL(dataChanged (const QModelIndex &, const QModelIndex &)),this,SLOT(dataChanged())); 42 | //ui->optionComboBox->setCurrentIndex(-1); 43 | //ui->label->setVisible(false); 44 | 45 | //ui->descTableView->horizontalHeader()->swapSections(1,2); 46 | ui->descTableView->horizontalHeader()->setStretchLastSection(true); 47 | ui->descTableView->verticalHeader()->setSectionResizeMode(QHeaderView::ResizeToContents); 48 | 49 | //Horrible hack to make row resizing work right. Make this not so, plz. 50 | QTimer::singleShot(1, ui->descTableView, SLOT(resizeRowsToContents())); 51 | } 52 | 53 | DBLocalisationEditorDialog::~DBLocalisationEditorDialog() 54 | { 55 | delete ui; 56 | delete model; 57 | } 58 | 59 | void DBLocalisationEditorDialog::doFinish(bool accepted) 60 | { 61 | 62 | if(accepted){ 63 | model->submitAll(); 64 | } 65 | else{ 66 | model->revertAll(); 67 | } 68 | 69 | } 70 | 71 | 72 | void DBLocalisationEditorDialog::on_apply_pushbutton_clicked() 73 | { 74 | 75 | model->submitAll(); 76 | for(int i=0; irowCount(); ++i){ 77 | ui->descTableView->showRow(i); 78 | } 79 | ui->apply_pushbutton->setEnabled(false); 80 | //ui->label->setVisible(true); 81 | 82 | } 83 | 84 | void DBLocalisationEditorDialog::dataChanged() 85 | { 86 | ui->apply_pushbutton->setEnabled(true); 87 | //ui->label->setVisible(true); 88 | 89 | } 90 | 91 | 92 | void DBLocalisationEditorDialog::on_buttonBox_accepted() 93 | { 94 | qDebug()<<"accepted"; 95 | this->accept(); 96 | } 97 | 98 | void DBLocalisationEditorDialog::on_buttonBox_rejected() 99 | { 100 | this->reject(); 101 | } 102 | -------------------------------------------------------------------------------- /PaperBlossoms/src/dialog/dblocalisationeditordialog.h: -------------------------------------------------------------------------------- 1 | #ifndef DBLOCALISATIONEDITORDIALOG_H 2 | #define DBLOCALISATIONEDITORDIALOG_H 3 | 4 | #include 5 | #include "../dependency/databasedependency.h" 6 | #include 7 | 8 | namespace Ui { 9 | class DBLocalisationEditorDialog; 10 | } 11 | 12 | class DBLocalisationEditorDialog : public QDialog 13 | { 14 | Q_OBJECT 15 | 16 | public: 17 | explicit DBLocalisationEditorDialog(DatabaseDependency* deps, QWidget *parent = nullptr); 18 | ~DBLocalisationEditorDialog(); 19 | void doFinish(bool accepted); 20 | 21 | private slots: 22 | 23 | 24 | void on_apply_pushbutton_clicked(); 25 | 26 | void dataChanged(); 27 | 28 | 29 | 30 | void on_buttonBox_accepted(); 31 | 32 | void on_buttonBox_rejected(); 33 | 34 | private: 35 | Ui::DBLocalisationEditorDialog *ui; 36 | QSqlTableModel* model; 37 | QStandardItemModel* simodel; 38 | DatabaseDependency* deps; 39 | 40 | }; 41 | 42 | #endif // DBLOCALISATIONEDITORDIALOG_H 43 | -------------------------------------------------------------------------------- /PaperBlossoms/src/dialog/edituserdescriptionsdialog.cpp: -------------------------------------------------------------------------------- 1 | #include "edituserdescriptionsdialog.h" 2 | #include "ui_edituserdescriptionsdialog.h" 3 | #include "../dependency/databasedependency.h" 4 | #include 5 | #include 6 | #include 7 | #include 8 | 9 | EditUserDescriptionsDialog::EditUserDescriptionsDialog(DatabaseDependency* deps, QWidget *parent) : 10 | QDialog(parent), 11 | ui(new Ui::EditUserDescriptionsDialog) 12 | { 13 | ui->setupUi(this); 14 | this->deps = deps; 15 | 16 | this->model = new QSqlTableModel(); 17 | model->setTable("user_descriptions"); 18 | model->setEditStrategy(QSqlTableModel::OnManualSubmit); 19 | model->select(); 20 | model->setHeaderData(0, Qt::Horizontal, tr("Field")); 21 | model->setHeaderData(1, Qt::Horizontal, tr("Description")); 22 | model->setHeaderData(2, Qt::Horizontal, tr("Short Desc")); 23 | 24 | 25 | 26 | ui->descTableView->setModel(this->model); 27 | ui->optionComboBox->addItems(deps->dal->qsl_getdescribablenames()); 28 | ui->apply_pushbutton->setEnabled(false); 29 | ui->descTableView->resizeColumnToContents(2); 30 | connect(model,SIGNAL(dataChanged (const QModelIndex &, const QModelIndex &)),this,SLOT(dataChanged())); 31 | ui->optionComboBox->setCurrentIndex(-1); 32 | ui->label->setVisible(false); 33 | 34 | ui->descTableView->horizontalHeader()->swapSections(1,2); 35 | ui->descTableView->horizontalHeader()->setStretchLastSection(true); 36 | ui->descTableView->verticalHeader()->setSectionResizeMode(QHeaderView::ResizeToContents); 37 | 38 | //Horrible hack to make row resizing work right. Make this not so, plz. 39 | QTimer::singleShot(1, ui->descTableView, SLOT(resizeRowsToContents())); 40 | } 41 | 42 | EditUserDescriptionsDialog::~EditUserDescriptionsDialog() 43 | { 44 | delete ui; 45 | } 46 | 47 | void EditUserDescriptionsDialog::doFinish(bool accepted) 48 | { 49 | if(accepted){ 50 | model->submitAll(); 51 | } 52 | else{ 53 | model->revertAll(); 54 | } 55 | } 56 | 57 | void EditUserDescriptionsDialog::on_pushButton_clicked() 58 | { 59 | //TODO: Move this into DAL? 60 | QSqlField namefield("name",QVariant::String); 61 | namefield.setValue(ui->optionComboBox->currentText().toHtmlEscaped()); // casts QString to int 62 | QSqlField descfield("description",QVariant::String); 63 | descfield.setValue(ui->textEdit->toPlainText().toHtmlEscaped()); // casts QString to int 64 | QSqlField sdescfield("short_desc",QVariant::String); 65 | sdescfield.setValue(ui->lineEdit->text().toHtmlEscaped()); // casts QString to int 66 | 67 | QSqlRecord record; 68 | record.append(namefield); 69 | record.append(descfield); 70 | record.append(sdescfield); 71 | 72 | model->insertRecord(-1,record); 73 | ui->apply_pushbutton->setEnabled(true); 74 | ui->descTableView->resizeColumnToContents(2); 75 | 76 | //clear the data 77 | ui->lineEdit->clear(); 78 | ui->textEdit->setText(""); 79 | ui->optionComboBox->setCurrentIndex(-1); 80 | 81 | } 82 | 83 | void EditUserDescriptionsDialog::on_apply_pushbutton_clicked() 84 | { 85 | model->submitAll(); 86 | for(int i=0; irowCount(); ++i){ 87 | ui->descTableView->showRow(i); 88 | } 89 | ui->apply_pushbutton->setEnabled(false); 90 | ui->label->setVisible(true); 91 | } 92 | 93 | void EditUserDescriptionsDialog::dataChanged() 94 | { 95 | ui->apply_pushbutton->setEnabled(true); 96 | //ui->label->setVisible(true); 97 | 98 | } 99 | 100 | void EditUserDescriptionsDialog::on_delete_pushButton_clicked() 101 | { 102 | const QModelIndex curIndex = ui->descTableView->currentIndex(); 103 | 104 | if(curIndex.isValid()){ 105 | if(QMessageBox::Cancel==QMessageBox::information(this, tr("Warning: Unreversable Change"), "Warning: This will immediately save all changes. This action cannot be undone. Continue?",QMessageBox::Yes|QMessageBox::Cancel)){ 106 | return; 107 | } 108 | //ui->descTableView->hideRow(curIndex.row()); 109 | model->removeRow(curIndex.row()); 110 | model->submitAll(); 111 | ui->apply_pushbutton->setEnabled(false); 112 | 113 | } 114 | ui->label->setVisible(true); 115 | 116 | } 117 | 118 | void EditUserDescriptionsDialog::on_optionComboBox_currentIndexChanged(int index) 119 | { 120 | ui->pushButton->setEnabled(index>=0); 121 | } 122 | -------------------------------------------------------------------------------- /PaperBlossoms/src/dialog/edituserdescriptionsdialog.h: -------------------------------------------------------------------------------- 1 | #ifndef EDITUSERDESCRIPTIONSDIALOG_H 2 | #define EDITUSERDESCRIPTIONSDIALOG_H 3 | 4 | #include 5 | #include 6 | #include "../dependency/databasedependency.h" 7 | 8 | namespace Ui { 9 | class EditUserDescriptionsDialog; 10 | } 11 | 12 | class EditUserDescriptionsDialog : public QDialog 13 | { 14 | Q_OBJECT 15 | 16 | public: 17 | explicit EditUserDescriptionsDialog(DatabaseDependency* deps, QWidget *parent = nullptr); 18 | ~EditUserDescriptionsDialog(); 19 | void doFinish(bool accepted); 20 | 21 | private slots: 22 | void on_pushButton_clicked(); 23 | 24 | 25 | void on_apply_pushbutton_clicked(); 26 | 27 | void dataChanged(); 28 | 29 | void on_delete_pushButton_clicked(); 30 | 31 | void on_optionComboBox_currentIndexChanged(int index); 32 | 33 | private: 34 | Ui::EditUserDescriptionsDialog *ui; 35 | QSqlTableModel* model; 36 | DatabaseDependency* deps; 37 | }; 38 | 39 | #endif // EDITUSERDESCRIPTIONSDIALOG_H 40 | -------------------------------------------------------------------------------- /PaperBlossoms/src/dialog/renderdialog.h: -------------------------------------------------------------------------------- 1 | /* 2 | * ******************************************************************* 3 | * This file is part of the Paper Blossoms application 4 | * (https://github.com/dashnine/PaperBlossoms). 5 | * Copyright (c) 2019 Kyle Hankins (dashnine) 6 | * 7 | * This program is free software: you can redistribute it and/or modify 8 | * it under the terms of the GNU General Public License as published by 9 | * the Free Software Foundation, version 3. 10 | * 11 | * This program is distributed in the hope that it will be useful, but 12 | * WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 14 | * General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with this program. If not, see . 18 | * 19 | * The Legend of the Five Rings Roleplaying Game is the creation 20 | * and property of Fantasy Flight Games. 21 | * ******************************************************************* 22 | */ 23 | 24 | #ifndef RENDERDIALOG_H 25 | #define RENDERDIALOG_H 26 | 27 | #include 28 | #include "../pboutputdata.h" 29 | #include 30 | #include 31 | 32 | namespace Ui { 33 | class RenderDialog; 34 | } 35 | 36 | class RenderDialog : public QDialog 37 | { 38 | Q_OBJECT 39 | 40 | public: 41 | explicit RenderDialog(PBOutputData *charData, QWidget *parent = 0); 42 | ~RenderDialog(); 43 | 44 | private slots: 45 | 46 | void on_printButton_clicked(); 47 | void on_cancelButton_clicked(); 48 | 49 | void on_hideskill_checkbox_toggled(const bool checked); 50 | 51 | void on_hideportrait_checkbox_toggled(const bool checked); 52 | 53 | void on_browserButton_clicked(); 54 | 55 | private: 56 | Ui::RenderDialog *ui; 57 | PBOutputData* m_character; 58 | 59 | QString m_curHtml; 60 | QString m_template; 61 | QByteArray m_img; 62 | QByteArray m_ringimg; 63 | void setTemplate(const QString filename); 64 | QString generateHtml(); 65 | 66 | QPrinter printer; 67 | QTemporaryFile* tempFile; 68 | QString newlineToBR(QString text); 69 | const int MAXSIZE = 500; //max pixels for portrait 70 | 71 | }; 72 | 73 | #endif // RENDERDIALOG_H 74 | -------------------------------------------------------------------------------- /PaperBlossoms/src/dynamicchoicewidget.h: -------------------------------------------------------------------------------- 1 | /* 2 | * ******************************************************************* 3 | * This file is part of the Paper Blossoms application 4 | * (https://github.com/dashnine/PaperBlossoms). 5 | * Copyright (c) 2019 Kyle Hankins (dashnine) 6 | * 7 | * This program is free software: you can redistribute it and/or modify 8 | * it under the terms of the GNU General Public License as published by 9 | * the Free Software Foundation, version 3. 10 | * 11 | * This program is distributed in the hope that it will be useful, but 12 | * WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 14 | * General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with this program. If not, see . 18 | * 19 | * The Legend of the Five Rings Roleplaying Game is the creation 20 | * and property of Fantasy Flight Games. 21 | * ******************************************************************* 22 | */ 23 | 24 | #ifndef DYNAMICCHOICEWIDGET_H 25 | #define DYNAMICCHOICEWIDGET_H 26 | 27 | #include 28 | #include 29 | #include 30 | #include 31 | #include 32 | #include 33 | #include "dependency/databasedependency.h" 34 | 35 | namespace Ui { 36 | class DynamicChoiceWidget; 37 | } 38 | 39 | class DynamicChoiceWidget : public QWidget 40 | { 41 | Q_OBJECT 42 | Q_PROPERTY(QString selections MEMBER m_selections NOTIFY selectionsChanged) 43 | 44 | public: 45 | explicit DynamicChoiceWidget( QWidget *parent = 0); 46 | ~DynamicChoiceWidget(); 47 | 48 | void addCBox(QStringList options, QString value= ""); 49 | QStringList getCurrent(); 50 | 51 | void updateSelections(const QStringList currentList); 52 | QString getSelections() const; 53 | void setSelections(const QString selections); 54 | void clear(); 55 | signals: 56 | void dataChanged(QStringList); 57 | void selectionsChanged(const QString &newText); 58 | 59 | private slots: 60 | void dataEntered(); 61 | 62 | private: 63 | Ui::DynamicChoiceWidget *ui; 64 | 65 | QFrame* baseFrame; 66 | QGridLayout* frameLayout; 67 | QMap m_showFieldMap;//map determining whether or not field is visible 68 | 69 | bool m_isValid; 70 | void validateBox(); 71 | 72 | QString m_selections = ""; 73 | enum COLUMNS { Label,ComboBox,LineEdit}; 74 | }; 75 | 76 | #endif // DYNAMICCHOICEWIDGET_H 77 | -------------------------------------------------------------------------------- /PaperBlossoms/src/enums.h: -------------------------------------------------------------------------------- 1 | /* 2 | * ******************************************************************* 3 | * This file is part of the Paper Blossoms application 4 | * (https://github.com/dashnine/PaperBlossoms). 5 | * Copyright (c) 2019 Kyle Hankins (dashnine) 6 | * 7 | * This program is free software: you can redistribute it and/or modify 8 | * it under the terms of the GNU General Public License as published by 9 | * the Free Software Foundation, version 3. 10 | * 11 | * This program is distributed in the hope that it will be useful, but 12 | * WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 14 | * General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with this program. If not, see . 18 | * 19 | * The Legend of the Five Rings Roleplaying Game is the creation 20 | * and property of Fantasy Flight Games. 21 | * ******************************************************************* 22 | */ 23 | 24 | #ifndef ENUMS_H 25 | #define ENUMS_H 26 | 27 | namespace ItemData{ 28 | enum{ 29 | NAME, 30 | DESCRIPTION, 31 | SHORT_DESC, 32 | REFERENCE_BOOK, 33 | REFERENCE_PAGE, 34 | PRICE_VALUE, 35 | PRICE_UNIT, 36 | RARITY, 37 | SKILL, 38 | GRIP, 39 | RANGE_MIN, 40 | RANGE_MAX, 41 | DAMAGE, 42 | DEADLINESS, 43 | }; 44 | } 45 | 46 | namespace WeaponData{ 47 | enum{ 48 | CATEGORY, 49 | SKILL, 50 | GRIP, 51 | RANGE_MIN, 52 | RANGE_MAX, 53 | DAMAGE, 54 | DEADLINESS 55 | }; 56 | } 57 | 58 | namespace ArmorData { 59 | enum{ 60 | RESIST_CATEGORY, 61 | RESIST_VALUE 62 | }; 63 | } 64 | 65 | namespace Equipment { 66 | enum{ 67 | TYPE, 68 | NAME, 69 | DESC, 70 | SHORT_DESC, 71 | BOOK, 72 | PAGE, 73 | PRICE, 74 | UNIT, 75 | RARITY, 76 | QUALITIES, 77 | W_CATEGORY, 78 | W_SKILL, 79 | W_GRIP, 80 | W_MINRANGE, 81 | W_MAXRANGE, 82 | W_DAM, 83 | W_DLS, 84 | A_PHYSRES, 85 | A_SUPERRES 86 | }; 87 | } 88 | 89 | namespace Adv_Disadv { 90 | enum{ 91 | TYPE, 92 | NAME, 93 | RING, 94 | DESC, 95 | SHORT_DESC, 96 | BOOK, 97 | PAGE, 98 | TYPES 99 | }; 100 | } 101 | 102 | namespace Tech { 103 | enum{ 104 | NAME, 105 | TYPE, 106 | SUBTYPE, 107 | RANK, 108 | BOOK, 109 | PAGE, 110 | RESTRICTION, 111 | SHORT_DESC, 112 | DESCRIPTION 113 | }; 114 | } 115 | 116 | namespace TechQuery { 117 | enum{ 118 | NAME, 119 | CATEGORY, 120 | SUBCATEGORY, 121 | RANK, 122 | XP, 123 | BOOK, 124 | PAGE, 125 | RESTRICTION, 126 | }; 127 | } 128 | 129 | namespace Curric { 130 | enum{ 131 | RANK, 132 | ADVANCE, 133 | TYPE, 134 | SPEC, 135 | MINRANK, 136 | MAXRANK 137 | }; 138 | 139 | } 140 | 141 | namespace Title { 142 | enum{ 143 | SOURCE, 144 | ADVANCE, 145 | TYPE, 146 | SPEC, 147 | TRANK 148 | }; 149 | 150 | } 151 | 152 | namespace Abilities { 153 | enum{ 154 | NAME, 155 | SOURCE, 156 | REF_BOOK, 157 | REF_PAGE, 158 | DESCRIPTION 159 | }; 160 | 161 | } 162 | #endif // ENUMS_H 163 | -------------------------------------------------------------------------------- /PaperBlossoms/src/main.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * ******************************************************************* 3 | * This file is part of the Paper Blossoms application 4 | * (https://github.com/dashnine/PaperBlossoms). 5 | * Copyright (c) 2019 Kyle Hankins (dashnine) 6 | * 7 | * This program is free software: you can redistribute it and/or modify 8 | * it under the terms of the GNU General Public License as published by 9 | * the Free Software Foundation, version 3. 10 | * 11 | * This program is distributed in the hope that it will be useful, but 12 | * WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 14 | * General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with this program. If not, see . 18 | * 19 | * The Legend of the Five Rings Roleplaying Game is the creation 20 | * and property of Fantasy Flight Games. 21 | * ******************************************************************* 22 | */ 23 | 24 | #include "mainwindow.h" 25 | #include 26 | #include 27 | #include 28 | #include 29 | #include 30 | #include 31 | #include 32 | #include 33 | 34 | int main(int argc, char *argv[]) 35 | { 36 | QApplication a(argc, argv); 37 | //QTextCodec::setCodecForLocale(QTextCodec::codecForName("UTF-8")); 38 | 39 | QString defaultLocaleDB, defaultLocaleUI; 40 | defaultLocaleDB = defaultLocaleUI = QLocale::system().name(); 41 | defaultLocaleDB.truncate(defaultLocaleDB.lastIndexOf('_')); 42 | defaultLocaleUI.truncate(defaultLocaleUI.lastIndexOf('_')); 43 | QString settingfile = QStandardPaths::writableLocation(QStandardPaths::DataLocation) + "/settings.ini"; 44 | qDebug() << "Settings file: " << settingfile; 45 | QSettings settings(settingfile, QSettings::IniFormat); 46 | 47 | if(!settings.contains("localeDB")){ 48 | //initialize the locale to the system locale (which would be the default anyways). 49 | settings.setValue("localeDB",defaultLocaleDB); 50 | } 51 | else{ 52 | //if there is a setting, and it matches an allowed locale, use it. 53 | QString settinglocale = settings.value("localeDB").toString(); 54 | if(settinglocale.toLower()=="en") defaultLocaleDB = "en"; 55 | else if(settinglocale.toLower()=="es") defaultLocaleDB = "es"; 56 | else if(settinglocale.toLower()=="fr") defaultLocaleDB = "fr"; 57 | else if(settinglocale.toLower()=="de") defaultLocaleDB = "de"; 58 | else if(settinglocale.toLower()=="test") defaultLocaleDB = "test"; 59 | else defaultLocaleDB = "en"; 60 | 61 | } 62 | 63 | if(!settings.contains("localeUI")){ 64 | //initialize the locale to the system locale (which would be the default anyways). 65 | settings.setValue("localeUI",defaultLocaleUI); 66 | } 67 | else{ 68 | //if there is a setting, and it matches an allowed locale, use it. 69 | QString settinglocale = settings.value("localeUI").toString(); 70 | if(settinglocale.toLower()=="en") defaultLocaleUI = "en"; 71 | else if(settinglocale.toLower()=="es") defaultLocaleUI = "es"; 72 | else if(settinglocale.toLower()=="fr") defaultLocaleUI = "fr"; 73 | else if(settinglocale.toLower()=="de") defaultLocaleUI = "de"; 74 | else if(settinglocale.toLower()=="test") defaultLocaleUI = "test"; 75 | else defaultLocaleUI = "en"; 76 | 77 | } 78 | 79 | //support forcing a locale. NOTE: hardcoded list to avoid injection risks 80 | //this would override the settings. 81 | if(argc>1){ 82 | QString arg1(argv[1]); 83 | if(arg1.toLower()=="en") defaultLocaleDB = defaultLocaleUI = "en"; 84 | else if(arg1.toLower()=="es") defaultLocaleDB = defaultLocaleUI = "es"; 85 | else if(arg1.toLower()=="fr") defaultLocaleDB = defaultLocaleUI = "fr"; 86 | else if(arg1.toLower()=="de") defaultLocaleDB = defaultLocaleUI = "de"; 87 | else if(arg1.toLower()=="test") defaultLocaleDB = defaultLocaleUI = "test"; 88 | } 89 | qDebug()<< "localeDB = " + defaultLocaleDB; 90 | qDebug()<< "localeUI = " + defaultLocaleUI; 91 | 92 | QTranslator tra; 93 | if(tra.load("paperblossoms_"+defaultLocaleUI,":/translations")){ 94 | a.installTranslator(&tra); 95 | qDebug()<<"translation loaded"; 96 | } 97 | else{ 98 | qWarning() << "Translation not loaded."; 99 | } 100 | MainWindow w(defaultLocaleDB); 101 | w.show(); 102 | 103 | return a.exec(); 104 | } 105 | -------------------------------------------------------------------------------- /PaperBlossoms/src/pboutputdata.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * ******************************************************************* 3 | * This file is part of the Paper Blossoms application 4 | * (https://github.com/dashnine/PaperBlossoms). 5 | * Copyright (c) 2019 Kyle Hankins (dashnine) 6 | * 7 | * This program is free software: you can redistribute it and/or modify 8 | * it under the terms of the GNU General Public License as published by 9 | * the Free Software Foundation, version 3. 10 | * 11 | * This program is distributed in the hope that it will be useful, but 12 | * WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 14 | * General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with this program. If not, see . 18 | * 19 | * The Legend of the Five Rings Roleplaying Game is the creation 20 | * and property of Fantasy Flight Games. 21 | * ******************************************************************* 22 | */ 23 | 24 | #include "pboutputdata.h" 25 | 26 | PBOutputData::PBOutputData(QObject *parent) : QObject(parent) 27 | { 28 | 29 | } 30 | -------------------------------------------------------------------------------- /PaperBlossoms/src/pboutputdata.h: -------------------------------------------------------------------------------- 1 | /* 2 | * ******************************************************************* 3 | * This file is part of the Paper Blossoms application 4 | * (https://github.com/dashnine/PaperBlossoms). 5 | * Copyright (c) 2019 Kyle Hankins (dashnine) 6 | * 7 | * This program is free software: you can redistribute it and/or modify 8 | * it under the terms of the GNU General Public License as published by 9 | * the Free Software Foundation, version 3. 10 | * 11 | * This program is distributed in the hope that it will be useful, but 12 | * WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 14 | * General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with this program. If not, see . 18 | * 19 | * The Legend of the Five Rings Roleplaying Game is the creation 20 | * and property of Fantasy Flight Games. 21 | * ******************************************************************* 22 | */ 23 | 24 | #ifndef PBOUTPUTDATA_H 25 | #define PBOUTPUTDATA_H 26 | 27 | #include 28 | #include 29 | #include 30 | 31 | class PBOutputData : public QObject 32 | { 33 | Q_OBJECT 34 | public: 35 | explicit PBOutputData(QObject *parent = nullptr); 36 | 37 | QString name; 38 | QStringList titles; 39 | 40 | QString clan; 41 | QString family; 42 | QString school; 43 | 44 | QString ninjo; 45 | QString giri; 46 | 47 | 48 | QList skills; 49 | QImage rings; 50 | 51 | QString honor; 52 | QString glory; 53 | QString status; 54 | QString koku; //wealth 55 | QString bu; //wealth 56 | QString zeni; //wealth 57 | 58 | QString focus; 59 | QString vigilance; 60 | QString endurance; 61 | QString composure; 62 | 63 | //QString rank; 64 | //QString curricXP; 65 | QString curricStatus; 66 | QString titleStatus; 67 | QList curriculum; 68 | QList curTitle; 69 | 70 | QList techniques; 71 | 72 | QList distinctions; 73 | QList passions; 74 | QList adversities; 75 | QList anxieties; 76 | 77 | QList weapons; 78 | QList armor; 79 | QList personaleffects; 80 | 81 | QList abilities; 82 | 83 | QString heritage; 84 | QStringList advanceStack; 85 | 86 | QString notes; 87 | 88 | QImage portrait; 89 | 90 | signals: 91 | 92 | public slots: 93 | }; 94 | 95 | #endif // PBOUTPUTDATA_H 96 | -------------------------------------------------------------------------------- /PaperBlossoms/src/repository/abstractrepository.cpp: -------------------------------------------------------------------------------- 1 | #include "abstractrepository.h" 2 | #include 3 | #include 4 | #include 5 | #include 6 | #include 7 | #include 8 | #include 9 | #include 10 | #include 11 | #include 12 | #include 13 | #include 14 | 15 | QString AbstractRepository::getLastExecutedQuery(const QSqlQuery &query) { 16 | QString str = query.executedQuery(); 17 | QMapIterator it(query.boundValues()); 18 | while (it.hasNext()) { 19 | it.next(); 20 | str.replace(it.key(), it.value().toString()); 21 | } 22 | return str; 23 | } 24 | 25 | QString AbstractRepository::translate(QString string_tr) { 26 | return this->dal->translate(string_tr); 27 | } 28 | 29 | QString AbstractRepository::untranslate(QString string_tr) { 30 | return this->dal->untranslate(string_tr); 31 | } -------------------------------------------------------------------------------- /PaperBlossoms/src/repository/abstractrepository.h: -------------------------------------------------------------------------------- 1 | #ifndef ABSTRACTREPOSITORY_H 2 | #define ABSTRACTREPOSITORY_H 3 | 4 | #include 5 | #include 6 | #include 7 | #include 8 | #include 9 | #include 10 | #include 11 | #include "dataaccesslayer.h" 12 | 13 | class AbstractRepository { 14 | public: 15 | AbstractRepository(DataAccessLayer *dal) { 16 | this->dal = dal; 17 | } 18 | 19 | protected: 20 | DataAccessLayer *dal; 21 | 22 | QString translate(QString string_tr); 23 | 24 | QString untranslate(QString string_tr); 25 | 26 | QString getLastExecutedQuery(const QSqlQuery &query); 27 | }; 28 | 29 | #endif // ABSTRACTREPOSITORY_H 30 | -------------------------------------------------------------------------------- /PaperBlossoms/src/repository/advantagesrepository.cpp: -------------------------------------------------------------------------------- 1 | #include "advantagesrepository.h" 2 | #include 3 | #include 4 | #include 5 | #include 6 | #include 7 | #include 8 | #include 9 | #include 10 | 11 | QStringList AdvantagesRepository::qsl_getadvdisadv(const QString category) { 12 | QStringList out; 13 | QSqlQuery query; 14 | query.prepare("SELECT name_tr FROM advantages_disadvantages WHERE category = :category"); 15 | query.bindValue(0, category); 16 | query.exec(); 17 | while (query.next()) { 18 | const QString name = query.value(0).toString(); 19 | // qDebug() << name; 20 | out << name; 21 | } 22 | return out; 23 | } 24 | 25 | QStringList AdvantagesRepository::qsl_getadvdisadvbyname(const QString name) { 26 | QStringList out; 27 | QSqlQuery query; 28 | query.prepare( 29 | "SELECT category, name_tr, ring_tr, description, short_desc, reference_book, reference_page, types FROM advantages_disadvantages WHERE name_tr = :name"); 30 | query.bindValue(0, name); 31 | query.exec(); 32 | while (query.next()) { 33 | out << query.value(0).toString(); 34 | out << query.value(1).toString(); 35 | out << query.value(2).toString(); 36 | out << query.value(3).toString(); 37 | out << query.value(4).toString(); 38 | out << query.value(5).toString(); 39 | out << query.value(6).toString(); 40 | out << query.value(7).toString(); 41 | // qDebug() << name; 42 | } 43 | return out; 44 | } 45 | 46 | QStringList AdvantagesRepository::qsl_getadv() { 47 | QStringList out; 48 | QSqlQuery query; 49 | query.prepare("SELECT name_tr FROM advantages_disadvantages WHERE category IN ('Distinctions', 'Passions')"); 50 | query.exec(); 51 | while (query.next()) { 52 | const QString name = query.value(0).toString(); 53 | // qDebug() << name; 54 | out << name; 55 | } 56 | return out; 57 | } 58 | 59 | QStringList AdvantagesRepository::qsl_getdisadv() { 60 | QStringList out; 61 | QSqlQuery query; 62 | query.prepare("SELECT name_tr FROM advantages_disadvantages WHERE category IN ('Adversities', 'Anxieties')"); 63 | query.exec(); 64 | while (query.next()) { 65 | const QString name = query.value(0).toString(); 66 | // qDebug() << name; 67 | out << name; 68 | } 69 | return out; 70 | } -------------------------------------------------------------------------------- /PaperBlossoms/src/repository/advantagesrepository.h: -------------------------------------------------------------------------------- 1 | #ifndef ADVANTAGESREPOSITORY_H 2 | #define ADVANTAGESREPOSITORY_H 3 | 4 | #include "abstractrepository.h" 5 | #include 6 | #include 7 | #include 8 | #include 9 | #include 10 | #include 11 | #include 12 | 13 | class AdvantagesRepository : public AbstractRepository { 14 | public: 15 | AdvantagesRepository(DataAccessLayer *dal) : AbstractRepository(dal) {}; 16 | 17 | QStringList qsl_getadv(); 18 | 19 | QStringList qsl_getadvdisadv(const QString category); 20 | 21 | QStringList qsl_getadvdisadvbyname(const QString name); 22 | 23 | QStringList qsl_getdisadv(); 24 | }; 25 | 26 | #endif // ADVANTAGESREPOSITORY_H 27 | -------------------------------------------------------------------------------- /PaperBlossoms/src/repository/bondsrepository.cpp: -------------------------------------------------------------------------------- 1 | #include "bondsrepository.h" 2 | #include 3 | #include 4 | #include 5 | #include 6 | #include 7 | #include 8 | #include 9 | #include 10 | 11 | QStringList BondsRepository::qsl_getbonds() { 12 | QStringList out; 13 | QSqlQuery query; 14 | query.prepare("SELECT name_tr FROM bonds"); 15 | //query.bindValue(0, category); 16 | query.exec(); 17 | while (query.next()) { 18 | const QString name = query.value(0).toString(); 19 | // qDebug() << name; 20 | out << name; 21 | } 22 | return out; 23 | } 24 | 25 | QStringList BondsRepository::qsl_getbond(const QString name) { 26 | QStringList out; 27 | QSqlQuery query; 28 | query.prepare( 29 | "SELECT name_tr, bond_ability_name_tr, description, short_desc, reference_book, reference_page FROM bonds WHERE name_tr = :name"); 30 | query.bindValue(0, name); 31 | query.exec(); 32 | while (query.next()) { 33 | // qDebug() << name; 34 | out << query.value(0).toString(); 35 | out << query.value(1).toString(); 36 | out << query.value(2).toString(); 37 | out << query.value(3).toString(); 38 | out << query.value(4).toString(); 39 | out << query.value(5).toString(); 40 | } 41 | return out; 42 | } 43 | 44 | QStringList BondsRepository::qsl_getbondability(const QString bond) { 45 | QStringList out; 46 | QSqlQuery query; 47 | query.prepare( 48 | "SELECT bond_ability_name_tr, reference_book, reference_page, bond_ability_description FROM bonds WHERE name_tr = ?"); 49 | query.bindValue(0, bond); 50 | query.exec(); 51 | while (query.next()) { 52 | out << query.value(0).toString(); 53 | out << bond; 54 | out << query.value(1).toString(); 55 | out << query.value(2).toString(); 56 | out << query.value(3).toString(); 57 | } 58 | return out; 59 | } -------------------------------------------------------------------------------- /PaperBlossoms/src/repository/bondsrepository.h: -------------------------------------------------------------------------------- 1 | #ifndef BONDSREPOSITORY_H 2 | #define BONDSREPOSITORY_H 3 | 4 | #include "abstractrepository.h" 5 | #include 6 | #include 7 | #include 8 | #include 9 | #include 10 | #include 11 | #include 12 | 13 | class BondsRepository : public AbstractRepository { 14 | public: 15 | BondsRepository(DataAccessLayer *dal) : AbstractRepository(dal) {}; 16 | 17 | QStringList qsl_getbonds(); 18 | 19 | QStringList qsl_getbond(const QString name); 20 | 21 | QStringList qsl_getbondability(const QString bond); 22 | }; 23 | 24 | #endif // BONDSREPOSITORY_H 25 | -------------------------------------------------------------------------------- /PaperBlossoms/src/repository/clansrepository.cpp: -------------------------------------------------------------------------------- 1 | #include "clansrepository.h" 2 | #include 3 | #include 4 | #include 5 | #include 6 | #include 7 | #include 8 | #include 9 | #include 10 | 11 | 12 | QStringList ClansRepository::qsl_getclans() { 13 | QStringList out; 14 | //clan query 15 | QSqlQuery query("SELECT name_tr FROM clans ORDER BY name_tr"); 16 | while (query.next()) { 17 | const QString cname = query.value(0).toString(); 18 | out << cname; 19 | // qDebug() << cname; 20 | } 21 | return out; 22 | } 23 | 24 | QString ClansRepository::qs_getclandesc(const QString clan) { 25 | QSqlQuery query; 26 | query.prepare("SELECT description FROM clans WHERE name_tr = :clan"); 27 | query.bindValue(0, clan); 28 | query.exec(); 29 | while (query.next()) { 30 | const QString desc = query.value(0).toString(); 31 | // qDebug() << desc; 32 | return desc; 33 | } 34 | qWarning() << "ERROR - Clan" + clan + " not found while searching for desc."; 35 | return ""; 36 | } 37 | 38 | QString ClansRepository::qs_getclanref(const QString clan) { 39 | QSqlQuery query; 40 | query.prepare("SELECT reference_book, reference_page FROM clans WHERE name_tr = :clan"); 41 | query.bindValue(0, clan); 42 | query.exec(); 43 | while (query.next()) { 44 | QString ref = query.value(0).toString() + " "; 45 | ref += query.value(1).toString(); 46 | // qDebug() << desc; 47 | return ref; 48 | } 49 | qWarning() << "ERROR - Clan" + clan + " not found while searching for desc."; 50 | return ""; 51 | } 52 | 53 | //TODO: this is a QStringList, but only returns 1 skill right now. Refactor? 54 | QStringList ClansRepository::qsl_getclanskills(const QString clan) { 55 | QStringList out; 56 | QSqlQuery query; 57 | query.prepare("SELECT skill_tr FROM clans WHERE name_tr = :clan"); 58 | query.bindValue(0, clan); 59 | query.exec(); 60 | while (query.next()) { 61 | const QString cname = query.value(0).toString(); 62 | // qDebug() << cname; 63 | out << cname; 64 | } 65 | return out; 66 | } 67 | 68 | QString ClansRepository::qs_getclanring(const QString clan) { 69 | QSqlQuery query; 70 | query.prepare("SELECT ring_tr FROM clans WHERE name_tr = :clan"); 71 | query.bindValue(0, clan); 72 | query.exec(); 73 | while (query.next()) { 74 | const QString ring = query.value(0).toString(); 75 | // qDebug() << ring; 76 | return ring; 77 | } 78 | qWarning() << "ERROR - Clan" + clan + " not found while searching for rings."; 79 | return ""; 80 | } 81 | 82 | int ClansRepository::i_getclanstatus(const QString clan) { 83 | int out = 0; 84 | QSqlQuery query; 85 | query.prepare("SELECT status FROM clans WHERE name_tr = :clan"); 86 | query.bindValue(0, clan); 87 | query.exec(); 88 | while (query.next()) { 89 | out = query.value(0).toInt(); 90 | } 91 | return out; 92 | } 93 | -------------------------------------------------------------------------------- /PaperBlossoms/src/repository/clansrepository.h: -------------------------------------------------------------------------------- 1 | #ifndef CLANSREPOSITORY_H 2 | #define CLANSREPOSITORY_H 3 | 4 | #include "abstractrepository.h" 5 | #include 6 | #include 7 | #include 8 | #include 9 | #include 10 | #include 11 | #include 12 | 13 | class ClansRepository : AbstractRepository { 14 | public: 15 | ClansRepository(DataAccessLayer *dal) : AbstractRepository(dal) {}; 16 | 17 | int i_getclanstatus(const QString clan); 18 | 19 | QString qs_getclandesc(const QString clan); 20 | 21 | QString qs_getclanref(const QString clan); 22 | 23 | QString qs_getclanring(const QString clan); 24 | 25 | QStringList qsl_getclans(); 26 | 27 | QStringList qsl_getclanskills(const QString clan); 28 | }; 29 | 30 | #endif // CLANSREPOSITORY_H 31 | -------------------------------------------------------------------------------- /PaperBlossoms/src/repository/familiesRepository.h: -------------------------------------------------------------------------------- 1 | // 2 | // Created by Maciej Kruszewski on 17.08.2021. 3 | // 4 | 5 | #ifndef FAMILIESREPOSITORY_H 6 | #define FAMILIESREPOSITORY_H 7 | 8 | #include "abstractrepository.h" 9 | #include 10 | #include 11 | #include 12 | #include 13 | #include 14 | #include 15 | #include 16 | 17 | 18 | class FamiliesRepository : AbstractRepository { 19 | public: 20 | FamiliesRepository(DataAccessLayer *dal) : AbstractRepository(dal) {}; 21 | 22 | QString qs_getfamilydesc(const QString family); 23 | 24 | QString qs_getfamilyref(const QString family); 25 | 26 | QStringList qsl_getfamilies(const QString clan); 27 | 28 | int i_getfamilyglory(const QString family); 29 | 30 | int i_getfamilywealth(const QString family); 31 | 32 | QStringList qsl_getfamilyrings(const QString family); 33 | 34 | QStringList qsl_getfamilyskills(const QString family); 35 | }; 36 | 37 | 38 | #endif //FAMILIESREPOSITORY_H 39 | -------------------------------------------------------------------------------- /PaperBlossoms/src/repository/familiesrepository.cpp: -------------------------------------------------------------------------------- 1 | // 2 | // Created by Maciej Kruszewski on 17.08.2021. 3 | // 4 | 5 | #include "familiesRepository.h" 6 | #include 7 | #include 8 | #include 9 | #include 10 | #include 11 | #include 12 | #include 13 | #include 14 | 15 | QStringList FamiliesRepository::qsl_getfamilies(const QString clan) { 16 | QStringList out; 17 | QSqlQuery query; 18 | query.prepare("SELECT name_tr FROM families WHERE clan_tr = :clan ORDER BY name_tr"); 19 | query.bindValue(0, clan); 20 | query.exec(); 21 | while (query.next()) { 22 | const QString fname = query.value(0).toString(); 23 | out << fname; 24 | } 25 | return out; 26 | } 27 | 28 | QString FamiliesRepository::qs_getfamilydesc(const QString family) { 29 | QSqlQuery query; 30 | query.prepare("SELECT description FROM families WHERE name_tr = :family"); 31 | query.bindValue(0, family); 32 | query.exec(); 33 | while (query.next()) { 34 | const QString desc = query.value(0).toString(); 35 | return desc; 36 | } 37 | qWarning() << "ERROR - Family" + family + " not found while searching for desc."; 38 | return ""; 39 | } 40 | 41 | QString FamiliesRepository::qs_getfamilyref(const QString family) { 42 | QSqlQuery query; 43 | query.prepare("SELECT reference_book, reference_page FROM families WHERE name_tr = :family"); 44 | query.bindValue(0, family); 45 | query.exec(); 46 | while (query.next()) { 47 | QString ref = query.value(0).toString() + " "; 48 | ref += query.value(1).toString(); 49 | return ref; 50 | } 51 | qWarning() << "ERROR - Family" + family + " not found while searching for desc."; 52 | return ""; 53 | } 54 | 55 | int FamiliesRepository::i_getfamilyglory(const QString family) { 56 | int out = 0; 57 | QSqlQuery query; 58 | query.prepare("SELECT glory FROM families WHERE name_tr = :family"); 59 | query.bindValue(0, family); 60 | query.exec(); 61 | while (query.next()) { 62 | out = query.value(0).toInt(); 63 | } 64 | return out; 65 | } 66 | 67 | int FamiliesRepository::i_getfamilywealth(const QString family) { 68 | int out = 0; 69 | QSqlQuery query; 70 | query.prepare("SELECT wealth FROM families WHERE name_tr = :family"); 71 | query.bindValue(0, family); 72 | query.exec(); 73 | while (query.next()) { 74 | out = query.value(0).toInt(); 75 | } 76 | return out; 77 | } 78 | 79 | QStringList FamiliesRepository::qsl_getfamilyrings(const QString fam) { ///NOTE - ALSO USED FOR UPBRINGINGS (PoW) 80 | //bonus query - rings, skills 81 | QStringList out; 82 | QSqlQuery query; 83 | query.prepare("SELECT ring_tr FROM family_rings WHERE family_tr = :family"); 84 | query.bindValue(0, fam); 85 | query.exec(); 86 | while (query.next()) { 87 | const QString cname = query.value(0).toString(); 88 | // qDebug() << cname; 89 | out << cname; 90 | } 91 | //model->setQuery(query); 92 | return out; 93 | } 94 | 95 | QStringList FamiliesRepository::qsl_getfamilyskills(const QString family) { 96 | QStringList out; 97 | QSqlQuery query; 98 | query.prepare("SELECT skill_tr FROM family_skills WHERE family_tr = :family"); 99 | query.bindValue(0, family); 100 | query.exec(); 101 | while (query.next()) { 102 | const QString cname = query.value(0).toString(); 103 | out << cname; 104 | } 105 | return out; 106 | } -------------------------------------------------------------------------------- /PaperBlossoms/src/repository/hertiagesrepository.cpp: -------------------------------------------------------------------------------- 1 | #include "hertiagesrepository.h" 2 | #include 3 | #include 4 | #include 5 | #include 6 | #include 7 | #include 8 | #include 9 | #include 10 | 11 | QStringList HertiagesRepository::qsl_getancestors(QString source) { 12 | QStringList out; 13 | QSqlQuery query; 14 | query.prepare("SELECT ancestor_tr FROM samurai_heritage WHERE source = ? order by roll_min"); 15 | query.bindValue(0, source); 16 | query.exec(); 17 | while (query.next()) { 18 | const QString name = query.value(0).toString(); 19 | // qDebug() << name; 20 | out << name; 21 | } 22 | return out; 23 | } 24 | 25 | QStringList HertiagesRepository::qsl_getancestormods(const QString ancestor) { 26 | 27 | QMap map; 28 | QStringList out; 29 | 30 | map["Honor"] = 0; 31 | map["Glory"] = 0; 32 | map["Status"] = 0; 33 | QSqlQuery query; 34 | query.prepare( 35 | "SELECT modifier_honor, modifier_glory, modifier_status FROM samurai_heritage WHERE ancestor_tr = :ancestor"); 36 | query.bindValue(0, ancestor); 37 | query.exec(); 38 | while (query.next()) { 39 | map["Honor"] = query.value(0).toInt(); 40 | map["Glory"] = query.value(1).toInt(); 41 | map["Status"] = query.value(2).toInt(); 42 | } 43 | out.append(QString::number(map["Honor"])); 44 | out.append(QString::number(map["Glory"])); 45 | out.append(QString::number(map["Status"])); 46 | return out; 47 | } 48 | 49 | QStringList HertiagesRepository::qsl_getancestorseffects(const QString ancestor) { 50 | QStringList out; 51 | QSqlQuery query; 52 | query.prepare("SELECT outcome_tr FROM heritage_effects where ancestor_tr = :ancestor order by roll_min"); 53 | query.bindValue(0, ancestor); 54 | query.exec(); 55 | while (query.next()) { 56 | const QString name = query.value(0).toString(); 57 | // qDebug() << name; 58 | out << name; 59 | } 60 | return out; 61 | } 62 | 63 | QStringList HertiagesRepository::qsl_getheritageranges(const QString heritage) { 64 | QStringList out; 65 | QSqlQuery query; 66 | query.prepare("SELECT roll_min, roll_max from HERITAGE_EFFECTS where ancestor_tr = :heritage ORDER BY roll_min"); 67 | query.bindValue(0, heritage); 68 | query.exec(); 69 | while (query.next()) { 70 | const QString a = query.value(0).toString(); 71 | const QString b = query.value(1).toString(); 72 | // qDebug() << a + ", " + b; 73 | out << a + ", " + b; 74 | } 75 | return out; 76 | } 77 | 78 | QStringList HertiagesRepository::qsl_getancestorranges(const QString source) { 79 | QStringList out; 80 | QSqlQuery query; 81 | query.prepare("SELECT roll_min, roll_max from samurai_heritage where source = ? ORDER BY roll_min"); 82 | query.bindValue(0, source); 83 | query.exec(); 84 | while (query.next()) { 85 | QString a = query.value(0).toString(); 86 | QString b = query.value(1).toString(); 87 | // qDebug() << a + ", " + b; 88 | out << a + ", " + b; 89 | } 90 | return out; 91 | } 92 | 93 | QMap HertiagesRepository::qm_heritagehonorglorystatus(const QString heritage) { 94 | 95 | QMap map; 96 | QStringList out; 97 | 98 | map["Honor"] = 0; 99 | map["Glory"] = 0; 100 | map["Status"] = 0; 101 | QSqlQuery query; 102 | query.prepare( 103 | "SELECT modifier_honor, modifier_glory, modifier_status FROM samurai_heritage WHERE ancestor_tr = :ancestor"); 104 | query.bindValue(0, heritage); 105 | query.exec(); 106 | while (query.next()) { 107 | map["Honor"] = query.value(0).toInt(); 108 | map["Glory"] = query.value(1).toInt(); 109 | map["Status"] = query.value(2).toInt(); 110 | } 111 | return map; 112 | 113 | 114 | } 115 | -------------------------------------------------------------------------------- /PaperBlossoms/src/repository/hertiagesrepository.h: -------------------------------------------------------------------------------- 1 | #ifndef HERTIAGESREPOSITORY_H 2 | #define HERTIAGESREPOSITORY_H 3 | 4 | #include "abstractrepository.h" 5 | #include 6 | #include 7 | #include 8 | #include 9 | #include 10 | #include 11 | #include 12 | #include 13 | 14 | class HertiagesRepository : AbstractRepository { 15 | public: 16 | HertiagesRepository(DataAccessLayer *dal) : AbstractRepository(dal) {}; 17 | 18 | QStringList qsl_getancestors(const QString source); 19 | 20 | QStringList qsl_getancestormods(const QString ancestor); 21 | 22 | QStringList qsl_getancestorseffects(const QString ancestor); 23 | 24 | QStringList qsl_getheritageranges(const QString heritage); 25 | 26 | QStringList qsl_getancestorranges(const QString ancestor); 27 | 28 | QMap qm_heritagehonorglorystatus(const QString heritage); 29 | }; 30 | 31 | #endif // HERTIAGESREPOSITORY_H 32 | -------------------------------------------------------------------------------- /PaperBlossoms/src/repository/inventoryrepository.h: -------------------------------------------------------------------------------- 1 | #ifndef INVENTORYREPOSITORY_H 2 | #define INVENTORYREPOSITORY_H 3 | 4 | #include "abstractrepository.h" 5 | #include 6 | #include 7 | #include 8 | #include 9 | #include 10 | #include 11 | #include 12 | 13 | class InventoryRepository : AbstractRepository { 14 | public: 15 | InventoryRepository(DataAccessLayer *dal) : AbstractRepository(dal) {}; 16 | 17 | QString qs_getitemtype(const QString name); 18 | 19 | QStringList qsl_getitemsunderrarity(const int rarity); 20 | 21 | QStringList qsl_getweaponsunderrarity(const int rarity); 22 | 23 | QStringList qsl_getweapontypeunderrarity(const int rarity, const QString type); 24 | 25 | QStringList qsl_getitemsbytype(const QString type); 26 | 27 | QStringList qsl_getweaponcategories(); 28 | 29 | QStringList qsl_getweaponskills(); 30 | 31 | QStringList qsl_getqualities(); 32 | 33 | QStringList qsl_getpatterns(); 34 | 35 | QStringList qsl_getbaseitemdata(const QString name, const QString type); 36 | 37 | QStringList qsl_getitemqualities(const QString name, const QString type); 38 | 39 | QList ql_getweapondata(const QString name); 40 | 41 | QList ql_getarmordata(const QString name); 42 | }; 43 | 44 | #endif // INVENTORYREPOSITORY_H 45 | -------------------------------------------------------------------------------- /PaperBlossoms/src/repository/regionsrepository.cpp: -------------------------------------------------------------------------------- 1 | #include "regionsrepository.h" 2 | #include 3 | #include 4 | #include 5 | #include 6 | #include 7 | #include 8 | #include 9 | #include 10 | 11 | QStringList RegionsRepository::qsl_getregions(QString type) { 12 | QStringList out; 13 | //clan query 14 | QSqlQuery query("SELECT name_tr FROM regions WHERE type = :type ORDER BY name_tr"); 15 | query.bindValue(0, type); 16 | query.exec(); 17 | while (query.next()) { 18 | const QString cname = query.value(0).toString(); 19 | out << cname; 20 | // qDebug() << cname; 21 | } 22 | //qDebug() << getLastExecutedQuery(query); 23 | 24 | return out; 25 | } 26 | 27 | QString RegionsRepository::qs_getregiondesc(const QString region) { 28 | QSqlQuery query; 29 | query.prepare("SELECT description FROM regions WHERE name_tr = :region"); 30 | query.bindValue(0, region); 31 | query.exec(); 32 | while (query.next()) { 33 | const QString desc = query.value(0).toString(); 34 | // qDebug() << desc; 35 | return desc; 36 | } 37 | qWarning() << "ERROR - Region" + region + " not found while searching for desc."; 38 | return ""; 39 | } 40 | 41 | QString RegionsRepository::qs_getregionref(const QString region) { 42 | QSqlQuery query; 43 | query.prepare("SELECT reference_book, reference_page FROM regions WHERE name_tr = :region"); 44 | query.bindValue(0, region); 45 | query.exec(); 46 | while (query.next()) { 47 | QString ref = query.value(0).toString() + " "; 48 | ref += query.value(1).toString(); 49 | // qDebug() << desc; 50 | return ref; 51 | } 52 | qWarning() << "ERROR - Region" + region + " not found while searching for ref."; 53 | return ""; 54 | } 55 | 56 | QString RegionsRepository::qs_getregionring(const QString region) { 57 | QSqlQuery query; 58 | query.prepare("SELECT ring_increase_tr FROM regions WHERE name_tr = :region"); 59 | query.bindValue(0, region); 60 | query.exec(); 61 | while (query.next()) { 62 | const QString ring = query.value(0).toString(); 63 | // qDebug() << ring; 64 | return ring; 65 | } 66 | qWarning() << "ERROR - Region" + region + " not found while searching for rings."; 67 | return ""; 68 | } 69 | 70 | //TODO: this is a QStringList, but only returns 1 skill right now. Refactor? 71 | QStringList RegionsRepository::qsl_getregionskills(const QString region) { 72 | QStringList out; 73 | QSqlQuery query; 74 | query.prepare("SELECT skill_increase_tr FROM regions WHERE name_tr = :region"); 75 | query.bindValue(0, region); 76 | query.exec(); 77 | while (query.next()) { 78 | const QString cname = query.value(0).toString(); 79 | // qDebug() << cname; 80 | out << cname; 81 | } 82 | return out; 83 | } 84 | 85 | 86 | QString RegionsRepository::qs_getregionsubtype(const QString region) { 87 | QSqlQuery query; 88 | query.prepare("SELECT subtype FROM regions WHERE name_tr = :region"); 89 | query.bindValue(0, region); 90 | query.exec(); 91 | while (query.next()) { 92 | QString subtype = query.value(0).toString(); 93 | return subtype; 94 | } 95 | qWarning() << "ERROR - Region" + region + " not found while searching for ref."; 96 | return ""; 97 | } 98 | 99 | int RegionsRepository::i_getregionglory(const QString region) { 100 | int out = 0; 101 | QSqlQuery query; 102 | query.prepare("SELECT glory FROM regions WHERE name_tr = :region"); 103 | query.bindValue(0, region); 104 | query.exec(); 105 | while (query.next()) { 106 | out = query.value(0).toInt(); 107 | } 108 | return out; 109 | } -------------------------------------------------------------------------------- /PaperBlossoms/src/repository/regionsrepository.h: -------------------------------------------------------------------------------- 1 | #ifndef REGIONSREPOSITORY_H 2 | #define REGIONSREPOSITORY_H 3 | 4 | #include "abstractrepository.h" 5 | #include 6 | #include 7 | #include 8 | #include 9 | #include 10 | #include 11 | #include 12 | 13 | class RegionsRepository : AbstractRepository { 14 | public: 15 | RegionsRepository(DataAccessLayer *dal) : AbstractRepository(dal) {}; 16 | 17 | int i_getregionglory(const QString region); 18 | 19 | QString qs_getregiondesc(const QString region); 20 | 21 | QString qs_getregionref(const QString region); 22 | 23 | QString qs_getregionring(const QString region); 24 | 25 | QString qs_getregionsubtype(const QString region); 26 | 27 | QStringList qsl_getregions(QString type); 28 | 29 | QStringList qsl_getregionskills(const QString region); 30 | 31 | }; 32 | 33 | #endif // REGIONSREPOSITORY_H 34 | -------------------------------------------------------------------------------- /PaperBlossoms/src/repository/ringsrepository.cpp: -------------------------------------------------------------------------------- 1 | #include "ringsrepository.h" 2 | #include 3 | #include 4 | #include 5 | #include 6 | #include 7 | #include 8 | #include 9 | #include 10 | 11 | QStringList RingsRepository::qsl_getrings() { 12 | QStringList out; 13 | QSqlQuery query; 14 | query.prepare("SELECT name_tr FROM rings"); 15 | query.exec(); 16 | while (query.next()) { 17 | const QString name = query.value(0).toString(); 18 | // qDebug() << name; 19 | out << name; 20 | } 21 | return out; 22 | } 23 | 24 | QString RingsRepository::qs_getringdesc(const QString ring) { 25 | QString out; 26 | QSqlQuery query; 27 | query.prepare("SELECT outstanding_quality_tr FROM rings WHERE name_tr = :ring"); 28 | query.bindValue(0, ring); 29 | query.exec(); 30 | while (query.next()) { 31 | const QString result = query.value(0).toString(); 32 | // qDebug() << result; 33 | out = result; 34 | } 35 | return out; 36 | 37 | } -------------------------------------------------------------------------------- /PaperBlossoms/src/repository/ringsrepository.h: -------------------------------------------------------------------------------- 1 | #ifndef RINGSREPOSITORY_H 2 | #define RINGSREPOSITORY_H 3 | 4 | #include "abstractrepository.h" 5 | #include 6 | #include 7 | #include 8 | #include 9 | #include 10 | #include 11 | #include 12 | 13 | class RingsRepository : AbstractRepository { 14 | public: 15 | RingsRepository(DataAccessLayer *dal) : AbstractRepository(dal) {}; 16 | 17 | QString qs_getringdesc(const QString ring); 18 | 19 | QStringList qsl_getrings(); 20 | }; 21 | 22 | #endif // RINGSREPOSITORY_H 23 | -------------------------------------------------------------------------------- /PaperBlossoms/src/repository/schoolsrepository.h: -------------------------------------------------------------------------------- 1 | #ifndef SCHOOLSREPOSITORY_H 2 | #define SCHOOLSREPOSITORY_H 3 | 4 | #include "abstractrepository.h" 5 | #include 6 | #include 7 | #include 8 | #include 9 | #include 10 | #include 11 | #include 12 | 13 | 14 | class SchoolsRepository : AbstractRepository { 15 | public: 16 | SchoolsRepository(DataAccessLayer *dal) : AbstractRepository(dal) {}; 17 | 18 | void qsm_getschoolcurriculum(QSqlQueryModel *const model, const QString school); 19 | 20 | int i_getschoolhonor(const QString school); 21 | 22 | int i_getschoolskillcount(const QString school); 23 | 24 | QString qs_getschooldesc(const QString school); 25 | 26 | QString qs_getschoolref(const QString school); 27 | 28 | QString qs_getschooladvdisadv(const QString school); 29 | 30 | QStringList qsl_getschoolskills(const QString school); 31 | 32 | QStringList qsl_getschoolability(const QString school); 33 | 34 | QStringList qsl_getschoolmastery(const QString school); 35 | 36 | QStringList qsl_getschools(const QString clan, const bool allclans = false, const QString type = "Samurai"); 37 | 38 | QStringList qsl_getschoolrings(const QString clan); 39 | 40 | QStringList qsl_gettechallowedbyschool(QString school); 41 | 42 | QList ql_getlistsofeq(const QString school); 43 | 44 | QList ql_getlistsoftech(const QString school); 45 | 46 | QList qsl_getschoolcurriculum(const QString school); 47 | 48 | private: 49 | QStringList qsl_getschooltechsetids(const QString school); 50 | 51 | QStringList qsl_getschoolequipsetids(const QString school); 52 | }; 53 | 54 | #endif // SCHOOLSREPOSITORY_H 55 | -------------------------------------------------------------------------------- /PaperBlossoms/src/repository/skillsrepository.cpp: -------------------------------------------------------------------------------- 1 | #include "skillsrepository.h" 2 | #include 3 | #include 4 | #include 5 | #include 6 | #include 7 | #include 8 | #include 9 | #include 10 | 11 | QStringList SkillsRepository::qsl_getskills() { 12 | QStringList out; 13 | QSqlQuery query; 14 | query.prepare("SELECT skill_tr FROM skills "); 15 | query.exec(); 16 | while (query.next()) { 17 | const QString cname = query.value(0).toString(); 18 | out << cname; 19 | } 20 | return out; 21 | } 22 | 23 | QStringList SkillsRepository::qsl_getskillsandgroup() { 24 | QStringList out; 25 | QSqlQuery query; 26 | query.prepare("SELECT skill_tr, skill_group_tr FROM skills "); 27 | query.exec(); 28 | while (query.next()) { 29 | const QString s = query.value(0).toString() + "|" + query.value(1).toString(); 30 | out << s; 31 | } 32 | return out; 33 | } 34 | 35 | QStringList SkillsRepository::qsl_getskillsbygroup(const QString group) { 36 | QStringList out; 37 | QSqlQuery query; 38 | query.prepare("SELECT skill_tr FROM skills WHERE skill_group_tr = ?"); 39 | query.bindValue(0, group); 40 | query.exec(); 41 | while (query.next()) { 42 | const QString cname = query.value(0).toString(); 43 | out << cname; 44 | } 45 | return out; 46 | } -------------------------------------------------------------------------------- /PaperBlossoms/src/repository/skillsrepository.h: -------------------------------------------------------------------------------- 1 | #ifndef SKILLSREPOSITORY_H 2 | #define SKILLSREPOSITORY_H 3 | 4 | #include "abstractrepository.h" 5 | #include 6 | #include 7 | #include 8 | #include 9 | #include 10 | #include 11 | #include 12 | 13 | class SkillsRepository : AbstractRepository { 14 | public: 15 | SkillsRepository(DataAccessLayer *dal) : AbstractRepository(dal) {}; 16 | 17 | QStringList qsl_getskills(); 18 | 19 | QStringList qsl_getskillsbygroup(const QString group); 20 | 21 | QStringList qsl_getskillsandgroup(); 22 | }; 23 | 24 | #endif // SKILLSREPOSITORY_H 25 | -------------------------------------------------------------------------------- /PaperBlossoms/src/repository/techniquesrepository.h: -------------------------------------------------------------------------------- 1 | #ifndef TECHNIQUESREPOSITORY_H 2 | #define TECHNIQUESREPOSITORY_H 3 | 4 | #include "abstractrepository.h" 5 | #include 6 | #include 7 | #include 8 | #include 9 | #include 10 | #include 11 | #include 12 | 13 | class TechniquesRepository : AbstractRepository { 14 | public: 15 | TechniquesRepository(DataAccessLayer *dal) : AbstractRepository(dal) {}; 16 | 17 | void 18 | qsm_gettechniquetable(QSqlQueryModel *const model, const QString rank, const QString school, const QString title, 19 | const bool norestrictions = false); 20 | 21 | QString qs_gettechtypebyname(const QString tech); 22 | 23 | QString qs_gettechtypebygroupname(const QString tech); 24 | 25 | QStringList qsl_gettechbytyperank(const QString type, const int rank); 26 | 27 | QStringList qsl_getmahoninjutsu(const int rank); 28 | 29 | QStringList qsl_gettechbyname(const QString name); 30 | 31 | QStringList qsl_gettechbygroup(const QString group, const int minrank, const int maxrank); 32 | 33 | QStringList qsl_gettechniquessubtypes(); 34 | 35 | QStringList qsl_gettechniquesbysubcategory(const QString subcategory, const int minRank, const int maxRank); 36 | 37 | QList ql_getalltechniques(); 38 | 39 | private: 40 | int i_gettitletechgrouprank(const QString title); 41 | }; 42 | 43 | #endif // TECHNIQUESREPOSITORY_H 44 | -------------------------------------------------------------------------------- /PaperBlossoms/src/repository/titlesrepository.cpp: -------------------------------------------------------------------------------- 1 | #include "titlesrepository.h" 2 | #include 3 | #include 4 | #include 5 | #include 6 | #include 7 | #include 8 | #include 9 | #include 10 | 11 | QStringList TitlesRepository::qsl_gettitlemastery(const QString title) { 12 | QStringList out; 13 | QSqlQuery query; 14 | query.prepare( 15 | "SELECT title_ability_name_tr, reference_book, reference_page, title_ability_description FROM titles WHERE name_tr = ?"); 16 | query.bindValue(0, title); 17 | query.exec(); 18 | while (query.next()) { 19 | out << query.value(0).toString(); 20 | out << title; 21 | out << query.value(1).toString(); 22 | out << query.value(2).toString(); 23 | out << query.value(3).toString(); 24 | } 25 | return out; 26 | } 27 | 28 | 29 | QStringList TitlesRepository::qsl_gettitles() { 30 | QStringList out; 31 | QSqlQuery query; 32 | query.prepare("SELECT name_tr FROM titles "); 33 | query.exec(); 34 | while (query.next()) { 35 | const QString cname = query.value(0).toString(); 36 | out << cname; 37 | } 38 | return out; 39 | } 40 | 41 | QString TitlesRepository::qs_gettitleref(const QString title) { 42 | QString out = ""; 43 | QSqlQuery query; 44 | query.prepare("SELECT reference_book, reference_page FROM titles where name_tr = ?"); 45 | query.bindValue(0, title); 46 | query.exec(); 47 | while (query.next()) { 48 | const QString b = query.value(0).toString(); 49 | const QString p = query.value(1).toString(); 50 | out += (b + " " + p); 51 | } 52 | return out; 53 | } 54 | 55 | QString TitlesRepository::qs_gettitlexp(const QString title) { 56 | QString out = ""; 57 | QSqlQuery query; 58 | query.prepare("SELECT xp_to_completion FROM titles where name_tr = ?"); 59 | query.bindValue(0, title); 60 | query.exec(); 61 | while (query.next()) { 62 | const QString b = query.value(0).toString(); 63 | out = b; 64 | } 65 | return out; 66 | } 67 | 68 | QString TitlesRepository::qs_gettitleability(const QString title) { 69 | QString out = ""; 70 | QSqlQuery query; 71 | query.prepare("SELECT title_ability_name_tr FROM titles where name_tr = ?"); 72 | query.bindValue(0, title); 73 | query.exec(); 74 | while (query.next()) { 75 | const QString b = query.value(0).toString(); 76 | out = b; 77 | } 78 | return out; 79 | } 80 | 81 | QStringList TitlesRepository::qsl_gettitletrack(const QString title) { 82 | QStringList out; 83 | QSqlQuery query; 84 | query.prepare("SELECT title_tr, name_tr, type, special_access,rank " //select main list 85 | "FROM title_advancements " // from table 86 | "WHERE title_tr = ? " 87 | ); 88 | query.bindValue(0, title); 89 | query.exec(); 90 | while (query.next()) { 91 | const QString title = query.value(0).toString(); 92 | const QString name = query.value(1).toString(); 93 | const QString type = query.value(2).toString(); 94 | const QString sp_ac = query.value(3).toString(); 95 | const QString rank = query.value(4).toString(); 96 | out << title + "|" + name + "|" + type + "|" + sp_ac + "|" + rank; 97 | // qDebug() << out; 98 | } 99 | return out; 100 | } 101 | 102 | QList TitlesRepository::ql_gettitletrack(const QString title) { 103 | QList out; 104 | QSqlQuery query; 105 | query.prepare("SELECT title_tr, name_tr, type, special_access,rank " //select main list 106 | "FROM title_advancements " // from table 107 | "WHERE title_tr = ? " 108 | ); 109 | query.bindValue(0, title); 110 | query.exec(); 111 | while (query.next()) { 112 | QStringList row; 113 | row << query.value(0).toString(); 114 | row << query.value(1).toString(); 115 | row << query.value(2).toString(); 116 | row << query.value(3).toString(); 117 | row << query.value(4).toString(); 118 | out << row; 119 | // qDebug() << out; 120 | } 121 | return out; 122 | } 123 | 124 | -------------------------------------------------------------------------------- /PaperBlossoms/src/repository/titlesrepository.h: -------------------------------------------------------------------------------- 1 | #ifndef TITLESREPOSITORY_H 2 | #define TITLESREPOSITORY_H 3 | 4 | #include "abstractrepository.h" 5 | #include 6 | #include 7 | #include 8 | #include 9 | #include 10 | #include 11 | #include 12 | 13 | class TitlesRepository : AbstractRepository { 14 | public: 15 | TitlesRepository(DataAccessLayer *dal) : AbstractRepository(dal) {}; 16 | 17 | QString qs_gettitleref(const QString title); 18 | 19 | QString qs_gettitlexp(const QString title); 20 | 21 | QString qs_gettitleability(const QString title); 22 | 23 | QStringList qsl_gettitletrack(const QString title); 24 | 25 | QStringList qsl_gettitlemastery(const QString title); 26 | 27 | QStringList qsl_gettitles(); 28 | 29 | QList ql_gettitletrack(const QString title); 30 | }; 31 | 32 | #endif // TITLESREPOSITORY_H 33 | -------------------------------------------------------------------------------- /PaperBlossoms/src/repository/upbringingsrepository.h: -------------------------------------------------------------------------------- 1 | #ifndef UPBRINGINGSREPOSITORY_H 2 | #define UPBRINGINGSREPOSITORY_H 3 | 4 | #include "abstractrepository.h" 5 | #include 6 | #include 7 | #include 8 | #include 9 | #include 10 | #include 11 | #include 12 | 13 | class UpbringingsRepository : AbstractRepository { 14 | public: 15 | UpbringingsRepository(DataAccessLayer *dal) : AbstractRepository(dal) {}; 16 | 17 | int i_getupbringingstatusmod(const QString upbringing); 18 | 19 | int i_getupbringingkoku(const QString upbringing); 20 | 21 | int i_getupbringingbu(const QString upbringing); 22 | 23 | int i_getupbringingzeni(const QString upbringing); 24 | 25 | QString qs_getupbringingitem(const QString upbringing); 26 | 27 | QString qs_getupbringingdesc(const QString upbringing); 28 | 29 | QString qs_getupbringingref(const QString upbringing); 30 | 31 | QStringList qsl_getupbringingrings(const QString upbringing); 32 | 33 | QStringList qsl_getupbringings(); 34 | 35 | QStringList qsl_getupbringingskills2(const QString upbringing); 36 | 37 | QStringList qsl_getupbringingskillsbyset(const QString upbringing, const int setID); 38 | }; 39 | 40 | #endif // UPBRINGINGSREPOSITORY_H 41 | -------------------------------------------------------------------------------- /PaperBlossoms/src/ringviewer.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * ******************************************************************* 3 | * This file is part of the Paper Blossoms application 4 | * (https://github.com/dashnine/PaperBlossoms). 5 | * Copyright (c) 2019 Kyle Hankins (dashnine) 6 | * 7 | * This program is free software: you can redistribute it and/or modify 8 | * it under the terms of the GNU General Public License as published by 9 | * the Free Software Foundation, version 3. 10 | * 11 | * This program is distributed in the hope that it will be useful, but 12 | * WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 14 | * General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with this program. If not, see . 18 | * 19 | * The Legend of the Five Rings Roleplaying Game is the creation 20 | * and property of Fantasy Flight Games. 21 | * ******************************************************************* 22 | */ 23 | 24 | #include "ringviewer.h" 25 | #include "ui_ringviewer.h" 26 | 27 | RingViewer::RingViewer(QWidget *parent) : 28 | QWidget(parent), 29 | ui(new Ui::RingViewer) 30 | { 31 | ui->setupUi(this); 32 | ui->airring_label->setVisible(false); 33 | ui->earthring_label->setVisible(false); 34 | ui->firering_label->setVisible(false); 35 | ui->voidring_label->setVisible(false); 36 | ui->waterring_label->setVisible(false); 37 | ui->airring_label->setStyleSheet("QLabel { color : white; }"); 38 | ui->earthring_label->setStyleSheet("QLabel { color : white; }"); 39 | ui->firering_label->setStyleSheet("QLabel { color : white; }"); 40 | ui->voidring_label->setStyleSheet("QLabel { color : white; }"); 41 | ui->waterring_label->setStyleSheet("QLabel { color : white; }"); 42 | 43 | //QFontDatabase::addApplicationFont(":/images/resources/Bradley Hand Bold.ttf"); 44 | #ifdef Q_OS_MAC 45 | const QFont scriptfont = QFont("Bradley Hand", 20, QFont::Bold); 46 | #else 47 | const QFont scriptfont = QFont("Segoe Script",16, QFont::Bold); 48 | #endif 49 | 50 | ui->airring_label->setFont(scriptfont); 51 | ui->earthring_label->setFont(scriptfont); 52 | ui->firering_label->setFont(scriptfont); 53 | ui->voidring_label->setFont(scriptfont); 54 | ui->waterring_label->setFont(scriptfont); 55 | } 56 | 57 | RingViewer::~RingViewer() 58 | { 59 | delete ui; 60 | } 61 | 62 | void RingViewer::setRings(const QMap ringmap){ 63 | ui->airring_label->setVisible(true); 64 | ui->earthring_label->setVisible(true); 65 | ui->firering_label->setVisible(true); 66 | ui->voidring_label->setVisible(true); 67 | ui->waterring_label->setVisible(true); 68 | ui->airring_label->setText(QString::number(ringmap["Air"])); 69 | ui->earthring_label->setText(QString::number(ringmap["Earth"])); 70 | ui->firering_label->setText(QString::number(ringmap["Fire"])); 71 | ui->voidring_label->setText(QString::number(ringmap["Void"])); 72 | ui->waterring_label->setText(QString::number(ringmap["Water"])); 73 | } 74 | 75 | void RingViewer::setBackgroundWhite(){ 76 | ui->label->setStyleSheet("background:white"); 77 | } 78 | 79 | void RingViewer::setBackgroundClear(){ 80 | ui->label->setStyleSheet(""); 81 | 82 | } 83 | 84 | -------------------------------------------------------------------------------- /PaperBlossoms/src/ringviewer.h: -------------------------------------------------------------------------------- 1 | /* 2 | * ******************************************************************* 3 | * This file is part of the Paper Blossoms application 4 | * (https://github.com/dashnine/PaperBlossoms). 5 | * Copyright (c) 2019 Kyle Hankins (dashnine) 6 | * 7 | * This program is free software: you can redistribute it and/or modify 8 | * it under the terms of the GNU General Public License as published by 9 | * the Free Software Foundation, version 3. 10 | * 11 | * This program is distributed in the hope that it will be useful, but 12 | * WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 14 | * General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with this program. If not, see . 18 | * 19 | * The Legend of the Five Rings Roleplaying Game is the creation 20 | * and property of Fantasy Flight Games. 21 | * ******************************************************************* 22 | */ 23 | 24 | #ifndef RINGVIEWER_H 25 | #define RINGVIEWER_H 26 | #include 27 | 28 | #include 29 | 30 | namespace Ui { 31 | class RingViewer; 32 | } 33 | 34 | class RingViewer : public QWidget 35 | { 36 | Q_OBJECT 37 | 38 | public: 39 | explicit RingViewer(QWidget *parent = 0); 40 | ~RingViewer(); 41 | void setBackgroundWhite(); 42 | void setBackgroundClear(); 43 | public slots: 44 | void setRings(const QMap ringmap); 45 | private: 46 | Ui::RingViewer *ui; 47 | }; 48 | 49 | #endif // RINGVIEWER_H 50 | -------------------------------------------------------------------------------- /PaperBlossoms/src/tabs/backgroundpage.cpp: -------------------------------------------------------------------------------- 1 | #include "../mainwindow.h" 2 | #include "ui_mainwindow.h" 3 | #include "../dialog/edituserdescriptionsdialog.h" 4 | #include 5 | #include 6 | #include 7 | #include 8 | #include 9 | #include 10 | 11 | void MainWindow::on_family_lineEdit_textEdited(const QString &arg1) { 12 | curCharacter.family = arg1; 13 | m_dirtyDataFlag = true; 14 | } 15 | 16 | void MainWindow::on_name_lineEdit_textChanged(const QString &arg1) { 17 | curCharacter.name = arg1; 18 | ui->character_name_label->setText(curCharacter.family + " " + curCharacter.name + ", " + curCharacter.school); 19 | m_dirtyDataFlag = true; 20 | } 21 | 22 | void MainWindow::on_ninjo_textEdit_textChanged() { 23 | curCharacter.ninjo = ui->ninjo_textEdit->toPlainText(); 24 | m_dirtyDataFlag = true; 25 | } 26 | 27 | void MainWindow::on_giri_textEdit_textChanged() { 28 | curCharacter.giri = ui->giri_textEdit->toPlainText(); 29 | m_dirtyDataFlag = true; 30 | } 31 | 32 | void MainWindow::on_notes_textEdit_textChanged() { 33 | curCharacter.notes = ui->notes_textEdit->toPlainText(); 34 | m_dirtyDataFlag = true; 35 | } 36 | 37 | void MainWindow::on_actionDescription_Editor_triggered() { 38 | EditUserDescriptionsDialog dialog(deps); 39 | const int result = dialog.exec(); 40 | if (result == QDialog::Accepted) { 41 | dialog.doFinish(true); 42 | qDebug() << "Accepted: data comitted"; 43 | 44 | } else { 45 | dialog.doFinish(false); 46 | qDebug() << "Rejected: data discarded"; 47 | } 48 | } 49 | 50 | void MainWindow::on_image_label_clicked() { 51 | const QString fileName = QFileDialog::getOpenFileName( 52 | this, 53 | tr("Open File"), 54 | QDir::homePath(), 55 | tr("All files (*.*);;JPEG (*.jpg *.jpeg);;PNG (*.png)") 56 | ); 57 | 58 | if (!fileName.isEmpty()) { 59 | curCharacter.portrait.load(fileName); 60 | if (curCharacter.portrait.isNull()) { 61 | QMessageBox::information(this, tr("Image Viewer"), 62 | tr("Cannot load %1.").arg(fileName)); 63 | return; 64 | } 65 | const QPixmap p = QPixmap::fromImage(curCharacter.portrait); 66 | ui->image_label->setPixmap(p.scaled(ui->image_label->size(), Qt::KeepAspectRatio, Qt::SmoothTransformation)); 67 | 68 | 69 | ui->image_label->adjustSize(); 70 | } 71 | m_dirtyDataFlag = true; 72 | } 73 | -------------------------------------------------------------------------------- /PaperBlossoms/src/tabs/bondspage.cpp: -------------------------------------------------------------------------------- 1 | #include "../mainwindow.h" 2 | #include "../dialog/addbonddialog.h" 3 | #include 4 | #include 5 | #include 6 | #include 7 | #include 8 | #include 9 | #include "ui_mainwindow.h" 10 | 11 | void MainWindow::on_bondAdd_pushButton_clicked() { 12 | AddBondDialog addbonddialog(deps, &curCharacter, "Bonds"); 13 | const int result = addbonddialog.exec(); 14 | if (result == QDialog::Accepted) { 15 | qDebug() << "Accepted: getting bond"; 16 | m_dirtyDataFlag = true; 17 | //TODO:SUPPORT BOND SAVING with a BONDMODEL 18 | curCharacter.bonds.append(addbonddialog.getResult()); 19 | curCharacter.advanceStack.append("Bond|" + addbonddialog.getResult().first() + "|None|" + "3"); 20 | //TODO: Refresh Bonds in UI 21 | populateUI(); 22 | } else { 23 | qDebug() << "Not accepted; discarding changes."; 24 | } 25 | } 26 | 27 | void MainWindow::on_bondRemove_pushButton_clicked() { 28 | QModelIndex curIndex = ui->bonds_tableView->currentIndex(); 29 | if (!curIndex.isValid()) return; 30 | //QString name = bondmodel.item(curIndex.row(),1)->text(); 31 | curCharacter.bonds.removeAt(curIndex.row()); //TODO: TESTING -- is this accurate? 32 | populateUI(); 33 | m_dirtyDataFlag = true; 34 | } 35 | 36 | void MainWindow::on_bondUpgrade_pushButton_clicked() { 37 | QModelIndex curIndex = ui->bonds_tableView->currentIndex(); 38 | if (!curIndex.isValid()) return; 39 | 40 | QStringList bondrow = curCharacter.bonds.at(curIndex.row()); 41 | int currank = bondrow.at(1).toInt(); 42 | 43 | 44 | if (currank < 5) { 45 | int cost = 0; //cost of upgrade to next rank. Per page 190 PoW (also on CoS) 46 | switch (currank) { 47 | case 1: 48 | cost = 4; 49 | break; 50 | case 2: 51 | cost = 6; 52 | break; 53 | case 3: 54 | cost = 8; 55 | break; 56 | case 4: 57 | cost = 10; 58 | break; 59 | default: 60 | cost = 0; 61 | break; 62 | } 63 | if (QMessageBox::Cancel == QMessageBox::information(this, tr("Upgrading Bond"), 64 | "This will spend " + QString::number(cost) + 65 | " XP, and is not reversable. Continue?", 66 | QMessageBox::Yes | QMessageBox::Cancel)) { 67 | return; 68 | } 69 | 70 | bondrow.replace(1, QString::number(++currank)); 71 | curCharacter.bonds.replace(curIndex.row(), bondrow); 72 | curCharacter.advanceStack.append("Bond Upgrade|" + bondrow.first() + "|None|" + QString::number(cost)); 73 | 74 | } 75 | 76 | 77 | populateUI(); 78 | m_dirtyDataFlag = true; 79 | } 80 | -------------------------------------------------------------------------------- /PaperBlossoms/src/tabs/characterdatapage.cpp: -------------------------------------------------------------------------------- 1 | #include "../mainwindow.h" 2 | #include 3 | 4 | void MainWindow::on_glory_spinBox_valueChanged(const int arg1) { 5 | curCharacter.glory = arg1; 6 | m_dirtyDataFlag = true; 7 | } 8 | 9 | void MainWindow::on_honor_spinBox_valueChanged(const int arg1) { 10 | curCharacter.honor = arg1; 11 | m_dirtyDataFlag = true; 12 | } 13 | 14 | void MainWindow::on_status_spinBox_valueChanged(const int arg1) { 15 | curCharacter.status = arg1; 16 | m_dirtyDataFlag = true; 17 | } -------------------------------------------------------------------------------- /PaperBlossoms/src/tabs/equipmentpage.cpp: -------------------------------------------------------------------------------- 1 | #include "../mainwindow.h" 2 | #include "../dialog/additemdialog.h" 3 | #include "../enums.h" 4 | #include "ui_mainwindow.h" 5 | #include 6 | #include 7 | #include 8 | #include 9 | 10 | void MainWindow::on_removeweapon_pushbutton_clicked() { 11 | const QModelIndex curIndex = weaponProxyModel.mapToSource(ui->weapon_tableview->currentIndex()); 12 | if (!curIndex.isValid()) return; 13 | const QString name = equipmodel.item(curIndex.row(), Equipment::NAME)->text(); 14 | curCharacter.equipment.removeAt(curIndex.row()); //TODO: TESTING -- is this accurate? 15 | populateUI(); 16 | m_dirtyDataFlag = true; 17 | } 18 | 19 | void MainWindow::on_removearmor_pushbutton_clicked() { 20 | const QModelIndex curIndex = armorProxyModel.mapToSource(ui->armor_tableview->currentIndex()); 21 | if (!curIndex.isValid()) return; 22 | const QString name = equipmodel.item(curIndex.row(), Equipment::NAME)->text(); 23 | curCharacter.equipment.removeAt(curIndex.row()); //TODO: TESTING -- is this accurate? 24 | populateUI(); 25 | m_dirtyDataFlag = true; 26 | } 27 | 28 | void MainWindow::on_koku_spinBox_valueChanged(const int arg1) { 29 | curCharacter.koku = arg1; 30 | m_dirtyDataFlag = true; 31 | 32 | } 33 | 34 | void MainWindow::on_bu_spinBox_valueChanged(const int arg1) { 35 | curCharacter.bu = arg1; 36 | m_dirtyDataFlag = true; 37 | 38 | } 39 | 40 | void MainWindow::on_zeni_spinBox_valueChanged(const int arg1) { 41 | curCharacter.zeni = arg1; 42 | m_dirtyDataFlag = true; 43 | 44 | } 45 | 46 | void MainWindow::on_add_weapon_pushButton_clicked() { 47 | AddItemDialog additemdialog(deps, &curCharacter, "Weapon"); 48 | const int result = additemdialog.exec(); 49 | if (result == QDialog::Accepted) { 50 | qDebug() << "Accepted: getting item"; 51 | m_dirtyDataFlag = true; 52 | curCharacter.equipment.append(additemdialog.getResult()); 53 | populateUI(); 54 | } else { 55 | qDebug() << "Not accepted; discarding changes."; 56 | } 57 | } 58 | 59 | void MainWindow::on_add_armor_pushButton_clicked() { 60 | AddItemDialog additemdialog(deps, &curCharacter, "Armor"); 61 | const int result = additemdialog.exec(); 62 | if (result == QDialog::Accepted) { 63 | qDebug() << "Accepted: getting item"; 64 | m_dirtyDataFlag = true; 65 | curCharacter.equipment.append(additemdialog.getResult()); 66 | populateUI(); 67 | } else { 68 | qDebug() << "Not accepted; discarding changes."; 69 | } 70 | } 71 | 72 | void MainWindow::on_add_other_pushButton_clicked() { 73 | AddItemDialog additemdialog(deps, &curCharacter, "Other"); 74 | const int result = additemdialog.exec(); 75 | if (result == QDialog::Accepted) { 76 | qDebug() << "Accepted: getting item"; 77 | m_dirtyDataFlag = true; 78 | curCharacter.equipment.append(additemdialog.getResult()); 79 | populateUI(); 80 | } else { 81 | qDebug() << "Not accepted; discarding changes."; 82 | } 83 | } 84 | 85 | void MainWindow::on_removepersonaleffect_pushbutton_clicked() { 86 | const QModelIndex curIndex = perseffProxyModel.mapToSource(ui->other_tableview->currentIndex()); 87 | if (!curIndex.isValid()) return; 88 | const QString name = equipmodel.item(curIndex.row(), Equipment::NAME)->text(); 89 | curCharacter.equipment.removeAt(curIndex.row()); //TODO: TESTING -- is this accurate? 90 | populateUI(); 91 | m_dirtyDataFlag = true; 92 | } -------------------------------------------------------------------------------- /PaperBlossoms/src/tabs/personaltraitspage.cpp: -------------------------------------------------------------------------------- 1 | #include "../mainwindow.h" 2 | #include "../enums.h" 3 | #include "../dialog/adddisadvdialog.h" 4 | #include "ui_mainwindow.h" 5 | #include 6 | #include 7 | 8 | void MainWindow::on_addDistinction_pushButton_clicked() { 9 | AddDisAdvDialog adddisadvdialog(deps, &curCharacter, "Distinctions"); 10 | const int result = adddisadvdialog.exec(); 11 | if (result == QDialog::Accepted) { 12 | qDebug() << "Accepted: getting distrinction"; 13 | m_dirtyDataFlag = true; 14 | curCharacter.adv_disadv.append(adddisadvdialog.getResult()); 15 | populateUI(); 16 | } else { 17 | qDebug() << "Not accepted; discarding changes."; 18 | } 19 | } 20 | 21 | void MainWindow::on_addPassion_pushButton_clicked() { 22 | AddDisAdvDialog adddisadvdialog(deps, &curCharacter, "Passions"); 23 | const int result = adddisadvdialog.exec(); 24 | if (result == QDialog::Accepted) { 25 | qDebug() << "Accepted: getting distrinction"; 26 | m_dirtyDataFlag = true; 27 | curCharacter.adv_disadv.append(adddisadvdialog.getResult()); 28 | curCharacter.advanceStack.append("Passion|" + adddisadvdialog.getResult() + "|Curriculum|" + "3"); 29 | populateUI(); 30 | } else { 31 | qDebug() << "Not accepted; discarding changes."; 32 | } 33 | } 34 | 35 | void MainWindow::on_addAdversity_pushButton_clicked() { 36 | AddDisAdvDialog adddisadvdialog(deps, &curCharacter, "Adversities"); 37 | const int result = adddisadvdialog.exec(); 38 | if (result == QDialog::Accepted) { 39 | qDebug() << "Accepted: getting distrinction"; 40 | m_dirtyDataFlag = true; 41 | curCharacter.adv_disadv.append(adddisadvdialog.getResult()); 42 | populateUI(); 43 | } else { 44 | qDebug() << "Not accepted; discarding changes."; 45 | } 46 | } 47 | 48 | void MainWindow::on_addAnxiety_pushButton_clicked() { 49 | AddDisAdvDialog adddisadvdialog(deps, &curCharacter, "Anxieties"); 50 | const int result = adddisadvdialog.exec(); 51 | if (result == QDialog::Accepted) { 52 | qDebug() << "Accepted: getting distrinction"; 53 | m_dirtyDataFlag = true; 54 | curCharacter.adv_disadv.append(adddisadvdialog.getResult()); 55 | populateUI(); 56 | } else { 57 | qDebug() << "Not accepted; discarding changes."; 58 | } 59 | } 60 | 61 | void MainWindow::on_remDistinction_pushButton_clicked() { 62 | QModelIndex curIndex = distinctionsProxyModel.mapToSource(ui->distinctions_tableView->currentIndex()); 63 | if (!curIndex.isValid()) return; 64 | QString name = dis_advmodel.item(curIndex.row(), Adv_Disadv::NAME)->text(); 65 | curCharacter.adv_disadv.removeAt(curIndex.row()); //TODO: TESTING -- is this accurate? 66 | populateUI(); 67 | m_dirtyDataFlag = true; 68 | } 69 | 70 | void MainWindow::on_remPassion_pushButton_clicked() { 71 | QModelIndex curIndex = passionsProxyModel.mapToSource(ui->passions_tableView->currentIndex()); 72 | if (!curIndex.isValid()) return; 73 | QString name = dis_advmodel.item(curIndex.row(), Adv_Disadv::NAME)->text(); 74 | curCharacter.adv_disadv.removeAt(curIndex.row()); //TODO: TESTING -- is this accurate? 75 | populateUI(); 76 | m_dirtyDataFlag = true; 77 | } 78 | 79 | void MainWindow::on_remAdversity_pushButton_clicked() { 80 | QModelIndex curIndex = adversitiesProxyModel.mapToSource(ui->adversities_tableView->currentIndex()); 81 | if (!curIndex.isValid()) return; 82 | QString name = dis_advmodel.item(curIndex.row(), Adv_Disadv::NAME)->text(); 83 | curCharacter.adv_disadv.removeAt(curIndex.row()); //TODO: TESTING -- is this accurate? 84 | populateUI(); 85 | m_dirtyDataFlag = true; 86 | } 87 | 88 | void MainWindow::on_remAnxiety_pushButton_clicked() { 89 | QModelIndex curIndex = anxietiesProxyModel.mapToSource(ui->anxieties_tableView->currentIndex()); 90 | if (!curIndex.isValid()) return; 91 | QString name = dis_advmodel.item(curIndex.row(), Adv_Disadv::NAME)->text(); 92 | curCharacter.adv_disadv.removeAt(curIndex.row()); //TODO: TESTING -- is this accurate? 93 | populateUI(); 94 | m_dirtyDataFlag = true; 95 | } 96 | -------------------------------------------------------------------------------- /PaperBlossoms/src/tools/developer.cpp: -------------------------------------------------------------------------------- 1 | #include "../mainwindow.h" 2 | #include "../dialog/dblocalisationeditordialog.h" 3 | #include 4 | #include 5 | #include 6 | #include 7 | 8 | void MainWindow::on_actionExport_Translation_CSV_triggered() { 9 | bool success = false; 10 | qDebug() << QString("Homepath = ") + QDir::homePath(); 11 | 12 | QString fileName = QFileDialog::getSaveFileName(this, tr("Export Translation File..."), 13 | QDir::homePath() + "/tr.csv", tr("CSV (*.csv)")); 14 | if (fileName.isEmpty()) 15 | return; 16 | else { 17 | qDebug() << QString("Filename = ") + fileName; 18 | success = deps->dal->exportTranslatableCSV(fileName); 19 | } 20 | if (!success) { 21 | QMessageBox::information(this, tr("Error exporting translation data"), 22 | "Data export encoutered one or more errors. Your file may be corrupt or incomplete."); 23 | 24 | } else { 25 | QMessageBox::information(this, tr("Translation Template Export Complete"), 26 | "User data export completed. This file can be comitted to the Paper Blossoms github to update your localisation."); 27 | 28 | } 29 | 30 | } 31 | 32 | void MainWindow::on_actionTranslate_For_Locale_triggered() { 33 | DBLocalisationEditorDialog dialog(deps); 34 | const int result = dialog.exec(); 35 | if (result == QDialog::Accepted) { 36 | dialog.doFinish(true); 37 | bool success = false; 38 | qDebug() << QString("Homepath = ") + QDir::homePath(); 39 | 40 | QString fileName = QFileDialog::getSaveFileName(this, tr("Export Translation File..."), 41 | QDir::homePath() + "/tr.csv", tr("CSV (*.csv)")); 42 | if (fileName.isEmpty()) 43 | return; 44 | else { 45 | qDebug() << QString("Filename = ") + fileName; 46 | success = deps->dal->exportTranslatableCSV(fileName); 47 | } 48 | if (!success) { 49 | QMessageBox::information(this, tr("Error exporting translation data"), 50 | "Data export encoutered one or more errors. Your file may be corrupt or incomplete."); 51 | 52 | } else { 53 | QMessageBox::information(this, tr("Translation Template Export Complete"), 54 | "User data export completed. This file can be comitted to the Paper Blossoms github to update your localisation."); 55 | 56 | } 57 | 58 | 59 | qDebug() << "Accepted: data comitted"; 60 | 61 | } else { 62 | dialog.doFinish(false); 63 | qDebug() << "Rejected: data discarded"; 64 | } 65 | } 66 | -------------------------------------------------------------------------------- /PaperBlossoms/src/tools/import.cpp: -------------------------------------------------------------------------------- 1 | #include "../mainwindow.h" 2 | #include 3 | #include 4 | #include 5 | 6 | void MainWindow::on_actionImport_User_Data_Tables_triggered() { 7 | QMessageBox::information(this, tr("Warning"), 8 | "This feature is in beta; it will attempt to import a folder containing exported user data files. Errors importing could cause inconsistencies in the data. Proceed with caution. If you experience difficulty, remove the local copy of the DB and relaunch Paper Blossoms."); 9 | const QString fileName = QFileDialog::getExistingDirectory(this, tr("Choose a folder containing exported data..."), 10 | QDir::homePath()); 11 | if (fileName.isEmpty()) 12 | return; 13 | else { 14 | bool success = true; 15 | foreach(QString tablename, deps->dal->user_tables) { 16 | //dal->queryToCsv(fileName,tablename); 17 | success &= deps->dal->importCSV(fileName, tablename); 18 | } 19 | if (!success) { 20 | QMessageBox::information(this, tr("Error Importing Data"), 21 | "Data import encoutered one or more errors. Your database may be inconsistent or incomplete. Recommend restoring default DB."); 22 | 23 | } else { 24 | QMessageBox::information(this, tr("Import Complete"), 25 | "User data import completed. This feature is in beta; please verify that your data still functions normally."); 26 | 27 | } 28 | } 29 | } 30 | 31 | void MainWindow::on_actionImport_User_Descriptions_Table_triggered() { 32 | const QString fileName = QFileDialog::getOpenFileName(this, tr("Import User Descriptions..."), QDir::homePath(), 33 | tr("CSV (*.csv);;Any (*)")); 34 | if (fileName.isEmpty()) 35 | return; 36 | else { 37 | bool success = true; 38 | success &= deps->dal->importCSV(fileName, "user_descriptions", false); 39 | if (!success) { 40 | QMessageBox::information(this, tr("Error Importing Data"), 41 | "Data import encoutered one or more errors. Your database may be inconsistent or incomplete. Recommend restoring default DB."); 42 | 43 | } else { 44 | QMessageBox::information(this, tr("Import Complete"), 45 | "User data import completed. This feature is in beta; please verify that your data still functions normally."); 46 | 47 | } 48 | } 49 | 50 | } 51 | -------------------------------------------------------------------------------- /PaperBlossoms/ui/addbonddialog.ui: -------------------------------------------------------------------------------- 1 | 2 | 3 | AddBondDialog 4 | 5 | 6 | 7 | 0 8 | 0 9 | 400 10 | 219 11 | 12 | 13 | 14 | Add Personal Trait 15 | 16 | 17 | 18 | 19 | 20 | Choose a bond to add. Note: Requires GM approval. 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | Note: Adding Bonds requires 3 XP, and does not count towards Curriculum or Title. Removing this bond will not automatically remove the associated Advance. 31 | 32 | 33 | true 34 | 35 | 36 | 37 | 38 | 39 | 40 | Qt::Horizontal 41 | 42 | 43 | QDialogButtonBox::Cancel|QDialogButtonBox::Ok 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | buttonBox 53 | accepted() 54 | AddBondDialog 55 | accept() 56 | 57 | 58 | 248 59 | 254 60 | 61 | 62 | 157 63 | 274 64 | 65 | 66 | 67 | 68 | buttonBox 69 | rejected() 70 | AddBondDialog 71 | reject() 72 | 73 | 74 | 316 75 | 260 76 | 77 | 78 | 286 79 | 274 80 | 81 | 82 | 83 | 84 | 85 | -------------------------------------------------------------------------------- /PaperBlossoms/ui/adddisadvdialog.ui: -------------------------------------------------------------------------------- 1 | 2 | 3 | AddDisAdvDialog 4 | 5 | 6 | 7 | 0 8 | 0 9 | 400 10 | 219 11 | 12 | 13 | 14 | Add Personal Trait 15 | 16 | 17 | 18 | 19 | 20 | Choose a personal trait to add. Note: Requires GM approval. 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | Note: Adding Passions requires 3 XP. Removing this passion will not automatically remove the associated Advance. 31 | 32 | 33 | true 34 | 35 | 36 | 37 | 38 | 39 | 40 | Qt::Horizontal 41 | 42 | 43 | QDialogButtonBox::Cancel|QDialogButtonBox::Ok 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | buttonBox 53 | accepted() 54 | AddDisAdvDialog 55 | accept() 56 | 57 | 58 | 248 59 | 254 60 | 61 | 62 | 157 63 | 274 64 | 65 | 66 | 67 | 68 | buttonBox 69 | rejected() 70 | AddDisAdvDialog 71 | reject() 72 | 73 | 74 | 316 75 | 260 76 | 77 | 78 | 286 79 | 274 80 | 81 | 82 | 83 | 84 | 85 | -------------------------------------------------------------------------------- /PaperBlossoms/ui/addtitledialog.ui: -------------------------------------------------------------------------------- 1 | 2 | 3 | AddTitleDialog 4 | 5 | 6 | 7 | 0 8 | 0 9 | 400 10 | 124 11 | 12 | 13 | 14 | 15 | 0 16 | 0 17 | 18 | 19 | 20 | Add Title 21 | 22 | 23 | 24 | 25 | 26 | XP to Completion: 27 | 28 | 29 | 30 | 31 | 32 | 33 | TextLabel 34 | 35 | 36 | 37 | 38 | 39 | 40 | Title Ability: 41 | 42 | 43 | 44 | 45 | 46 | 47 | TextLabel 48 | 49 | 50 | 51 | 52 | 53 | 54 | Reference: 55 | 56 | 57 | 58 | 59 | 60 | 61 | TextLabel 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | Qt::Horizontal 72 | 73 | 74 | QDialogButtonBox::Cancel|QDialogButtonBox::Ok 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | buttonBox 84 | accepted() 85 | AddTitleDialog 86 | accept() 87 | 88 | 89 | 248 90 | 254 91 | 92 | 93 | 157 94 | 274 95 | 96 | 97 | 98 | 99 | buttonBox 100 | rejected() 101 | AddTitleDialog 102 | reject() 103 | 104 | 105 | 316 106 | 260 107 | 108 | 109 | 286 110 | 274 111 | 112 | 113 | 114 | 115 | 116 | -------------------------------------------------------------------------------- /PaperBlossoms/ui/dblocalisationeditordialog.ui: -------------------------------------------------------------------------------- 1 | 2 | 3 | DBLocalisationEditorDialog 4 | 5 | 6 | 7 | 0 8 | 0 9 | 655 10 | 560 11 | 12 | 13 | 14 | Dialog 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | Apply Changes 23 | 24 | 25 | 26 | 27 | 28 | 29 | Qt::Horizontal 30 | 31 | 32 | 33 | 150 34 | 20 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | QDialogButtonBox::Cancel|QDialogButtonBox::Ok 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 0 53 | 0 54 | 55 | 56 | 57 | QAbstractScrollArea::AdjustToContents 58 | 59 | 60 | true 61 | 62 | 63 | QAbstractItemView::SingleSelection 64 | 65 | 66 | true 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | -------------------------------------------------------------------------------- /PaperBlossoms/ui/dynamicchoicewidget.ui: -------------------------------------------------------------------------------- 1 | 2 | 3 | DynamicChoiceWidget 4 | 5 | 6 | 7 | 0 8 | 0 9 | 400 10 | 300 11 | 12 | 13 | 14 | 15 | 0 16 | 0 17 | 18 | 19 | 20 | 21 | 0 22 | 20 23 | 24 | 25 | 26 | Form 27 | 28 | 29 | 30 | 31 | 32 | 33 | -------------------------------------------------------------------------------- /PaperBlossoms/ui/renderdialog.ui: -------------------------------------------------------------------------------- 1 | 2 | 3 | RenderDialog 4 | 5 | 6 | 7 | 0 8 | 0 9 | 810 10 | 446 11 | 12 | 13 | 14 | Customize Character Sheet 15 | 16 | 17 | 18 | 19 | 20 | Options: 21 | 22 | 23 | 24 | 25 | 26 | Hide Portrait 27 | 28 | 29 | 30 | 31 | 32 | 33 | Hide 0-Ranks Skills 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | Print... 46 | 47 | 48 | 49 | 50 | 51 | 52 | Send to Browser 53 | 54 | 55 | 56 | 57 | 58 | 59 | Qt::Vertical 60 | 61 | 62 | 63 | 20 64 | 40 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | Cancel 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 0 83 | 0 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | QWebEngineView 93 | QWidget 94 |
qwebengineview.h
95 | 1 96 |
97 |
98 | 99 | 100 |
101 | -------------------------------------------------------------------------------- /PaperBlossoms/ui/ringviewer.ui: -------------------------------------------------------------------------------- 1 | 2 | 3 | RingViewer 4 | 5 | 6 | 7 | 0 8 | 0 9 | 231 10 | 231 11 | 12 | 13 | 14 | 15 | 0 16 | 0 17 | 18 | 19 | 20 | 21 | 231 22 | 231 23 | 24 | 25 | 26 | 27 | 352 28 | 348 29 | 30 | 31 | 32 | Form 33 | 34 | 35 | 36 | 37 | 0 38 | 0 39 | 231 40 | 231 41 | 42 | 43 | 44 | 45 | 0 46 | 0 47 | 48 | 49 | 50 | 51 | 52 | 53 | :/images/resources/colorRingsMed.png 54 | 55 | 56 | false 57 | 58 | 59 | 60 | 61 | 62 | 80 63 | 48 64 | 21 65 | 31 66 | 67 | 68 | 69 | 70 | Bradley Hand 71 | 20 72 | 75 73 | true 74 | 75 | 76 | 77 | 6 78 | 79 | 80 | 81 | 82 | 83 | 132 84 | 47 85 | 21 86 | 31 87 | 88 | 89 | 90 | 91 | Bradley Hand 92 | 20 93 | 75 94 | true 95 | 96 | 97 | 98 | 6 99 | 100 | 101 | 102 | 103 | 104 | 60 105 | 102 106 | 21 107 | 31 108 | 109 | 110 | 111 | 112 | Bradley Hand 113 | 20 114 | 75 115 | true 116 | 117 | 118 | 119 | 6 120 | 121 | 122 | 123 | 124 | 125 | 151 126 | 100 127 | 21 128 | 31 129 | 130 | 131 | 132 | 133 | Bradley Hand 134 | 20 135 | 75 136 | true 137 | 138 | 139 | 140 | 6 141 | 142 | 143 | 144 | 145 | 146 | 105 147 | 142 148 | 21 149 | 31 150 | 151 | 152 | 153 | 154 | Bradley Hand 155 | 20 156 | 75 157 | true 158 | 159 | 160 | 161 | 6 162 | 163 | 164 | 165 | 166 | 167 | 168 | 169 | 170 | -------------------------------------------------------------------------------- /PaperBlossomsSolution.pro: -------------------------------------------------------------------------------- 1 | TEMPLATE = subdirs 2 | SUBDIRS += PaperBlossoms \ 3 | TestPaperBlossoms 4 | -------------------------------------------------------------------------------- /TestPaperBlossoms/.gitignore: -------------------------------------------------------------------------------- 1 | # This file is used to ignore files which are generated 2 | # ---------------------------------------------------------------------------- 3 | 4 | *~ 5 | *.autosave 6 | *.a 7 | *.core 8 | *.moc 9 | *.o 10 | *.obj 11 | *.orig 12 | *.rej 13 | *.so 14 | *.so.* 15 | *_pch.h.cpp 16 | *_resource.rc 17 | *.qm 18 | .#* 19 | *.*# 20 | core 21 | !core/ 22 | tags 23 | .DS_Store 24 | .directory 25 | *.debug 26 | Makefile* 27 | *.prl 28 | *.app 29 | moc_*.cpp 30 | ui_*.h 31 | qrc_*.cpp 32 | Thumbs.db 33 | *.res 34 | *.rc 35 | /.qmake.cache 36 | /.qmake.stash 37 | 38 | # qtcreator generated files 39 | *.pro.user* 40 | 41 | # xemacs temporary files 42 | *.flc 43 | 44 | # Vim temporary files 45 | .*.swp 46 | 47 | # Visual Studio generated files 48 | *.ib_pdb_index 49 | *.idb 50 | *.ilk 51 | *.pdb 52 | *.sln 53 | *.suo 54 | *.vcproj 55 | *vcproj.*.*.user 56 | *.ncb 57 | *.sdf 58 | *.opensdf 59 | *.vcxproj 60 | *vcxproj.* 61 | 62 | # MinGW generated files 63 | *.Debug 64 | *.Release 65 | 66 | # Python byte code 67 | *.pyc 68 | 69 | # Binaries 70 | # -------- 71 | *.dll 72 | *.exe 73 | 74 | -------------------------------------------------------------------------------- /TestPaperBlossoms/TestPaperBlossoms.pro: -------------------------------------------------------------------------------- 1 | QT += testlib 2 | QT += core gui sql webenginewidgets widgets printsupport 3 | CONFIG += qt warn_on depend_includepath testcase 4 | 5 | TEMPLATE = app 6 | 7 | SOURCES += tst_testmain.cpp 8 | 9 | RESOURCES += \ 10 | ../PaperBlossoms/resources.qrc \ 11 | testresources.qrc 12 | -------------------------------------------------------------------------------- /TestPaperBlossoms/export_sample/user_advantages_disadvantages.csv: -------------------------------------------------------------------------------- 1 | "Distinctions","TESTING","none","none","Void","testing","test" 2 | -------------------------------------------------------------------------------- /TestPaperBlossoms/export_sample/user_armor.csv: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dashnine/PaperBlossoms/bfca0f065a946f1e3206716acd362763b4322856/TestPaperBlossoms/export_sample/user_armor.csv -------------------------------------------------------------------------------- /TestPaperBlossoms/export_sample/user_armor_qualities.csv: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dashnine/PaperBlossoms/bfca0f065a946f1e3206716acd362763b4322856/TestPaperBlossoms/export_sample/user_armor_qualities.csv -------------------------------------------------------------------------------- /TestPaperBlossoms/export_sample/user_armor_resistance.csv: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dashnine/PaperBlossoms/bfca0f065a946f1e3206716acd362763b4322856/TestPaperBlossoms/export_sample/user_armor_resistance.csv -------------------------------------------------------------------------------- /TestPaperBlossoms/export_sample/user_clans.csv: -------------------------------------------------------------------------------- 1 | "Cat","none","none","Minor","Air","Skulduggery","25" 2 | -------------------------------------------------------------------------------- /TestPaperBlossoms/export_sample/user_curriculum.csv: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dashnine/PaperBlossoms/bfca0f065a946f1e3206716acd362763b4322856/TestPaperBlossoms/export_sample/user_curriculum.csv -------------------------------------------------------------------------------- /TestPaperBlossoms/export_sample/user_descriptions.csv: -------------------------------------------------------------------------------- 1 | "Crane","Such Best. Very Clan.","Oh wow" 2 | "Kakita","White hair","so cool" 3 | "Kakita Duelist School","Such Duelist","Swords win" 4 | -------------------------------------------------------------------------------- /TestPaperBlossoms/export_sample/user_families.csv: -------------------------------------------------------------------------------- 1 | "Cat","Nekoma","none","none","25","5" 2 | -------------------------------------------------------------------------------- /TestPaperBlossoms/export_sample/user_family_rings.csv: -------------------------------------------------------------------------------- 1 | "Nekoma","Air" 2 | "Nekoma","Earth" 3 | -------------------------------------------------------------------------------- /TestPaperBlossoms/export_sample/user_family_skills.csv: -------------------------------------------------------------------------------- 1 | "Nekoma","Survival" 2 | "Nekoma","Performance" 3 | -------------------------------------------------------------------------------- /TestPaperBlossoms/export_sample/user_personal_effect_qualities.csv: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dashnine/PaperBlossoms/bfca0f065a946f1e3206716acd362763b4322856/TestPaperBlossoms/export_sample/user_personal_effect_qualities.csv -------------------------------------------------------------------------------- /TestPaperBlossoms/export_sample/user_personal_effects.csv: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dashnine/PaperBlossoms/bfca0f065a946f1e3206716acd362763b4322856/TestPaperBlossoms/export_sample/user_personal_effects.csv -------------------------------------------------------------------------------- /TestPaperBlossoms/export_sample/user_qualities.csv: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dashnine/PaperBlossoms/bfca0f065a946f1e3206716acd362763b4322856/TestPaperBlossoms/export_sample/user_qualities.csv -------------------------------------------------------------------------------- /TestPaperBlossoms/export_sample/user_school_rings.csv: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dashnine/PaperBlossoms/bfca0f065a946f1e3206716acd362763b4322856/TestPaperBlossoms/export_sample/user_school_rings.csv -------------------------------------------------------------------------------- /TestPaperBlossoms/export_sample/user_school_starting_outfit.csv: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dashnine/PaperBlossoms/bfca0f065a946f1e3206716acd362763b4322856/TestPaperBlossoms/export_sample/user_school_starting_outfit.csv -------------------------------------------------------------------------------- /TestPaperBlossoms/export_sample/user_school_starting_skills.csv: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dashnine/PaperBlossoms/bfca0f065a946f1e3206716acd362763b4322856/TestPaperBlossoms/export_sample/user_school_starting_skills.csv -------------------------------------------------------------------------------- /TestPaperBlossoms/export_sample/user_school_starting_techniques.csv: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dashnine/PaperBlossoms/bfca0f065a946f1e3206716acd362763b4322856/TestPaperBlossoms/export_sample/user_school_starting_techniques.csv -------------------------------------------------------------------------------- /TestPaperBlossoms/export_sample/user_school_techniques_available.csv: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dashnine/PaperBlossoms/bfca0f065a946f1e3206716acd362763b4322856/TestPaperBlossoms/export_sample/user_school_techniques_available.csv -------------------------------------------------------------------------------- /TestPaperBlossoms/export_sample/user_schools.csv: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dashnine/PaperBlossoms/bfca0f065a946f1e3206716acd362763b4322856/TestPaperBlossoms/export_sample/user_schools.csv -------------------------------------------------------------------------------- /TestPaperBlossoms/export_sample/user_skills.csv: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dashnine/PaperBlossoms/bfca0f065a946f1e3206716acd362763b4322856/TestPaperBlossoms/export_sample/user_skills.csv -------------------------------------------------------------------------------- /TestPaperBlossoms/export_sample/user_techniques.csv: -------------------------------------------------------------------------------- 1 | "Kata","Special Kata","TESTING","","none","none","1","3" 2 | -------------------------------------------------------------------------------- /TestPaperBlossoms/export_sample/user_title_advancements.csv: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dashnine/PaperBlossoms/bfca0f065a946f1e3206716acd362763b4322856/TestPaperBlossoms/export_sample/user_title_advancements.csv -------------------------------------------------------------------------------- /TestPaperBlossoms/export_sample/user_titles.csv: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dashnine/PaperBlossoms/bfca0f065a946f1e3206716acd362763b4322856/TestPaperBlossoms/export_sample/user_titles.csv -------------------------------------------------------------------------------- /TestPaperBlossoms/export_sample/user_weapon_qualities.csv: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dashnine/PaperBlossoms/bfca0f065a946f1e3206716acd362763b4322856/TestPaperBlossoms/export_sample/user_weapon_qualities.csv -------------------------------------------------------------------------------- /TestPaperBlossoms/export_sample/user_weapons.csv: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dashnine/PaperBlossoms/bfca0f065a946f1e3206716acd362763b4322856/TestPaperBlossoms/export_sample/user_weapons.csv -------------------------------------------------------------------------------- /TestPaperBlossoms/testresources.qrc: -------------------------------------------------------------------------------- 1 | 2 | 3 | export_sample/user_advantages_disadvantages.csv 4 | export_sample/user_armor_qualities.csv 5 | export_sample/user_armor_resistance.csv 6 | export_sample/user_armor.csv 7 | export_sample/user_clans.csv 8 | export_sample/user_curriculum.csv 9 | export_sample/user_descriptions.csv 10 | export_sample/user_families.csv 11 | export_sample/user_family_rings.csv 12 | export_sample/user_family_skills.csv 13 | export_sample/user_personal_effect_qualities.csv 14 | export_sample/user_personal_effects.csv 15 | export_sample/user_qualities.csv 16 | export_sample/user_school_rings.csv 17 | export_sample/user_school_starting_outfit.csv 18 | export_sample/user_school_starting_skills.csv 19 | export_sample/user_school_starting_techniques.csv 20 | export_sample/user_school_techniques_available.csv 21 | export_sample/user_schools.csv 22 | export_sample/user_skills.csv 23 | export_sample/user_techniques.csv 24 | export_sample/user_title_advancements.csv 25 | export_sample/user_titles.csv 26 | export_sample/user_weapon_qualities.csv 27 | export_sample/user_weapons.csv 28 | 29 | 30 | -------------------------------------------------------------------------------- /_config.yml: -------------------------------------------------------------------------------- 1 | theme: jekyll-theme-tactile -------------------------------------------------------------------------------- /_layouts/default.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 13 | 14 | {% seo %} 15 | 16 | 17 | 18 |
19 |
20 | 21 |
22 |

{{ page.title | default: site.title | default: site.github.repository_name }}

23 |

{{ page.description | default: site.description | default: site.github.project_tagline }}

24 |
25 |
26 | {% if site.show_downloads %} 27 | Download .zip 28 | Download .tar.gz 29 | {% endif %} 30 | {% if site.github.public %} 31 | {% if site.github.is_project_page %} 32 | View on GitHub 33 | {% else %} 34 | View on GitHub 35 | {% endif %} 36 | {% endif %} 37 |
38 |
39 |
40 | {{ content }} 41 |
42 | 43 |
44 | {% if site.github.is_project_page %} 45 | {{ site.title | default: site.github.repository_name }} is maintained by {{ site.github.owner_name }}
46 | {% endif %} 47 | This page was generated by GitHub Pages. 48 |
49 | 50 |
51 |
52 | 53 | {% if site.google_analytics %} 54 | 62 | {% endif %} 63 | 64 | 65 | --------------------------------------------------------------------------------