1
0
Fork 0
mirror of https://github.com/AquariaOSE/Aquaria.git synced 2024-12-25 22:25:46 +00:00

minor things, added entity_loadSkin function

This commit is contained in:
fgenesis 2012-04-01 18:14:02 +02:00
parent e94de627eb
commit 83dbb7e310
3 changed files with 35 additions and 14 deletions

View file

@ -5806,7 +5806,7 @@ Entity* Game::setActivePet(int flag)
void Game::createLi() void Game::createLi()
{ {
int liFlag = dsq->continuity.getFlag(1000); int liFlag = dsq->continuity.getFlag(FLAG_LI);
std::ostringstream os; std::ostringstream os;
os << "liFlag: " << liFlag; os << "liFlag: " << liFlag;
debugLog(os.str()); debugLog(os.str());

View file

@ -3370,9 +3370,12 @@ void SceneEditor::updateText()
os << "entities (" << dsq->entities.size() << ")"; os << "entities (" << dsq->entities.size() << ")";
if (editingEntity) if (editingEntity)
{ {
os << " id: " << editingEntity->getID() << " name: " << editingEntity->name << " flag: " << dsq->continuity.getEntityFlag(dsq->game->sceneName, editingEntity->getID()); os << " id: " << editingEntity->getID()
os << " groupID: " << editingEntity->getGroupID() << " "; << " name: " << editingEntity->name
os << " state: " << editingEntity->getState(); << " flag:" << dsq->continuity.getEntityFlag(dsq->game->sceneName, editingEntity->getID())
<< " fh:" << editingEntity->isfh()
<< " fv:" << editingEntity->isfv()
<< " state:" << editingEntity->getState();
} }
break; break;
case ET_PATHS: case ET_PATHS:

View file

@ -3233,16 +3233,30 @@ luaFunc(entity_initStrands)
luaFunc(entity_initSkeletal) luaFunc(entity_initSkeletal)
{ {
ScriptedEntity *e = scriptedEntity(L); Entity *e = entity(L);
if (e)
{
e->renderQuad = false; e->renderQuad = false;
e->setWidthHeight(128, 128); e->setWidthHeight(128, 128);
e->skeletalSprite.loadSkeletal(getString(L, 2)); e->skeletalSprite.loadSkeletal(getString(L, 2));
const char *s = lua_tostring(L, 3); const char *s = lua_tostring(L, 3);
if (s && *s) if (s && *s)
e->skeletalSprite.loadSkin(s); e->skeletalSprite.loadSkin(s);
}
luaReturnNil(); luaReturnNil();
} }
luaFunc(entity_loadSkin)
{
Entity *e = entity(L);
if (e && e->skeletalSprite.isLoaded())
{
const char *s = lua_tostring(L, 2);
if (s && *s)
e->skeletalSprite.loadSkin(s);
}
luaReturnNil();
}
luaFunc(entity_idle) luaFunc(entity_idle)
{ {
@ -7099,6 +7113,7 @@ luaFunc(createBitmapText)
luaFunc(text_setText) luaFunc(text_setText)
{ {
BaseText *txt = getText(L); BaseText *txt = getText(L);
if (txt)
txt->setText(getString(L, 2)); txt->setText(getString(L, 2));
luaReturnNil(); luaReturnNil();
} }
@ -7106,6 +7121,7 @@ luaFunc(text_setText)
luaFunc(text_setFontSize) luaFunc(text_setFontSize)
{ {
BaseText *txt = getText(L); BaseText *txt = getText(L);
if (txt)
txt->setFontSize(lua_tointeger(L, 2)); txt->setFontSize(lua_tointeger(L, 2));
luaReturnNil(); luaReturnNil();
} }
@ -7113,6 +7129,7 @@ luaFunc(text_setFontSize)
luaFunc(text_setWidth) luaFunc(text_setWidth)
{ {
BaseText *txt = getText(L); BaseText *txt = getText(L);
if (txt)
txt->setWidth(lua_tointeger(L, 2)); txt->setWidth(lua_tointeger(L, 2));
luaReturnNil(); luaReturnNil();
} }
@ -7408,6 +7425,7 @@ static const struct {
luaRegister(entity_initSegments), luaRegister(entity_initSegments),
luaRegister(entity_warpSegments), luaRegister(entity_warpSegments),
luaRegister(entity_initSkeletal), luaRegister(entity_initSkeletal),
luaRegister(entity_loadSkin),
luaRegister(entity_initStrands), luaRegister(entity_initStrands),
luaRegister(entity_hurtTarget), luaRegister(entity_hurtTarget),