Skip to content

Commit d46d7f2

Browse files
Update notice (#1228)
* Add licence dialog * Update to Python 3.10 * Reformat
1 parent 2b02d39 commit d46d7f2

File tree

10 files changed

+124
-179
lines changed

10 files changed

+124
-179
lines changed

.github/workflows/python-build.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ jobs:
1818
fail-fast: false
1919
matrix:
2020
cfg:
21-
- {os: windows-latest, python-version: '3.9', architecture: x64}
21+
- {os: windows-latest, python-version: '3.10', architecture: x64}
2222

2323
steps:
2424
- uses: actions/checkout@v4

.github/workflows/python-stylecheck.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ jobs:
1717
runs-on: ubuntu-latest
1818
strategy:
1919
matrix:
20-
python-version: ['3.9']
20+
python-version: ['3.10']
2121

2222
steps:
2323
- uses: actions/checkout@v4

.github/workflows/python-unittests.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ jobs:
1717
runs-on: windows-latest
1818
strategy:
1919
matrix:
20-
python-version: ['3.9']
20+
python-version: ['3.10']
2121

2222
steps:
2323
- uses: actions/checkout@v4

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ Extract the contained folder to a location on your computer and run the executab
1919

2020
**If you are running a compiled build you do NOT need to do this.**
2121

22-
1) Install [Python 3.9+](https://www.python.org/)
22+
1) Install [Python 3.10](https://www.python.org/downloads/release/python-31011/)
2323
2) We recommend setting up a [python virtual environment](https://docs.python.org/3/tutorial/venv.html) so you don't run into issues with dependency conflicts.
2424
3) run `python -m pip install amulet-map-editor` to install the library and all its dependencies.
2525
4) run `python -m amulet_map_editor` to run the program

amulet_map_editor/api/framework/app.py

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
from amulet_map_editor.api import config
99
from amulet_map_editor import __version__
1010
from .warning_dialog import WarningDialog
11-
from .support_dialog import SupportDialog
11+
from .licence_dialog import LicenceDialog
1212

1313
log = logging.getLogger(__name__)
1414

@@ -30,16 +30,17 @@ def OnInit(self):
3030

3131
meta_config = config.get("amulet_meta", {})
3232

33-
support_dialog_show_time = meta_config.get("support_dialog_show_time", 0)
34-
if support_dialog_show_time < time.time() - 3600 * 24 * 7:
35-
# Last shown more than a week ago
36-
support_dialog = SupportDialog(
37-
self._amulet_ui, 60, support_dialog_show_time == 0
38-
)
39-
support_dialog.Centre()
40-
if support_dialog.ShowModal() == wx.ID_OK:
41-
meta_config["support_dialog_show_time"] = time.time()
42-
config.put("amulet_meta", meta_config)
33+
if not getattr(sys, "frozen", False):
34+
licence_dialog_show_time = meta_config.get("licence_dialog_show_time", 0)
35+
if licence_dialog_show_time < time.time() - 3600 * 24 * 30:
36+
# Last shown more than a month ago
37+
licence_dialog = LicenceDialog(self._amulet_ui)
38+
licence_dialog.Centre()
39+
if licence_dialog.ShowModal() == wx.ID_OK:
40+
meta_config["licence_dialog_show_time"] = time.time()
41+
config.put("amulet_meta", meta_config)
42+
else:
43+
return False
4344

