Post #1 · Posted at 2016-11-11 12:13:38pm 7.4 years ago
leadbman | |
---|---|
Member | |
263 Posts | |
Reg. 2016-02-01 | |
"Working On: 5thMix BGA bgchanges" |
I've just about got my character select screen working properly (or at least, working in such a way that looks like the console PS2 character select screens - screenshot below).
This is all running from the default metrics and I'm using a LUA file within a ScreenSelectCharacter underlay folder in BGAnimations.
What I'm needing to find out to make it perfect is to find out if I can check what texture is loaded and then act on that.
In stepmania/src/ScreenSelectCharacter.cpp (https://github.com/stepmania/stepmania/blob/4df85929cc2e41ef8c24bddea17d90fe44fb2807/src/ScreenSelectCharacter.cpp) it loads and unloads the character card for each player on lines 239 to 243:
If I could work out what character card is loaded for each player from this, I could create code that would alter depending on what card is loaded (as the default SM code will always attempt to load a new character card on left/right button press for each player). By doing this I could get the result show below:
Does anyone know if I could get the loaded GetCardPath() for P1 and P2?
Hope someone can help me out!
This is all running from the default metrics and I'm using a LUA file within a ScreenSelectCharacter underlay folder in BGAnimations.
What I'm needing to find out to make it perfect is to find out if I can check what texture is loaded and then act on that.
In stepmania/src/ScreenSelectCharacter.cpp (https://github.com/stepmania/stepmania/blob/4df85929cc2e41ef8c24bddea17d90fe44fb2807/src/ScreenSelectCharacter.cpp) it loads and unloads the character card for each player on lines 239 to 243:
Quote
vector<Character*> apCharacters;
CHARMAN->GetCharacters( apCharacters );
Character* pChar = apCharacters[ m_iSelectedCharacter[pnAffected] ];
m_sprCard[pnAffected].UnloadTexture();
m_sprCard[pnAffected].Load( pChar->GetCardPath() );
CHARMAN->GetCharacters( apCharacters );
Character* pChar = apCharacters[ m_iSelectedCharacter[pnAffected] ];
m_sprCard[pnAffected].UnloadTexture();
m_sprCard[pnAffected].Load( pChar->GetCardPath() );
If I could work out what character card is loaded for each player from this, I could create code that would alter depending on what card is loaded (as the default SM code will always attempt to load a new character card on left/right button press for each player). By doing this I could get the result show below:
Does anyone know if I could get the loaded GetCardPath() for P1 and P2?
Hope someone can help me out!
Post #2 · Posted at 2016-12-07 06:42:08pm 7.3 years ago
Mercury | |
---|---|
Member+ | |
807 Posts | |
Reg. 2007-06-15 | |
Something along the lines of
local texturePath = THEME:GetPathG("","../../../path/to/texture.png")
if not string.find(texturePath,"_missing") then
--file exists
else
--file does not exist
end
local texturePath = THEME:GetPathG("","../../../path/to/texture.png")
if not string.find(texturePath,"_missing") then
--file exists
else
--file does not exist
end