[Dvar] Use steamname as initial name
This commit is contained in:
parent
6b86d4a807
commit
22900cf1ed
@ -162,7 +162,19 @@ namespace Components
|
||||
}
|
||||
});
|
||||
|
||||
return Dvar::Register<const char*>(name, "Unknown Soldier", Dvar::Flag(flag | Game::dvar_flag::DVAR_FLAG_SAVED).val, description).get<Game::dvar_t*>();
|
||||
std::string username = "Unknown Soldier";
|
||||
|
||||
if (Steam::Proxy::SteamFriends)
|
||||
{
|
||||
const char* steamName = Steam::Proxy::SteamFriends->GetPersonaName();
|
||||
|
||||
if (steamName && !std::string(steamName).empty())
|
||||
{
|
||||
username = steamName;
|
||||
}
|
||||
}
|
||||
|
||||
return Dvar::Register<const char*>(name, username.data(), Dvar::Flag(flag | Game::dvar_flag::DVAR_FLAG_SAVED).val, description).get<Game::dvar_t*>();
|
||||
}
|
||||
|
||||
Dvar::Dvar()
|
||||
|
Loading…
Reference in New Issue
Block a user