jolievivienne

Gosh Life

May 26th, 2015
276
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 1.05 KB | None | 0 0
  1. /// Handle character selection
  2. void ExistenceClient::HandleCharacterSelectedInfoButtonReleased(StringHash eventType, VariantMap& eventData)
  3. {
  4.  
  5.     /// Get the button that was clicked
  6.     UI* ui_ = GetSubsystem<UI>();
  7.  
  8.     UIElement* clickedinfo = static_cast<UIElement*>(eventData[UIMouseClick::P_ELEMENT].GetPtr());
  9.  
  10.     /// Get Button String
  11.     String clickedButtonString(clickedinfo->GetName());
  12.  
  13.     /// Convert text to a integer number
  14.     int button = clickedButtonString.Back()-'0';
  15.  
  16.     /// Load UI root
  17.     UIElement * uiroot = ui_ -> GetRoot ();
  18.  
  19.     /// Locate Window PlayerWindow
  20.     Window* PlayerWindow = static_cast<Window*>(uiroot ->GetChild("PlayerWindow", true));
  21.  
  22.     /// IF PlayerWindow exist then enable visibility
  23.     if(PlayerWindow)
  24.     {
  25.         ///PlayerWindow-> SetEnabled(true);
  26.         ///PlayerWindow-> SetDeepEnabled(true);
  27.         PlayerWindow-> SetVisible(true);
  28.  
  29.         cout << "test" <<endl;
  30.     }
  31.     else
  32.     {
  33.         /// Load Player WIndow UI
  34.         loadUIXML(UIPLAYERWINDOW,200,200, button);
  35.     }
  36. }
Advertisement
Add Comment
Please, Sign In to add comment