public static void valid(final Event e) { final MessageBoxControler msgBox = Xulor.getInstance() .msgBox( WakfuTranslator.getInstance().getString("setItemElements.question"), WakfuMessageBoxConstants.getMessageBoxIconUrl(0), 2073L, 102, 1); msgBox.addEventListener( new MessageBoxEventListener() { @Override public void messageBoxClosed(final int type, final String userEntry) { if (type == 8) { final SelectItemElementsView elementsView = SelectItemElementsView.INSTANCE; final Item item = elementsView.getConcernedItem(); final SetItemElementsRequestMessage netMsg = new SetItemElementsRequestMessage(); netMsg.setItemUid(item.getUniqueId()); netMsg.setDamageElementMask( elementsView.getElementMask(SelectItemElementsView.DAMAGE_ACTION_ID)); netMsg.setResElementMask( elementsView.getElementMask(SelectItemElementsView.RES_ACTION_ID)); WakfuGameEntity.getInstance().getNetworkEntity().sendMessage(netMsg); WakfuGameEntity.getInstance().removeFrame(UISelectItemElementsFrame.getInstance()); } } }); }
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 boolean run(final Message message) { final MessageBoxControler controler = Xulor.getInstance() .msgBox(WakfuTranslator.getInstance().getString("guild.leave.validate"), 6L, 102, 3); controler.addEventListener( new MessageBoxEventListener() { @Override public void messageBoxClosed(final int type, final String userEntry) { if (type != 2) { return; } final LocalPlayerCharacter localPlayer = WakfuGameEntity.getInstance().getLocalPlayer(); WakfuGuildView.getInstance().requestRemoveById(localPlayer.getId()); WakfuGameEntity.getInstance().removeFrame(UIGuildManagementFrame.getInstance()); } }); return false; }