@@ -298,6 +298,7 @@ internal static void ShowConfigPopup()
298298 polymodPopup . Description = "" ;
299299
300300 polymodPopup . buttonData = CreateConfigPopupButtonData ( ) ;
301+ polymodPopup . ShowSetWidth ( POPUP_WIDTH ) ;
301302 polymodPopup . Show ( ) ;
302303 }
303304
@@ -315,41 +316,62 @@ internal static PopupButtonData[] CreateConfigPopupButtonData()
315316 else
316317 {
317318 string debugButtonName = Localization . Get (
318- "polymod.hub.config.enable" ,
319- new Il2CppSystem . Object [ ] { "DEBUG" }
319+ Plugin . config . debug ? "polymod.hub.config.disable" : "polymod.hub.config.enable" ,
320+ new Il2CppSystem . Object [ ] { Localization . Get ( "polymod.debug" ,
321+ new Il2CppSystem . Object [ ] { } ) . ToUpperInvariant ( ) }
322+ ) ;
323+ string autoUpdateButtonName = Localization . Get (
324+ Plugin . config . autoUpdate ? "polymod.hub.config.disable" : "polymod.hub.config.enable" ,
325+ new Il2CppSystem . Object [ ] { Localization . Get ( "polymod.autoupdate" ,
326+ new Il2CppSystem . Object [ ] { } ) . ToUpperInvariant ( ) }
327+ ) ;
328+ string includeAlphasButtonName = Localization . Get (
329+ Plugin . config . updatePrerelease ? "polymod.hub.config.disable" : "polymod.hub.config.enable" ,
330+ new Il2CppSystem . Object [ ] { Localization . Get ( "polymod.autoupdate.alpha" ,
331+ new Il2CppSystem . Object [ ] { } ) . ToUpperInvariant ( ) }
320332 ) ;
321- if ( Plugin . config . debug )
322- {
323- debugButtonName = Localization . Get (
324- "polymod.hub.config.disable" ,
325- new Il2CppSystem . Object [ ] { "DEBUG" }
326- ) ;
327- }
328333 popupButtons . Add ( new PopupButtonData ( debugButtonName , PopupButtonData . States . None , ( UIButtonBase . ButtonAction ) OnDebugButtonClicked , - 1 , true , null ) ) ;
329- // popupButtons.Add(new PopupButtonData("" , PopupButtonData.States.None, (UIButtonBase.ButtonAction)OnAutoUpdateButtonClicked, -1, true, null));
330- // popupButtons.Add(new PopupButtonData("", PopupButtonData.States.Disabled, (UIButtonBase.ButtonAction)OnIncludeAlphasButtonClicked, -1, true, null));
334+ popupButtons . Add ( new PopupButtonData ( autoUpdateButtonName , PopupButtonData . States . None , ( UIButtonBase . ButtonAction ) OnAutoUpdateButtonClicked , - 1 , true , null ) ) ;
335+ popupButtons . Add ( new PopupButtonData ( includeAlphasButtonName , Plugin . config . autoUpdate ? PopupButtonData . States . None : PopupButtonData . States . Disabled , ( UIButtonBase . ButtonAction ) OnIncludeAlphasButtonClicked , - 1 , true , null ) ) ;
331336 }
332337 return popupButtons . ToArray ( ) ;
333338
334339 void OnDebugButtonClicked ( int buttonId , BaseEventData eventData )
335340 {
336- Plugin . config = new ( debug : ! Plugin . config . debug ) ;
341+ Plugin . config = new ( debug : ! Plugin . config . debug , autoUpdate : Plugin . config . autoUpdate , updatePrerelease : Plugin . config . updatePrerelease ) ;
337342 Plugin . WriteConfig ( ) ;
338343 Plugin . UpdateConsole ( ) ;
339344 NotificationManager . Notify ( Localization . Get (
340345 "polymod.config.setto" ,
341- new Il2CppSystem . Object [ ] { "Debug" , Plugin . config . debug }
346+ new Il2CppSystem . Object [ ] { Localization . Get ( "polymod.debug" ,
347+ new Il2CppSystem . Object [ ] { } ) , Plugin . config . debug }
342348 ) ) ;
343349 isConfigPopupActive = false ;
344350 }
345351
346352 void OnAutoUpdateButtonClicked ( int buttonId , BaseEventData eventData )
347353 {
354+ Plugin . config = new ( debug : Plugin . config . debug , autoUpdate : ! Plugin . config . autoUpdate , updatePrerelease : Plugin . config . updatePrerelease ) ;
355+ Plugin . WriteConfig ( ) ;
356+ Plugin . UpdateConsole ( ) ;
357+ NotificationManager . Notify ( Localization . Get (
358+ "polymod.config.setto" ,
359+ new Il2CppSystem . Object [ ] { Localization . Get ( "polymod.autoupdate" ,
360+ new Il2CppSystem . Object [ ] { } ) , Plugin . config . autoUpdate }
361+ ) ) ;
348362 isConfigPopupActive = false ;
349363 }
350364
351365 void OnIncludeAlphasButtonClicked ( int buttonId , BaseEventData eventData )
352366 {
367+ Plugin . config = new ( debug : Plugin . config . debug , autoUpdate : Plugin . config . autoUpdate , updatePrerelease : ! Plugin . config . updatePrerelease ) ;
368+ Plugin . WriteConfig ( ) ;
369+ Plugin . UpdateConsole ( ) ;
370+ NotificationManager . Notify ( Localization . Get (
371+ "polymod.config.setto" ,
372+ new Il2CppSystem . Object [ ] { Localization . Get ( "polymod.autoupdate.alpha" ,
373+ new Il2CppSystem . Object [ ] { } ) , Plugin . config . updatePrerelease }
374+ ) ) ;
353375 isConfigPopupActive = false ;
354376 }
355377
0 commit comments