@@ -58,6 +58,21 @@ def __init__(self, parent: wx.Frame, title: str, global_constants: constants.Con
5858
5959 self ._generate_elements (self .frame_modal )
6060 self .frame_modal .ShowWindowModal ()
61+
62+ def api_link (self ):
63+ if self .constants .github_proxy_link != "SimpleHac" :
64+ self .constants .kdk_api_link = "https://dortania.github.io/KdkSupportPkg/manifest.json"
65+ self .constants .metallib_api_link = "https://dortania.github.io/MetallibSupportPkg/manifest.json"
66+ print (f"- User Select kdk link: { self .constants .kdk_api_link } " )
67+ print (f"- User Select metallib link: { self .constants .metallib_api_link } " )
68+
69+ if self .constants .github_proxy_link == "SimpleHac" :
70+
71+ self .constants .kdk_api_link = "https://next.oclpapi.simplehac.cn/KdkSupportPkg/manifest.json"
72+ self .constants .metallib_api_link = "https://next.oclpapi.simplehac.cn/MetallibSupportPkg/manifest.json"
73+
74+ print (f"- User Select kdk link: { self .constants .kdk_api_link } " )
75+ print (f"- User Select metallib link: { self .constants .metallib_api_link } " )
6176 def condition_exp (self ,key :str ):
6277 import json
6378 try :
@@ -82,7 +97,7 @@ def _generate_elements(self, frame: wx.Frame = None) -> None:
8297 Uses wx.Notebook to implement a tabbed interface
8398 and relies on 'self._settings()' for populating
8499 """
85-
100+
86101 notebook = wx .Notebook (frame , style = wx .NB_MULTILINE )
87102 notebook .SetFont (gui_support .font_factory (13 , wx .FONTWEIGHT_NORMAL ))
88103 notebook .SetMinSize ((- 1 , 300 ))
@@ -901,6 +916,7 @@ def _settings(self) -> dict:
901916 },
902917 self .trans ["Github Proxy" ]: {
903918 "type" : "choice" ,
919+ "function" :self .api_link (),
904920 "choices" : [
905921 "Default" ,
906922 "SimpleHac" ,
@@ -918,6 +934,7 @@ def _settings(self) -> dict:
918934 self .trans ["ghfast : https://ghfast.top/" ],
919935 self .trans ["ghllkk : https://gh.llkk.cc/" ],
920936 ],
937+
921938 },
922939
923940 "wrap_around 1" : {
@@ -1306,6 +1323,7 @@ def on_spinctrl(self, event: wx.Event, label: str) -> None:
13061323
13071324
13081325 def _update_setting (self , variable , value ):
1326+ self .api_link ()
13091327 logging .info (self .trans ["Updating Local Setting: {variable} = {value}" ].format (variable = variable , value = value ))
13101328 setattr (self .constants , variable , value )
13111329 tmp_value = value
0 commit comments