@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); }
@Override public void onFrameRemove(final FrameHandler frameHandler, final boolean isAboutToBeRemoved) { if (!isAboutToBeRemoved) { Xulor.getInstance().removeActionClass("wakfu.popupInfos"); this.m_lastDialog = null; this.m_fieldProvider = null; this.m_popupDialog = null; } }
public void setContent(final FieldProvider fieldProvider) { String dialog = ""; if (fieldProvider instanceof SpellLevel) { dialog = "spellDetailPopup"; this.m_property = "describedSpell"; } else if (fieldProvider instanceof Item || fieldProvider instanceof ReferenceItem || fieldProvider instanceof MerchantInventoryItem || fieldProvider instanceof ReferenceItemFieldProvider) { Item item = null; ReferenceItem refItem; if (fieldProvider instanceof Item) { refItem = (ReferenceItem) ((Item) fieldProvider).getReferenceItem(); item = (Item) fieldProvider; } else if (fieldProvider instanceof ReferenceItem) { refItem = (ReferenceItem) fieldProvider; } else if (fieldProvider instanceof MerchantInventoryItem) { refItem = (ReferenceItem) ((MerchantInventoryItem) fieldProvider).getItem().getReferenceItem(); } else { if (!(fieldProvider instanceof ReferenceItemFieldProvider)) { return; } refItem = ((ReferenceItemFieldProvider) fieldProvider).getReferenceItem(); } final ReferenceItemDisplayer refItemDisplayer = refItem.getReferenceItemDisplayer(); final ArrayList<String> characteristicsDesc = refItemDisplayer.getCharacteristicsString(); final ArrayList<String> effectsDesc = refItemDisplayer.getEffectsString(); if (effectsDesc == null && characteristicsDesc == null) { dialog = "itemSimplePopup"; } else { dialog = "itemDetailPopup"; } this.m_property = "itemPopupDetail"; } else if (fieldProvider instanceof Skill) { dialog = "skillDescription2"; } if (this.m_property != null && !this.m_property.isEmpty() && fieldProvider != null && !fieldProvider.equals( PropertiesProvider.getInstance().getObjectProperty(this.m_property))) { PropertiesProvider.getInstance().setPropertyValue(this.m_property, fieldProvider); } if (!dialog.isEmpty() && !dialog.equals(this.m_lastDialog)) { final ElementMap map = Xulor.getInstance().getEnvironment().getElementMap("worldAndFightBarDialog"); if (map != null) { this.m_popupDialog = (PopupElement) map.getElement(dialog); } this.m_lastDialog = dialog; } }
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 onFrameAdd(final FrameHandler frameHandler, final boolean isAboutToBeAdded) { if (!isAboutToBeAdded) { Xulor.getInstance().putActionClass("wakfu.popupInfos", PopupInfosActions.class); } }