Exemple #1
0
 public override void SetUpRecording()
 {
     base.SetUpRecording();
     foreach (WekitPlayer_Base player in ActiveWekitPlayers)
     {
         if (OverWriteWekitPlayers.Contains(player))
         {
             player.SetUpRecording();
         }
     }
 }
Exemple #2
0
 public override void InitiateRecording()
 {
     base.InitiateRecording();
     foreach (WekitPlayer_Base player in ActiveWekitPlayers)
     {
         if (OverWriteWekitPlayers.Contains(player))
         {
             player.InitiateRecording();
         }
         else
         {
             player.Replaying = false;
             player.Speed     = Speed;
             player.Replay();
         }
     }
 }
Exemple #3
0
    public override void CustomGUI()
    {
        float x = (Screen.width * (5f / 6)) / 2f - _buttonWidth * WekitPlayers.Count / 2;

        for (int i = 0; i < WekitPlayers.Count; i++)
        {
            bool contained = ActiveWekitPlayers.Contains(WekitPlayers[i]);

            if (contained && RecordGUI)
            {
                //Overwrite toggle
                bool inOverwriteList = OverWriteWekitPlayers.Contains(WekitPlayers[i]);
                bool overwrite       =
                    GUI.Toggle(
                        new Rect(x + i * _buttonWidth, Screen.height - (Screen.height / 20f * 5), _buttonWidth,
                                 Screen.height / 20f), inOverwriteList, "Overwrite");
                if (overwrite != inOverwriteList)
                {
                    if (overwrite)
                    {
                        OverWriteWekitPlayers.Add(WekitPlayers[i]);
                    }
                    else
                    {
                        OverWriteWekitPlayers.Remove(WekitPlayers[i]);
                    }
                }

                //Force focus toggle
                bool focus =
                    GUI.Toggle(
                        new Rect(x + i * _buttonWidth, Screen.height - (Screen.height / 20f * 4), _buttonWidth,
                                 Screen.height / 20f), WekitPlayers[i].ForceFocus, "Force focus");
                if (focus != WekitPlayers[i].ForceFocus)
                {
                    WekitPlayers[i].ForceFocus = focus;
                    WekitPlayers[i].SetFocus(true);
                }
                //Step size slider
                WekitPlayers[i].Stepsize = (int)GUI.HorizontalSlider(new Rect(x + i * _buttonWidth, Screen.height - (Screen.height / 20f * 3), _buttonWidth, Screen.height / 20f), WekitPlayers[i].Stepsize, 1, 3);
                if (WekitPlayers[i].HasGui)
                {
                    if (GUI.Button(new Rect(x + i * _buttonWidth, Screen.height - (Screen.height / 20f * 2), _buttonWidth, Screen.height / 20f), WekitPlayers[i].PlayerName + " options"))
                    {
                        _activeGuiIndex = i;
                        SetCustomGuiActive(i, true);
                    }
                }
            }

            //Player active button
            if (!GUI.Button(new Rect(x + i * _buttonWidth, Screen.height - (Screen.height / 20f), _buttonWidth, Screen.height / 20f),
                            WekitPlayers[i].PlayerName + (contained ? " active" : " inactive")))
            {
                continue;
            }

            //(De)activate button pressed
            EnablePlayer(WekitPlayers[i], !contained);
        }
    }
Exemple #4
0
    public override bool Load(bool useZip, string fileName, string entryName)
    {
        if (!base.Load(useZip, fileName, entryName))
        {
            return(false);
        }
        int localMaxFrames = 0;

        //Single save file
        if (FrameList.Count > 0 && FrameList[0].MyName == "SingleSave" && (bool)FrameList[0].MyObject)
        {
            for (int i = WekitPlayers.Count - 1; i >= 0; i--)
            {
                WekitPlayer_Base player = WekitPlayers[i];
                player.ClearFrameList();

                for (int j = FrameList.Count - 1; j >= 1; j--)
                {
                    if (FrameList[j].MyName == player.PlayerName)
                    {
                        player.MakeDataContainerFromObject(FrameList[j].MyObject);

                        if (player.FrameCount > localMaxFrames)
                        {
                            localMaxFrames = player.FrameCount;
                            ReplayFps      = player.ReplayFps;
                        }
                        break;
                    }
                }
                if (player.FrameCount == 0)
                {
                    player.Enabled(false);
                    ActiveWekitPlayers.Remove(player);
                }
                else
                {
                    player.Enabled(true);
                    if (!ActiveWekitPlayers.Contains(player))
                    {
                        ActiveWekitPlayers.Add(player);
                    }
                    if (OverWriteWekitPlayers.Contains(player))
                    {
                        OverWriteWekitPlayers.Remove(player);
                    }
                }
            }
        }
        //Multiple files
        else
        {
            for (int i = WekitPlayers.Count - 1; i >= 0; i--)
            {
                WekitPlayer_Base player = WekitPlayers[i];
                player.ClearFrameList();
                if (!player.Load(useZip, fileName, entryName))
                {
                    player.Enabled(false);
                    ActiveWekitPlayers.Remove(player);
                }
                else
                {
                    player.Enabled(true);
                    if (!ActiveWekitPlayers.Contains(player))
                    {
                        ActiveWekitPlayers.Add(player);
                    }
                    if (OverWriteWekitPlayers.Contains(player))
                    {
                        OverWriteWekitPlayers.Remove(player);
                    }

                    if (player.FrameCount > localMaxFrames)
                    {
                        localMaxFrames = player.FrameCount;
                        ReplayFps      = player.ReplayFps;
                    }
                }
            }
        }
        if (localMaxFrames == 0)
        {
            return(false);
        }
        FrameList = new List <ObjectWithName>(new ObjectWithName[localMaxFrames + 1]);
        return(true);
    }