mirror of
https://github.com/amyinspace/MagicSetEditor2.git
synced 2026-06-10 21:06:59 -04:00
fix compilation errors
This commit is contained in:
@@ -45,7 +45,7 @@ SCRIPT_FUNCTION(get_mse_locale) {
|
||||
|
||||
SCRIPT_FUNCTION(get_mse_dark_mode) {
|
||||
SCRIPT_RETURN(settings.darkMode());
|
||||
}
|
||||
}
|
||||
|
||||
SCRIPT_FUNCTION(trace) {
|
||||
SCRIPT_PARAM_C(String, input);
|
||||
@@ -753,7 +753,7 @@ SCRIPT_FUNCTION(get_card_stylesheet) {
|
||||
SCRIPT_PARAM_C(ScriptValueP, set);
|
||||
ScriptObject<CardP>* c = dynamic_cast<ScriptObject<CardP>*>(input.get());
|
||||
ScriptObject<Set*>* s = dynamic_cast<ScriptObject<Set*>*>(set.get());
|
||||
if (s && c) {
|
||||
if (s && c) {
|
||||
return to_script(s->getValue()->stylesheetForP(c->getValue()));
|
||||
}
|
||||
throw ScriptError(_("invalid set or card argument"));
|
||||
|
||||
@@ -40,7 +40,7 @@ inline static Value* get_card_field_container(Game& game, IndexMap<FieldP, Value
|
||||
return it->get();
|
||||
}
|
||||
|
||||
inline static Value* get_container(IndexMap<FieldP, ValueP>& map, String& type, String& key_name, bool ignore_field_not_found) {
|
||||
inline static Value* get_container(IndexMap<FieldP, ValueP>& map, const String& type, const String& key_name, bool ignore_field_not_found) {
|
||||
// find value container to update
|
||||
IndexMap<FieldP, ValueP>::const_iterator it = map.find(key_name);
|
||||
if (it == map.end()) {
|
||||
|
||||
@@ -222,7 +222,7 @@ inline static CardP json_to_mse_card(boost::json::object& jv, Set* set) {
|
||||
if (jv.contains("extra_data") && jv["extra_data"].is_object()) {
|
||||
boost::json::object datav = jv["extra_data"].as_object();
|
||||
for (auto it = datav.begin(); it != datav.end(); ++it) {
|
||||
StyleSheetP& stylesheet = StyleSheet::byGameAndName(*set->game, it->key_c_str());
|
||||
StyleSheetP stylesheet = StyleSheet::byGameAndName(*set->game, it->key_c_str());
|
||||
if (!stylesheet) continue;
|
||||
IndexMap<FieldP, ValueP>& stylesheet_data = card->extraDataFor(*stylesheet);
|
||||
boost::json::object stylesheet_datav = it->value().as_object();
|
||||
@@ -245,9 +245,9 @@ inline static SetP json_to_mse_set(boost::json::object& jv) {
|
||||
if (!jv.contains("stylesheet")) {
|
||||
throw ScriptError(_ERROR_("json set without stylesheet"));
|
||||
}
|
||||
GameP& game = Game::byName(wxString(jv["game"].as_string().c_str()));
|
||||
StyleSheetP& stylesheet = StyleSheet::byGameAndName(*game, wxString(jv["stylesheet"].as_string().c_str()));
|
||||
SetP& set = make_intrusive<Set>(stylesheet);
|
||||
GameP game = Game::byName(wxString(jv["game"].as_string().c_str()));
|
||||
StyleSheetP stylesheet = StyleSheet::byGameAndName(*game, wxString(jv["stylesheet"].as_string().c_str()));
|
||||
SetP set = make_intrusive<Set>(stylesheet);
|
||||
// set fields
|
||||
if (jv.contains("set_info") && jv["set_info"].is_object()) {
|
||||
boost::json::object datav = jv["set_info"].as_object();
|
||||
@@ -262,7 +262,7 @@ inline static SetP json_to_mse_set(boost::json::object& jv) {
|
||||
if (jv.contains("styling") && jv["styling"].is_object()) {
|
||||
boost::json::object datav = jv["styling"].as_object();
|
||||
for (auto it = datav.begin(); it != datav.end(); ++it) {
|
||||
StyleSheetP& stylesheet = StyleSheet::byGameAndName(*set->game, it->key_c_str());
|
||||
StyleSheetP stylesheet = StyleSheet::byGameAndName(*set->game, it->key_c_str());
|
||||
if (!stylesheet) continue;
|
||||
IndexMap<FieldP, ValueP>& stylesheet_data = set->stylingDataFor(*stylesheet);
|
||||
boost::json::object stylesheet_datav = it->value().as_object();
|
||||
@@ -528,7 +528,7 @@ inline static boost::json::object mse_to_json(const Set* set) {
|
||||
return setv;
|
||||
}
|
||||
|
||||
inline static boost::json::value mse_to_json(ScriptValueP& sv, Set* set) {
|
||||
inline static boost::json::value mse_to_json(const ScriptValueP& sv, Set* set) {
|
||||
ScriptType type = sv->type();
|
||||
// special types
|
||||
if (ScriptObject<PackItemP>* i = dynamic_cast<ScriptObject<PackItemP>*>(sv.get())) return mse_to_json(i->getValue());
|
||||
|
||||
Reference in New Issue
Block a user