Example #1
0
        public static void UISaveGameWindow__OnOpen_Prefix(UISaveGameWindow __instance)
        {
            originalSaveGO = GameObject.Find("UI Root/Overlay Canvas/Top Windows/Save Game Window/save-button");

            if (originalSaveGO != null && optimisedSaveGO == null)
            {
                optimisedSaveGO      = Instantiate(originalSaveGO, originalSaveGO.transform.position, Quaternion.identity);
                optimisedSaveGO.name = "optimisedSaveButton";
                optimisedSaveGO.transform.SetParent(originalSaveGO.transform.parent);

                var position = optimisedSaveGO.transform.localPosition;
                position.x -= 200;
                optimisedSaveGO.transform.localScale    = new Vector3(1f, 1f, 1f);
                optimisedSaveGO.transform.localPosition = position;


                var optimisedSaveButton = optimisedSaveGO.GetComponent <Button>();
                optimisedSaveButton.onClick.AddListener(new UnityAction(() =>
                {
                    optimiseSave = true;
                    if (optimisedSaveButton.interactable)
                    {
                        __instance.SaveGameAs();
                    }
                }));
            }

            optimisedSaveGO.GetComponentInChildren <Text>().text = "Optimised Save";
            optimisedSaveGO.GetComponent <Button>().interactable = true;
        }
Example #2
0
 static void CheckAndSetSaveButtonEnable(UISaveGameWindow __instance, UIButton ___saveButton, Text ___saveButtonText)
 {
     _OnOpen(__instance, ___saveButton, ___saveButtonText);
     if (context.saveButtonText && context.saveButton)
     {
         SetButtonState(context.saveButtonText.text, context.saveButton.button.interactable);
     }
 }
        public static void UISaveGameWindow_RefreshList_Postfix(ref UISaveGameWindow __instance)
        {
            if (configSortSaveScreen.Value)
            {
                __instance.entries.Sort(new GameSaveEntryReverseSorter());

                for (int i = 0; i < __instance.entries.Count;)
                {
                    UIGameSaveEntry entry = __instance.entries[i++];
                    entry.SetEntry(i, i, entry.fileInfo);
                }

                __instance.OnSelectedChange();
            }
        }
Example #4
0
        static void _OnOpen(UISaveGameWindow __instance, UIButton ___saveButton, Text ___saveButtonText)
        {
            if (!context.buttonCompress)
            {
                context.saveButton     = ___saveButton;
                context.saveButtonText = ___saveButtonText;

                context.ui             = __instance;
                context.buttonCompress = (__instance.transform.Find("button-compress")?.gameObject ?? GameObject.Instantiate(___saveButton.gameObject, ___saveButton.transform.parent)).GetComponent <UIButton>();

                context.buttonCompress.gameObject.name = "button-compress";
                context.buttonCompress.transform.Translate(new Vector3(-2.0f, 0, 0));
                context.buttonCompress.button.image.color = new Color32(0xfc, 0x6f, 00, 0x77);
                context.buttonCompressText = context.buttonCompress.transform.Find("button-text")?.GetComponent <Text>();

                context.buttonCompress.onClick += __instance.OnSaveClick;
                context.saveButton.onClick     -= __instance.OnSaveClick;
                context.saveButton.onClick     += WrapClick;
            }
        }
Example #5
0
 public static void UISaveGameWindow_OnSaveClick_Prefix(UISaveGameWindow __instance)
 {
     optimiseSave = false;
 }
Example #6
0
 static void OSaveGameAs(this UISaveGameWindow ui, int data)
 {
 }