mirror of
https://github.com/amyinspace/MagicSetEditor2.git
synced 2026-06-10 13:06:59 -04:00
Remove AColor class, because wxColour now supports alpha values.
This commit is contained in:
@@ -112,7 +112,7 @@ SCRIPT_FUNCTION(to_int) {
|
||||
if (t == SCRIPT_BOOL) {
|
||||
result = (bool)*input ? 1 : 0;
|
||||
} else if (t == SCRIPT_COLOR) {
|
||||
AColor c = (AColor)*input;
|
||||
Color c = (Color)*input;
|
||||
result = (c.Red() + c.Blue() + c.Green()) / 3;
|
||||
} else if (t == SCRIPT_STRING) {
|
||||
long l;
|
||||
@@ -141,7 +141,7 @@ SCRIPT_FUNCTION(to_real) {
|
||||
if (t == SCRIPT_BOOL) {
|
||||
result = (bool)*input ? 1.0 : 0.0;
|
||||
} else if (t == SCRIPT_COLOR) {
|
||||
AColor c = (AColor)*input;
|
||||
Color c = (Color)*input;
|
||||
result = (c.Red() + c.Blue() + c.Green()) / 3.0;
|
||||
} else if (t == SCRIPT_STRING) {
|
||||
String str = input->toString();
|
||||
@@ -166,7 +166,7 @@ SCRIPT_FUNCTION(to_number) {
|
||||
if (t == SCRIPT_BOOL) {
|
||||
SCRIPT_RETURN((bool)*input ? 1 : 0);
|
||||
} else if (t == SCRIPT_COLOR) {
|
||||
AColor c = (AColor)*input;
|
||||
Color c = (Color)*input;
|
||||
SCRIPT_RETURN( (c.Red() + c.Blue() + c.Green()) / 3 );
|
||||
} else if (t == SCRIPT_DOUBLE) {
|
||||
SCRIPT_RETURN((double)*input);
|
||||
@@ -208,7 +208,7 @@ SCRIPT_FUNCTION(to_boolean) {
|
||||
|
||||
SCRIPT_FUNCTION(to_color) {
|
||||
try {
|
||||
SCRIPT_PARAM_C(AColor, input);
|
||||
SCRIPT_PARAM_C(Color, input);
|
||||
SCRIPT_RETURN(input);
|
||||
} catch (const ScriptError& e) {
|
||||
return delay_error(e);
|
||||
|
||||
@@ -44,7 +44,7 @@ SCRIPT_FUNCTION(new_card) {
|
||||
} else if (PackageChoiceValue* pvalue = dynamic_cast<PackageChoiceValue*>(value)) {
|
||||
pvalue->package_name = v->toString();
|
||||
} else if (ColorValue* cvalue = dynamic_cast<ColorValue*>(value)) {
|
||||
cvalue->value = (AColor)*v;
|
||||
cvalue->value = (Color)*v;
|
||||
} else {
|
||||
throw ScriptError(format_string(_("Can not set value '%s', it is not of the right type"),name));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user