@Override public void onFrameAdd(final FrameHandler frameHandler, final boolean isAboutToBeAdded) { if (!isAboutToBeAdded) { this.m_dialogUnloadListener = new DialogUnloadListener() { @Override public void dialogUnloaded(final String id) { if (id.equals("moderatorChatDialog")) { UIModeratorChatFrame.this.askToCloseRequest(); } } }; Xulor.getInstance().addDialogUnloadListener(this.m_dialogUnloadListener); Xulor.getInstance() .load( "moderatorChatDialog", Dialogs.getDialogPath("moderatorChatDialog"), 40977L, (short) 10000); Xulor.getInstance().putActionClass("wakfu.moderatorChat", ModeratorChatDialogActions.class); final Message msg = new UIChatCreationRequestMessage( (short) 19067, this.m_remoteUser, new Listener(this.m_firstMessage, this.m_sourceId, this.m_remoteUser)); Worker.getInstance().pushMessage(msg); this.m_isRunning = true; } }
@Override public void onFrameRemove(final FrameHandler frameHandler, final boolean isAboutToBeRemoved) { if (!isAboutToBeRemoved) { Xulor.getInstance().removeDialogUnloadListener(this.m_dialogUnloadListener); UIChatFrameHelper.closeModeratorChatWindow(); Xulor.getInstance().unload("moderatorChatDialog"); Xulor.getInstance().removeActionClass("wakfu.moderatorChat"); if (this.m_isRunning) { final Message notifyToOtherSide = new CloseModeratorRequestMessage(); WakfuGameEntity.getInstance().getNetworkEntity().sendMessage(notifyToOtherSide); this.m_isRunning = false; } } }
public static void displayNameError(final byte errorCode) { String errorString = null; switch (errorCode) { case 10: { errorString = "error.characterCreation.existingName"; break; } case 11: { errorString = "error.characterCreation.invalidName"; break; } case 12: { errorString = "error.characterCreation.tooManyCharacters"; break; } default: { errorString = "error.characterCreation"; break; } } Xulor.getInstance() .msgBox( WakfuTranslator.getInstance().getString(errorString), WakfuMessageBoxConstants.getMessageBoxIconUrl(1), 1027L, 8, 1); }
private void askToCloseRequest() { if (this.m_isRunning) { final MessageBoxData data = new MessageBoxData( 102, 0, WakfuTranslator.getInstance().getString("contactModerator.suretoclose"), 24L); final MessageBoxControler controler = Xulor.getInstance().msgBox(data); controler.addEventListener( new MessageBoxEventListener() { @Override public void messageBoxClosed(final int type, final String userEntry) { if (type == 8) { WakfuGameEntity.getInstance().removeFrame(UIModeratorChatFrame.this); } } }); } else { WakfuGameEntity.getInstance().removeFrame(this); } }
@Override public void onCloseEvent() { if (SWFWrapper.INSTANCE.isOpened()) { SWFWrapper.INSTANCE.unload(); return; } final MessageBoxControler messageBoxControler = Xulor.getInstance() .msgBox( WakfuTranslator.getInstance().getString("question.quit"), WakfuMessageBoxConstants.getMessageBoxIconUrl(0), 2073L, 102, 1); messageBoxControler.addEventListener( new MessageBoxEventListener() { @Override public void messageBoxClosed(final int type, final String userEntry) { if (type == 8) { WakfuApplicationUI.this.onCloseEvent(); } } }); }