Ejemplo n.º 1
0
 void Awake()
 {
     if (instance == null)
     {
         instance = this;
     }
 }
Ejemplo n.º 2
0
    IEnumerator ClientCheck()
    {
        string persistentCVFile = GameUtility.PersistentHotfixPath + "/ClientVersion.txt";
        string streamingCVFile  = GameUtility.StreamingHotfixPathFull + "/ClientVersion.txt";

        yield return(GameLoader.LoadText(streamingCVFile, (str) => {
            ClientVersion streamCC = JsonUtility.FromJson <ClientVersion> (str);
            ClientVersion persistentCC = LoadPersistentCC(persistentCVFile);
            if (persistentCC != null)
            {
                if (streamCC.md5 != persistentCC.md5)
                {
                    Caching.CleanCache();
                    File.WriteAllText(persistentCVFile, str);
                    Debug.Log("CleanCache And WriteClient");
                }
            }
            else
            {
                if (!Directory.Exists(GameUtility.PersistentHotfixPath))
                {
                    Directory.CreateDirectory(GameUtility.PersistentHotfixPath);
                }
                File.WriteAllText(persistentCVFile, str);
                Debug.Log("WriteClient");
            }
        }));
    }
Ejemplo n.º 3
0
    IEnumerator LoadManifest()
    {
        string file = GameUtility.StreamingHotfixPathApp + "/" + Configs.clientConfig.hotfixFile;

        AssetBundle curBundle = null;

        yield return(GameLoader.LoadFromFileAsync(file, (bundle) => {
            curBundle = bundle;
        }));

        AssetBundleRequest requst = curBundle.LoadAssetAsync <AssetBundleManifest> ("AssetBundleManifest");

        yield return(requst);

        if (requst.asset != null)
        {
            streamManifest = (AssetBundleManifest)requst.asset;
        }
        curBundle.Unload(false);
        curBundle = null;

        yield return(GameLoader.LoadAssetBundle(GameUtility.resURL + Configs.clientConfig.hotfixFile, (bundle) => {
            curBundle = bundle;
        }));

        requst = curBundle.LoadAssetAsync <AssetBundleManifest> ("AssetBundleManifest");
        yield return(requst);

        if (requst.asset != null)
        {
            remoteManifest = (AssetBundleManifest)requst.asset;
        }
        curBundle.Unload(false);
        curBundle = null;
    }
Ejemplo n.º 4
0
        private void LateInitialize(On.Celeste.GameLoader.orig_Begin orig, GameLoader self)
        {
            orig(self);
            var dll = AppDomain.CurrentDomain.GetAssemblies().FirstOrDefault(asm => asm.FullName.Contains("ExtendedVariant"));

            if (dll != null)
            {
                var ty     = dll.GetType("ExtendedVariants.Module.ExtendedVariantsModule");
                var module = ty.GetField("Instance", BindingFlags.Static | BindingFlags.Public).GetValue(null);
                var method = ty.GetMethod("ResetToDefaultSettings", BindingFlags.Public | BindingFlags.Instance);
                ResetExtendedVariants = () => {
                    method.Invoke(module, new object[0]);
                };
            }
            else
            {
                ResetExtendedVariants = () => {};
            }
            dll = AppDomain.CurrentDomain.GetAssemblies().FirstOrDefault(asm => asm.FullName.Contains("IsaMods"));
            if (dll != null)
            {
                var ty     = dll.GetType("Celeste.Mod.IsaGrabBag.ForceVariantTrigger");
                var method = ty.GetMethod("SetVariantsToDefault", BindingFlags.Static | BindingFlags.Public);
                ResetIsaVariants = () => {
                    method.Invoke(null, new object[0]);
                };
            }
            else
            {
                ResetIsaVariants = () => {};
            }

            this.DelayedLoadMechanics();
            this.DelayedLoadQol();
        }
Ejemplo n.º 5
0
 internal SetScriptBase(SetScriptConstructor constructor, IFunction appliesTo, string property, GameLoader loader)
 {
     m_constructor = constructor;
     AppliesTo = appliesTo;
     Property = property;
     m_loader = loader;
 }
Ejemplo n.º 6
0
 public FunctionCallScript(GameLoader loader, string procedure, IList<IFunction> parameters, IScript paramFunction)
 {
     m_loader = loader;
     m_procedure = procedure.Replace(" ", Utility.SpaceReplacementString);
     m_parameters = new FunctionCallParameters(parameters);
     m_paramFunction = paramFunction;
 }
Ejemplo n.º 7
0
 internal SetScriptBase(SetScriptConstructor constructor, IFunction appliesTo, string property, GameLoader loader)
 {
     m_constructor = constructor;
     AppliesTo     = appliesTo;
     Property      = property;
     m_loader      = loader;
 }
 public GameManager Initialize(int startLevel)
 {
     //_topScore= ServiceLocator.Get<SaveSystem>().LoadBinary<int>("topScore");
     GameLoader.CallOnComplete(OnGameLoaderComplete);
     SetLevel(startLevel);
     return(this);
 }
Ejemplo n.º 9
0
    // Use this for initialization
    void Start()
    {
        GameLoader.LoadData();
        GameLoader.LoadScenario();

        sceneSwitcher = gameObject.GetComponent <SceneSwitcher>();
        sceneSwitcher.LoadMain();
    }
Ejemplo n.º 10
0
    public void OnNbPlayersChanged()
    {
        Dropdown dd = GameObject.Find("NbPlayers_Dropdown").GetComponent <Dropdown> ();

        GameLoader gl = GameObject.Find("GameLoader").GetComponent <GameLoader> ();

        gl.setNbPlayers(dd.value + 1);
    }
Ejemplo n.º 11
0
 // Update is called once per frame
 private void Update()
 {
     if (firstUpdate)
     {
         firstUpdate = false;
         GameLoader.LoaderCallBack();
     }
 }
Ejemplo n.º 12
0
        private void bLoadGame_Click(object sender, EventArgs e)
        {
            var gameLoader = new GameLoader();

            gameLoader.StartMenu = this;
            gameLoader.LoadGame();
            SettingsPanel.Hide();
        }
    private void SaveEndExit()
    {
        updateProvider.IsStoped = true;
        orbitalManager.Save();
        gameModeManager.Save();

        GameLoader.Reload();
    }
Ejemplo n.º 14
0
 public override void Begin()
 {
     base.Begin();
     this.previousX = this.previousX2 = this.gameObject.transform.position.x;
     this.edge      = 0.5;
     this.timer     = this.effectTimer = 1.0;
     this.loader    = GameSystem.GetGameData <GameLoader>("GameLoader");;
 }
Ejemplo n.º 15
0
 public Save()
 {
     Version      = 1;
     PlayerID     = GameLoader.GetUniqueKey(8);
     PlayerData   = new PlayerData();
     GarageData   = new GarageData();
     SettingsData = new SettingsData();
 }
Ejemplo n.º 16
0
        private void LoadFile(string path, List <string> pathArgs = null)
        {
            var projectLoader = new GameLoader();

            this.FileReaderProvider = projectLoader.Load(path);
            project = FileReaderProvider.GetProjectReader().Load();

            BasePath = project.BaseDir;

            PixelsDown   = project.ScreenHeight;
            PixelsAcross = project.ScreenWidth;

            if (ScreenSizeChanged != null)
            {
                ScreenSizeChangedEventArgs args = new ScreenSizeChangedEventArgs(PixelsAcross, PixelsDown);
                ScreenSizeChanged(this, args);
            }

            if (project.MusicNSF != null)
            {
                Engine.Instance.SoundSystem.LoadMusicNSF(project.MusicNSF.Absolute);
            }
            if (project.EffectsNSF != null)
            {
                Engine.Instance.SoundSystem.LoadSfxNSF(project.EffectsNSF.Absolute);
            }

            foreach (var stageInfo in project.Stages)
            {
                stageFactory.Load(stageInfo);
            }

            _tileProperties.LoadProperties(project.EntityProperties);
            _entitySource.LoadEntities(project.Entities);
            EffectParser.LoadEffectsList(project.Functions);
            Engine.Instance.SoundSystem.LoadEffectsFromInfo(project.Sounds);
            Scene.LoadScenes(project.Scenes);
            Menu.LoadMenus(project.Menus);
            FontSystem.Load(project.Fonts);
            PaletteSystem.LoadPalettes(project.Palettes);

            currentPath = path;

            if (pathArgs != null && pathArgs.Any())
            {
                ProcessCommandLineArgs(pathArgs);
            }
            else if (project.StartHandler != null)
            {
                _stateMachine.ProcessHandler(project.StartHandler);
            }
            else
            {
                throw new GameRunException("The game file loaded correctly, but it failed to specify a starting point!");
            }

            Player = new Player();
        }
