Beispiel #1
0
 static void Postfix(SGCmdCenterLanceConfigBG __instance)
 {
     if (CustomUnitsAPI.Detected() == false)
     {
         BiggerDrops.baysAlreadyAdded = 0;
         __instance.LC.UpdateSlotsCount(DropManager.DefaultMechSlots +
                                        DropManager.AdditionalMechSlots());
     }
 }
Beispiel #2
0
 static void Prefix(LanceConfiguratorPanel __instance, ref int maxUnits, Contract contract)
 {
     try {
         if (CustomUnitsAPI.Detected())
         {
             return;
         }
         if (contract != null)
         {
             maxUnits = DropManager.DefaultMechSlots + DropManager.AdditionalMechSlots();
             __instance.UpdateSlotsCount(maxUnits);
             if (contract.Override != null)
             {
                 if (contract.IsFlashpointContract | contract.IsFlashpointCampaignContract)
                 {
                     if (BiggerDrops.settings.limitFlashpointDrop)
                     {
                         maxUnits = Math.Min(4, contract.Override.maxNumberOfPlayerUnits);
                     }
                 }
                 if (BiggerDrops.settings.respectFourDropLimit)
                 {
                     if (contract.Override.maxNumberOfPlayerUnits != -1)
                     {
                         maxUnits = contract.Override.maxNumberOfPlayerUnits;
                     }
                 }
                 else
                 {
                     if (contract.Override.maxNumberOfPlayerUnits != 4)
                     {
                         maxUnits = contract.Override.maxNumberOfPlayerUnits;
                     }
                 }
             }
         }
         else
         {
             maxUnits = DropManager.DefaultMechSlots + DropManager.MaxAdditionalMechSlots;
             BiggerDrops.baysAlreadyAdded = 0;
             __instance.UpdateSlotsCount(maxUnits);
             //SkirmishUIFix(__instance,maxUnits);
         }
     } catch (Exception e) {
         Logger.M.TWL(0, e.ToString());
     }
 }
Beispiel #3
0
 static void Postfix(LanceConfiguratorPanel __instance, ref LanceConfiguration __result, LanceLoadoutSlot[] ___loadoutSlots)
 {
     try {
         if (CustomUnitsAPI.Detected())
         {
             return;
         }
         Fields.callsigns.Clear();
         LanceConfiguration lanceConfiguration = new LanceConfiguration();
         for (int i = 0; i < ___loadoutSlots.Length; i++)
         {
             LanceLoadoutSlot lanceLoadoutSlot = ___loadoutSlots[i];
             MechDef          mechDef          = null;
             PilotDef         pilotDef         = null;
             if (lanceLoadoutSlot.SelectedMech != null)
             {
                 mechDef = lanceLoadoutSlot.SelectedMech.MechDef;
             }
             if (lanceLoadoutSlot.SelectedPilot != null)
             {
                 pilotDef = lanceLoadoutSlot.SelectedPilot.Pilot.pilotDef;
             }
             if (mechDef != null && pilotDef != null)
             {
                 if (i < DropManager.DefaultMechSlots)
                 {
                     lanceConfiguration.AddUnit(__instance.playerGUID, mechDef, pilotDef);
                 }
                 else
                 {
                     //if (i >= BiggerDrops.settings.additinalMechSlots + Settings.DEFAULT_MECH_SLOTS) { break; }
                     Logger.M.TWL(0, "LanceConfiguratorPanel.CreateLanceConfiguration. Index:" + i + " additional slots border:" + (DropManager.AdditionalMechSlots() + DropManager.DefaultMechSlots) + " player slots border:" + (DropManager.AdditionalPlayerMechs() + DropManager.DefaultMechSlots));
                     if (i >= DropManager.AdditionalPlayerMechs() + DropManager.DefaultMechSlots)
                     {
                         Fields.callsigns.Add(pilotDef.Description.Callsign);
                         //EMPLOYER ID
                         Logger.M.WL(1, "adding to employer lance " + Settings.EMPLOYER_LANCE_GUID + " mech:" + mechDef.Description.Id + " pilot:" + pilotDef.Description.Id);
                         lanceConfiguration.AddUnit(Settings.EMPLOYER_LANCE_GUID, mechDef, pilotDef);
                     }
                     else
                     {
                         Logger.M.WL(1, "adding to player lance " + __instance.playerGUID + " mech:" + mechDef.Description.Id + " pilot:" + pilotDef.Description.Id);
                         lanceConfiguration.AddUnit(__instance.playerGUID, mechDef, pilotDef);
                     }
                 }
             }
         }
         __result = lanceConfiguration;
     } catch (Exception e) {
         Logger.LogError(e);
     }
 }