4445
if not meta_config.get("do_not_show_warning_dialog", False):
4546
warning_dialog = WarningDialog(self._amulet_ui)
Lines changed: 95 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,95 @@
1+
import webbrowser
2+
3+
import wx
4+
import wx.lib.agw.hyperlink
5+
6+
from amulet_map_editor import lang
7+
8+
9+
_padding = 20
10+
11+
12+
class LicenceDialog(wx.Dialog):
13+
def __init__(self, parent: wx.Window):
14+
super().__init__(parent, style=wx.CAPTION)
15+
self.SetTitle(lang.get("licence_dialog.title"))
16+
17+
root_sizer = wx.BoxSizer(wx.VERTICAL)
18+
root_sizer.AddSpacer(_padding)
19+
20+
root_sizer_2 = wx.BoxSizer(wx.HORIZONTAL)
21+
root_sizer.Add(root_sizer_2)
22+
23+
root_sizer_2.AddSpacer(_padding)
24+
self._main_sizer = wx.BoxSizer(wx.VERTICAL)
25+
root_sizer_2.Add(self._main_sizer)
26+
root_sizer_2.AddSpacer(_padding)
27+
28+
root_sizer.AddSpacer(_padding)
29+
30+
title = wx.StaticText(
31+
self,
32+
wx.ID_ANY,
33+
lang.get("licence_dialog.header"),
34+
style=wx.ALIGN_CENTER_HORIZONTAL,
35+
)
36+
font = title.GetFont()
37+
font.SetPointSize(25)
38+
title.SetFont(font)
39+
self._main_sizer.Add(title, 0, wx.ALL | wx.EXPAND, 5)
40+
41+
self._add_line(lang.get("licence_dialog.content_1"))
42+
self._main_sizer.AddSpacer(20)
43+
self._add_line(lang.get("licence_dialog.content_2"))
44+
self._main_sizer.AddSpacer(20)
45+
self._add_line(lang.get("licence_dialog.content_3"))
46+
self._main_sizer.AddSpacer(20)
47+
self._add_line(lang.get("licence_dialog.content_4"))
48+
49+
self._main_sizer.AddSpacer(10)
50+
51+
button_sizer = wx.StdDialogButtonSizer()
52+
root_sizer.Add(button_sizer, 0, wx.ALIGN_RIGHT | wx.ALL, 4)
53+
54+
self._quit_button = wx.Button(
55+
self, wx.ID_CANCEL, lang.get("licence_dialog.quit_button")
56+
)
57+
self.SetEscapeId(self._quit_button.GetId())
58+
button_sizer.Add(self._quit_button)
59+
60+
self._buy_button = wx.Button(
61+
self, wx.ID_ANY, lang.get("licence_dialog.buy_button")
62+
)
63+
self._buy_button.SetDefault()
64+
self._buy_button.Bind(wx.EVT_BUTTON, self._buy)
65+
button_sizer.Add(self._buy_button)
66+
67+
self._continue_button = wx.Button(
68+
self, wx.ID_OK, lang.get("licence_dialog.continue_button")
69+
)
70+
button_sizer.Add(self._continue_button)
71+
self.SetAffirmativeId(self._continue_button.GetId())
72+
73+
button_sizer.Realize()
74+
75+
self.SetSizer(root_sizer)
76+
root_sizer.Fit(self)
77+
78+
self.Layout()
79+
80+
def _add_line(self, text: str) -> None:
81+
content = wx.StaticText(
82+
self,
83+
wx.ID_ANY,
84+
text,
85+
style=wx.ALIGN_CENTER_HORIZONTAL,
86+
)
87+
font = content.GetFont()
88+
font.SetPointSize(12)
89+
content.SetFont(font)
90+
content.Wrap(750)
91+
self._main_sizer.Add(content, 0, wx.EXPAND)
92+
93+
@staticmethod
94+
def _buy(_) -> None:
95+
webbrowser.open("https://www.amuletmc.com/")

amulet_map_editor/api/framework/pages/main_menu.py

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88

99
from amulet_map_editor.api import image, lang
1010
from .base_page import BasePageUI
11-
from ..support_dialog import SupportDialog
1211
from amulet_map_editor.api.wx.ui.select_world import open_level_from_dialog
1312

1413

@@ -50,11 +49,6 @@ def __init__(self, parent: wx.Window):
5049
)
5150
sizer.Add(self._open_world_button, 0, wx.ALL | wx.CENTER, 5)
5251

53-
self._support_button = wx.Button(self, size=(400, 70))
54-
self._support_button.SetFont(button_font)
55-
self._support_button.Bind(wx.EVT_BUTTON, self._support)
56-
sizer.Add(self._support_button, 0, wx.ALL | wx.CENTER, 5)
57-
5852
self._user_manual_button = wx.Button(self, size=(400, 70))
5953
self._user_manual_button.SetFont(button_font)
6054
self._user_manual_button.Bind(wx.EVT_BUTTON, self._documentation)
@@ -115,7 +109,6 @@ def __init__(self, parent: wx.Window):
115109
def _load_strings(self):
116110
self._amulet_name.SetLabel(lang.get("meta.amulet"))
117111
self._open_world_button.SetLabel(lang.get("main_menu.open_world"))
118-
self._support_button.SetLabel(lang.get("main_menu.support"))
119112
self._user_manual_button.SetLabel(lang.get("main_menu.user_manual"))
120113
self._user_manual_button.SetToolTip(lang.get("app.browser_open_tooltip"))
121114
self._bug_tracker_button.SetLabel(lang.get("main_menu.bug_tracker"))
@@ -125,11 +118,6 @@ def _load_strings(self):
125118
self._sponsor_label.SetLabel(lang.get("main_menu.our_sponsors"))
126119
self._sponsor_link.SetLabel(lang.get("main_menu.sponsor_link"))
127120

