Skip to content

Commit 88e2aff

Browse files
committed
gold pass now properly grants all pro features
1 parent 368d63b commit 88e2aff

File tree

10 files changed

+70
-49
lines changed

10 files changed

+70
-49
lines changed

.efrocachemap

Lines changed: 28 additions & 28 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
### 1.7.37 (build 22150, api 9, 2024-12-28)
1+
### 1.7.37 (build 22152, api 9, 2024-12-30)
22
- Bumping api version to 9. As you'll see below, there's some UI changes that
33
will require a bit of work for any UI mods to adapt to. If your mods don't
44
touch UI stuff at all you can simply bump your api version and call it a day.

config/requirements.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ cpplint==2.0.0
22
dmgbuild==1.6.2
33
filelock==3.16.1
44
furo==2024.8.6
5-
mypy==1.14.0
5+
mypy==1.14.1
66
pbxproj==4.2.1
77
pdoc==15.0.1
88
pur==7.3.3

src/assets/ba_data/python/baclassic/_accountv1.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -230,13 +230,12 @@ def have_pro(self) -> bool:
230230
if plus is None:
231231
return False
232232

233-
# Check our tickets-based pro upgrade and our two real-IAP based
234-
# upgrades. Also always unlock this stuff in ballistica-core builds.
233+
# Check various server-side purchases that mean we have pro.
235234
return bool(
236-
plus.get_v1_account_product_purchased('upgrades.pro')
235+
plus.get_v1_account_product_purchased('gold_pass')
236+
or plus.get_v1_account_product_purchased('upgrades.pro')
237237
or plus.get_v1_account_product_purchased('static.pro')
238238
or plus.get_v1_account_product_purchased('static.pro_sale')
239-
or 'ballistica' + 'kit' == babase.appname()
240239
)
241240

242241
def have_pro_options(self) -> bool:

src/assets/ba_data/python/baenv.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@
5353

5454
# Build number and version of the ballistica binary we expect to be
5555
# using.
56-
TARGET_BALLISTICA_BUILD = 22150
56+
TARGET_BALLISTICA_BUILD = 22152
5757
TARGET_BALLISTICA_VERSION = '1.7.37'
5858

5959

