public contractUIObject(contractContainer c, contractMission m)
        {
            container   = c;
            mission     = m;
            _showParams = true;
            _order      = null;

            _agencyLogo = container.RootAgent.Logo;
            _agencyName = container.RootAgent.Name;

            _difficulty = (int)container.Root.Prestige;
            _id         = container.ID;

            for (int i = 0; i < c.FirstLevelParameterCount; i++)
            {
                parameterContainer p = c.getParameterLevelOne(i);

                if (p == null)
                {
                    continue;
                }

                if (string.IsNullOrEmpty(p.Title))
                {
                    continue;
                }

                paramList.Add(new parameterUIObject(p));
            }
        }
Ejemplo n.º 2
0
        internal string vesselConcat(contractMission m)
        {
            if (m == null || !HighLogic.LoadedSceneIsFlight)
            {
                return(vesselIDString);
            }

            Vessel v = FlightGlobals.ActiveVessel;

            if (v == null)
            {
                return(vesselIDString);
            }

            bool withVessel     = ContainsVessel(v);
            bool currentMission = m == this;

            if (withVessel && !currentMission)
            {
                removeFromVessels(v, false);
            }
            else if (!withVessel && currentMission)
            {
                addToVessels(v, false);
            }

            List <Vessel> source = currentVessels.Values.ToList();

            return(vesselConcat(source));
        }
Ejemplo n.º 3
0
        public void Rebuild()
        {
            contractScenario.Instance.addFullMissionList();

            currentMission = contractScenario.Instance.MasterMission;

            int l = ContractSystem.Instance.Contracts.Count;

            for (int i = 0; i < l; i++)
            {
                Contract c = ContractSystem.Instance.Contracts[i];

                if (c == null || c.ContractState != Contract.State.Active)
                {
                    continue;
                }

                contractContainer cC = contractParser.getActiveContract(c.ContractGuid);

                if (cC != null)
                {
                    currentMission.addContract(cC, true, true);
                }
            }

            UIWindow.SelectMission(currentMission);
        }
Ejemplo n.º 4
0
        public void NewMission(string title, Guid id)
        {
            if (string.IsNullOrEmpty(title))
            {
                return;
            }

            if (!contractScenario.Instance.addMissionList(title))
            {
                return;
            }

            contractMission cM = contractScenario.Instance.getMissionList(title);

            if (cM == null)
            {
                return;
            }

            contractContainer c = contractParser.getActiveContract(id);

            if (c == null)
            {
                return;
            }

            cM.addContract(c, true, true);
        }
Ejemplo n.º 5
0
 private void generateList()
 {
     contractScenario.Instance.loadAllMissionLists();
     if (HighLogic.LoadedSceneIsFlight)
     {
         currentMission = contractScenario.Instance.setLoadedMission(FlightGlobals.ActiveVessel);
     }
     else
     {
         currentMission = contractScenario.Instance.MasterMission;
     }
 }
        public void RemoveContractFromAll()
        {
            for (int i = contractScenario.Instance.getAllMissions().Count - 1; i >= 0; i--)
            {
                contractMission m = contractScenario.Instance.getAllMissions()[i];

                if (m == null)
                {
                    return;
                }

                m.RemoveContract(this);
            }
        }
Ejemplo n.º 7
0
        public void setMission(contractMission mission)
        {
            currentMission = mission;

            setMission();
        }