mirror of
https://github.com/amyinspace/MagicSetEditor2.git
synced 2026-06-10 04:57:00 -04:00
Use toSomeType() instead of operator SomeType in ScriptValue.
This means that we are more explicit about type conversions. Also use override specifiers for overriden virtual functions in ScriptValue.
This commit is contained in:
@@ -319,7 +319,7 @@ int CardListBase::OnGetItemImage(long pos) const {
|
||||
wxListItemAttr* CardListBase::OnGetItemAttr(long pos) const {
|
||||
if (!set->game->card_list_color_script) return nullptr;
|
||||
Context& ctx = set->getContext(getCard(pos));
|
||||
item_attr.SetTextColour(*set->game->card_list_color_script.invoke(ctx));
|
||||
item_attr.SetTextColour(set->game->card_list_color_script.invoke(ctx)->toColor());
|
||||
return &item_attr;
|
||||
}
|
||||
|
||||
|
||||
@@ -508,7 +508,7 @@ void ConsolePanel::exec(String const& command) {
|
||||
message->bitmap = wxBitmap(image);
|
||||
} else if (type == SCRIPT_COLOR) {
|
||||
message->text = result->toCode();
|
||||
Color color = result->operator Color();
|
||||
Color color = result->toColor();
|
||||
wxImage image(30,20);
|
||||
fill_image(image,color);
|
||||
set_alpha(image, color.Alpha() / 255.0);
|
||||
|
||||
@@ -253,7 +253,7 @@ size_t DropDownChoiceList::selection() const {
|
||||
return 0;
|
||||
} else {
|
||||
// run default script to find out what the default choice would be
|
||||
String default_choice = *field().default_script.invoke( cve.viewer.getContext() );
|
||||
String default_choice = field().default_script.invoke( cve.viewer.getContext() )->toString();
|
||||
default_id = group->choiceId(default_choice);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -107,7 +107,7 @@ size_t DropDownColorList::selection() const {
|
||||
return 0;
|
||||
} else if (hasDefault()) {
|
||||
// evaluate script to find default color
|
||||
default_color = *field().default_script.invoke(cve.viewer.getContext());
|
||||
default_color = field().default_script.invoke(cve.viewer.getContext())->toColor();
|
||||
}
|
||||
return selection;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user