(x 37)
(y 20)
)
+ (special-tile
+ (invisible-tile #t)
+ (script "abort_screenfade();")
+ (apply-to-direction "south")
+ (x 37)
+ (y 19)
+ )
(sprite-change
(change-on-touch #t)
(initial-stay-action #f)
state.world <- \"levels/world1/worldmap.stwm\";")
(x 8)
(y 45)
+ (apply-to-direction "east")
+ )
+ (special-tile
+ (invisible-tile #t)
+ (script "abort_screenfade();")
+ (x 9)
+ (y 45)
+ (apply-to-direction "west")
)
(sprite-change
(change-on-touch #f)
// check this as PHYSFS seems to be buggy and still returns a
// valid pointer in this case
if(filename == "") {
- throw std::runtime_error("Couldn't open file: emtpy filename");
+ throw std::runtime_error("Couldn't open file: empty filename");
}
PHYSFS_file* file = (PHYSFS_file*) PHYSFS_openRead(filename.c_str());
// check this as PHYSFS seems to be buggy and still returns a
// valid pointer in this case
if(filename == "") {
- throw std::runtime_error("Couldn't open file: emtpy filename");
+ throw std::runtime_error("Couldn't open file: empty filename");
}
file = PHYSFS_openRead(filename.c_str());
if(file == 0) {
main_loop->set_screen_fade(new ShrinkFade(Vector(dest_x, dest_y), seconds));
}
+void abort_screenfade()
+{
+ main_loop->set_screen_fade(NULL);
+}
+
std::string translate(const std::string& text)
{
return dictionary_manager.get_dictionary().translate(text);
void shrink_screen(float dest_x, float dest_y, float seconds);
/**
+ * Aborts any kind of previous screen fade; the screenchange will happen
+ * anyway.
+ */
+void abort_screenfade();
+
+/**
* Translate a text into the users language (by looking it up in the .po
* files)
*/
}
+static SQInteger abort_screenfade_wrapper(HSQUIRRELVM vm)
+{
+ (void) vm;
+
+ try {
+ Scripting::abort_screenfade();
+
+ return 0;
+
+ } catch(std::exception& e) {
+ sq_throwerror(vm, e.what());
+ return SQ_ERROR;
+ } catch(...) {
+ sq_throwerror(vm, _SC("Unexpected exception while executing function 'abort_screenfade'"));
+ return SQ_ERROR;
+ }
+
+}
+
static SQInteger translate_wrapper(HSQUIRRELVM vm)
{
const SQChar* arg0;
throw SquirrelError(v, "Couldn't register function 'shrink_screen'");
}
+ sq_pushstring(v, "abort_screenfade", -1);
+ sq_newclosure(v, &abort_screenfade_wrapper, 0);
+ if(SQ_FAILED(sq_createslot(v, -3))) {
+ throw SquirrelError(v, "Couldn't register function 'abort_screenfade'");
+ }
+
sq_pushstring(v, "translate", -1);
sq_newclosure(v, &translate_wrapper, 0);
if(SQ_FAILED(sq_createslot(v, -3))) {