Interactive actions now allows displaying images.

For more info, see http://thepit.ja-galaxy-forum.com/index.php?t=msg&th=23144&goto=363478&#msg_363478

GameDir >= r2597 recommended.

git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@9131 3b4a5df2-a311-0410-b5c6-a8a6f20db521
This commit is contained in:
Flugente
2021-07-07 20:05:42 +00:00
parent 9756cf33f4
commit 3f4da5fad5
8 changed files with 320 additions and 95 deletions
+23
View File
@@ -878,6 +878,7 @@ static int l_SetSamSiteHackStatus( lua_State *L );
static int l_GetSamSiteHackStatus( lua_State *L );
static int l_SetMiniGameType( lua_State *L );
static int l_DisplayPictureTactical( lua_State *L );
static int l_SoldierSpendMoney( lua_State *L );
static int l_SetAdditionalDialogue( lua_State *L );
@@ -1772,6 +1773,7 @@ void IniFunction(lua_State *L, BOOLEAN bQuests )
lua_register( L, "GetSamSiteHackStatus", l_GetSamSiteHackStatus );
lua_register( L, "SetMiniGameType", l_SetMiniGameType );
lua_register( L, "DisplayPictureTactical", l_DisplayPictureTactical );
lua_register( L, "SoldierSpendMoney", l_SoldierSpendMoney );
lua_register( L, "SetAdditionalDialogue", l_SetAdditionalDialogue );
@@ -13247,6 +13249,27 @@ static int l_SetMiniGameType( lua_State *L )
return 0;
}
static int l_DisplayPictureTactical( lua_State *L )
{
if ( lua_gettop( L ) >= 2 )
{
size_t len = 0;
const char* str = lua_tolstring( L, 1, &len );
bool stretch = lua_tointeger( L, 2 );
if ( guiCurrentScreen == GAME_SCREEN
&& (std::strstr(str, ".png") != NULL || std::strstr( str, ".PNG" ) != NULL ) )
{
SetInteractivePicture( str, stretch );
SetNextGame( PICTURE );
SetPendingNewScreen( MINIGAME_SCREEN );
}
}
return 0;
}
static int l_SoldierSpendMoney( lua_State *L )
{
if ( lua_gettop( L ) >= 2 )