128-
def _support(self, _):
129-
support_dialog = SupportDialog(self, 0, False)
130-
support_dialog.Centre()
131-
support_dialog.ShowModal()
132-
133121
@staticmethod
134122
def _documentation(_):
135123
webbrowser.open(

amulet_map_editor/api/framework/support_dialog.py

Lines changed: 0 additions & 142 deletions
This file was deleted.

amulet_map_editor/lang/en.lang

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,6 @@ menu_bar.help.menu_name=&Help
8383
## The start screen
8484
main_menu.tab_name=Main Menu
8585
main_menu.open_world=Open World
86-
main_menu.support=Support Amulet
8786
main_menu.user_manual=User Manual
8887
main_menu.bug_tracker=Bug Tracker
8988
main_menu.discord=Amulet Discord
@@ -96,15 +95,15 @@ language_select.help=Select the language to use in Amulet from the list below.
9695
language_select.contribute=If you want to fix or add translations click here.
9796

9897
# Support Dialog
99-
support_dialog.title=I Need Your Support!
100-
support_dialog.support_button=I am contributing to Amulet.
101-
support_dialog.ignore_button_wait=Continue without contributing. Wait {t} seconds
102-
support_dialog.ignore_button=Continue without contributing.
103-
support_dialog.content_1=Pathway Studios have been funding the development of Amulet for the past 6 years but have decided to stop funding development from 2026.
104-
support_dialog.content_2=Who am I?\nI am James. You may know me as gentlegiantJGC.\nAmulet has been my job since 2019 but to continue I need financial support.\nAny contribution, no matter how small, is greatly appreciated.\nWithout your support, development and maintenance of Amulet will stop and Amulet will not be able to open worlds from new versions.
105-
support_dialog.github_sponsor=Support Amulet on Github
106-
support_dialog.paypal_sponsor=Support Amulet on Paypal
107-
support_dialog.content_3=The future of Amulet\nFor the past two years I have been rewriting Amulet from the ground up.\nMost of the libraries are now written in C++ for improved speed and parallelisation and the new application uses Qt to allow more control over the user interface.\nI still have a way to go until the rewrite can replace this version of Amulet but experimental versions of the rewrite should be out soon.
98+
licence_dialog.title=Amulet
99+
licence_dialog.header=You must own a license to use Amulet.
100+
licence_dialog.quit_button=Close Amulet.
101+
licence_dialog.continue_button=I have a license.
102+
licence_dialog.buy_button=Buy a license.
103+
licence_dialog.content_1=From 11th December 2025, you must own a license to use Amulet.
104+
licence_dialog.content_2=Pathway Studios have been funding the development of Amulet for the past 6 years but have decided to stop funding development from 2026.
105+
licence_dialog.content_3=I have always wanted Amulet to be free for those who cannot afford it and that has been a reality while Pathway Studios was funding the project but that time has come to an end. The only solution I can see to fund continued development is to charge for use of the software. I understand that this decision may be generally disliked but it is the only way that I can see to keep Amulet alive.
106+
licence_dialog.content_4=The future of Amulet\nFor the past two years I have been rewriting Amulet from the ground up.\nMost of the libraries are now written in C++ for improved speed and parallelisation and the new application uses Qt to allow more control over the user interface.\nI still have a way to go until the rewrite can replace this version of Amulet but, if funding allows, experimental versions of the rewrite should be ready soon.
108107

109108
# Warning Dialog
110109
warning_dialog.title=Welcome to Amulet

amulet_map_editor/lang/en_GB.lang

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
licence_dialog.header=You must own a licence to use Amulet.
2+
licence_dialog.content_1=From 11th December 2025, you must own a licence to use Amulet.
3+
licence_dialog.continue_button=I have a licence.
4+
licence_dialog.buy_button=Buy a licence.

0 commit comments

Comments
 (0)