mirror of
https://github.com/amyinspace/MagicSetEditor2.git
synced 2026-06-10 13:06:59 -04:00
add allow_image_download setting
This commit is contained in:
@@ -35,7 +35,7 @@ SCRIPT_FUNCTION(new_card) {
|
||||
ScriptValueP key;
|
||||
while (ScriptValueP value = it->next(&key)) {
|
||||
assert(key);
|
||||
if (key == script_nil) continue;
|
||||
if (key == script_nil || value == script_nil) continue;
|
||||
String key_name = key->toString();
|
||||
if (set_stylesheet_container(*game, new_card, value, key_name, ignore_field_not_found)) break;
|
||||
}
|
||||
@@ -43,7 +43,7 @@ SCRIPT_FUNCTION(new_card) {
|
||||
it = input->makeIterator();
|
||||
while (ScriptValueP value = it->next(&key)) {
|
||||
assert(key);
|
||||
if (key == script_nil) continue;
|
||||
if (key == script_nil || value == script_nil) continue;
|
||||
String key_name = key->toString();
|
||||
// check if the given value is for a built-in field
|
||||
if (set_builtin_container(*game, new_card, value, key_name, ignore_field_not_found)) continue;
|
||||
@@ -66,7 +66,7 @@ SCRIPT_FUNCTION(new_card) {
|
||||
ScriptValueP script_key;
|
||||
while (ScriptValueP script_value = script_it->next(&script_key)) {
|
||||
assert(script_key);
|
||||
if (script_key == script_nil) continue;
|
||||
if (script_key == script_nil || script_value == script_nil) continue;
|
||||
String script_key_name = script_key->toString();
|
||||
if (set_stylesheet_container(*game, new_card, script_value, script_key_name, ignore_field_not_found)) break;
|
||||
}
|
||||
@@ -74,7 +74,7 @@ SCRIPT_FUNCTION(new_card) {
|
||||
script_it = script_input->makeIterator();
|
||||
while (ScriptValueP script_value = script_it->next(&script_key)) {
|
||||
assert(script_key);
|
||||
if (script_key == script_nil) continue;
|
||||
if (script_key == script_nil || script_value == script_nil) continue;
|
||||
String script_key_name = script_key->toString();
|
||||
// check if the script value is for a built-in field
|
||||
if (set_builtin_container(*game, new_card, script_value, script_key_name, ignore_field_not_found)) continue;
|
||||
@@ -109,7 +109,7 @@ SCRIPT_FUNCTION(new_card) {
|
||||
ScriptValueP script_key;
|
||||
while (ScriptValueP script_value = script_it->next(&script_key)) {
|
||||
assert(script_key);
|
||||
if (script_key == script_nil) continue;
|
||||
if (script_key == script_nil || script_value == script_nil) continue;
|
||||
String script_key_name = script_key->toString();
|
||||
if (set_stylesheet_container(*game, new_card, script_value, script_key_name, ignore_field_not_found)) break;
|
||||
}
|
||||
@@ -117,7 +117,7 @@ SCRIPT_FUNCTION(new_card) {
|
||||
script_it = script_input->makeIterator();
|
||||
while (ScriptValueP script_value = script_it->next(&script_key)) {
|
||||
assert(script_key);
|
||||
if (script_key == script_nil) continue;
|
||||
if (script_key == script_nil || script_value == script_nil) continue;
|
||||
String script_key_name = script_key->toString();
|
||||
// check if the script value is for a built-in field
|
||||
if (set_builtin_container(*game, new_card, script_value, script_key_name, ignore_field_not_found)) continue;
|
||||
|
||||
@@ -160,7 +160,7 @@ inline static bool set_builtin_container(const Game& game, CardP& card, ScriptVa
|
||||
ScriptValueP key;
|
||||
while (ScriptValueP value = it->next(&key)) {
|
||||
assert(key);
|
||||
if (key == script_nil) continue;
|
||||
if (key == script_nil || value == script_nil) continue;
|
||||
String key_name = key->toString();
|
||||
Value* container = get_container(data, type, key_name, ignore_field_not_found);
|
||||
set_container(container, value, key_name);
|
||||
|
||||
@@ -56,7 +56,8 @@ SCRIPT_FUNCTION(import_image) {
|
||||
return make_intrusive<ImportedImage>(set, input);
|
||||
}
|
||||
|
||||
SCRIPT_FUNCTION(download_image) {
|
||||
SCRIPT_FUNCTION(download_image) {
|
||||
if (!settings.allow_image_download) return script_nil;
|
||||
SCRIPT_PARAM(Set*, set);
|
||||
SCRIPT_PARAM(String, input);
|
||||
return make_intrusive<DownloadedImage>(set, input);
|
||||
|
||||
Reference in New Issue
Block a user