Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /// Handle character selection
- void ExistenceClient::HandleCharacterSelectedInfoButtonReleased(StringHash eventType, VariantMap& eventData)
- {
- /// Get the button that was clicked
- UI* ui_ = GetSubsystem<UI>();
- UIElement* clickedinfo = static_cast<UIElement*>(eventData[UIMouseClick::P_ELEMENT].GetPtr());
- /// Get Button String
- String clickedButtonString(clickedinfo->GetName());
- /// Convert text to a integer number
- int button = clickedButtonString.Back()-'0';
- /// Load UI root
- UIElement * uiroot = ui_ -> GetRoot ();
- /// Locate Window PlayerWindow
- Window* PlayerWindow = static_cast<Window*>(uiroot ->GetChild("PlayerWindow", true));
- /// IF PlayerWindow exist then enable visibility
- if(PlayerWindow)
- {
- ///PlayerWindow-> SetEnabled(true);
- ///PlayerWindow-> SetDeepEnabled(true);
- PlayerWindow-> SetVisible(true);
- cout << "test" <<endl;
- }
- else
- {
- /// Load Player WIndow UI
- loadUIXML(UIPLAYERWINDOW,200,200, button);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment