Example #1
0
        public void OnDelayedWorldLoadFinished()
        {
            foreach (Lot lot in LotManager.AllLots)
            {
                if (MapTagHelper.ShouldReplace(lot))
                {
                    if (Tagger.Settings.TypeHasCustomSettings((uint)lot.CommercialLotSubType))
                    {
                        TagSettingKey key = Tagger.Settings.mCustomTagSettings[(uint)lot.CommercialLotSubType];
                        if (key.MetaAutonomyType > 0)
                        {
                            SetMetaAutonomyType(lot, (Lot.MetaAutonomyType)key.MetaAutonomyType);
                        }
                    }
                    else
                    {
                        SetMetaAutonomyType(lot, Lot.MetaAutonomyType.Hangout);
                    }
                }
            }

            foreach (KeyValuePair <Lot.MetaAutonomyType, MetaAutonomySettingKey> key in Tagger.Settings.mMetaAutonomySettings)
            {
                key.Value.InjectTuning();
            }
        }
Example #2
0
        protected override OptionResult Perform(IActor actor, GameObject target, GameObjectHit hit)
        {
            Lot lot = GetLot(target, hit);

            if (lot == null)
            {
                return(OptionResult.Failure);
            }

            uint type = (uint)lot.CommercialLotSubType;

            Common.Notify("Current Type: " + lot.mMetaAutonomyType.ToString());

            List <Item> allOptions = new List <Item>();

            foreach (Lot.MetaAutonomyType metaAutoType in Enum.GetValues(typeof(Lot.MetaAutonomyType)))
            {
                allOptions.Add(new Item(metaAutoType));
            }

            Item selection = new CommonSelection <Item>(lot.GetLocalizedName(), allOptions).SelectSingle();

            if (selection == null)
            {
                return(OptionResult.Failure);
            }

            if (!Tagger.Settings.TypeHasCustomSettings(type))
            {
                TagSettingKey key = new TagSettingKey();
                key.MetaAutonomyType = (uint)selection.Value;
                Tagger.Settings.mCustomTagSettings.Add(type, key);
            }
            else
            {
                Tagger.Settings.mCustomTagSettings[type].MetaAutonomyType = (uint)selection.Value;
            }

            Tagger.SetMetaAutonomyType(lot, selection.Value);

            Common.Notify(GetInteractionName() + ": " + selection.Value);
            return(OptionResult.SuccessClose);
        }