Example #1
0
        public void OnPreLoad()
        {
            sDefaultBarTuned = false;

            foreach (BookComicData bookData in BookData.BookComicDataList.Values)
            {
                bookData.AllowedWorldTypes.Add(WorldType.Vacation);
            }

            foreach (Opportunity opp in OpportunityManager.sLocationBasedOpportunityList.Values)
            {
                if (opp.SharedData.mTargetWorldRequired == WorldName.SunsetValley)
                {
                    opp.SharedData.mTargetWorldRequired = WorldName.Undefined;
                }
            }

            if (ServiceNPCSpecifications.sServiceSpecifications != null)
            {
                foreach (ServiceType type in Enum.GetValues(typeof(ServiceType)))
                {
                    ServiceNPCSpecifications.ServiceSpecifications spec;
                    if (ServiceNPCSpecifications.sServiceSpecifications.TryGetValue(type.ToString(), out spec))
                    {
                        spec.InvalidWorlds.Clear();
                    }
                }
            }

            foreach (List <MotiveTuning> tempTuning in MotiveTuning.sTuning.Values)
            {
                foreach (MotiveTuning tuning in tempTuning)
                {
                    tuning.WorldRestrictionType = WorldRestrictionType.None;
                }
            }

            Bartending.BarData defaultData;
            if (Bartending.TryGetBarData(Lot.MetaAutonomyType.None, out defaultData))
            {
                sDefaultBarTuned = (defaultData.mFoods.Count > 0);
            }

            // Unlock all subTypes for all worlds
            foreach (Lot.CommercialSubTypeData commData in Lot.sCommnunityTypeData)
            {
                commData.WorldAllowed     = null;
                commData.WorldTypeAllowed = null;
            }

            // Unlock all subTypes for all worlds
            foreach (Lot.ResidentialSubTypeData residentData in Lot.sResidentialTypeData)
            {
                residentData.WorldAllowed     = null;
                residentData.WorldTypeAllowed = null;
            }

            foreach (ActionData action in ActionData.sData.Values)
            {
                if (action.mAllowedWorldTypes != null)
                {
                    List <WorldType> types = new List <WorldType>(action.mAllowedWorldTypes);

                    if (types.Count > 0)
                    {
                        if ((!types.Contains(WorldType.Vacation)))
                        {
                            types.Add(WorldType.Vacation);
                        }

                        if ((!types.Contains(WorldType.Future)))
                        {
                            types.Add(WorldType.Future);
                        }

                        action.mAllowedWorldTypes = types.ToArray();
                    }
                }
            }

            STCData.SetNumSocialsDuringConversation(int.MaxValue);

            foreach (InsectData insect in InsectData.sData.Values)
            {
                if (insect.RequiredWorld != WorldName.Undefined)
                {
                    insect.mRequiredWorld = WorldName.Undefined;

                    BooterLogger.AddTrace("  Unlocked: " + insect.Name);
                }
            }

            foreach (RockGemMetalData rock in RockGemMetalBase.sData.Values)
            {
                if (rock.RequiredWorld != WorldName.Undefined)
                {
                    rock.mRequiredWorld = WorldName.Undefined;

                    BooterLogger.AddTrace("  Unlocked: " + rock.Name);
                }
            }

            List <KeyValuePair <WorldName, WorldNameData> > data = new List <KeyValuePair <WorldName, WorldNameData> >();

            if (GameUtils.IsInstalled(ProductVersion.EP1))
            {
                data.Add(new KeyValuePair <WorldName, WorldNameData>(WorldName.China, new WorldNameData("China.world", "China_0x0859db4c", TravelUtil.DestinationInfoImage[0], TravelUtil.DestinationInfoName[0], TravelUtil.DestinationInfoDescription[0], UIManager.LoadUIImage(ResourceKey.CreatePNGKey(TravelUtil.DestinationInfoConfirmImage[0], 0x0)), TravelUtil.DestinationInfoComfirmDescription[0])));
                data.Add(new KeyValuePair <WorldName, WorldNameData>(WorldName.Egypt, new WorldNameData("Egypt.world", "Egypt_0x0859db48", TravelUtil.DestinationInfoImage[1], TravelUtil.DestinationInfoName[1], TravelUtil.DestinationInfoDescription[1], UIManager.LoadUIImage(ResourceKey.CreatePNGKey(TravelUtil.DestinationInfoConfirmImage[1], 0x0)), TravelUtil.DestinationInfoComfirmDescription[1])));
                data.Add(new KeyValuePair <WorldName, WorldNameData>(WorldName.France, new WorldNameData("France.world", "France_0x0859db50", TravelUtil.DestinationInfoImage[2], TravelUtil.DestinationInfoName[2], TravelUtil.DestinationInfoDescription[2], UIManager.LoadUIImage(ResourceKey.CreatePNGKey(TravelUtil.DestinationInfoConfirmImage[2], 0x0)), TravelUtil.DestinationInfoComfirmDescription[2])));
            }

            List <WorldFileMetadata> worlds = new List <WorldFileMetadata>();

            WorldFileSearch search = new WorldFileSearch(0x0);

            foreach (string str in search)
            {
                WorldFileMetadata info = new WorldFileMetadata();

                info.mWorldFile = str;
                if (GetWorldFileDetails(ref info))
                {
                    worlds.Add(info);
                }
            }

            worlds.Sort(OnSort);

            foreach (WorldFileMetadata info in worlds)
            {
                string name = info.mWorldFile.Replace(".world", "");

                WorldName worldName = WorldName.Undefined;

                try
                {
                    worldName = unchecked ((WorldName)ResourceUtils.HashString32(name.Replace(" ", "")));
                }
                catch
                {
                    continue;
                }

                string saveFile = name;
                switch (name.ToLower())
                {
                case "islaparadiso":
                    if (!GameUtils.IsInstalled(ProductVersion.EP10))
                    {
                        continue;
                    }

                    worldName = WorldName.IslaParadiso;

                    saveFile += "_0x0c50c382";
                    break;

                case "sims university":
                    if (!GameUtils.IsInstalled(ProductVersion.EP9))
                    {
                        continue;
                    }

                    worldName = WorldName.University;

                    saveFile += "_0x0e41c954";
                    break;

                case "bridgeport":
                    if (!GameUtils.IsInstalled(ProductVersion.EP3))
                    {
                        continue;
                    }

                    worldName = WorldName.NewDowntownWorld;

                    saveFile += "_0x09ffe3d7";
                    break;

                case "twinbrook":
                    if (!GameUtils.IsInstalled(ProductVersion.EP2))
                    {
                        continue;
                    }

                    worldName = WorldName.TwinBrook;

                    saveFile += "_0x09b610fa";
                    break;

                case "appaloosaplains":
                    if (!GameUtils.IsInstalled(ProductVersion.EP5))
                    {
                        continue;
                    }

                    worldName = WorldName.AppaloosaPlains;

                    saveFile += "_0x0c50c56d";
                    break;

                case "riverview":
                    worldName = WorldName.RiverView;

                    saveFile += "_0x0859db43";
                    break;

                case "sunset valley":
                    worldName = WorldName.SunsetValley;

                    saveFile += "_0x0859db3c";
                    break;

                case "moonlight falls":
                    worldName = WorldName.MoonlightFalls;

                    saveFile += "_0x09b61110";
                    break;

                case "starlight shores":
                    if (!GameUtils.IsInstalled(ProductVersion.EP6))
                    {
                        continue;
                    }

                    worldName = WorldName.StarlightShores;

                    saveFile += "_0x09b610ff";
                    break;

                case "hidden springs":
                case "barnacle bay":
                case "lunar lakes":
                case "lucky palms":
                    saveFile += "_0x08866eb8";
                    break;

                case "roaring heights":
                    worldName = WorldName.DOT11;

                    saveFile += "_0x0de07e86";
                    break;

                case "midnight hollow":
                    worldName = WorldName.DOT10;

                    saveFile += "_0x0de07e7d";
                    break;

                case "dragon valley":
                    worldName = WorldName.DOT09;

                    saveFile += "_0x0de07c9c";
                    break;

                case "aurora skies":
                    worldName = WorldName.DOT08;

                    saveFile += "_0x0de07c8b";
                    break;

                case "monte vista":
                    worldName = WorldName.DOT07;

                    saveFile += "_0x0de07c83";
                    break;

                case "sunlit tides":
                    worldName = WorldName.DOT06;

                    saveFile += "_0x0de07c78";
                    break;

                case "oasis landing":
                    worldName = WorldName.FutureWorld;

                    saveFile += "_0x0f36012a";
                    break;

                case "egypt":
                case "china":
                case "france":
                    continue;

                default:
                    saveFile = FileNameBooter.GetFileName(saveFile);
                    break;
                }

                string infoIcon = "glb_i_suburb";
                switch (info.mWorldType)
                {
                case WorldType.Downtown:
                    infoIcon = "glb_i_downtown";
                    break;

                case WorldType.Vacation:
                    infoIcon = "glb_i_vacation";
                    break;

                default:
                    break;
                }

                if (!VisaManager.sDictionary.ContainsKey((ulong)worldName))
                {
                    Visa defaultVisa = new Visa();
                    defaultVisa.mWorldName          = worldName;
                    defaultVisa.mNonPersistableData = new NonPersistableVisaData();
                    defaultVisa.NonPersistableData.LevelUpStrings = new string[3] {
                        "", "", ""
                    };
                    defaultVisa.NonPersistableData.PointsForNextLevel = new int[3] {
                        0, 0, 0
                    };

                    Visa chinaVisa = VisaManager.GetStaticVisaData(WorldName.China);
                    if (chinaVisa != null)
                    {
                        defaultVisa.NonPersistableData.LevelUpStrings     = new List <string>(chinaVisa.NonPersistableData.LevelUpStrings).ToArray();
                        defaultVisa.NonPersistableData.PointsForNextLevel = new List <int>(chinaVisa.NonPersistableData.PointsForNextLevel).ToArray();
                    }

                    VisaManager.sDictionary.Add((ulong)worldName, defaultVisa);

                    data.Add(new KeyValuePair <WorldName, WorldNameData>(worldName, new WorldNameData(info.mWorldFile, saveFile, infoIcon, info.mCaption, info.mDescription, info.mWorldThumb, Common.Localize("Itinerary:Name", false, new object[] { info.mCaption }))));
                }
            }

            TravelUtil.kVacationWorldNames = new WorldName[data.Count];

            TravelUtil.DestinationInfoImage              = new string[data.Count];
            TravelUtil.DestinationInfoName               = new string[data.Count];
            TravelUtil.DestinationInfoDescription        = new string[data.Count];
            TravelUtil.DestinationInfoConfirmImage       = new string[data.Count];
            TravelUtil.DestinationInfoComfirmDescription = new string[data.Count];

            TravelUtil.DestinationInfoIndex = new int[data.Count];

            int index = 0;

            foreach (KeyValuePair <WorldName, WorldNameData> value in data)
            {
                TravelUtil.kVacationWorldNames[index] = value.Key;

                TravelUtil.DestinationInfoIndex[index] = index;

                TravelUtil.DestinationInfoImage[index]              = value.Value.mDestinationInfoImage;
                TravelUtil.DestinationInfoName[index]               = value.Value.mDestinationInfoName;
                TravelUtil.DestinationInfoDescription[index]        = value.Value.mDestinationInfoDescription;
                TravelUtil.DestinationInfoConfirmImage[index]       = "";
                TravelUtil.DestinationInfoComfirmDescription[index] = value.Value.mDestinationInfoConfirmDescription;

                sConfirmImages.Add(value.Value.mDestinationInfoConfirmImage);

                BooterLogger.AddTrace(value.Value.ToString());
                BooterLogger.AddTrace("  WorldName: " + (ulong)value.Key);

                index++;

                sData.Add(value.Key, value.Value);
            }

            //BooterLogger.AddError("WorldData");

            sOrigWorldNameToType = GameUtils.WorldNameToType;

            foreach (InteractionTuning tuning in InteractionTuning.sAllTunings.Values)
            {
                switch (tuning.Availability.WorldRestrictionType)
                {
                case WorldRestrictionType.Allow:
                    if (!tuning.Availability.WorldRestrictionWorldTypes.Contains(WorldType.Vacation))
                    {
                        tuning.Availability.WorldRestrictionWorldTypes.Add(WorldType.Vacation);

                        BooterLogger.AddTrace("Tuning Altered: Allowed (A) " + tuning.FullInteractionName + " : " + tuning.FullObjectName);
                    }
                    else if (!tuning.Availability.WorldRestrictionWorldTypes.Contains(WorldType.Downtown))
                    {
                        tuning.Availability.WorldRestrictionWorldTypes.Add(WorldType.Downtown);

                        BooterLogger.AddTrace("Tuning Altered: Allowed (C) " + tuning.FullInteractionName + " : " + tuning.FullObjectName);
                    }

                    break;

                case WorldRestrictionType.Disallow:
                    if ((tuning.Availability.WorldRestrictionWorldTypes.Contains(WorldType.Vacation)) ||
                        (tuning.Availability.WorldRestrictionWorldTypes.Contains(WorldType.Downtown)) ||
                        (tuning.Availability.WorldRestrictionWorldTypes.Contains(WorldType.University)) ||
                        (tuning.Availability.WorldRestrictionWorldTypes.Contains(WorldType.Future)))
                    {
                        tuning.Availability.WorldRestrictionWorldTypes.Remove(WorldType.Vacation);
                        tuning.Availability.WorldRestrictionWorldTypes.Remove(WorldType.Downtown);
                        tuning.Availability.WorldRestrictionWorldTypes.Remove(WorldType.University);
                        tuning.Availability.WorldRestrictionWorldTypes.Remove(WorldType.Future);

                        BooterLogger.AddTrace("Tuning Altered: Allowed (B) " + tuning.FullInteractionName + " : " + tuning.FullObjectName);
                    }

                    break;
                }
            }
        }
