Logo

[SM5] Check if texture is loaded?

Register Log In Back To Forums

Post #1 · Posted at 2016-11-11 12:13:38pm 7.4 years ago

Offline leadbman
leadbman Avatar Member
263 Posts
Australia
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).

http://i.imgur.com/JwgZ3Jl.jpg

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() );

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:

http://i.imgur.com/RTrQVTt.jpg

Does anyone know if I could get the loaded GetCardPath() for P1 and P2?

Hope someone can help me out!
https://zenius-i-vanisher.com/ddrsig/18213.png?t=1510895050
Really need to add my scores to the tracker soon.
Always learning, always trying to push the boundaries of SM.

Post #2 · Posted at 2016-12-07 06:42:08pm 7.3 years ago

Offline Mercury
Mercury Avatar Member+
807 Posts
United Kingdom
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
http://zenius-i-vanisher.com/ddrsig/1229.png?t=1299671484
Register Log In Back To Forums

0 User(s) Viewing This Thread (Past 15 Minutes)

©2006-2024 Zenius -I- vanisher.com -5th style- IIPrivacy Policy
Web Server: 6% · Database: 4% · Server Time: 2024-04-24 19:49:59
This page took 0.004 seconds to execute.
Theme: starlight · Language: englishuk
Reset Theme & Language