So I'm trying to manually copy the "window_position.dat" file to the dir that AppGameKit looks for it in when the app starts. I've gotten it to semi-work. However, it only works after closing and opening the app twice.
SetFolder("")
AGKAppsDir AS STRING : AGKAppsDir = GetWritePath()
GLOBAL GameDataDir AS STRING : GameDataDir = GetDocumentsPath()
IF FindString( GameDataDir, "My Documents" ) : GameDataDir = Left( GameDataDir, FindString( GameDataDir, "My Documents" )-1 )
ELSEIF FindString( GameDataDir, "Documents" ) : GameDataDir = Left( GameDataDir, FindString( GameDataDir, "Documents" )-1 ) : ENDIF
GameDataDir = GameDataDir+"GameData/Aidos/SirTet"
SetRawWritePath(GameDataDir)
IF GetFileExists( "window_position.dat" )
MB_WinPosDat = CreateMemblockFromFile("window_position.dat")
SetRawWritePath(AGKAppsDir)
CreateFileFromMemblock( "window_position.dat", MB_WinPosDat )
DeleteMemblock(MB_WinPosDat)
SetRawWritePath(GameDataDir)
ENDIF
I need this too happen when the app ends. Does anyone know if AppGameKit has an "#OnEnd, do this" or something similar? (needs to work with external termination, for example pressing the X on the window)