Example #2
0
        private static bool GetWorldFileDetails(ref WorldFileMetadata info)
        {
            string mWorldFile = info.mWorldFile;

            if (!mWorldFile.ToLower().EndsWith(".world"))
            {
                mWorldFile = mWorldFile + ".world";
            }

            info.mDescription = null;
            info.mWorldThumb  = null;
            info.mLotCount    = 0x0;

            WorldName worldName    = WorldName.Undefined;
            ulong     worldNameKey = 0x0L;

            string entryKey = UIManager.GetWorldMetadata(mWorldFile, ref info.mLotCount, ref info.mWorldThumb, ref worldNameKey, ref info.mWorldType, ref worldName);

            if (!GameUtils.WorldNameToType.ContainsKey(worldName))
            {
                GameUtils.WorldNameToType.Add(worldName, info.mWorldType);
            }

            ILocalizationModel localizationModel = Sims3.Gameplay.UI.Responder.Instance.LocalizationModel;

            if (entryKey != null)
            {
                if (localizationModel.HasLocalizationString(entryKey))
                {
                    info.mDescription = localizationModel.LocalizeString(entryKey, new object[0x0]);
                }
                else
                {
                    info.mDescription = entryKey;
                }
            }

            if ((worldNameKey != 0x0L) && localizationModel.HasLocalizationString(worldNameKey))
            {
                info.mCaption = localizationModel.LocalizeString(worldNameKey);
            }

            if (string.IsNullOrEmpty(info.mCaption))
            {
                BooterLogger.AddTrace("Untranslated " + mWorldFile + ": " + worldNameKey);

                if (mWorldFile.ToLower().EndsWith(".world"))
                {
                    int num2 = mWorldFile.LastIndexOfAny(new char[] { '\\', '/' });
                    info.mCaption = ((num2 >= 0x0) && (mWorldFile.Length > 0x0)) ? mWorldFile.Substring(num2 + 0x1) : mWorldFile.Substring(0x0, mWorldFile.Length - 0x6);
                }
                else
                {
                    info.mCaption = mWorldFile;
                }
            }

            if (info.mDescription == null)
            {
                info.mDescription = "Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Fusce pulvinar. Donec faucibus, dolor eu porta lobortis ante nibh vulputate justo, velvolutpat odio sapien venenatis justo. Quisque sit amet felis acelit imperdiet hendrerit. Nam ut mauris et nisi varius portitor. Fusce blandit, diam id varius portitor, sem elit bibendum dolor, congue molestie sapien lorem vel dolor. Fusce laoreet est non urna euismod commodo. Donec enim quam, blandit at, placerat in, eleifend vitae, justo. Suspendisse potenti. In blandit pede sit amet sem. Nam condimentum sapien sit amet erat.";
            }

            if (info.mWorldThumb == null)
            {
                info.mWorldThumb = UIManager.LoadUIImage(ResourceKey.CreatePNGKey("game_entry_town_placeholder", 0x0));
            }
            return(true);
        }
