Skip to content

Commit

Permalink
Minor bugfix
Browse files Browse the repository at this point in the history
  • Loading branch information
macarooni-man committed Dec 25, 2023
1 parent fcfdf9b commit 6591e60
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 5 deletions.
4 changes: 2 additions & 2 deletions source/addons.py
Original file line number Diff line number Diff line change
Expand Up @@ -146,14 +146,14 @@ def check_for_updates(self):
if addon.id == 'geyser':
update = requests.get('https://download.geysermc.org/v2/projects/geyser/versions/latest/builds/latest').json()
if constants.check_app_version(addon.addon_version, update['version'], limit=3):
print(addon.name, addon.addon_version, update.addon_version)
# print(addon.name, addon.addon_version, update.addon_version)
self.update_required = True
return True

# Everything else
update = get_update_url(addon, self.server['version'], self.server['type'])
if constants.check_app_version(addon.addon_version, update.addon_version, limit=3):
print(addon.name, addon.addon_version, update.addon_version)
# print(addon.name, addon.addon_version, update.addon_version)
self.update_required = True
return True
except:
Expand Down
Binary file added source/gui-assets/icons/sm/notification-glow.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added source/gui-assets/icons/sm/notification.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
18 changes: 16 additions & 2 deletions source/menu.py
Original file line number Diff line number Diff line change
Expand Up @@ -11389,6 +11389,12 @@ class TaskbarItem(RelativeLayout):
def show_notification(self, show=True, animate=True):
if animate:
Animation(opacity=(1 if show else 0), duration=0.25, transition='in_out_sine').start(self.notification)
def fade_in(*a):
Animation(opacity=(0.5 if show else 0), duration=0.15, transition='in_out_sine').start(self.notification_glow)
Clock.schedule_once(fade_in, 0.1)
def fade_out(*a):
Animation(opacity=0, duration=0.5, transition='in_out_sine').start(self.notification_glow)
Clock.schedule_once(fade_out, 0.35)
else:
self.notification.opacity = (1 if show else 0)

Expand Down Expand Up @@ -11536,14 +11542,20 @@ def check_prehover(*args):


# Notification icon
self.notification_glow = Image(source=os.path.join(constants.gui_assets, 'icons', 'sm', 'notification-glow.png'))
self.notification_glow.opacity = 0
self.notification_glow.pos_hint = {'center_x': 0.7, 'center_y': 0.7}
self.notification_glow.size_hint_max = (27, 27)
self.notification_glow.color = constants.convert_color('#FFC175')['rgb']
self.add_widget(self.notification_glow)

self.notification = Image(source=os.path.join(constants.gui_assets, 'icons', 'sm', 'notification.png'))
self.notification.opacity = 0
self.notification.pos_hint = {'center_x': 0.7, 'center_y': 0.7}
self.notification.size_hint_max = (20, 20)
self.notification.color = constants.convert_color('#FFC175')['rgb']
self.add_widget(self.notification)


# Icon list (name, path, color, next_screen)
icon_path = os.path.join(constants.gui_assets, 'icons', 'sm')
self.item_list = [
Expand Down Expand Up @@ -18655,6 +18667,8 @@ def delete_eula(eula_path):

def after_func(*args):
constants.make_update_list()
server_obj._view_notif('add-ons', False)
server_obj._view_notif('settings', viewed=constants.new_server_info['version'])
open_server(server_obj.name, True, f"{final_text} '{server_obj.name}' successfully", launch=self.page_contents['launch'])


Expand Down Expand Up @@ -18895,7 +18909,7 @@ def raise_window(*a):
# open_server("bedrock-test")
# def show_notif(*args):
# screen_manager.current_screen.menu_taskbar.show_notification('amscript')
# Clock.schedule_once(show_notif, 1)
# Clock.schedule_once(show_notif, 2)
# # def open_ams(*args):
# # screen_manager.current = "ServerAddonScreen"
# # Clock.schedule_once(open_ams, 1)
Expand Down
2 changes: 1 addition & 1 deletion source/svrmgr.py
Original file line number Diff line number Diff line change
Expand Up @@ -1494,7 +1494,7 @@ def _view_notif(self, name, add=True, viewed=''):
if name and add:
show_notif = name not in self.viewed_notifs
if name in self.viewed_notifs:
show_notif = viewed != self.viewed_notifs[name]
show_notif = viewed != self.viewed_notifs[name] and viewed

if self.taskbar and show_notif:
self.taskbar.show_notification(name)
Expand Down

0 comments on commit 6591e60

Please sign in to comment.