mirror of
https://github.com/PikaMug/Quests.git
synced 2025-02-11 18:11:19 +01:00
Format money in rewards prompt, per #1719
This commit is contained in:
parent
f341bc0e79
commit
ea8b8fe24b
@ -191,9 +191,8 @@ public class RewardsPrompt extends QuestsEditorNumericPrompt {
|
|||||||
return ChatColor.GRAY + "(" + Lang.get("noneSet") + ")";
|
return ChatColor.GRAY + "(" + Lang.get("noneSet") + ")";
|
||||||
} else {
|
} else {
|
||||||
final int moneyRew = (Integer) context.getSessionData(CK.REW_MONEY);
|
final int moneyRew = (Integer) context.getSessionData(CK.REW_MONEY);
|
||||||
return ChatColor.GRAY + "(" + ChatColor.AQUA + moneyRew + " "
|
return ChatColor.GRAY + "(" + ChatColor.AQUA + moneyRew + " "
|
||||||
+ (moneyRew > 1 ? plugin.getDependencies().getCurrency(true)
|
+ plugin.getDependencies().getVaultEconomy().format(moneyRew) + ChatColor.GRAY + ")";
|
||||||
: plugin.getDependencies().getCurrency(false)) + ChatColor.GRAY + ")";
|
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
return ChatColor.GRAY + "(" + Lang.get("notInstalled") + ")";
|
return ChatColor.GRAY + "(" + Lang.get("notInstalled") + ")";
|
||||||
@ -490,16 +489,14 @@ public class RewardsPrompt extends QuestsEditorNumericPrompt {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getPromptText(final ConversationContext context) {
|
public String getPromptText(final ConversationContext context) {
|
||||||
final QuestsEditorPostOpenStringPromptEvent event = new QuestsEditorPostOpenStringPromptEvent(context, this);
|
final QuestsEditorPostOpenStringPromptEvent event
|
||||||
|
= new QuestsEditorPostOpenStringPromptEvent(context, this);
|
||||||
context.getPlugin().getServer().getPluginManager().callEvent(event);
|
context.getPlugin().getServer().getPluginManager().callEvent(event);
|
||||||
|
|
||||||
String text = getQueryText(context);
|
String text = getQueryText(context);
|
||||||
if (plugin.getDependencies().getVaultEconomy() != null) {
|
if (plugin.getDependencies().getVaultEconomy() != null) {
|
||||||
text = text.replace("<money>", ChatColor.AQUA + (plugin.getDependencies().getVaultEconomy()
|
text = text.replace("<money>", ChatColor.AQUA
|
||||||
.currencyNamePlural().isEmpty() ? Lang.get("money") : plugin.getDependencies().getVaultEconomy()
|
+ (plugin.getDependencies().getVaultEconomy().currencyNamePlural() + ChatColor.YELLOW));
|
||||||
.currencyNamePlural()) + ChatColor.YELLOW);
|
|
||||||
} else {
|
|
||||||
text = text.replace("<money>", ChatColor.AQUA + Lang.get("money") + ChatColor.YELLOW);
|
|
||||||
}
|
}
|
||||||
return ChatColor.YELLOW + text;
|
return ChatColor.YELLOW + text;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user