Example #3
0
 protected static int OnSort(WorldFileMetadata left, WorldFileMetadata right)
 {
     return(left.mCaption.CompareTo(right.mCaption));
 }
Example #4
0
        private static void MoveToWorld()
        {
            PersistStatic.MainMenuLoading = false;
            GameStates.EnsureNoModalDialogsUp();
            GameUtils.EnableSceneDraw(false);
            WorldFileMetadata info = new WorldFileMetadata();
            info.mWorldFile = GameStates.sMovingWorldData.mDestWorld;
            Sims3.UI.Responder.Instance.MainMenuModel.GetWorldFileDetails(ref info);
            LoadingScreenController.LoadNewGameLoadingScreen(info);

            SpeedTrap.Sleep();

            CameraController.DisableObjectFollow();
            bool furniturePacked = GameStates.sMovingWorldData.mFurniturePacked;
            Lot lotHome = GameStates.sMovingWorldData.mTravelHouse.LotHome;
            Dictionary<ObjectGuid, ObjectGuid> originalsToClones = null;
            if (furniturePacked && (lotHome != null))
            {
                GameplayMovingModel.PackFurniture(lotHome, GameStates.sMovingWorldData.mTravelHouse, ref originalsToClones);
            }

            // Transfer data to cross-world lookup
            WorldData.MergeToCrossWorldData();

            // Custom
            MiniSimDescriptionEx.AddMiniSims();

            // Custom
            foreach (SimDescription sim in Households.All(GameStates.sMovingWorldData.mTravelHouse))
            {
                Corrections.CleanupBrokenSkills(sim, null);
            }

            // Custom
            string packageName = BinEx.ExportHousehold(Bin.Singleton, GameStates.sMovingWorldData.mTravelHouse, false, furniturePacked);
            if (packageName != null)
            {
                ulong num = BinModel.Singleton.AddToExportBin(packageName);
                GameStates.sMovingWorldData.binExportId = num;
            }

            GameStates.sOldActiveHousehold = null;
            GameStates.GotoState(GameState.MoveOtherWorld);
        }
