//=============================================================== // ReviewServerInvitation Popup //=============================================================== _dialog( ReviewServerInvitation, localize( "guis/mainmenu/reviewinvites" ), _center( desktop, width ), _center( desktop, height ), 260, 188, "noMove", "dim" ) _input_dialog( ReviewServerInvitation ) _on_default( ReviewServerInvitationAccept, ReviewServerInvitationCancel ) properties { float serverHandle = -1; string ip; string currentUser; string callbackWindow; } events { onNamedEvent "onShow" { setTabStop( 0 ); gui.edtReviewServerInvitationInfo.editText = sdnet.getProposalText( currentUser ); gui.lblReviewServerInvitationName.text = localizeArgs( "guis/mainmenu/respondtosessioninvite", toWStr( currentUser ) ); gui.messageTimeStamp = sdnet.getMessageTimeStamp(); ip = sdnet.getServerInviteIP(); gui.edtReviewServerInvitationInfo.editText = localizeArgs( "guis/mainmenu/refreshing" ); sdnet.refreshServer( gui.serverMode, gui.selectedServer, ip ); gui.customRefreshActive = true; } onPropertyChanged "visible" { callSuper(); gui.customRefreshActive = immediate( visible ); } onPropertyChanged "gui.onConnectionLost" { if( isVisible() ) { gui.btnReviewServerInvitationCancel.postNamedEvent( "onAction" ); } } onPropertyChanged "sdnet.serverRefreshComplete" { if( sdnet.serverRefreshComplete == false || gui.customRefreshActive == false ) { return; } if( isVisible() ) { gui.edtReviewServerInvitationInfo.editText = sdnet.formatSessionInfo( ip ); } } } _group_box( ReviewServerInvitation, PADDING, _top( dlgReviewServerInvitation ), _fill_to_right_of( dlgReviewServerInvitation ), $evalfloat( BUTTON_HEIGHT * 2 + 3 ) ) events { onCreate { fillColor.a = 1.0f; } } _label_literal( ReviewServerInvitationName, gui.blankWStr, 2, 2, 100, BUTTON_HEIGHT, "1,1,1,0.5" ) properties { vec2 textAlignment = TA_LEFT, TA_VCENTER; } _end_label _label_literal( ReviewServerInvitationTime, localizeArgs( "guis/mainmenu/sentat", gui.messageTimeStamp ), 2, _to_bottom_of( lblReviewServerInvitationName ), 100, BUTTON_HEIGHT, "1,1,1,0.5" ) properties { vec2 textAlignment = TA_LEFT, TA_VCENTER; float visible = wcompare( gui.messageTimeStamp, gui.blankWStr ) == false; } _end_label _end_group_box _editw_scroll( ReviewServerInvitationInfo, PADDING, _to_bottom_of( grpReviewServerInvitation ) + 3, _fill_to_right_of( dlgReviewServerInvitation ), $evalfloat( BUTTON_HEIGHT * 6 ) ) properties { float readOnly = true; color foreColor = 1,1,1,0.5; } _end_editw_scroll _button( ReviewServerInvitationAccept, _to_left_of( btnReviewServerInvitationDecline ) - 3, _bottom( dlgReviewServerInvitation ), BUTTON_WIDTH, BUTTON_HEIGHT ) properties { float taskActive = 0; handle localizedText = localize( "guis/mainmenu/accept" ); } _button_action( gui.broadcastEvent( gui.dlgReviewServerInvitation.callbackWindow, "onJoinSession" ); ) _end_button _button( ReviewServerInvitationDecline, _to_left_of( btnReviewServerInvitationCancel ) - 3, _bottom( dlgReviewServerInvitation ), BUTTON_WIDTH, BUTTON_HEIGHT ) properties { float taskActive = 0; handle localizedText = localize( "guis/mainmenu/decline" ); } _button_action( gui.broadcastEvent( gui.dlgReviewServerInvitation.callbackWindow, "onCancelJoinSession" ); ) _end_button _button( ReviewServerInvitationCancel, _right( dlgReviewServerInvitation ), _bottom( dlgReviewServerInvitation ), BUTTON_WIDTH, BUTTON_HEIGHT ) properties { float taskActive = 0; handle localizedText = localize( "guis/mainmenu/cancel" ); } _button_action( _close_input sdnet.clearActiveMessage(); ) _end_button _end_dialog