Ejemplo n.º 17
0
        //--- Class Methods ---
        public static void Main(string[] args)
        {
            // check if a filepath to an adventure file was provided and that the file exists
            if (args.Length != 1)
            {
                Console.WriteLine("ERROR: missing path to adventure file.");
                return;
            }
            if (!File.Exists(args[0]))
            {
                Console.WriteLine("ERROR: cannot find file.");
                return;
            }

            // initialize the game from the adventure file
            Game       game;
            GamePlayer player;

            try {
                game   = GameLoader.LoadFrom(args[0]);
                player = new GamePlayer(Game.StartPlaceId);
            } catch (GameLoaderException e) {
                Console.WriteLine($"ERROR: {e.Message}");
                return;
            } catch (Exception e) {
                Console.WriteLine($"ERROR: unable to load file");
                Console.WriteLine(e);
                return;
            }
            Console.Clear();

            // start the game loop
            var responses = game.Do(player, GameCommandType.Restart);

            try {
                while (true)
                {
                    if (PlayResponses(responses))
                    {
                        return;
                    }

                    // prompt user input
                    Console.Write("> ");
                    var commandText = Console.ReadLine().Trim().ToLower();
                    if (!Enum.TryParse(commandText, true, out GameCommandType command))
                    {
                        responses = new[] { new GameResponseNotUnderstood() };
                        continue;
                    }

                    // process user input
                    responses = game.Do(player, command);
                }
            } catch (Exception e) {
                Console.Error.WriteLine(e);
            }
        }
    private void Awake()
    {
        if (hudPrefab == null)
        {
            Debug.Log("UIManager has no hud prefab assigned");
        }

        GameLoader.CallOnComplete(Initialize);
    }
Ejemplo n.º 19
0
    void Start()
    {
        menu = GameObject.Find("Menu");

        gl      = menu.GetComponent <GameLoader>();
        p1Score = GameObject.Find("p1Score").GetComponent <Text>();
        p2Score = GameObject.Find("p2Score").GetComponent <Text>();
        cam     = GameObject.Find("Main Camera");
    }
Ejemplo n.º 20
0
        /// <summary>
        /// Loads the games stored in the preferences into the UI.
        /// </summary>
        private async Task LoadGames()
        {
            var sw = new Stopwatch();

            sw.Start();

            var loader = new GameLoader();
            var dialog = EverlookGameLoadingDialog.Create(this);

            dialog.ShowAll();

            var loadingProgress = default(OverallLoadingProgress);

            loadingProgress.OperationCount = GamePathStorage.Instance.GamePaths.Count;
            var loadedGames = 0;

            foreach (var gameTarget in GamePathStorage.Instance.GamePaths)
            {
                loadedGames++;
                loadingProgress.FinishedOperations = loadedGames;
                dialog.OverallProgressNotifier.Report(loadingProgress);

                if (!Directory.Exists(gameTarget.Path))
                {
                    Log.Warn($"Could not find game folder for {gameTarget.Alias}. Has the directory moved?");
                    continue;
                }

                try
                {
                    (var group, var nodeTree) = await loader.LoadGameAsync
                                                (
                        gameTarget.Alias,
                        gameTarget.Path,
                        dialog.CancellationSource.Token,
                        dialog.GameLoadProgressNotifier
                                                );

                    if (group is null || nodeTree is null)
                    {
                        continue;
                    }

                    AddGamePage(gameTarget.Alias, gameTarget.Version, group, nodeTree);
                }
                catch (OperationCanceledException)
                {
                    Log.Info("Cancelled game loading operation.");
                    break;
                }
            }

            dialog.Destroy();

            sw.Stop();
            Log.Debug($"Game loading took {sw.Elapsed.TotalMilliseconds}ms ({sw.Elapsed.TotalSeconds}s)");
        }
Ejemplo n.º 21
0
        public PlayGame(string fileName)
        {
            InitializeComponent();
            var loader = new GameLoader();

            definition = loader.LoadGame(fileName);
            engine     = new GameEngine(definition);
            pictureBox1.Refresh();
        }
