Hide ANNEHMEN in the advertising offer browser when the offer cannot be accepted
The original shows only ABBRECHEN while a running sponsor contract is not terminable; the button was always drawn here. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
39de3dc9d4
commit
f33b381f18
2 files changed
+14
-1
No files matched your search
+12
-1
@@ -756,7 +756,10 @@ Image AdvertisingScreen::render() const {
|
||||
copy(image, logos_, 32, 217, 138, 174, 11, 14);
|
||||
|
||||
button(image, 89, 191, 66, state_.cancel_label);
|
||||
button(image, 164, 191, 66, state_.accept_label);
|
||||
// The original shows ABBRECHEN only when the selected offer cannot be accepted
|
||||
// (for example while a running sponsor contract is not terminable).
|
||||
if (offer_acceptable())
|
||||
button(image, 164, 191, 66, state_.accept_label);
|
||||
}
|
||||
}
|
||||
if (hovered_target_ >= 0) {
|
||||
@@ -970,6 +973,14 @@ bool AdvertisingScreen::open_offers(int display_slot) {
|
||||
return true;
|
||||
}
|
||||
|
||||
bool AdvertisingScreen::offer_acceptable() const {
|
||||
if (!offer_open_ || selected_contract_ < 0 || selected_contract_ >= 16 || selected_offer_ < 0) return false;
|
||||
for (const auto& candidate : state_.offers[size_t(selected_contract_)].offers)
|
||||
if (candidate.raw_slot == selected_offer_)
|
||||
return candidate.present && candidate.can_accept && candidate.monthly_amount != 0;
|
||||
return false;
|
||||
}
|
||||
|
||||
void AdvertisingScreen::submit_selected_offer() {
|
||||
if (pending_ || !offer_open_ || selected_contract_ < 0 || selected_contract_ >= 16 || selected_offer_ < 0)
|
||||
return;
|
||||
|
||||
@@ -158,6 +158,8 @@ private:
|
||||
int max_width = 310, bool use_gradient = true) const;
|
||||
void begin_offer_browser(int display_slot);
|
||||
void submit_selected_offer();
|
||||
// True when the selected offer of the open browser can be accepted (draws ANNEHMEN).
|
||||
bool offer_acceptable() const;
|
||||
void open_spending_calculator(int display_slot);
|
||||
bool accept_spending_calculator();
|
||||
void close_spending_calculator();
|
||||
|
||||
Reference in new issue
Block a user