Example #5
0
        private static bool GetWorldFileDetails(ref WorldFileMetadata info)
        {
            string mWorldFile = info.mWorldFile;
            if (!mWorldFile.ToLower().EndsWith(".world"))
            {
                mWorldFile = mWorldFile + ".world";
            }

            info.mDescription = null;
            info.mWorldThumb = null;
            info.mLotCount = 0x0;

            WorldName worldName = WorldName.Undefined;
            ulong worldNameKey = 0x0L;

            string entryKey = UIManager.GetWorldMetadata(mWorldFile, ref info.mLotCount, ref info.mWorldThumb, ref worldNameKey, ref info.mWorldType, ref worldName);
            if (!GameUtils.WorldNameToType.ContainsKey(worldName))
            {
                GameUtils.WorldNameToType.Add(worldName, info.mWorldType);
            }

            ILocalizationModel localizationModel = Sims3.Gameplay.UI.Responder.Instance.LocalizationModel;
            if (entryKey != null)
            {
                if (localizationModel.HasLocalizationString(entryKey))
                {
                    info.mDescription = localizationModel.LocalizeString(entryKey, new object[0x0]);
                }
                else
                {
                    info.mDescription = entryKey;
                }
            }

            if ((worldNameKey != 0x0L) && localizationModel.HasLocalizationString(worldNameKey))
            {
                info.mCaption = localizationModel.LocalizeString(worldNameKey);
            }

            if (string.IsNullOrEmpty(info.mCaption))
            {
                BooterLogger.AddTrace("Untranslated " + mWorldFile + ": " + worldNameKey);

                if (mWorldFile.ToLower().EndsWith(".world"))
                {
                    int num2 = mWorldFile.LastIndexOfAny(new char[] { '\\', '/' });
                    info.mCaption = ((num2 >= 0x0) && (mWorldFile.Length > 0x0)) ? mWorldFile.Substring(num2 + 0x1) : mWorldFile.Substring(0x0, mWorldFile.Length - 0x6);
                }
                else
                {
                    info.mCaption = mWorldFile;
                }
            }

            if (info.mDescription == null)
            {
                info.mDescription = "Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Fusce pulvinar. Donec faucibus, dolor eu porta lobortis ante nibh vulputate justo, velvolutpat odio sapien venenatis justo. Quisque sit amet felis acelit imperdiet hendrerit. Nam ut mauris et nisi varius portitor. Fusce blandit, diam id varius portitor, sem elit bibendum dolor, congue molestie sapien lorem vel dolor. Fusce laoreet est non urna euismod commodo. Donec enim quam, blandit at, placerat in, eleifend vitae, justo. Suspendisse potenti. In blandit pede sit amet sem. Nam condimentum sapien sit amet erat.";
            }

            if (info.mWorldThumb == null)
            {
                info.mWorldThumb = UIManager.LoadUIImage(ResourceKey.CreatePNGKey("game_entry_town_placeholder", 0x0));
            }
            return true;
        }