Ejemplo n.º 22
0
 void GetReferences()
 {
     offlineManager = FindObjectOfType <OfflineManager>();
     playFabLogin   = FindObjectOfType <PlayfabNoEmailLogin>();
     // playFab = FindObjectOfType<PlayFabLogin>();
     internetManager = FindObjectOfType <InternetManager>();
     gameloader      = FindObjectOfType <GameLoader>();
     popupManager    = FindObjectOfType <PopupManager>();
 }
Ejemplo n.º 23
0
        void GetReferencesFromScene()
        {
            flowchart         = GameObject.FindObjectOfType <Flowchart>();
            flowchartTransVar = flowchart.GetVariable <TransformVariable>("thisTrans");
            gameSaver         = GameObject.FindObjectOfType <GameSaver>();
            gameLoader        = GameObject.FindObjectOfType <GameLoader>();
            saveManager       = GameObject.FindObjectOfType <SaveManager>();

            GetRefsToGameObjects();
        }
Ejemplo n.º 24
0
 void OnPhotonInstantiate(PhotonMessageInfo info)
 {
     if (photonView.isMine)
     {
         battleLauncher = GameObject.FindGameObjectWithTag("BattleLauncher").GetComponent <BattleLauncher>();
         playername     = battleLauncher.playername;
     }
     gameLoader = GameObject.FindGameObjectWithTag("GameLoader").GetComponent <GameLoader>();
     gameLoader.playersready++;
 }
Ejemplo n.º 25
0
 public void LoadScene(string scene, GameLoader gameLoader)
 {
     if (persistentState.ContainsKey(scene))
     {
         foreach (State.Data data in persistentState[scene])
         {
             gameLoader.StartCoroutine(State.LoadObject(data, guidManager));
         }
     }
 }
Ejemplo n.º 26
0
 static public IEnumerator LoadFromJson <T>(string path, string name, Action <T> callback = null)
 {
     yield return(GameLoader.LoadText(path + "/" + name + ".txt", (str) => {
         T config = JsonUtility.FromJson <T> (str);
         if (callback != null)
         {
             callback(config);
         }
     }));
 }
Ejemplo n.º 27
0
        private void LoadGame(string file)
        {
            GameLoader loader = new GameLoader();

            definition = loader.LoadGame(file);
            fileName   = file;
            UpdateTree();
            //this.Text = file;
            this.Text = definition.Name;
        }
Ejemplo n.º 28
0
        public Game1()
        {
            this.IsMouseVisible = true;

            graphics = new GraphicsDeviceManager(this);
            Content.RootDirectory = "Content";
            gameWorld             = new GameWorld(this);
            loader = new GameLoader(gameWorld);
            input  = new InputManager(gameWorld);
        }
Ejemplo n.º 29
0
 public static void RegisterAudio()
 {
     GameLoader.AddSoundFile(GameLoader.NAMESPACE + "ZombieAudio", new List <string>()
     {
         GameLoader.AUDIO_FOLDER_PANDA + "/Zombie1.ogg",
         GameLoader.AUDIO_FOLDER_PANDA + "/Zombie2.ogg",
         GameLoader.AUDIO_FOLDER_PANDA + "/Zombie3.ogg",
         GameLoader.AUDIO_FOLDER_PANDA + "/Zombie4.ogg",
     });
 }
Ejemplo n.º 30
0
        public SuperMetroidComponent(LiveSplitState state)
        {
            GameLoader.Load(new SuperMetroid());
            InternalComponent = new ComponentRendererComponent();
            var components = new List <IComponent>();

            components.Add(new ItemTracker());
            //components.Add(new BossTracker());
            InternalComponent.VisibleComponents = components;
        }
Ejemplo n.º 31
0
 private static void LoadUpdatables()
 {
     if (JSON.Deserialize(GameLoader.GetUpdatableBlocksJSONPath(), out JSONNode jSONNode, false))
     {
         if (jSONNode.TryGetChild(Items.UpdatableBlocks.Herbs.NAME, out JSONNode array))
         {
             Items.UpdatableBlocks.Herbs.Load(array);
         }
     }
 }
Ejemplo n.º 32
0
 public void OnLoadGame(ref GameLoader.GameDataContainer data)
 {
     for (int i = 0; i < data.AcquiredUpgrades.Count; i++)
     {
         this.UpgradeList[data.AcquiredUpgrades[i]].ApplyUpgrade();
         this.UpgradeList.Remove(data.AcquiredUpgrades[i]);
         this.AcquiredUps.Add(data.AcquiredUpgrades[i]);
     }
     UpdateUpgrdList ();
 }