src/assets/ba_data/python/bauiv1lib/chest.py

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,7 @@ def _on_chest_info_response(
148148
return
149149

150150
if response.chest is None:
151-
self._error('Would show general info about chests.')
151+
self._show_about_chest_slots()
152152
return
153153

154154
self.show_chest_actions(response.chest)
@@ -310,6 +310,14 @@ def _error(self, msg: str | bui.Lstr) -> None:
310310
self._reset()
311311
bui.textwidget(edit=self._infotext, text=msg, color=(1, 0, 0))
312312

313+
def _show_about_chest_slots(self) -> None:
314+
self._reset()
315+
msg = (
316+
'This empty slot can hold a treasure chest.\n'
317+
'Treasure chests are earned through gameplay.'
318+
)
319+
bui.textwidget(edit=self._infotext, text=msg, color=(1, 1, 1))
320+
313321
@override
314322
def get_main_window_state(self) -> bui.MainWindowState:
315323
# Support recreating our window for back/refresh purposes.

src/assets/ba_data/python/bauiv1lib/resourcetypeinfo.py

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -57,20 +57,20 @@ def __init__(
5757

5858
if resource_type == 'tickets':
5959
rdesc = (
60-
'Use tickets to unlock characters, maps,\n'
61-
'minigames, and more in the store.\n'
60+
'Tickets can be used to unlock characters,\n'
61+
'maps, minigames, and more in the store.\n'
6262
'\n'
63-
'Earn tickets by completing achievements or\n'
64-
'by opening chests won in the game.'
63+
'Earn tickets by completing achievements\n'
64+
'or by opening chests won in the game.'
6565
)
6666
texname = 'tickets'
6767
elif resource_type == 'tokens':
6868
rdesc = (
69-
'Tokens can be used to speed up chest unlocks\n'
70-
'and skip other waits.\n'
69+
'Tokens have various uses in the game such as\n'
70+
'speeding up chest unlocks.\n'
7171
'\n'
72-
'You can buy packs of tokens or buy a Gold Pass\n'
73-
'to get infinite tokens forever.\n'
72+
'You can buy packs of tokens or you can buy a\n'
73+
'Gold Pass to get unlimited tokens.\n'
7474
)
7575
texname = 'coin'
7676
elif resource_type == 'trophies':

src/ballistica/shared/ballistica.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ auto main(int argc, char** argv) -> int {
3939
namespace ballistica {
4040

4141
// These are set automatically via script; don't modify them here.
42-
const int kEngineBuildNumber = 22150;
42+
const int kEngineBuildNumber = 22152;
4343
const char* kEngineVersion = "1.7.37";
4444
const int kEngineApiVersion = 9;
4545

src/ballistica/ui_v1/widget/root_widget.cc

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1396,22 +1396,31 @@ void RootWidget::SetTicketsMeterText(const std::string& val) {
13961396
void RootWidget::SetTokensMeterText(const std::string& val, bool gold_pass) {
13971397
assert(tokens_meter_text_);
13981398
assert(get_tokens_button_);
1399-
if (gold_pass) {
1399+
gold_pass_ = gold_pass;
1400+
if (gold_pass_) {
14001401
get_tokens_button_->force_hide = true;
14011402

14021403
// Use the infinity symbol if we have full unicode support.
14031404
tokens_meter_text_->widget->SetText(
14041405
g_buildconfig.enable_os_font_rendering() ? "\xE2\x88\x9E" : "inf");
1405-
tokens_meter_text_->widget->set_color(1.0f, 0.6f, 0.1f, 0.6f);
14061406
} else {
14071407
get_tokens_button_->force_hide = false;
14081408
tokens_meter_text_->widget->SetText(val);
1409-
tokens_meter_text_->widget->set_color(1.0f, 1.0f, 1.0f, 1.0f);
14101409
}
1410+
UpdateTokensMeterTextColor_();
14111411
// May need to animate in/out.
14121412
child_widgets_dirty_ = true;
14131413
}
14141414

1415+
void RootWidget::UpdateTokensMeterTextColor_() {
1416+
auto oval{have_live_values_ ? 1.0f : 0.4f};
1417+
if (gold_pass_ && have_live_values_) {
1418+
tokens_meter_text_->widget->set_color(1.0f, 0.6f, 0.1f, 0.6f);
1419+
} else {
1420+
tokens_meter_text_->widget->set_color(1.0f, 1.0f, 1.0f, oval);
1421+
}
1422+
}
1423+
14151424
void RootWidget::SetLeagueRankText(const std::string& val) {
14161425
assert(league_rank_text_);
14171426
league_rank_text_->widget->SetText(val);
@@ -1454,6 +1463,7 @@ void RootWidget::SetXPText(const std::string& val) {
14541463
}
14551464

14561465
void RootWidget::SetHaveLiveValues(bool have_live_values) {
1466+
have_live_values_ = have_live_values;
14571467
// auto cval{have_live_values ? 1.0f : 0.4f};
14581468
auto oval{have_live_values ? 1.0f : 0.4f};
14591469
auto oval2{have_live_values ? 1.0f : 0.4f};
@@ -1466,7 +1476,8 @@ void RootWidget::SetHaveLiveValues(bool have_live_values) {
14661476

14671477
assert(tokens_meter_text_);
14681478
assert(tokens_meter_icon_);
1469-
tokens_meter_text_->widget->set_color(1.0f, 1.0f, 1.0f, oval);
1479+
UpdateTokensMeterTextColor_();
1480+
// tokens_meter_text_->widget->set_color(1.0f, 1.0f, 1.0f, oval);
14701481
// tokens_meter_icon_->widget->set_color(cval, cval, cval);
14711482
tokens_meter_icon_->widget->set_opacity(oval2);
14721483

src/ballistica/ui_v1/widget/root_widget.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,7 @@ class RootWidget : public ContainerWidget {
7373
void StepChildWidgets_(float dt);
7474
void AddMeter_(MeterType_ type, float h_align, float r, float g, float b,
7575
bool plus, const std::string& s);
76+
void UpdateTokensMeterTextColor_();
7677

7778
std::list<Button_> buttons_;
7879
std::list<Text_> texts_;
@@ -121,6 +122,8 @@ class RootWidget : public ContainerWidget {
121122
ToolbarVisibility toolbar_visibility_{ToolbarVisibility::kInGame};
122123
bool child_widgets_dirty_{true};
123124
bool in_main_menu_{};
125+
bool gold_pass_{};
126+
bool have_live_values_{};
124127
};
125128

126129
} // namespace ballistica::ui_v1

0 commit comments

Comments
 (0)