mirror of
https://github.com/RYDE-WORK/ballistica.git
synced 2026-02-05 06:53:18 +08:00
tidying
This commit is contained in:
parent
b2f70fb2af
commit
5c299f0062
@ -179,7 +179,7 @@ class StoreBrowserWindow(ba.Window):
|
|||||||
('minigames', ba.Lstr(resource=self._r + '.miniGamesText')),
|
('minigames', ba.Lstr(resource=self._r + '.miniGamesText')),
|
||||||
('characters', ba.Lstr(resource=self._r + '.charactersText')),
|
('characters', ba.Lstr(resource=self._r + '.charactersText')),
|
||||||
('icons', ba.Lstr(resource=self._r + '.iconsText')),
|
('icons', ba.Lstr(resource=self._r + '.iconsText')),
|
||||||
] # yapf : disable
|
]
|
||||||
|
|
||||||
tab_results = tabs.create_tab_buttons(self._root_widget,
|
tab_results = tabs.create_tab_buttons(self._root_widget,
|
||||||
tabs_def,
|
tabs_def,
|
||||||
@ -454,16 +454,19 @@ class StoreBrowserWindow(ba.Window):
|
|||||||
# purchase this. Better to fail now than after we've
|
# purchase this. Better to fail now than after we've
|
||||||
# paid locally.
|
# paid locally.
|
||||||
app = ba.app
|
app = ba.app
|
||||||
serverget('bsAccountPurchaseCheck', {
|
serverget(
|
||||||
'item': item,
|
'bsAccountPurchaseCheck',
|
||||||
'platform': app.platform,
|
{
|
||||||
'subplatform': app.subplatform,
|
'item': item,
|
||||||
'version': app.version,
|
'platform': app.platform,
|
||||||
'buildNumber': app.build_number,
|
'subplatform': app.subplatform,
|
||||||
'purchaseType': 'ticket' if is_ticket_purchase else 'real'
|
'version': app.version,
|
||||||
},
|
'buildNumber': app.build_number,
|
||||||
callback=ba.WeakCall(self._purchase_check_result, item,
|
'purchaseType': 'ticket' if is_ticket_purchase else 'real'
|
||||||
is_ticket_purchase))
|
},
|
||||||
|
callback=ba.WeakCall(self._purchase_check_result, item,
|
||||||
|
is_ticket_purchase),
|
||||||
|
)
|
||||||
|
|
||||||
def buy(self, item: str) -> None:
|
def buy(self, item: str) -> None:
|
||||||
"""Attempt to purchase the provided item."""
|
"""Attempt to purchase the provided item."""
|
||||||
@ -537,8 +540,7 @@ class StoreBrowserWindow(ba.Window):
|
|||||||
sales_raw = _ba.get_account_misc_read_val('sales', {})
|
sales_raw = _ba.get_account_misc_read_val('sales', {})
|
||||||
sales = {}
|
sales = {}
|
||||||
try:
|
try:
|
||||||
# look at the current set of sales; filter any with
|
# Look at the current set of sales; filter any with time remaining.
|
||||||
# time remaining..
|
|
||||||
for sale_item, sale_info in list(sales_raw.items()):
|
for sale_item, sale_info in list(sales_raw.items()):
|
||||||
to_end = (datetime.datetime.utcfromtimestamp(sale_info['e']) -
|
to_end = (datetime.datetime.utcfromtimestamp(sale_info['e']) -
|
||||||
datetime.datetime.utcnow()).total_seconds()
|
datetime.datetime.utcnow()).total_seconds()
|
||||||
@ -548,7 +550,7 @@ class StoreBrowserWindow(ba.Window):
|
|||||||
'original_price': sale_info['op']
|
'original_price': sale_info['op']
|
||||||
}
|
}
|
||||||
except Exception:
|
except Exception:
|
||||||
ba.print_exception("Error parsing sales")
|
ba.print_exception("Error parsing sales.")
|
||||||
|
|
||||||
assert self.button_infos is not None
|
assert self.button_infos is not None
|
||||||
for b_type, b_info in self.button_infos.items():
|
for b_type, b_info in self.button_infos.items():
|
||||||
@ -602,7 +604,8 @@ class StoreBrowserWindow(ba.Window):
|
|||||||
price_text_right = ''
|
price_text_right = ''
|
||||||
else:
|
else:
|
||||||
price = _ba.get_account_misc_read_val('price.' + b_type, 0)
|
price = _ba.get_account_misc_read_val('price.' + b_type, 0)
|
||||||
# color button differently if we cant afford this
|
|
||||||
|
# Color the button differently if we cant afford this.
|
||||||
if _ba.get_account_state() == 'signed_in':
|
if _ba.get_account_state() == 'signed_in':
|
||||||
if _ba.get_account_ticket_count() < price:
|
if _ba.get_account_ticket_count() < price:
|
||||||
color = (0.6, 0.61, 0.6)
|
color = (0.6, 0.61, 0.6)
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user