Removed unnecessary variable.

This commit is contained in:
hiker 2014-03-06 08:49:30 +11:00
parent 352863a763
commit b0018d4e5f
2 changed files with 5 additions and 5 deletions

View File

@ -42,7 +42,6 @@ DEFINE_SCREEN_SINGLETON( OnlineProfileFriends );
OnlineProfileFriends::OnlineProfileFriends() OnlineProfileFriends::OnlineProfileFriends()
: OnlineProfileBase("online/profile_friends.stkgui") : OnlineProfileBase("online/profile_friends.stkgui")
{ {
m_selected_friend_index = -1;
} // OnlineProfileFriends } // OnlineProfileFriends
// ----------------------------------------------------------------------------- // -----------------------------------------------------------------------------
@ -105,9 +104,8 @@ void OnlineProfileFriends::eventCallback(Widget* widget,
} }
else if (name == m_friends_list_widget->m_properties[GUIEngine::PROP_ID]) else if (name == m_friends_list_widget->m_properties[GUIEngine::PROP_ID])
{ {
m_selected_friend_index = m_friends_list_widget->getSelectionID(); int index = m_friends_list_widget->getSelectionID();
const Profile::IDList &friends = m_visiting_profile->getFriends(); new UserInfoDialog(m_visiting_profile->getFriends()[index]);
new UserInfoDialog(friends[m_selected_friend_index]);
} }
} // eventCallback } // eventCallback
@ -158,6 +156,9 @@ void OnlineProfileFriends::displayResults()
} // displayResults } // displayResults
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------
/** Called each frame to check if results have arrived.
* \param delta Time step size.
*/
void OnlineProfileFriends::onUpdate(float delta) void OnlineProfileFriends::onUpdate(float delta)
{ {
if(m_waiting_for_friends) if(m_waiting_for_friends)

View File

@ -44,7 +44,6 @@ private:
GUIEngine::ButtonWidget *m_search_button_widget; GUIEngine::ButtonWidget *m_search_button_widget;
GUIEngine::TextBoxWidget *m_search_box_widget; GUIEngine::TextBoxWidget *m_search_box_widget;
int m_selected_friend_index;
bool m_waiting_for_friends; bool m_waiting_for_friends;
void displayResults(); void displayResults();