diff --git a/Aquaria/ModSelector.cpp b/Aquaria/ModSelector.cpp index 22f2a88..6a7f222 100644 --- a/Aquaria/ModSelector.cpp +++ b/Aquaria/ModSelector.cpp @@ -24,6 +24,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #include "AquariaProgressBar.h" #include "tinyxml.h" #include "ModSelector.h" +#include #ifdef BBGE_BUILD_VFS #include "ModDownloader.h" @@ -684,7 +685,7 @@ bool ModIconOnline::fixIcon() statusIcon = new Quad("modselect/ico_update", pos); statusIcon->alpha.interpolateTo(0.5f, 0.5f, -1, true, true); } - else + else statusIcon = new Quad("modselect/ico_check", pos); } @@ -819,7 +820,7 @@ void MenuIconBar::init() MenuIcon *ico; int y = (-height / 2) - 35; - + ico = new MenuIcon(0); ico->label = dsq->continuity.stringBank.get(2027); ico->useQuad("modselect/installed"); diff --git a/Aquaria/SceneEditor.cpp b/Aquaria/SceneEditor.cpp index 739179b..bd22623 100644 --- a/Aquaria/SceneEditor.cpp +++ b/Aquaria/SceneEditor.cpp @@ -2365,6 +2365,7 @@ void SceneEditor::loadScene() dsq->game->loadEntityTypeList(); dsq->loadElementEffects(); dsq->continuity.loadSongBank(); + dsq->continuity.stringBank.load(); } void SceneEditor::saveScene() diff --git a/Aquaria/ScriptInterface.cpp b/Aquaria/ScriptInterface.cpp index cac06a1..79f264f 100644 --- a/Aquaria/ScriptInterface.cpp +++ b/Aquaria/ScriptInterface.cpp @@ -36,6 +36,7 @@ extern "C" #include "Web.h" #include "GridRender.h" #include "AfterEffect.h" +#include #include "../BBGE/MathFunctions.h" @@ -2502,7 +2503,7 @@ luaFunc(entity_setBoneLock) Bone *b = 0; if (lua_isuserdata(L, 3)) b = bone(L, 3); - + bl.entity = e2; bl.bone = b; bl.on = true; @@ -2926,7 +2927,7 @@ luaFunc(entity_playSfx) if(sfx.vol <= 0) sfx.vol = 1; sfx.loops = lua_tonumber(L, 5); - + float fadeOut = lua_tonumber(L, 6); sfx.maxdist = lua_tonumber(L, 7); sfx.relative = false; @@ -8506,6 +8507,11 @@ luaFunc(castLine) return 3; } +luaFunc(getUserInputString) +{ + luaReturnStr(dsq->getUserInputString(getString(L, 1), getString(L, 2), true).c_str()); +} + luaFunc(inv_isFull) { @@ -8657,6 +8663,12 @@ luaFunc(text_setAlign) luaReturnNil(); } +luaFunc(text_getHeight) +{ + BaseText *txt = getText(L); + luaReturnNum(txt ? txt->getHeight() : 0.0f); +} + luaFunc(loadShader) { int handle = 0; @@ -8690,7 +8702,7 @@ luaFunc(shader_setAsAfterEffect) if(core->afterEffectManager) done = core->afterEffectManager->setShaderPipelinePos(handle, pos); - + luaReturnBool(done); } @@ -9313,6 +9325,7 @@ static const struct { luaRegister(getObstruction), luaRegister(findPath), luaRegister(castLine), + luaRegister(getUserInputString), luaRegister(isFlag), @@ -9705,6 +9718,7 @@ static const struct { luaRegister(text_setFontSize), luaRegister(text_setWidth), luaRegister(text_setAlign), + luaRegister(text_getHeight), luaRegister(loadShader), luaRegister(createShader), diff --git a/BBGE/BaseText.h b/BBGE/BaseText.h index a3be629..203bf18 100644 --- a/BBGE/BaseText.h +++ b/BBGE/BaseText.h @@ -13,6 +13,7 @@ public: virtual void setWidth(int width) = 0; virtual void setFontSize(int sz) = 0; virtual void setAlign(Align a) = 0; + virtual float getHeight() = 0; }; diff --git a/BBGE/BitmapFont.h b/BBGE/BitmapFont.h index 730e265..613faf9 100644 --- a/BBGE/BitmapFont.h +++ b/BBGE/BitmapFont.h @@ -72,7 +72,7 @@ public: void autoKern(); void setBitmapFontEffect(BitmapFontEffect bfe); void render(); - float getHeight(); + virtual float getHeight(); void unloadDevice(); void reloadDevice(); diff --git a/BBGE/Core.cpp b/BBGE/Core.cpp index f6fa00a..ad60431 100644 --- a/BBGE/Core.cpp +++ b/BBGE/Core.cpp @@ -3561,7 +3561,11 @@ void Core::pollEvents() case SDL_KEYDOWN: { #if __APPLE__ - if ((event.key.keysym.sym == SDLK_q) && (event.key.keysym.mod & KMOD_GUI)) + #if SDL_VERSION_ATLEAST(2, 0, 0) + if ((event.key.keysym.sym == SDLK_q) && (event.key.keysym.mod & KMOD_GUI)) + #else + if ((event.key.keysym.sym == SDLK_q) && (event.key.keysym.mod & KMOD_META)) + #endif #else if ((event.key.keysym.sym == SDLK_F4) && (event.key.keysym.mod & KMOD_ALT)) #endif diff --git a/BBGE/DebugFont.cpp b/BBGE/DebugFont.cpp index d7611cc..f1ffc69 100644 --- a/BBGE/DebugFont.cpp +++ b/BBGE/DebugFont.cpp @@ -47,6 +47,11 @@ void DebugFont::setFontSize(int sz) fontDrawSize = sz; } +float DebugFont::getHeight() +{ + return fontDrawSize * lines.size() * 1.5f; // vspc in render() +} + void DebugFont::formatText() { std::string text; diff --git a/BBGE/DebugFont.h b/BBGE/DebugFont.h index c8620fd..2a1d5bc 100644 --- a/BBGE/DebugFont.h +++ b/BBGE/DebugFont.h @@ -33,6 +33,7 @@ public: void setFontSize(int sz); int getNumLines() { return lines.size(); } virtual void setAlign(Align align); + virtual float getHeight(); protected: int fontDrawSize, textWidth; void formatText(); diff --git a/BBGE/Vector.h b/BBGE/Vector.h index 033f827..19e6b15 100644 --- a/BBGE/Vector.h +++ b/BBGE/Vector.h @@ -21,7 +21,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #ifndef BBGE_VECTOR_H #define BBGE_VECTOR_H -#include +#include #include #include #include "Event.h" @@ -374,7 +374,7 @@ public: #ifdef BBGE_BUILD_WINDOWS return _isnan(x) || _isnan(y) || _isnan(z); #elif defined(BBGE_BUILD_UNIX) - return isnan(x) || isnan(y) || isnan(z); + return std::isnan(x) || std::isnan(y) || std::isnan(z); #else return false; #endif