Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -298,6 +298,7 @@ public void changed(ChangeEvent event, Actor actor) {
}
});
addCheckBox(Forge.getLocalizer().getMessage("lblPromptAutoSell"), ForgePreferences.FPref.PROMPT_FOR_AUTOSELL);
addCheckBox(Forge.getLocalizer().getMessage("lblShowCardPriceRewardScreen"), ForgePreferences.FPref.UI_DISPLAY_PRICE_IN_REWARD_SCREEN);
addCheckBox(Forge.getLocalizer().getMessage("lblCardName"), ForgePreferences.FPref.UI_OVERLAY_CARD_NAME);
addSettingSlider(Forge.getLocalizer().getMessage("cbAdjustMusicVolume"), ForgePreferences.FPref.UI_VOL_MUSIC, 0, 100);
addSettingSlider(Forge.getLocalizer().getMessage("cbAdjustSoundsVolume"), ForgePreferences.FPref.UI_VOL_SOUNDS, 0, 100);
Expand Down
18 changes: 15 additions & 3 deletions forge-gui-mobile/src/forge/adventure/util/RewardActor.java
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,8 @@
import forge.gui.GuiBase;
import forge.item.PaperCard;
import forge.item.SealedProduct;
import forge.localinstance.properties.ForgePreferences.FPref;
import forge.model.FModel;
import forge.sound.SoundEffectType;
import forge.sound.SoundSystem;
import forge.util.MyRandom;
Expand Down Expand Up @@ -240,6 +242,17 @@ private void updateAutoSell() {
reward.setAutoSell(!reward.isAutoSell());
autoSell.setText(reward.isAutoSell() ? "[%85][+Sell]" + priceTag : "[%85][GRAY] " + priceTag);
autoSell.getColor().a = reward.isAutoSell() ? 1f : 0.7f;

calcAutoSellWidth();
}

private void calcAutoSellWidth() {
float btnHeight = autoSell.getTextraLabel().layout.getHeight() * 1.8f;
float width = btnHeight - 2f;
if (FModel.getPreferences().getPrefBoolean(FPref.UI_DISPLAY_PRICE_IN_REWARD_SCREEN)) {
width = Math.max(autoSell.getTextraLabel().layout.getWidth() + 6f, width);
};
autoSell.setSize(width, btnHeight);
}

public RewardActor(Reward reward, boolean flippable, RewardScene.Type type, boolean showOverlay) {
Expand All @@ -256,7 +269,7 @@ public RewardActor(Reward reward, boolean flippable, RewardScene.Type type, bool
case Card: {
if (!reward.isNoSell) {
int sellPrice = AdventurePlayer.current().cardSellPrice(reward.getCard());
priceTag = sellPrice > 0 ? " " + sellPrice : "";
priceTag = FModel.getPreferences().getPrefBoolean(FPref.UI_DISPLAY_PRICE_IN_REWARD_SCREEN) && sellPrice > 0 ? String.valueOf(sellPrice) : "";
autoSell = Controls.newTextButton("[%85][GRAY] " + priceTag);
autoSell.getColor().a = 0.7f; // semi-transparent by default
autoSell.addListener(new InputListener() {
Expand All @@ -269,8 +282,7 @@ public void exit(InputEvent event, float x, float y, int pointer, Actor toActor)
if (!reward.isAutoSell()) autoSell.getColor().a = 0.7f;
}
});
float btnHeight = autoSell.getTextraLabel().layout.getHeight() * 1.8f;
autoSell.setSize(autoSell.getWidth(), btnHeight);
calcAutoSellWidth();
autoSell.addListener(new ClickListener() {
public void clicked(InputEvent event, float x, float y) {
updateAutoSell();
Expand Down
1 change: 1 addition & 0 deletions forge-gui/res/languages/en-US.properties
Original file line number Diff line number Diff line change
Expand Up @@ -3431,6 +3431,7 @@ nlPreloadCustomDrafts=If enabled, the custom drafts files are preloaded on start
lblRepairCost=Repair Cost: {0} ?
lblRepair=Repair
lblDataMigrationMsg=Data Migration completed!\nPlease check your Inventory and Equipments.\nPlease make a backup of your saves at this point since the actual save is not yet overwritten by using the Data -> Backup at the Menu Scene.
lblShowCardPriceRewardScreen=Show card price on reward screen
#AdventureDeckEditor.java
lblRemoveUnsupportedCard=Remove unsupported card
lblRemoveAllUnsupportedCards=Unsupported cards have been removed from your inventory.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,7 @@ public enum FPref implements PreferencesStore.IPref {
UI_HAND_NO_OVERLAP("false"),
UI_ZONE_TAB_NEW_COUNT("false"),
UI_ENABLE_AI_PICKER("false"),
UI_DISPLAY_PRICE_IN_REWARD_SCREEN("true"),

UI_ENABLE_SOUNDS ("true"),
UI_ENABLE_MUSIC ("true"),
Expand Down
Loading