public void createChat(final String userName, final long sourceId, final String firstMessage) { if (!WakfuGameEntity.getInstance().hasFrame(this)) { this.m_remoteUser = userName; this.m_sourceId = sourceId; this.m_firstMessage = firstMessage; WakfuGameEntity.getInstance().pushFrame(this); } }
@Override public void onFrameRemove(final FrameHandler frameHandler, final boolean isAboutToBeRemoved) { if (!isAboutToBeRemoved) { WakfuGameEntity.getInstance().removeFrame(UICharacterCreationFrame.getInstance()); this.m_characterId = -1L; this.m_characterName = null; this.m_creationType = CreationType.DEFAULT; this.m_model = null; } }
@Override public boolean onMessage(final Message message) { switch (message.getId()) { case 2050: { final boolean success = NetCharacterChoiceFrame.onCharacterSelectionResult( (CharacterSelectionResultMessage) message, this); if (!success) { WakfuProgressMonitorManager.getInstance().done(); WakfuGameEntity.getInstance().removeFrame(this); NetCharacterChoiceFrame.getInstance().enableLoadUI(true); WakfuGameEntity.getInstance().pushFrame(NetCharacterChoiceFrame.getInstance()); } return false; } case 2054: { final CharacterCreationResultMessage msg = (CharacterCreationResultMessage) message; NetCharacterCreationFrame.m_logger.info( (Object) ("R\u00e9sultat de la cr\u00e9ation de perso : succes=" + msg.isCreationSuccessful() + ", code=" + msg.getCreationCode())); if (msg.isCreationSuccessful()) { WakfuProgressMonitorManager.getInstance() .getProgressMonitor(true) .beginTask(WakfuTranslator.getInstance().getString("loadingWorld.progress"), 0); } else { WakfuProgressMonitorManager.getInstance().done(); displayNameError(msg.getCreationCode()); CharacterCreationDialogActions.setCreateCharacterFlag(false); } return false; } default: { return true; } } }
@Override public void onFrameAdd(final FrameHandler frameHandler, final boolean isAboutToBeAdded) { if (!isAboutToBeAdded) { UICharacterCreationFrame.getInstance().setCharacterId(this.m_characterId); UICharacterCreationFrame.getInstance().setCharacterName(this.m_characterName); UICharacterCreationFrame.getInstance().setCreationType(this.m_creationType); UICharacterCreationFrame.getInstance().setRecustomType(this.m_recustomType); UICharacterCreationFrame.getInstance().setSource(this.m_source); UICharacterCreationFrame.getInstance().setModel(this.m_model); WakfuGameEntity.getInstance().pushFrame(UICharacterCreationFrame.getInstance()); } }
@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; } } }
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); } }