From bd754cbd11729b9534dbf89e6dfff150eebb64a6 Mon Sep 17 00:00:00 2001 From: Tristan Strathearn Date: Tue, 5 Apr 2022 09:35:18 +1000 Subject: [PATCH] feat: add a message/button to the shortcut menu & a link to the changelog in the UI panel when an update is available --- interface/main_menu.py | 6 ++++++ interface/main_ui_panel.py | 3 +++ 2 files changed, 9 insertions(+) diff --git a/interface/main_menu.py b/interface/main_menu.py index 8709295..e6a96be 100644 --- a/interface/main_menu.py +++ b/interface/main_menu.py @@ -1,5 +1,6 @@ import bpy from .. import bl_info +from .. import lib keys = [] @@ -12,6 +13,11 @@ class ND_MT_main_menu(bpy.types.Menu): def draw(self, context): layout = self.layout + + if lib.preferences.get_preferences().update_available: + layout.operator("wm.url_open", text="Update Available!", icon='PACKAGE').url = "https://hugemenace.gumroad.com/l/nd-blender-addon" + layout.separator() + layout.operator_context = 'INVOKE_DEFAULT' layout.operator("nd.view_align", icon='ORIENTATION_VIEW') layout.operator("nd.geo_lift", icon='FACESEL') diff --git a/interface/main_ui_panel.py b/interface/main_ui_panel.py index b79df27..ed8a741 100644 --- a/interface/main_ui_panel.py +++ b/interface/main_ui_panel.py @@ -21,6 +21,9 @@ def draw(self, context): row.scale_y = 1.5 row.alert = True row.operator("wm.url_open", text="Update Available!", icon='PACKAGE').url = "https://hugemenace.gumroad.com/l/nd-blender-addon" + row = column.row(align=True) + row.scale_y = 1.2 + row.operator("wm.url_open", text="View Changelog", icon='DOCUMENTS').url = "https://docs.nd.hugemenace.co/#/getting-started/changelog" box = layout.box() box.label(text="Documentation", icon='INFO')