Ejemplo n.º 1
0
        // This uses default animation for Pod
        private void GameSelectionPanel_LaunchSelectedShipInAnimation(On.GameSelectionPanel.orig_LaunchSelectedShipInAnimation orig, GameSelectionPanel self)
        {
            DynData <GameSelectionPanel> d = new DynData <GameSelectionPanel>(self);

            Amplitude.StaticString temp = d.Get <Amplitude.StaticString>("selectedShipName");
            if (temp == GetName())
            {
                d.Set <Amplitude.StaticString>("selectedShipName", AnimationPodWrapper.Value);
            }
            orig(self);
            d.Set <Amplitude.StaticString>("selectedShipName", temp);
        }
Ejemplo n.º 2
0
        private void GameSelectionPanel_Display(On.GameSelectionPanel.orig_Display orig, GameSelectionPanel self, bool isMultiplayer, string mpSaveKey, int slotCount, GameSelectionPanel.GameSelectionFinishedHandler onGameSelectionFinished)
        {
            Log("Attempting to Display!");
            IDatabase <ShipConfig> db = Databases.GetDatabase <ShipConfig>(false);

            Log("Database loaded!");
            if (db.GetValue(this.GetConfig().Name) != null)
            {
                // It already exists within the database, so we can continue
                Log("The shipconfig with name: " + this.GetConfig().Name + " already exists inside the database!");
            }
            else
            {
                db.Add(this.GetConfig());
            }
            DynData <GameSelectionPanel> paneldyn = new DynData <GameSelectionPanel>(self);

            paneldyn.Set <IDatabase <ShipConfig> >("shipConfigDB", db);
            Log("Database set!");

            orig(self, isMultiplayer, mpSaveKey, slotCount, onGameSelectionFinished);

            Log("Available Ships:");
            foreach (string s in paneldyn.Get <List <Amplitude.StaticString> >("availableShips"))
            {
                Log(s);
            }
            Log("DB:");
            foreach (ShipConfig s in paneldyn.Get <IDatabase <ShipConfig> >("shipConfigDB"))
            {
                Log("Name: " + s.Name + " localized: " + s.GetLocalizedName() + " desc: " + s.GetLocalizedDescription() + " abscissa val: " + s.AbscissaValue);
            }
        }
Ejemplo n.º 3
0
        private void GameSelectionPanel_LaunchSelectedShipOutAnimation(On.GameSelectionPanel.orig_LaunchSelectedShipOutAnimation orig, GameSelectionPanel self, bool nextOrPrevious, bool playOutSFX)
        {
            DynData <GameSelectionPanel> d = new DynData <GameSelectionPanel>(self);

            Amplitude.StaticString temp = d.Get <Amplitude.StaticString>("selectedShipName");
            if (temp == GetName())
            {
                d.Set <Amplitude.StaticString>("selectedShipName", AnimationPodWrapper.Value);
            }
            orig(self, nextOrPrevious, playOutSFX);
            d.Set <Amplitude.StaticString>("selectedShipName", temp);
        }
Ejemplo n.º 4
0
 private SpriteAnimationRuntime2 GameSelectionPanel_GetShipAnimation(On.GameSelectionPanel.orig_GetShipAnimation orig, GameSelectionPanel self, Amplitude.StaticString shipName)
 {
     Log("Getting an animation for: " + shipName);
     if (shipName == GetName())
     {
         return(orig(self, AnimationPodWrapper.Value));
     }
     return(orig(self, shipName));
 }
Ejemplo n.º 5
0
 private void GameSelectionPanel_UpdateShip(On.GameSelectionPanel.orig_UpdateShip orig, GameSelectionPanel self, Amplitude.StaticString shipName, bool nextOrPrevious, bool syncOverNetwork, bool refreshContent)
 {
     if (shipName == GetName())
     {
         orig(self, shipName, nextOrPrevious, syncOverNetwork, refreshContent);
         DynData <GameSelectionPanel> d       = new DynData <GameSelectionPanel>(self);
         GameNetworkManager           manager = d.Get <GameNetworkManager>("gameNetManager");
         Dungeon.SetShip(GetName());
         if (syncOverNetwork && manager.IsServer())
         {
             global::Session session = manager.GetSession();
             session.SetLobbyData(global::Session.LOBBYDATA_GAME_SHIP, GetName());
             // Values["AssumedPod"]
         }
         return;
     }
     orig(self, shipName, nextOrPrevious, syncOverNetwork, refreshContent);
 }
Ejemplo n.º 6
0
        private void GameSelectionPanel_RefreshContent(On.GameSelectionPanel.orig_RefreshContent orig, GameSelectionPanel self)
        {
            if (!run)
            {
                // Set GameConfig
                SetGameConfig();

                // Need to AT LEAST alter the following:
                // GameSelectionPanel.Display --> NullReference
                // Lift.Show() --> IndexOutOfBounds

                // GameSelectionPanel.Display --> NullReference
                var d = new DynData <GameSelectionPanel>(self);
                mod.Log("Before set:");
                mod.Log("GameSelectionPanel.maxHeroCount: " + d.Get <int>("maxHeroCount"));
                mod.Log("GameSelectionPanel.competitorsTable: " + d.Get <AgeTransform>("competitorsTable"));
                mod.Log("GameSelectionPanel.competitorSlots: " + d.Get <List <CompetitorSlot> >("competitorSlots"));

                d.Set <int>("maxHeroCount", maxHeroShipCountWrapper.Value);

                mod.Log("After set:");
                mod.Log("GameSelectionPanel.maxHeroCount: " + d.Get <int>("maxHeroCount"));


                run = true;
            }
            orig(self);
        }
Ejemplo n.º 7
0
        private void GameSelectionPanel_Display(On.GameSelectionPanel.orig_Display orig, GameSelectionPanel self, bool isMultiplayer, string mpSaveKey, int slotCount, GameSelectionPanel.GameSelectionFinishedHandler onGameSelectionFinished)
        {
            // Should happen often enough (before we get to the PodScreen) in order to work out.
            if (!run)
            {
                // Set GameConfig
                SetGameConfig();

                // Need to AT LEAST alter the following:
                // GameSelectionPanel.Display --> NullReference
                // Lift.Show() --> IndexOutOfBounds

                // GameSelectionPanel.Display --> NullReference
                var d = new DynData <GameSelectionPanel>(self);
                mod.Log("Before set:");
                mod.Log("GameSelectionPanel.maxHeroCount: " + d.Get <int>("maxHeroCount"));
                mod.Log("GameSelectionPanel.competitorsTable: " + d.Get <AgeTransform>("competitorsTable"));
                mod.Log("GameSelectionPanel.competitorSlots: " + d.Get <List <CompetitorSlot> >("competitorSlots"));

                d.Set <int>("maxHeroCount", maxHeroShipCountWrapper.Value);

                mod.Log("After set:");
                mod.Log("GameSelectionPanel.maxHeroCount: " + d.Get <int>("maxHeroCount"));

                run = true;
            }
            orig(self, isMultiplayer, mpSaveKey, slotCount, onGameSelectionFinished);
        }