Exemplo n.º 1
0
 public static void LoadFileLimitedPostfix(ChaFileControl __instance)
 {
     if (FBIOpenUp._isenabled)
     {
         if (FBIOpenUp.nowGameMode == FBIOpenUp.GameMode.Studio)
         {
             ChaControl chaCtrl = Manager.Character.dictEntryChara.Where((x) => x.Value.chaFile == __instance).Single().Value;
             if (null != chaCtrl)
             {
                 Patches.ChangeChara(chaCtrl);
             }
         }
         else
         {
             Patches.ChangeChara(Singleton <CustomBase> .Instance.chaCtrl);
         }
     }
 }
Exemplo n.º 2
0
        internal static void SetCharaPath(object sender, EventArgs e)
        {
            try {
                string sampleCharaPath = Path.GetFullPath(Sample_chara.Value);
                using (FileStream fileStream = new FileStream(sampleCharaPath, FileMode.Open, FileAccess.Read)) {
                    Patches.LoadSampleChara(fileStream);
                }
                Logger.LogDebug($@"Load path: {sampleCharaPath}");
            } catch (Exception) {
                Logger.LogDebug("Use default chara");
                Logger.LogDebug("FBI! Open Up!");
                Assembly ass = Assembly.GetExecutingAssembly();
                using (Stream stream = ass.GetManifestResourceStream("FBIOpenUp.Resources.sample_chara.png")) {
                    Patches.LoadSampleChara(stream);
                }
                Logger.LogWarning(@"If you see Sideloader related errors above, don't worry.
Sample Chara is made in a vanilla environment and does NOT contain any ExtendedSaveData.");
                Logger.LogDebug("An error occurred while Sideloader reads the vanilla file. I have nothing to say.");
            }
        }
Exemplo n.º 3
0
        private static void StepLightAndPlay()
        {
            if (intensityState && reflectCount < 60)
            {
                switch (FBIOpenUp.nowGameMode)
                {
                case FBIOpenUp.GameMode.Studio:
                    studioLightInfo.intensity += (intensityTo - intensityFrom) / 60;
                    studioLightCalc.Invoke("Reflect");
                    break;

                case FBIOpenUp.GameMode.FreeH:
                    freeHLight.intensity += (intensityTo - intensityFrom) / 60;
                    break;

                case FBIOpenUp.GameMode.Maker:
                    makerLight.intensity += (intensityTo - intensityFrom) / 60;
                    break;
                }
                reflectCount++;
            }
            else
            {
                Logger.LogDebug($"At Step: {step}");
                switch (step)
                {
                case 0:
                    //消滅圖片
                    if (null != shiftPicture.Transform.parent.gameObject)
                    {
                        GameObject.Destroy(shiftPicture.Transform.parent.gameObject);
                        shiftPicture.image = null;
                        shiftPicture.video = null;
                        shiftPicture       = null;
                    }
                    break;

                case 1:
                    //由中間移動到左邊
                    shiftPicture.targetPosition = new Vector3(0 - (shiftPicture.Width / 2), Screen.height / 2);
                    stepSet(0);
                    break;

                case 2:
                    //由中間移動到右邊
                    shiftPicture.targetPosition = new Vector3(Screen.width + shiftPicture.Width / 2, Screen.height / 2);
                    stepSet(0);
                    break;

                case 10:
                    //將角色全部替換
                    //加亮角色光
                    reflectCount = 0;
                    ToggleFlashLight(true);
                    stepAdd();
                    break;

                case 11:
                    intensityState = false;
                    Patches.ChangeAllCharacters(false);
                    reflectCount = 0;
                    ToggleFlashLight(false);
                    stepAdd();
                    break;

                case 12:
                    intensityState = false;
                    if (!ChangeWithoutShiftPicture)
                    {
                        stepSet(1);
                    }
                    else
                    {
                        ChangeWithoutShiftPicture = false;
                        stepSet(0);
                    }
                    break;

                case 20:
                    //將角色換回
                    //加亮角色光
                    reflectCount = 0;
                    ToggleFlashLight(true);
                    stepAdd();
                    break;

                case 21:
                    intensityState = false;
                    Patches.ChangeAllCharacters(true);
                    reflectCount = 0;
                    ToggleFlashLight(false);
                    stepAdd();
                    break;

                case 22:
                    intensityState = false;
                    if (!ChangeWithoutShiftPicture)
                    {
                        stepSet(2);
                    }
                    else
                    {
                        ChangeWithoutShiftPicture = false;
                        stepSet(0);
                    }
                    break;
                }
                void stepAdd()
                {
                    step++;
                }

                void stepSet(int st)
                {
                    step = st;
                }
            }
        }