@PostConstruct private void initializeDialog() { setTitle(messageSource.getMessage("ch.sahits.game.openpatrician.display.dialog.TavernTreasureMapOwnerDialog.title", new Object[]{}, locale.getCurrentLocal())); initializeButtons(); ITreasureMapOwner mapOwner = (ITreasureMapOwner) currentPerson.get(); String loadedText = messageSource.getMessage("ch.sahits.game.openpatrician.display.dialog.TavernTreasureMapOwnerDialog.dialog", new Object[]{city.getPlayer().getLastName()}, locale.getCurrentLocal()); HashMap<String, Object> parameters = new HashMap<>(); parameters.put("price", mapOwner.getPrice()); DecoratedText dt = decoratedTextFactory.createDecoratedText(loadedText, parameters); getContent().addAll(dt); }
@PostConstruct private void initializeDialog() { initializeButtons(); IConcurrent concurrent = (IConcurrent) currentPerson.get(); String loadedText = messageSource.getMessage("ch.sahits.game.openpatrician.display.dialog.TavernConcurrentDialog.dialog", new Object[]{city.getPlayer().getLastName(), concurrent.getName(), concurrent.getPremium()}, locale.getCurrentLocal()); DecoratedText dt = decoratedTextFactory.createDecoratedText(loadedText, new HashMap<>()); getContent().addAll(dt); }
@PostConstruct private void initializeDialog() { setTitle(messageSource.getMessage("ch.sahits.game.openpatrician.display.dialog.guild.JoinGuildDialog.title", new Object[]{}, locale.getCurrentLocal())); IHumanPlayer player = city.getPlayer(); ICity city = this.city.getCity(); int fee = guildService.getEntryFee(player); String template = messageSource.getMessage("ch.sahits.game.openpatrician.display.dialog.guild.JoinGuildDialog.text", new Object[]{city.getName(), player.getName(), player.getLastName(), fee}, locale.getCurrentLocal()); DecoratedText text = textFactory.createDecoratedText(template, new HashMap<>()); VBox box = new VBox(text); String s = messageSource.getMessage("ch.sahits.game.openpatrician.display.dialog.guild.JoinGuildDialog.joinBtn", new Object[]{}, locale.getCurrentLocal()); OpenPatricianLargeWaxButton action = new OpenPatricianLargeWaxButton(s); action.getStyleClass().add("actionButton"); action.setId("joinGuild"); final int actionButtonX = (WIDTH - 124) / 2; action.setLayoutX(actionButtonX); action.setLayoutY(CLOSE_BTN_Y_POS - 24); action.setOnAction(joinGuild(player, city, fee)); box.setLayoutX(50); box.setLayoutY(CLOSE_BTN_Y_POS - 500); getContent().addAll(box, action); }
String loadedText; if (ware.isBarrelSizedWare()) { loadedText = messageSource.getMessage("ch.sahits.game.openpatrician.display.dialog.TavernTraderDialog.dialogBarrel", new Object[]{city.getPlayer().getLastName(), translator.getLocalDisplayName((EWare) ware)}, locale.getCurrentLocal()); } else { loadedText = messageSource.getMessage("ch.sahits.game.openpatrician.display.dialog.TavernTraderDialog.dialogBale", new Object[]{city.getPlayer().getLastName(), translator.getLocalDisplayName((EWare) ware)}, locale.getCurrentLocal());
clientEventBus.post(new ViewChangeEvent(MainGameView.class, proxy)); } else { logger.debug("There is no trading office for {} {} in {}", viewState.getPlayer().getName(), viewState.getPlayer().getLastName(), cityProxy.getCity().getName());
String d = modelTranslator.toDisplayString(arrivalDate); String loadedText = messageSource.getMessage("ch.sahits.game.openpatrician.display.dialog.TavernTravelerDialog.dialog", new Object[]{city.getPlayer().getLastName(), modelTranslator.getLocalDisplayName(player.getCareerLevel()), player.getName(), traveler.getDestination().getName(), d}, locale.getCurrentLocal());
@Override public void run() { IHumanPlayer debitor = (IHumanPlayer) debt.getDebitor(); ICompany company = debitor.getCompany(); int requiredAmount = debt.getAmount(); int amount = (int) Math.min(requiredAmount, company.getCash()); company.updateCash(-amount); if (debt.getCreditor() instanceof IPlayer) { if (debt.getCreditor() instanceof IHumanPlayer) { ((IPlayer) debt.getCreditor()).getCompany().updateCash(amount); } else { ((IPlayer) debt.getCreditor()).getCompany().updateCashDirectly(amount); } if (debt.getCreditor() instanceof IHumanPlayer) { DisplayMessage msg = new DisplayMessage("ch.sahits.game.openpatrician.engine.land.city.LoanerEngine.paybackAfterShipAuction", new Object[]{debitor.getName(), debitor.getLastName(), amount}); TargetedEvent message = new TargetedEvent((IHumanPlayer) debt.getCreditor(), msg); clientServerEventBus.post(message); } } } }