Ejemplo n.º 33
0
    public void OnLoadGame(ref GameLoader.GameDataContainer cont)
    {
        this.Money = cont.Money;
        UpdateMoneyDisplay ();

        this.ProdList = GameLoader.LoadProducts (ref cont);

        foreach (Products p in ProdList.Keys) {
            UpdateButtonDisplay(p);
        }
    }
Ejemplo n.º 34
0
 void IPunInstantiateMagicCallback.OnPhotonInstantiate(PhotonMessageInfo info)
 {
     if (photonView.IsMine)
     {
         battleLauncher = GameObject.FindGameObjectWithTag("BattleLauncher").GetComponent <BattleLauncher>();
         playername     = battleLauncher.playername;
         portraitnumber = battleLauncher.selectedportraitnumber;
     }
     gameLoader = GameObject.FindGameObjectWithTag("GameLoader").GetComponent <GameLoader>();
     gameLoader.playersready++;
 }
Ejemplo n.º 35
0
        internal KGLLoaderUtility(string fileName, GameLoader gameLoader)
        {
            Parser parser = new Parser(grammar);
            string src = File.ReadAllText(fileName);
            ParseTree parseTree = parser.Parse(src, fileName);
            //TODO find out what to do here to get the error to show
            if (parseTree.HasErrors())
            {
                var builder = new StringBuilder("Can't construct game due to syntax errors:" + Environment.NewLine + Environment.NewLine);

                foreach (var message in parseTree.ParserMessages)
                {
                    builder.AppendLine(message.Message + " at line " + message.Location.Line + " column " + message.Location.Column);
                }

                Game.CurrentGame.Die(builder.ToString());
            }
            Root = parseTree.Root;
        }
Ejemplo n.º 36
0
 public SetScriptScript(SetScriptConstructor constructor, IFunction appliesTo, string property, IScript script, GameLoader loader)
     : base(constructor, appliesTo, property, loader)
 {
     m_script = script;
     m_scriptFactory = constructor.ScriptFactory;
 }
Ejemplo n.º 37
0
 public FunctionCallScript(GameLoader loader, string procedure)
     : this(loader, procedure, null, null)
 {
 }
Ejemplo n.º 38
0
 public SetExpressionScript(SetScriptConstructor constructor, IFunction appliesTo, string property, Expression expr, GameLoader loader)
     : base(constructor, appliesTo, property, loader)
 {
     m_expr = expr;
 }
Ejemplo n.º 39
0
 void Awake()
 {
     instance = this;
 }
Ejemplo n.º 40
0
            private GameViewer()
            {
                title = "Game Viewer";
                loader = new GameLoader (this);
                accel = new AccelGroup ();
                initialDirForFileChooser =
                    App.Session.CurrentFolder;

                gameLoaders = new ArrayList ();
                exporters = new ArrayList ();

                menubar.highlightMoveMenuItem.Active =
                    App.Session.HighLightMove;

                menubar.saveAsMenuItem.Activated +=
                    on_save_as_activate;
                menubar.switchSideMenuItem.Activated +=
                    on_switch_side_activate;
                menubar.moveCommentMenuItem.Activated +=
                    OnEditCommentActivated;
                menubar.highlightMoveMenuItem.Activated +=
                    OnHighlightMoveMenuItemActivated;
                menubar.switchSideMenuItem.
                    AddAccelerator ("activate", accel,
                            new AccelKey (Gdk.Key.
                                      t,
                                      Gdk.
                                      ModifierType.
                                      ControlMask,
                                      AccelFlags.
                                      Visible));

                menubar.quitMenuItem.
                    AddAccelerator ("activate", accel,
                            new AccelKey (Gdk.Key.
                                      q,
                                      Gdk.
                                      ModifierType.
                                      ControlMask,
                                      AccelFlags.
                                      Visible));

                Gtk.Image img = new Gtk.Image ();
                img.Stock = Stock.JustifyFill;
                toolbutton =
                    new ToolButton (img,
                            Catalog.
                            GetString ("Viewer"));
                ShowAll ();
                toolbutton.ShowAll ();
                progressBar.Hide ();

                gameViewerWidget.ChessGameWidget.SplitPane.
                    Position =
                    App.Session.ViewerSplitPanePosition;

                CsBoardApp.Instance.QuitEvent += OnQuitEvent;
            }