mirror of
https://github.com/amyinspace/MagicSetEditor2.git
synced 2026-06-12 21:47:00 -04:00
Spelling: availAble;
Added information about what parameter an error occured in; Conversion to string no longer results in [[typeName()]], it gives an error instead. git-svn-id: svn://svn.code.sf.net/p/magicseteditor/code/trunk@721 0fc631ac-6414-0410-93d0-97cfa31319b6
This commit is contained in:
@@ -635,6 +635,11 @@ error:
|
|||||||
has no member value: String "%s" has no member '%s'
|
has no member value: String "%s" has no member '%s'
|
||||||
can't convert value: Can't convert "%s" from %s to %s
|
can't convert value: Can't convert "%s" from %s to %s
|
||||||
unsupported format: Invalid string format: '%s'
|
unsupported format: Invalid string format: '%s'
|
||||||
|
in function:
|
||||||
|
%s
|
||||||
|
in function %s
|
||||||
|
in parameter:
|
||||||
|
Parameter %s: %s
|
||||||
|
|
||||||
# Image stuff
|
# Image stuff
|
||||||
coordinates for blending overlap: Coordinates for blending overlap
|
coordinates for blending overlap: Coordinates for blending overlap
|
||||||
|
|||||||
@@ -41,7 +41,7 @@ class PackageVersionData : public IntrusivePtrBase<PackageVersionData> {
|
|||||||
DECLARE_REFLECTION();
|
DECLARE_REFLECTION();
|
||||||
};
|
};
|
||||||
|
|
||||||
/// Information on the latest availible version
|
/// Information on the latest available version
|
||||||
class VersionData : public IntrusivePtrBase<VersionData> {
|
class VersionData : public IntrusivePtrBase<VersionData> {
|
||||||
public:
|
public:
|
||||||
Version version; ///< Latest version number of MSE
|
Version version; ///< Latest version number of MSE
|
||||||
@@ -163,7 +163,7 @@ struct HtmlWindowToBrowser : public wxHtmlWindow {
|
|||||||
void show_update_dialog(Window* parent) {
|
void show_update_dialog(Window* parent) {
|
||||||
if (!update_available() || shown_dialog) return; // we already have the latest version, or this has already been displayed.
|
if (!update_available() || shown_dialog) return; // we already have the latest version, or this has already been displayed.
|
||||||
// Show update dialog
|
// Show update dialog
|
||||||
wxDialog* dlg = new wxDialog(parent, wxID_ANY, _TITLE_("updates availible"), wxDefaultPosition);
|
wxDialog* dlg = new wxDialog(parent, wxID_ANY, _TITLE_("updates available"), wxDefaultPosition);
|
||||||
// controls
|
// controls
|
||||||
wxHtmlWindow* html = new HtmlWindowToBrowser(dlg, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxHW_SCROLLBAR_AUTO | wxSUNKEN_BORDER);
|
wxHtmlWindow* html = new HtmlWindowToBrowser(dlg, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxHW_SCROLLBAR_AUTO | wxSUNKEN_BORDER);
|
||||||
html->SetPage(update_version_data->description);
|
html->SetPage(update_version_data->description);
|
||||||
|
|||||||
@@ -21,7 +21,7 @@ void check_updates();
|
|||||||
*/
|
*/
|
||||||
void check_updates_now(bool async = true);
|
void check_updates_now(bool async = true);
|
||||||
|
|
||||||
/// Show a dialog to inform the user that updates are availible (if there are any)
|
/// Show a dialog to inform the user that updates are available (if there are any)
|
||||||
/** Call check_updates first.
|
/** Call check_updates first.
|
||||||
* Call this function from an onIdle loop */
|
* Call this function from an onIdle loop */
|
||||||
void show_update_dialog(Window* parent);
|
void show_update_dialog(Window* parent);
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
# This file contains the keys expected to be in MSE locales
|
# This file contains the keys expected to be in MSE locales
|
||||||
# It was automatically generated by tools/locale/locale.pl
|
# It was automatically generated by tools/locale/locale.pl
|
||||||
# Generated on Sun Sep 2 02:25:24 2007
|
# Generated on Thu Sep 20 23:50:25 2007
|
||||||
|
|
||||||
action:
|
action:
|
||||||
add control point: 0
|
add control point: 0
|
||||||
@@ -88,6 +88,8 @@ error:
|
|||||||
has no member: 2
|
has no member: 2
|
||||||
has no member value: 2
|
has no member value: 2
|
||||||
images used for blending must have the same size: 0
|
images used for blending must have the same size: 0
|
||||||
|
in function: 2
|
||||||
|
in parameter: 2
|
||||||
internal error: 1
|
internal error: 1
|
||||||
newer version: 2
|
newer version: 2
|
||||||
no game specified for the set: 0
|
no game specified for the set: 0
|
||||||
|
|||||||
@@ -131,7 +131,7 @@ ScriptValueP Context::eval(const Script& script, bool useScope) {
|
|||||||
const Instruction* instr_bt = script.backtraceSkip(instr - i.data - 2, i.data);
|
const Instruction* instr_bt = script.backtraceSkip(instr - i.data - 2, i.data);
|
||||||
// have we have reached the name
|
// have we have reached the name
|
||||||
if (instr_bt) {
|
if (instr_bt) {
|
||||||
throw ScriptError(e.what() + _("\n in function: ") + script.instructionName(instr_bt));
|
throw ScriptError(_ERROR_2_("in function", e.what(), script.instructionName(instr_bt)));
|
||||||
} else {
|
} else {
|
||||||
throw e; // rethrow
|
throw e; // rethrow
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -62,6 +62,15 @@
|
|||||||
|
|
||||||
// ----------------------------------------------------------------------------- : Parameters
|
// ----------------------------------------------------------------------------- : Parameters
|
||||||
|
|
||||||
|
template <typename Type>
|
||||||
|
inline Type from_script(const ScriptValueP& v, const String& str) {
|
||||||
|
try {
|
||||||
|
return from_script<Type>(v);
|
||||||
|
} catch (ScriptError& e) {
|
||||||
|
throw ScriptError(_ERROR_2_("in parameter", str, e.what()));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/// Retrieve a parameter to a SCRIPT_FUNCTION with the given name and type
|
/// Retrieve a parameter to a SCRIPT_FUNCTION with the given name and type
|
||||||
/** Usage:
|
/** Usage:
|
||||||
* @code
|
* @code
|
||||||
@@ -75,7 +84,7 @@
|
|||||||
#define SCRIPT_PARAM(Type, name) \
|
#define SCRIPT_PARAM(Type, name) \
|
||||||
SCRIPT_PARAM_N(Type, _(#name), name)
|
SCRIPT_PARAM_N(Type, _(#name), name)
|
||||||
#define SCRIPT_PARAM_N(Type, str, name) \
|
#define SCRIPT_PARAM_N(Type, str, name) \
|
||||||
Type name = from_script<Type>(ctx.getVariable(str))
|
Type name = from_script<Type>(ctx.getVariable(str), str)
|
||||||
|
|
||||||
/// Retrieve an optional parameter
|
/// Retrieve an optional parameter
|
||||||
/** Usage:
|
/** Usage:
|
||||||
@@ -102,7 +111,7 @@
|
|||||||
#define SCRIPT_OPTIONAL_PARAM_N_(Type, str, name) \
|
#define SCRIPT_OPTIONAL_PARAM_N_(Type, str, name) \
|
||||||
ScriptValueP name##_ = ctx.getVariableOpt(str); \
|
ScriptValueP name##_ = ctx.getVariableOpt(str); \
|
||||||
Type name = name##_ && name##_ != script_nil \
|
Type name = name##_ && name##_ != script_nil \
|
||||||
? from_script<Type>(name##_) : Type();
|
? from_script<Type>(name##_, str) : Type();
|
||||||
|
|
||||||
/// Retrieve an optional parameter with a default value
|
/// Retrieve an optional parameter with a default value
|
||||||
#define SCRIPT_PARAM_DEFAULT(Type, name, def) \
|
#define SCRIPT_PARAM_DEFAULT(Type, name, def) \
|
||||||
@@ -110,7 +119,7 @@
|
|||||||
/// Retrieve a named optional parameter with a default value
|
/// Retrieve a named optional parameter with a default value
|
||||||
#define SCRIPT_PARAM_DEFAULT_N(Type, str, name, def) \
|
#define SCRIPT_PARAM_DEFAULT_N(Type, str, name, def) \
|
||||||
ScriptValueP name##_ = ctx.getVariableOpt(str); \
|
ScriptValueP name##_ = ctx.getVariableOpt(str); \
|
||||||
Type name = name##_ ? from_script<Type>(name##_) : def
|
Type name = name##_ ? from_script<Type>(name##_, str) : def
|
||||||
|
|
||||||
// ----------------------------------------------------------------------------- : Rules
|
// ----------------------------------------------------------------------------- : Rules
|
||||||
|
|
||||||
|
|||||||
@@ -14,7 +14,7 @@
|
|||||||
// ----------------------------------------------------------------------------- : ScriptValue
|
// ----------------------------------------------------------------------------- : ScriptValue
|
||||||
// Base cases
|
// Base cases
|
||||||
|
|
||||||
ScriptValue::operator String() const { return _("[[") + typeName() + _("]]"); }
|
ScriptValue::operator String() const { throw ScriptError(_ERROR_2_("can't convert", typeName(), _TYPE_("string" ))); }
|
||||||
ScriptValue::operator int() const { throw ScriptError(_ERROR_2_("can't convert", typeName(), _TYPE_("integer" ))); }
|
ScriptValue::operator int() const { throw ScriptError(_ERROR_2_("can't convert", typeName(), _TYPE_("integer" ))); }
|
||||||
ScriptValue::operator double() const { throw ScriptError(_ERROR_2_("can't convert", typeName(), _TYPE_("double" ))); }
|
ScriptValue::operator double() const { throw ScriptError(_ERROR_2_("can't convert", typeName(), _TYPE_("double" ))); }
|
||||||
ScriptValue::operator Color() const { throw ScriptError(_ERROR_2_("can't convert", typeName(), _TYPE_("color" ))); }
|
ScriptValue::operator Color() const { throw ScriptError(_ERROR_2_("can't convert", typeName(), _TYPE_("color" ))); }
|
||||||
|
|||||||
Reference in New Issue
Block a user