Exemple #1
0
 public static void MapSelectMenuSceneRegisterCallback(MapSelectMenuScene __instance)
 {
     if (KoikatuGameplayMod.FastTravelTimePenalty.Value > 0)
     {
         var cycle = UnityEngine.Object.FindObjectsOfType <Cycle>().FirstOrDefault();
         if (cycle != null)
         {
             cycle.AddTimer(KoikatuGameplayMod.FastTravelTimePenalty.Value / 500f);
         }
     }
 }
Exemple #2
0
            private static void FreeHStartAsyncPostfix(MapSelectMenuScene __instance, ref IEnumerator __result)
            {
                var original = __result;

                __result = new[] { original, Postfix() }.GetEnumerator();

                IEnumerator Postfix()
                {
                    yield return(new WaitUntil(() => GameObject.Find("MapThumbnail") != null));

                    SetMainCanvasThumbnail(isVR, ThumbnailState.Default);
                }
            }
Exemple #3
0
            private static void Post_MapSelectMenuScene(MapSelectMenuScene __instance, ref IEnumerator __result)
            {
                var original = __result;

                __result = new[] { original, Postfix() }.GetEnumerator();

                IEnumerator Postfix()
                {
                    GameObject.Find("MapSelectMenu/Canvas/Panel/RightBG/btnEnter").GetComponent <Button>().onClick.AddListener(() => { SetMainCanvasThumbnail(isVR, ThumbnailState.Unset); });
                    yield return(new WaitUntil(() => GameObject.Find("MapSelectMenu/Canvas/Panel/ScrollView/Content/NodeFrame(Clone)/MapButton") != null));

                    DeclutterMapList();
                }
            }
        public static void MapSelectMenuSceneRegisterCallback(MapSelectMenuScene __instance)
        {
            var f = typeof(MapSelectMenuScene).GetField("enterButton",
                                                        BindingFlags.Instance | BindingFlags.NonPublic | BindingFlags.Public);

            var b = f.GetValue(__instance) as UnityEngine.UI.Button;

            // Add a time penalty for using F3 fast travel
            b.OnClickAsObservable().Subscribe(unit =>
            {
                if (__instance.result == MapSelectMenuScene.ResultType.EnterMapMove)
                {
                    var cycle = UnityEngine.Object.FindObjectsOfType <ActionGame.Cycle>().FirstOrDefault();
                    if (cycle != null)
                    {
                        var newVal = Math.Min(cycle.timer + KoikatuGameplayMod.FastTravelTimePenalty.Value, ActionGame.Cycle.TIME_LIMIT - 10);
                        typeof(ActionGame.Cycle)
                        .GetField("_timer", BindingFlags.Instance | BindingFlags.NonPublic)
                        .SetValue(cycle, newVal);
                    }
                }
            });
        }
Exemple #5
0
 private static void PostFixMapSelectMenuSceneStart(MapSelectMenuScene __instance)
 {
     ConsoleLog("attempting start");
     inMapScreen = true;
     DoTheThing();
 }