Example #6
0
        public void OnPreLoad()
        {
            sDefaultBarTuned = false;

            foreach (BookComicData bookData in BookData.BookComicDataList.Values)
            {
                bookData.AllowedWorldTypes.Add(WorldType.Vacation);
            }

            foreach (Opportunity opp in OpportunityManager.sLocationBasedOpportunityList.Values)
            {
                if (opp.SharedData.mTargetWorldRequired == WorldName.SunsetValley)
                {
                    opp.SharedData.mTargetWorldRequired = WorldName.Undefined;
                }
            }

            if (ServiceNPCSpecifications.sServiceSpecifications != null)
            {
                foreach (ServiceType type in Enum.GetValues(typeof(ServiceType)))
                {
                    ServiceNPCSpecifications.ServiceSpecifications spec;
                    if (ServiceNPCSpecifications.sServiceSpecifications.TryGetValue(type.ToString(), out spec))
                    {
                        spec.InvalidWorlds.Clear();
                    }
                }
            }

            foreach (List<MotiveTuning> tempTuning in MotiveTuning.sTuning.Values)
            {
                foreach (MotiveTuning tuning in tempTuning)
                {
                    tuning.WorldRestrictionType = WorldRestrictionType.None;
                }
            }

            Bartending.BarData defaultData;
            if (Bartending.TryGetBarData(Lot.MetaAutonomyType.None, out defaultData))
            {
                sDefaultBarTuned = (defaultData.mFoods.Count > 0);
            }

            // Unlock all subTypes for all worlds
            foreach (Lot.CommercialSubTypeData commData in Lot.sCommnunityTypeData)
            {
                commData.WorldAllowed = null;
                commData.WorldTypeAllowed = null;
            }

            // Unlock all subTypes for all worlds
            foreach (Lot.ResidentialSubTypeData residentData in Lot.sResidentialTypeData)
            {
                residentData.WorldAllowed = null;
                residentData.WorldTypeAllowed = null;
            }

            foreach (ActionData action in ActionData.sData.Values)
            {
                if (action.mAllowedWorldTypes != null)
                {
                    List<WorldType> types = new List<WorldType>(action.mAllowedWorldTypes);

                    if(types.Count > 0)
                    {
                        if ((!types.Contains(WorldType.Vacation)))
                        {
                            types.Add(WorldType.Vacation);
                        }

                        if ((!types.Contains(WorldType.Future)))
                        {
                            types.Add(WorldType.Future);
                        }

                        action.mAllowedWorldTypes = types.ToArray();
                    }
                }                
            }

            STCData.SetNumSocialsDuringConversation(int.MaxValue);

            foreach (InsectData insect in InsectData.sData.Values)
            {
                if (insect.RequiredWorld != WorldName.Undefined)
                {
                    insect.mRequiredWorld = WorldName.Undefined;

                    BooterLogger.AddTrace("  Unlocked: " + insect.Name);
                }
            }

            foreach (RockGemMetalData rock in RockGemMetalBase.sData.Values)
            {
                if (rock.RequiredWorld != WorldName.Undefined)
                {
                    rock.mRequiredWorld = WorldName.Undefined;

                    BooterLogger.AddTrace("  Unlocked: " + rock.Name);
                }
            }

            List<KeyValuePair<WorldName, WorldNameData>> data = new List<KeyValuePair<WorldName, WorldNameData>>();

            if (GameUtils.IsInstalled(ProductVersion.EP1))
            {
                data.Add(new KeyValuePair<WorldName, WorldNameData>(WorldName.China, new WorldNameData("China.world", "China_0x0859db4c", TravelUtil.DestinationInfoImage[0], TravelUtil.DestinationInfoName[0], TravelUtil.DestinationInfoDescription[0], UIManager.LoadUIImage(ResourceKey.CreatePNGKey(TravelUtil.DestinationInfoConfirmImage[0], 0x0)), TravelUtil.DestinationInfoComfirmDescription[0])));
                data.Add(new KeyValuePair<WorldName, WorldNameData>(WorldName.Egypt, new WorldNameData("Egypt.world", "Egypt_0x0859db48", TravelUtil.DestinationInfoImage[1], TravelUtil.DestinationInfoName[1], TravelUtil.DestinationInfoDescription[1], UIManager.LoadUIImage(ResourceKey.CreatePNGKey(TravelUtil.DestinationInfoConfirmImage[1], 0x0)), TravelUtil.DestinationInfoComfirmDescription[1])));
                data.Add(new KeyValuePair<WorldName, WorldNameData>(WorldName.France, new WorldNameData("France.world", "France_0x0859db50", TravelUtil.DestinationInfoImage[2], TravelUtil.DestinationInfoName[2], TravelUtil.DestinationInfoDescription[2], UIManager.LoadUIImage(ResourceKey.CreatePNGKey(TravelUtil.DestinationInfoConfirmImage[2], 0x0)), TravelUtil.DestinationInfoComfirmDescription[2])));
            }

            List<WorldFileMetadata> worlds = new List<WorldFileMetadata>();

            WorldFileSearch search = new WorldFileSearch(0x0);
            foreach (string str in search)
            {
                WorldFileMetadata info = new WorldFileMetadata();

                info.mWorldFile = str;
                if (GetWorldFileDetails(ref info))
                {
                    worlds.Add(info);
                }
            }

            worlds.Sort(OnSort);

            foreach(WorldFileMetadata info in worlds)
            {
                string name = info.mWorldFile.Replace(".world", "");

                WorldName worldName = WorldName.Undefined;

                try
                {
                    worldName = unchecked((WorldName)ResourceUtils.HashString32(name.Replace(" ", "")));
                }
                catch
                {
                    continue;
                }

                string saveFile = name;
                switch (name.ToLower())
                {
                    case "islaparadiso":
                        if (!GameUtils.IsInstalled(ProductVersion.EP10)) continue;

                        worldName = WorldName.IslaParadiso;

                        saveFile += "_0x0c50c382";
                        break;
                    case "sims university":
                        if (!GameUtils.IsInstalled(ProductVersion.EP9)) continue;

                        worldName = WorldName.University;

                        saveFile += "_0x0e41c954";
                        break;
                    case "bridgeport":
                        if (!GameUtils.IsInstalled(ProductVersion.EP3)) continue;

                        worldName = WorldName.NewDowntownWorld;

                        saveFile += "_0x09ffe3d7";
                        break;
                    case "twinbrook":
                        if (!GameUtils.IsInstalled(ProductVersion.EP2)) continue;

                        worldName = WorldName.TwinBrook;

                        saveFile += "_0x09b610fa";
                        break;
                    case "appaloosaplains":
                        if (!GameUtils.IsInstalled(ProductVersion.EP5)) continue;

                        worldName = WorldName.AppaloosaPlains;

                        saveFile += "_0x0c50c56d";
                        break;
                    case "riverview":
                        worldName = WorldName.RiverView;

                        saveFile += "_0x0859db43";
                        break;
                    case "sunset valley":
                        worldName = WorldName.SunsetValley;

                        saveFile += "_0x0859db3c";
                        break;
                    case "moonlight falls":
                        worldName = WorldName.MoonlightFalls;

                        saveFile += "_0x09b61110";
                        break;
                    case "starlight shores":
                        if (!GameUtils.IsInstalled(ProductVersion.EP6)) continue;

                        worldName = WorldName.StarlightShores;

                        saveFile += "_0x09b610ff";
                        break;
                    case "hidden springs":
                    case "barnacle bay":
                    case "lunar lakes":
                    case "lucky palms":
                        saveFile += "_0x08866eb8";
                        break;
                    case "roaring heights":
                        worldName = WorldName.DOT11;

                        saveFile += "_0x0de07e86";
                        break;
                    case "midnight hollow":
                        worldName = WorldName.DOT10;

                        saveFile += "_0x0de07e7d";
                        break;
                    case "dragon valley":
                        worldName = WorldName.DOT09;

                        saveFile += "_0x0de07c9c";
                        break;
                    case "aurora skies":
                        worldName = WorldName.DOT08;

                        saveFile += "_0x0de07c8b";
                        break;
                    case "monte vista":
                        worldName = WorldName.DOT07;

                        saveFile += "_0x0de07c83";
                        break;
                    case "sunlit tides":
                        worldName = WorldName.DOT06;

                        saveFile += "_0x0de07c78";
                        break;
                    case "oasis landing":
                        worldName = WorldName.FutureWorld;

                        saveFile += "_0x0f36012a";
                        break;
                    case "egypt":
                    case "china":
                    case "france":
                        continue;
                    default:
                        saveFile = FileNameBooter.GetFileName(saveFile);
                        break;
                }

                string infoIcon = "glb_i_suburb";
                switch (info.mWorldType)
                {
                    case WorldType.Downtown:
                        infoIcon = "glb_i_downtown";
                        break;
                    case WorldType.Vacation:
                        infoIcon = "glb_i_vacation";
                        break;
                    default:
                        break;
                }

                if (info.mWorldType == WorldType.Future)
                {
                    if (!TimePortal.sTimeTravelerHasBeenSummoned)
                    {
                        continue;
                    }
                }

                if (!VisaManager.sDictionary.ContainsKey((ulong)worldName))
                {
                    Visa defaultVisa = new Visa();
                    defaultVisa.mWorldName = worldName;
                    defaultVisa.mNonPersistableData = new NonPersistableVisaData();
                    defaultVisa.NonPersistableData.LevelUpStrings = new string[3] { "", "", "" };
                    defaultVisa.NonPersistableData.PointsForNextLevel = new int[3] { 0, 0, 0 };

                    Visa chinaVisa = VisaManager.GetStaticVisaData(WorldName.China);
                    if (chinaVisa != null)
                    {
                        defaultVisa.NonPersistableData.LevelUpStrings = new List<string>(chinaVisa.NonPersistableData.LevelUpStrings).ToArray();
                        defaultVisa.NonPersistableData.PointsForNextLevel = new List<int>(chinaVisa.NonPersistableData.PointsForNextLevel).ToArray();
                    }

                    VisaManager.sDictionary.Add((ulong)worldName, defaultVisa);

                    data.Add(new KeyValuePair<WorldName, WorldNameData>(worldName, new WorldNameData(info.mWorldFile, saveFile, infoIcon, info.mCaption, info.mDescription, info.mWorldThumb, Common.Localize("Itinerary:Name", false, new object[] { info.mCaption }))));
                }
            }

            TravelUtil.kVacationWorldNames = new WorldName[data.Count];

            TravelUtil.DestinationInfoImage = new string[data.Count];
            TravelUtil.DestinationInfoName = new string[data.Count];
            TravelUtil.DestinationInfoDescription = new string[data.Count];
            TravelUtil.DestinationInfoConfirmImage = new string[data.Count];
            TravelUtil.DestinationInfoComfirmDescription = new string[data.Count];

            TravelUtil.DestinationInfoIndex = new int[data.Count];

            int index = 0;
            foreach (KeyValuePair<WorldName, WorldNameData> value in data)
            {
                TravelUtil.kVacationWorldNames[index] = value.Key;

                TravelUtil.DestinationInfoIndex[index] = index;

                TravelUtil.DestinationInfoImage[index] = value.Value.mDestinationInfoImage;
                TravelUtil.DestinationInfoName[index] = value.Value.mDestinationInfoName;
                TravelUtil.DestinationInfoDescription[index] = value.Value.mDestinationInfoDescription;
                TravelUtil.DestinationInfoConfirmImage[index] = "";
                TravelUtil.DestinationInfoComfirmDescription[index] = value.Value.mDestinationInfoConfirmDescription;

                sConfirmImages.Add(value.Value.mDestinationInfoConfirmImage);

                BooterLogger.AddTrace(value.Value.ToString());
                BooterLogger.AddTrace("  WorldName: " + (ulong)value.Key);

                index++;

                sData.Add(value.Key, value.Value);
            }

            //BooterLogger.AddError("WorldData");

            sOrigWorldNameToType = GameUtils.WorldNameToType;

            foreach (InteractionTuning tuning in InteractionTuning.sAllTunings.Values)
            {
                switch (tuning.Availability.WorldRestrictionType)
                {
                    case WorldRestrictionType.Allow:
                        if (!tuning.Availability.WorldRestrictionWorldTypes.Contains(WorldType.Vacation))
                        {
                            tuning.Availability.WorldRestrictionWorldTypes.Add(WorldType.Vacation);

                            BooterLogger.AddTrace("Tuning Altered: Allowed (A) " + tuning.FullInteractionName + " : " + tuning.FullObjectName);
                        }
                        else if (!tuning.Availability.WorldRestrictionWorldTypes.Contains(WorldType.Downtown))
                        {
                            tuning.Availability.WorldRestrictionWorldTypes.Add(WorldType.Downtown);

                            BooterLogger.AddTrace("Tuning Altered: Allowed (C) " + tuning.FullInteractionName + " : " + tuning.FullObjectName);
                        }

                        break;
                    case WorldRestrictionType.Disallow:
                        if ((tuning.Availability.WorldRestrictionWorldTypes.Contains(WorldType.Vacation)) ||
                            (tuning.Availability.WorldRestrictionWorldTypes.Contains(WorldType.Downtown)) ||
                            (tuning.Availability.WorldRestrictionWorldTypes.Contains(WorldType.University)) ||
                            (tuning.Availability.WorldRestrictionWorldTypes.Contains(WorldType.Future)))
                        {
                            tuning.Availability.WorldRestrictionWorldTypes.Remove(WorldType.Vacation);
                            tuning.Availability.WorldRestrictionWorldTypes.Remove(WorldType.Downtown);
                            tuning.Availability.WorldRestrictionWorldTypes.Remove(WorldType.University);
                            tuning.Availability.WorldRestrictionWorldTypes.Remove(WorldType.Future);

                            BooterLogger.AddTrace("Tuning Altered: Allowed (B) " + tuning.FullInteractionName + " : " + tuning.FullObjectName);
                        }

                        break;
                }
            }
        }
Example #7
0
 protected static int OnSort(WorldFileMetadata left, WorldFileMetadata right)
 {
     return left.mCaption.CompareTo(right.mCaption);
 }