toml integration

This commit is contained in:
zxvfxwing
2022-07-10 02:11:41 +02:00
parent 55953b0388
commit 7d9ab717f1
8 changed files with 240 additions and 1 deletions

9
armors.json Normal file
View File

@@ -0,0 +1,9 @@
[
{
"name": "Kamura Legacy Set",
"head": {
},
""
}
]

47
armors.toml Normal file
View File

@@ -0,0 +1,47 @@
[[set]]
[set."Kamura Legacy Set"]
rarity = 8
[set."Kamura Legacy Set".helm]
name = "Kamura Legacy Head Scarf"
defense = 80
resistances = [2, 0, 0, 0, 0]
slots = [2]
skills."Devine Blessing" = 2
skills."Resuscitate" = 1
[set."Kamura Legacy Set".chest]
name = "Kamura Legacy Garb"
defense = 80
resistances = [2, 0, 0, 0, 0]
slots = [1, 1]
skills."Wirebug Whisperer" = 2
skills."Wall Runner" = 1
skills."Critical Eye" = 1
[set."Kamura Legacy Set".arms]
name = "Kamura Legacy Braces"
defense = 80
resistances = [2, 0, 0, 0, 0]
slots = [1]
skills."Divine Blessing" = 2
skills."Heroics" = 1
skills."Critical Eye" = 2
[set."Kamura Legacy Set".waist]
name = "Kamura Legacy Obi"
defense = 80
resistances = [2, 0, 0, 0, 0]
slots = [4, 1]
skills."Wirebug Whisperer" = 1
skills."Critical Eye" = 1
[set."Kamura Legacy Set".legs]
name = "Kamura Legacy Leggins"
defense = 80
resistances = [2, 0, 0, 0, 0]
slots = [2]
skills."Wall Runner" = 2
skills."Resuscitate" = 1
skills."Affinity Sliding" = 1

View File

@@ -16,5 +16,13 @@ FetchContent_Declare(
GIT_TAG "9aae45eb4a05a5a1f96be1ef37eb503a12ceb889" # 1.88
)
FetchContent_MakeAvailable(glfw imgui)
FetchContent_Declare(
tomlplusplus
GIT_REPOSITORY "https://github.com/marzer/tomlplusplus.git"
GIT_TAG "85c5128f90b4b4847df81ad546d7468afb46a7b4" # 3.1.0
)
FetchContent_MakeAvailable(glfw imgui tomlplusplus)
add_subdirectory(imgui)
add_subdirectory(tomlplusplus)

View File

@@ -0,0 +1,14 @@
add_library(
tomlplusplus STATIC
"${tomlplusplus_SOURCE_DIR}/src/toml++/toml.cpp"
)
target_compile_definitions(
tomlplusplus PUBLIC
TOML_EXCEPTIONS=0
)
target_include_directories(
tomlplusplus PUBLIC
"${tomlplusplus_SOURCE_DIR}/include"
)

17
include/mhache_armor.h Normal file
View File

@@ -0,0 +1,17 @@
#ifndef MHACHEARMOR_H
#define MHACHEARMOR_H
#include <string>
#include <array>
class MHacheArmor {
private:
std::string _name;
struct piece {
std::string _name;
std::array<char, 5> _resistances;
};
}
#endif

129
skills.toml Normal file
View File

@@ -0,0 +1,129 @@
[[skills]]
names = [
"Affinity Sliding",
Agitator
Ammo Up
Artillery
Attack Boost
Ballistics
Bladescale Hone
Blast Attack
Blast Resistance
Blight Resistance
Blood Rite
Bloodlust
Bludgeoner
Bombardier
Botanist
Bow Charge Plus
Bubbly Dance
Capture Master
Carving Master
Carving Pro
Chain Crit
Chameleos Blessing
Charge Master
Coalescence
Constitution
Counterstrike
Critical Boost
Critical Draw
Critical Element
Critical Eye
Defense Boost
Dereliction
Diversion
Divine Blessing
Dragon Attack
Dragon Resistance Skill
Dragonheart
Earplugs
Evade Extender
Evade Window
Fire Attack
Fire Resistance Skill
Flinch Free
Focus
Foray
Fortify
Free Meal
Furious
Geologist
Good Luck
Grinder (S)
Guard
Guard Up
Handicraft
Hellfire Cloak
Heroics
Horn Maestro
Hunger Resistance
Ice Attack
Ice Resistance Skill
Item Prolonger
Jump Master
Kushala Blessing
Latent Power
Leap of Faith
Load Shells
Mail of Hellfire
Marathon Runner
Master Mounter
Master's Touch
Maximum Might
Mind's Eye
Muck Resistance
Mushroomancer
Normal/Rapid Up
Offensive Guard
Paralysis Attack
Paralysis Resistance
Partbreaker
Peak Performance
Pierce Up
Poison Attack
Poison Resistance
Power Prolonger
Protective Polish
Punishing Draw
Quick Breath
Quick Sheath
Rapid Fire Up
Rapid Morph
Razor Sharp
Recoil Down
Recovery Speed
Recovery Up
Redirection
Reload Speed
Resentment
Resuscitate
Sleep Attack
Sleep Resistance
Slugger
Spare Shot
Special Ammo Boost
Speed Eating
Speed Shaprening
Spiribird's Call
Spread Up
Stamina Surge
Stamina Thief
Steadiness
Stormsoul
Stun Resistance
Teostra Blessing
Thunder Alignment
Thunder Attack
Thunder Resistance Skill
Tremor Resistance
Tune-Up
Wall Runner
Wall Runner (Boost)
Water Attack
Water Resistance Skill
Weakness Exploit
Wide-Range
Wind Alignment
Windproof
Wirebug Whisperer

View File

@@ -19,6 +19,7 @@ target_link_libraries(
${OPENGL_LIBRARIES}
glfw
imgui
tomlplusplus
)
target_include_directories(

View File

@@ -1,8 +1,22 @@
#include <iostream>
#include <memory>
#include <string>
#include <toml++/toml.h>
#include "mhache_window.h"
int main(int argc, char** argv)
{
toml::parse_result result = toml::parse_file("../../armors.toml");
if (!result) {
std::cerr << "Parsing of TOML file" << result.error().source().path << " failed." << std::endl;
std::cerr << "-> " << result.error().description() << std::endl;
return 1;
}
std::cerr << result.table() << std::endl;
auto window = std::make_unique<MHacheWindow>(620, 480);
window->display();
return 0;