Show android robot icon for bots in lobby
This commit is contained in:
parent
2a40606be7
commit
396e55a39d
data/gui/icons
src
modes
network
states_screens/online
@ -47,6 +47,8 @@ blue_flag.png, heart.png and red_flag.png by Benau, released under CC-BY-SA 4
|
|||||||
|
|
||||||
lap_flag.png, modified by Alayan, original by Alina Oleynik from The Noun Project, under CC-BY 3.0
|
lap_flag.png, modified by Alayan, original by Alina Oleynik from The Noun Project, under CC-BY 3.0
|
||||||
|
|
||||||
|
Android robot.png is licensed under the terms of the Creative Commons Attribution license
|
||||||
|
|
||||||
====
|
====
|
||||||
|
|
||||||
Glass Skin by Auria, under CC-BY-SA 3+
|
Glass Skin by Auria, under CC-BY-SA 3+
|
||||||
|
BIN
data/gui/icons/android/robot.png
Normal file
BIN
data/gui/icons/android/robot.png
Normal file
Binary file not shown.
After ![]() (image error) Size: 2.8 KiB |
@ -185,7 +185,7 @@ void LinearWorld::update(int ticks)
|
|||||||
if (npp)
|
if (npp)
|
||||||
{
|
{
|
||||||
auto peer = npp->getPeer();
|
auto peer = npp->getPeer();
|
||||||
if (peer && peer->getUserVersion() == "AI")
|
if (peer && peer->isAIPeer())
|
||||||
has_ai = true;
|
has_ai = true;
|
||||||
else if (!getKart(i)->hasFinishedRace())
|
else if (!getKart(i)->hasFinishedRace())
|
||||||
all_players_finished = false;
|
all_players_finished = false;
|
||||||
|
@ -421,7 +421,7 @@ void ClientLobby::update(int ticks)
|
|||||||
auto& p = NetworkConfig::get()->getNetworkPlayers()[i];
|
auto& p = NetworkConfig::get()->getNetworkPlayers()[i];
|
||||||
PlayerProfile* player = std::get<1>(p);
|
PlayerProfile* player = std::get<1>(p);
|
||||||
core::stringw name = player->getName();
|
core::stringw name = player->getName();
|
||||||
if (lan_ai)
|
if (NetworkConfig::get()->isNetworkAITester())
|
||||||
{
|
{
|
||||||
// I18N: Shown in lobby to indicate it's a bot in LAN game
|
// I18N: Shown in lobby to indicate it's a bot in LAN game
|
||||||
name = _("Bot");
|
name = _("Bot");
|
||||||
@ -787,9 +787,12 @@ void ClientLobby::updatePlayerList(Event* event)
|
|||||||
bool is_spectator = ((boolean_combine >> 1) & 1) == 1;
|
bool is_spectator = ((boolean_combine >> 1) & 1) == 1;
|
||||||
bool is_peer_server_owner = ((boolean_combine >> 2) & 1) == 1;
|
bool is_peer_server_owner = ((boolean_combine >> 2) & 1) == 1;
|
||||||
bool ready = ((boolean_combine >> 3) & 1) == 1;
|
bool ready = ((boolean_combine >> 3) & 1) == 1;
|
||||||
|
bool ai = ((boolean_combine >> 4) & 1) == 1;
|
||||||
// icon to be used, see NetworkingLobby::loadedFromFile
|
// icon to be used, see NetworkingLobby::loadedFromFile
|
||||||
lp.m_icon_id = is_peer_server_owner ? 0 :
|
lp.m_icon_id = is_peer_server_owner ? 0 :
|
||||||
lp.m_online_id != 0 /*if online account*/ ? 1 : 2;
|
lp.m_online_id != 0 /*if online account*/ ? 1 : 2;
|
||||||
|
if (ai)
|
||||||
|
lp.m_icon_id = 6;
|
||||||
if (waiting && !is_peer_waiting_for_game)
|
if (waiting && !is_peer_waiting_for_game)
|
||||||
lp.m_icon_id = 3;
|
lp.m_icon_id = 3;
|
||||||
if (is_spectator)
|
if (is_spectator)
|
||||||
|
@ -2961,7 +2961,8 @@ void ServerLobby::handleUnencryptedConnection(std::shared_ptr<STKPeer> peer,
|
|||||||
PerPlayerDifficulty per_player_difficulty =
|
PerPlayerDifficulty per_player_difficulty =
|
||||||
(PerPlayerDifficulty)data.getUInt8();
|
(PerPlayerDifficulty)data.getUInt8();
|
||||||
auto player = std::make_shared<NetworkPlayerProfile>
|
auto player = std::make_shared<NetworkPlayerProfile>
|
||||||
(peer, i == 0 && !online_name.empty() ? online_name : name,
|
(peer, i == 0 && !online_name.empty() && !peer->isAIPeer() ?
|
||||||
|
online_name : name,
|
||||||
peer->getHostId(), default_kart_color, i == 0 ? online_id : 0,
|
peer->getHostId(), default_kart_color, i == 0 ? online_id : 0,
|
||||||
per_player_difficulty, (uint8_t)i, KART_TEAM_NONE,
|
per_player_difficulty, (uint8_t)i, KART_TEAM_NONE,
|
||||||
country_code);
|
country_code);
|
||||||
@ -3156,6 +3157,8 @@ void ServerLobby::updatePlayerList(bool update_when_reset_server)
|
|||||||
m_peers_ready.find(p) != m_peers_ready.end() &&
|
m_peers_ready.find(p) != m_peers_ready.end() &&
|
||||||
m_peers_ready.at(p))
|
m_peers_ready.at(p))
|
||||||
boolean_combine |= (1 << 3);
|
boolean_combine |= (1 << 3);
|
||||||
|
if (p && p->isAIPeer())
|
||||||
|
boolean_combine |= (1 << 4);
|
||||||
pl->addUInt8(boolean_combine);
|
pl->addUInt8(boolean_combine);
|
||||||
pl->addUInt8(profile->getPerPlayerDifficulty());
|
pl->addUInt8(profile->getPerPlayerDifficulty());
|
||||||
if (ServerConfig::m_team_choosing &&
|
if (ServerConfig::m_team_choosing &&
|
||||||
@ -3201,7 +3204,7 @@ void ServerLobby::updateServerOwner()
|
|||||||
for (auto peer: peers)
|
for (auto peer: peers)
|
||||||
{
|
{
|
||||||
// Only 127.0.0.1 can be server owner in case of graphics-client-server
|
// Only 127.0.0.1 can be server owner in case of graphics-client-server
|
||||||
if (peer->isValidated() && peer->getUserVersion() != "AI" &&
|
if (peer->isValidated() && !peer->isAIPeer() &&
|
||||||
(NetworkConfig::get()->getServerIdFile().empty() ||
|
(NetworkConfig::get()->getServerIdFile().empty() ||
|
||||||
peer->getAddress().getIP() == 0x7f000001))
|
peer->getAddress().getIP() == 0x7f000001))
|
||||||
{
|
{
|
||||||
|
@ -248,6 +248,8 @@ public:
|
|||||||
// ------------------------------------------------------------------------
|
// ------------------------------------------------------------------------
|
||||||
const std::set<std::string>& getClientCapabilities() const
|
const std::set<std::string>& getClientCapabilities() const
|
||||||
{ return m_client_capabilities; }
|
{ return m_client_capabilities; }
|
||||||
|
// ------------------------------------------------------------------------
|
||||||
|
bool isAIPeer() const { return m_user_version == "AI"; }
|
||||||
}; // STKPeer
|
}; // STKPeer
|
||||||
|
|
||||||
#endif // STK_PEER_HPP
|
#endif // STK_PEER_HPP
|
||||||
|
@ -133,12 +133,15 @@ void NetworkingLobby::loadedFromFile()
|
|||||||
(file_manager->getAsset(FileManager::GUI_ICON, "main_options.png"));
|
(file_manager->getAsset(FileManager::GUI_ICON, "main_options.png"));
|
||||||
m_spectate_texture = irr_driver->getTexture
|
m_spectate_texture = irr_driver->getTexture
|
||||||
(file_manager->getAsset(FileManager::GUI_ICON, "screen_other.png"));
|
(file_manager->getAsset(FileManager::GUI_ICON, "screen_other.png"));
|
||||||
|
video::ITexture* icon_6 = irr_driver->getTexture
|
||||||
|
(file_manager->getAsset(FileManager::GUI_ICON, "android/robot.png"));
|
||||||
m_icon_bank->addTextureAsSprite(icon_1);
|
m_icon_bank->addTextureAsSprite(icon_1);
|
||||||
m_icon_bank->addTextureAsSprite(icon_2);
|
m_icon_bank->addTextureAsSprite(icon_2);
|
||||||
m_icon_bank->addTextureAsSprite(icon_3);
|
m_icon_bank->addTextureAsSprite(icon_3);
|
||||||
m_icon_bank->addTextureAsSprite(icon_4);
|
m_icon_bank->addTextureAsSprite(icon_4);
|
||||||
m_icon_bank->addTextureAsSprite(icon_5);
|
m_icon_bank->addTextureAsSprite(icon_5);
|
||||||
m_icon_bank->addTextureAsSprite(m_spectate_texture);
|
m_icon_bank->addTextureAsSprite(m_spectate_texture);
|
||||||
|
m_icon_bank->addTextureAsSprite(icon_6);
|
||||||
|
|
||||||
m_icon_bank->setScale((float)GUIEngine::getFontHeight() / 96.0f);
|
m_icon_bank->setScale((float)GUIEngine::getFontHeight() / 96.0f);
|
||||||
} // loadedFromFile
|
} // loadedFromFile
|
||||||
|
Loading…
x
Reference in New Issue
Block a user