示例#1
0
 public MaruComet()
 {
     zoom         = 4;
     content      = Game1.content.CreateTemporary();
     cometTexture = content.Load <Texture2D>("Minigames\\MaruComet");
     changeScreenSize();
 }
示例#2
0
        public GrandpaStory()
        {
            Game1.changeMusicTrack("none");
            this.content = Game1.content.CreateTemporary();
            this.texture = this.content.Load <Texture2D>("Minigames\\jojacorps");
            this.backgroundFadeChange = 0.0003f;
            this.grandpaSpeech        = new Queue <string>();
            this.grandpaSpeech.Enqueue(Game1.player.isMale ? Game1.content.LoadString("Strings\\StringsFromCSFiles:GrandpaStory.cs.12026") : Game1.content.LoadString("Strings\\StringsFromCSFiles:GrandpaStory.cs.12028"));
            this.grandpaSpeech.Enqueue(Game1.content.LoadString("Strings\\StringsFromCSFiles:GrandpaStory.cs.12029"));
            this.grandpaSpeech.Enqueue(Game1.content.LoadString("Strings\\StringsFromCSFiles:GrandpaStory.cs.12030"));
            this.grandpaSpeech.Enqueue(Game1.content.LoadString("Strings\\StringsFromCSFiles:GrandpaStory.cs.12031"));
            this.grandpaSpeech.Enqueue(Game1.content.LoadString("Strings\\StringsFromCSFiles:GrandpaStory.cs.12034"));
            this.grandpaSpeech.Enqueue(Game1.content.LoadString("Strings\\StringsFromCSFiles:GrandpaStory.cs.12035"));
            this.grandpaSpeech.Enqueue(Game1.player.isMale ? Game1.content.LoadString("Strings\\StringsFromCSFiles:GrandpaStory.cs.12036") : Game1.content.LoadString("Strings\\StringsFromCSFiles:GrandpaStory.cs.12038"));
            this.grandpaSpeech.Enqueue(Game1.content.LoadString("Strings\\StringsFromCSFiles:GrandpaStory.cs.12040"));
            Game1.player.position = new Vector2(this.panX, (float)(Game1.graphics.GraphicsDevice.Viewport.Height / 2 - 180 * Game1.pixelZoom / 2)) + new Vector2(3000f, 376f);
            Game1.viewport.X      = 0;
            Game1.viewport.Y      = 0;
            Map            m = this.content.Load <Map>("Maps\\FarmHouse");
            IDisplayDevice mapDisplayDevice = Game1.mapDisplayDevice;

            m.LoadTileSheets(mapDisplayDevice);
            string name = "FarmHouse";

            Game1.currentLocation        = (GameLocation) new FarmHouse(m, name);
            Game1.player.currentLocation = Game1.currentLocation;
        }
示例#3
0
 protected override void LoadContent()
 {
     Painter.Init();
     Game1.content         = new LocalizedContentManager(base.Content.ServiceProvider, base.Content.RootDirectory);
     StandAlone.FullScreen = StandAlone.GameScreen;
     CustomInit();
 }
示例#4
0
        /// <summary>Reload the sprites for matching farm animals.</summary>
        /// <param name="content">The content manager through which to reload the asset.</param>
        /// <param name="key">The asset key to reload.</param>
        /// <returns>Returns whether any textures were reloaded.</returns>
        /// <remarks>Derived from <see cref="FarmAnimal.reload"/>.</remarks>
        private bool ReloadFarmAnimalSprites(LocalizedContentManager content, string key)
        {
            // find matches
            FarmAnimal[] animals = this.GetFarmAnimals().ToArray();
            if (!animals.Any())
            {
                return(false);
            }

            // update sprites
            Lazy <Texture2D> texture = new Lazy <Texture2D>(() => content.Load <Texture2D>(key));

            foreach (FarmAnimal animal in animals)
            {
                // get expected key
                string expectedKey = animal.age.Value < animal.ageWhenMature.Value
                    ? $"Baby{(animal.type.Value == "Duck" ? "White Chicken" : animal.type.Value)}"
                    : animal.type.Value;
                if (animal.showDifferentTextureWhenReadyForHarvest.Value && animal.currentProduce.Value <= 0)
                {
                    expectedKey = $"Sheared{expectedKey}";
                }
                expectedKey = $"Animals\\{expectedKey}";

                // reload asset
                if (expectedKey == key)
                {
                    this.SetSpriteTexture(animal.Sprite, texture.Value);
                }
            }
            return(texture.IsValueCreated);
        }
示例#5
0
        /// <summary>Reload the disposition data for matching NPCs.</summary>
        /// <param name="content">The content manager through which to reload the asset.</param>
        /// <param name="key">The asset key to reload.</param>
        /// <returns>Returns whether any NPCs were affected.</returns>
        private bool ReloadNpcDispositions(LocalizedContentManager content, string key)
        {
            IDictionary <string, string> dispositions = content.Load <Dictionary <string, string> >(key);

            foreach (NPC character in this.GetCharacters())
            {
                if (!character.isVillager() || !dispositions.ContainsKey(character.Name))
                {
                    continue;
                }

                NPC clone = new NPC(null, character.Position, character.DefaultMap, character.FacingDirection, character.Name, null, character.Portrait, eventActor: false);
                character.Age             = clone.Age;
                character.Manners         = clone.Manners;
                character.SocialAnxiety   = clone.SocialAnxiety;
                character.Optimism        = clone.Optimism;
                character.Gender          = clone.Gender;
                character.datable.Value   = clone.datable.Value;
                character.homeRegion      = clone.homeRegion;
                character.Birthday_Season = clone.Birthday_Season;
                character.Birthday_Day    = clone.Birthday_Day;
                character.id          = clone.id;
                character.displayName = clone.displayName;
            }

            return(true);
        }
示例#6
0
 public FantasyBoardGame()
 {
     content = Game1.content.CreateTemporary();
     slides  = content.Load <Texture2D>("LooseSprites\\boardGame");
     border  = content.Load <Texture2D>("LooseSprites\\boardGameBorder");
     Game1.globalFadeToClear();
 }
示例#7
0
        /// <summary>Reload critter textures.</summary>
        /// <param name="content">The content manager through which to reload the asset.</param>
        /// <param name="key">The asset key to reload.</param>
        /// <returns>Returns the number of reloaded assets.</returns>
        private int ReloadCritterTextures(LocalizedContentManager content, string key)
        {
            // get critters
            Critter[] critters =
                (
                    from location in this.GetLocations()
                    let locCritters = this.Reflection.GetField <List <Critter> >(location, "critters").GetValue()
                                      where locCritters != null
                                      from Critter critter in locCritters
                                      where this.NormalizeAssetNameIgnoringEmpty(critter.sprite?.Texture?.Name) == key
                                      select critter
                )
                .ToArray();
            if (!critters.Any())
            {
                return(0);
            }

            // update sprites
            Texture2D texture = content.Load <Texture2D>(key);

            foreach (var entry in critters)
            {
                this.SetSpriteTexture(entry.sprite, texture);
            }

            return(critters.Length);
        }
示例#8
0
        /****
        ** Reload data methods
        ****/
        /// <summary>Reload the schedules for matching NPCs.</summary>
        /// <param name="content">The content manager through which to reload the asset.</param>
        /// <param name="key">The asset key to reload.</param>
        /// <returns>Returns whether any assets were reloaded.</returns>
        private bool ReloadNpcSchedules(LocalizedContentManager content, string key)
        {
            // get NPCs
            string name = Path.GetFileName(key);

            NPC[] villagers = this.GetCharacters().Where(npc => npc.Name == name && npc.isVillager()).ToArray();
            if (!villagers.Any())
            {
                return(false);
            }

            // update schedule
            foreach (NPC villager in villagers)
            {
                // reload schedule
                villager.Schedule = villager.getSchedule(Game1.dayOfMonth);

                // switch to new schedule if needed
                int lastScheduleTime = villager.Schedule.Keys.Where(p => p <= Game1.timeOfDay).OrderByDescending(p => p).FirstOrDefault();
                if (lastScheduleTime != 0)
                {
                    this.Reflection.GetField <int>(villager, "scheduleTimeToTry").SetValue(this.Reflection.GetField <int>(typeof(NPC), "NO_TRY").GetValue()); // use time that's passed in to checkSchedule
                    villager.checkSchedule(lastScheduleTime);
                }
            }
            return(true);
        }
示例#9
0
 public FishingGame()
 {
     content  = Game1.content.CreateTemporary();
     location = new GameLocation("Maps\\FishingGame", "fishingGame");
     location.isStructure.Value    = true;
     location.uniqueName.Value     = "fishingGame" + Game1.player.UniqueMultiplayerID;
     location.currentEvent         = Game1.currentLocation.currentEvent;
     Game1.player.CurrentToolIndex = 0;
     Game1.player.TemporaryItem    = new FishingRod();
     (Game1.player.CurrentTool as FishingRod).attachments[0] = new Object(690, 99);
     (Game1.player.CurrentTool as FishingRod).attachments[1] = new Object(687, 1);
     Game1.player.UsingTool        = false;
     Game1.player.CurrentToolIndex = 0;
     Game1.globalFadeToClear(null, 0.01f);
     location.Map.LoadTileSheets(Game1.mapDisplayDevice);
     Game1.player.Position        = new Vector2(14f, 7f) * 64f;
     Game1.player.currentLocation = location;
     originalLocation             = Game1.currentLocation;
     Game1.currentLocation        = location;
     changeScreenSize();
     gameEndTimer     = 100000;
     showResultsTimer = -1;
     Game1.player.faceDirection(3);
     Game1.player.Halt();
 }
示例#10
0
        /// <summary>Reload the portraits for matching NPCs.</summary>
        /// <param name="content">The content manager through which to reload the asset.</param>
        /// <param name="keys">The asset key to reload.</param>
        /// <returns>Returns the number of reloaded assets.</returns>
        private int ReloadNpcPortraits(LocalizedContentManager content, IEnumerable <string> keys)
        {
            // get NPCs
            HashSet <string> lookup = new HashSet <string>(keys, StringComparer.InvariantCultureIgnoreCase);
            var villagers           =
                (
                    from npc in this.GetCharacters()
                    where npc.isVillager()
                    let textureKey = this.GetNormalizedPath($"Portraits\\{this.getTextureName(npc)}")
                                     where lookup.Contains(textureKey)
                                     select new { npc, textureKey }
                )
                .ToArray();

            if (!villagers.Any())
            {
                return(0);
            }

            // update portrait
            int reloaded = 0;

            foreach (var entry in villagers)
            {
                entry.npc.resetPortrait();
                entry.npc.Portrait = content.Load <Texture2D>(entry.textureKey);
                reloaded++;
            }
            return(reloaded);
        }
示例#11
0
 public FantasyBoardGame()
 {
     this.content = Game1.content.CreateTemporary();
     this.slides  = this.content.Load <Texture2D>("LooseSprites\\boardGame");
     this.border  = this.content.Load <Texture2D>("LooseSprites\\boardGameBorder");
     Game1.globalFadeToClear((Game1.afterFadeFunction)null, 0.02f);
 }
示例#12
0
        /// <summary>Reload the sprites for a fence type.</summary>
        /// <param name="content">The content manager through which to reload the asset.</param>
        /// <param name="key">The asset key to reload.</param>
        /// <returns>Returns whether any textures were reloaded.</returns>
        private bool ReloadFenceTextures(LocalizedContentManager content, string key)
        {
            // get fence type
            if (!int.TryParse(this.GetSegments(key)[1].Substring("Fence".Length), out int fenceType))
            {
                return(false);
            }

            // get fences
            Fence[] fences =
                (
                    from location in this.GetLocations()
                    from fence in location.Objects.Values.OfType <Fence>()
                    where
                    fence.whichType.Value == fenceType ||
                    (fence.isGate.Value && fenceType == 1)        // gates are hardcoded to draw fence type 1
                    select fence
                )
                .ToArray();

            // update fence textures
            foreach (Fence fence in fences)
            {
                this.Reflection.GetField <Lazy <Texture2D> >(fence, "fenceTexture").SetValue(new Lazy <Texture2D>(fence.loadFenceTexture));
            }
            return(true);
        }
示例#13
0
        public HaleyCowPictures()
        {
            content  = Game1.content.CreateTemporary();
            pictures = (Game1.currentSeason.Equals("winter") ? content.Load <Texture2D>("LooseSprites\\cowPhotosWinter") : content.Load <Texture2D>("LooseSprites\\cowPhotos"));
            float pixel_zoom_adjustment = 1f / Game1.options.zoomLevel;

            centerOfScreen = new Vector2(Game1.game1.localMultiplayerWindow.Width / 2, Game1.game1.localMultiplayerWindow.Height / 2) * pixel_zoom_adjustment;
        }
示例#14
0
        public MaruComet()
        {
            zoom         = 4;
            content      = Game1.content.CreateTemporary();
            cometTexture = content.Load <Texture2D>("Minigames\\MaruComet");
            float pixel_zoom_adjustment = 1f / Game1.options.zoomLevel;

            centerOfScreen   = pixel_zoom_adjustment * new Vector2(Game1.graphics.GraphicsDevice.Viewport.Width / 2, Game1.graphics.GraphicsDevice.Viewport.Height / 2);
            cometColorOrigin = centerOfScreen + pixel_zoom_adjustment * new Vector2(-71 * zoom, 71 * zoom);
        }
示例#15
0
 public void unload()
 {
     Game1.player.addItemToInventory(this.tempItemStash, 0);
     Game1.currentLocation.Map.LoadTileSheets(Game1.mapDisplayDevice);
     Game1.player.forceCanMove();
     this.content.Unload();
     this.content.Dispose();
     this.content = null;
     Game1.changeMusicTrack("fallFest");
 }
示例#16
0
        /// <summary>Reload one of the game's core assets (if applicable).</summary>
        /// <param name="content">The content manager through which to reload the asset.</param>
        /// <param name="key">The asset key to reload.</param>
        /// <returns>Returns whether an asset was reloaded.</returns>
        public bool Propagate(LocalizedContentManager content, string key)
        {
            object result = this.PropagateImpl(content, key);

            if (result is bool b)
            {
                return(b);
            }
            return(result != null);
        }
示例#17
0
 public TelescopeScene(NPC Maru)
 {
     temporaryContent = Game1.content.CreateTemporary();
     background       = temporaryContent.Load <Texture2D>("LooseSprites\\nightSceneMaru");
     trees            = temporaryContent.Load <Texture2D>("LooseSprites\\nightSceneMaruTrees");
     walkSpace        = new GameLocation(null, "walkSpace");
     walkSpace.map    = new Map();
     walkSpace.map.AddLayer(new Layer("Back", walkSpace.map, new Size(30, 1), new Size(64)));
     Game1.currentLocation = walkSpace;
 }
示例#18
0
        /*********
        ** Public methods
        *********/
        /// <summary>Initialize the core asset data.</summary>
        /// <param name="mainContent">The main content manager through which to reload assets.</param>
        /// <param name="disposableContent">An internal content manager used only for asset propagation.</param>
        /// <param name="monitor">Writes messages to the console.</param>
        /// <param name="reflection">Simplifies access to private code.</param>
        /// <param name="aggressiveMemoryOptimizations">Whether to enable more aggressive memory optimizations.</param>
        public CoreAssetPropagator(LocalizedContentManager mainContent, GameContentManagerForAssetPropagation disposableContent, IMonitor monitor, Reflector reflection, bool aggressiveMemoryOptimizations)
        {
            this.MainContentManager       = mainContent;
            this.DisposableContentManager = disposableContent;
            this.Monitor    = monitor;
            this.Reflection = reflection;
            this.AggressiveMemoryOptimizations = aggressiveMemoryOptimizations;

            this.AssertAndNormalizeAssetName = disposableContent.AssertAndNormalizeAssetName;
        }
示例#19
0
 internal void InitializeContent(LocalizedContentManager content)
 {
     this.smallFont          = content.Load <SpriteFont>(@"Fonts\SmallFont");
     Game1.mobileSpriteSheet = content.Load <Texture2D>(@"LooseSprites\\MobileAtlas_manually_made");
     this.scrollbar          = new MobileScrollbar(0, 96, 16, this.ScrollBoxHeight - 192);
     this.scrollbox          = new MobileScrollbox(0, 0, this.MaxTextAreaWidth, this.ScrollBoxHeight, this.MaxScrollBoxHeight,
                                                   new Rectangle(0, 0, (int)(Game1.graphics.PreferredBackBufferWidth / Game1.NativeZoomLevel), this.ScrollBoxHeight),
                                                   this.scrollbar
                                                   );
 }
示例#20
0
        public TelescopeScene(NPC Maru)
        {
            this.temporaryContent = Game1.content.CreateTemporary();
            this.background       = this.temporaryContent.Load <Texture2D>("LooseSprites\\nightSceneMaru");
            this.trees            = this.temporaryContent.Load <Texture2D>("LooseSprites\\nightSceneMaruTrees");
            Map map = new Map();

            map.AddLayer(new Layer("Back", map, new Size(30, 1), new Size(Game1.tileSize)));
            this.walkSpace        = new GameLocation(map, nameof(walkSpace));
            Game1.currentLocation = this.walkSpace;
        }
示例#21
0
    public static string FormatTime(int time, string?format)
    {
        // Limit it to one day.
        time %= 2400;

        if (string.IsNullOrEmpty(format))
        {
            return(Game1.getTimeOfDayString(time));
        }

        return(LocalizedContentManager.FormatTimeString(time, format).ToString());
    }
示例#22
0
 public void unload()
 {
     (Game1.player.CurrentTool as FishingRod).castingEndFunction(-1);
     (Game1.player.CurrentTool as FishingRod).doneFishing(Game1.player);
     Game1.player.TemporaryItem   = null;
     Game1.player.currentLocation = Game1.currentLocation;
     Game1.player.completelyStopAnimatingOrDoingAction();
     Game1.player.forceCanMove();
     Game1.player.faceDirection(2);
     content.Unload();
     content.Dispose();
     content = null;
 }
示例#23
0
        /*********
        ** Public methods
        *********/
        /****
        ** Constructor
        ****/
        /// <summary>Construct an instance.</summary>
        /// <param name="serviceProvider">The service provider to use to locate services.</param>
        /// <param name="rootDirectory">The root directory to search for content.</param>
        /// <param name="currentCulture">The current culture for which to localise content.</param>
        /// <param name="monitor">Encapsulates monitoring and logging.</param>
        /// <param name="reflection">Simplifies access to private code.</param>
        public ContentCore(IServiceProvider serviceProvider, string rootDirectory, CultureInfo currentCulture, IMonitor monitor, Reflector reflection)
        {
            // init
            this.Monitor          = monitor ?? throw new ArgumentNullException(nameof(monitor));
            this.Content          = new LocalizedContentManager(serviceProvider, rootDirectory, currentCulture);
            this.Cache            = new ContentCache(this.Content, reflection);
            this.ModContentPrefix = this.GetAssetNameFromFilePath(Constants.ModPath);

            // get asset data
            this.CoreAssets          = new CoreAssetPropagator(this.NormaliseAssetName, reflection);
            this.LanguageCodes       = this.GetKeyLocales().ToDictionary(p => p.Value, p => p.Key, StringComparer.InvariantCultureIgnoreCase);
            this.IsLocalisableLookup = reflection.GetField <IDictionary <string, bool> >(this.Content, "_localizedAsset").GetValue();
        }
示例#24
0
 public void unload()
 {
     (Game1.player.CurrentTool as FishingRod).castingEndFunction(-1);
     (Game1.player.CurrentTool as FishingRod).doneFishing(Game1.player, false);
     Game1.player.addItemToInventory(this.tempItemStash, 0);
     Game1.player.currentLocation = Game1.currentLocation;
     Game1.player.completelyStopAnimatingOrDoingAction();
     Game1.player.forceCanMove();
     Game1.player.faceDirection(2);
     this.content.Unload();
     this.content.Dispose();
     this.content = (LocalizedContentManager)null;
 }
示例#25
0
 /*********
 ** Public methods
 *********/
 /// <summary>Construct an instance.</summary>
 /// <param name="serviceProvider">The service provider to use to locate services.</param>
 /// <param name="rootDirectory">The root directory to search for content.</param>
 /// <param name="currentCulture">The current culture for which to localize content.</param>
 /// <param name="monitor">Encapsulates monitoring and logging.</param>
 /// <param name="reflection">Simplifies access to private code.</param>
 /// <param name="jsonHelper">Encapsulates SMAPI's JSON file parsing.</param>
 /// <param name="onLoadingFirstAsset">A callback to invoke the first time *any* game content manager loads an asset.</param>
 public ContentCoordinator(IServiceProvider serviceProvider, string rootDirectory, CultureInfo currentCulture, IMonitor monitor, Reflector reflection, JsonHelper jsonHelper, Action onLoadingFirstAsset)
 {
     this.Monitor             = monitor ?? throw new ArgumentNullException(nameof(monitor));
     this.Reflection          = reflection;
     this.JsonHelper          = jsonHelper;
     this.OnLoadingFirstAsset = onLoadingFirstAsset;
     this.FullRootDirectory   = Path.Combine(Constants.ExecutionPath, rootDirectory);
     this.ContentManagers.Add(
         this.MainContentManager = new GameContentManager("Game1.content", serviceProvider, rootDirectory, currentCulture, this, monitor, reflection, this.OnDisposing, onLoadingFirstAsset)
         );
     this.VanillaContentManager = new LocalizedContentManager(serviceProvider, rootDirectory);
     this.CoreAssets            = new CoreAssetPropagator(this.MainContentManager.AssertAndNormalizeAssetName, reflection);
 }
示例#26
0
        /// <summary>Reload the disposition data for matching NPCs.</summary>
        /// <param name="content">The content manager through which to reload the asset.</param>
        /// <param name="key">The asset key to reload.</param>
        /// <returns>Returns whether any NPCs were affected.</returns>
        private bool ReloadNpcDispositions(LocalizedContentManager content, string key)
        {
            IDictionary <string, string> data = content.Load <Dictionary <string, string> >(key);
            bool changed = false;

            foreach (NPC npc in this.GetCharacters())
            {
                if (npc.isVillager() && data.ContainsKey(npc.Name))
                {
                    npc.reloadData();
                    changed = true;
                }
            }

            return(changed);
        }
示例#27
0
        private Program()
        {
            // Some window settings.
            Window.Title   = "Space. The Game. Seriously.";
            IsMouseVisible = true;

            // XNA's fixed time step implementation doesn't suit us, to be gentle.
            // So we let it be dynamic and adjust for it as necessary, leading
            // to almost no desynchronizations at all! Yay!
            IsFixedTimeStep = false;

            // We use this to dispose game components that are disposable and
            // were removed from the list of active components. We don't want
            // to dispose them during an update loop, because they will still
            // be updated if they had not been updated before the removal,
            // leading to object disposed exceptions.
            Components.ComponentRemoved += (sender, e) => _pendingComponents.Add(e.GameComponent);

            // Load settings. Save on exit.
            Settings.Load(SettingsFile);
            Exiting += (sender, e) =>
            {
                Logger.Info("Saving settings.");
                Settings.Save(SettingsFile);
            };

            // Set up display.
            GraphicsDeviceManager = new GraphicsDeviceManager(this)
            {
                PreferredBackBufferWidth  = Settings.Instance.ScreenResolution.X,
                PreferredBackBufferHeight = Settings.Instance.ScreenResolution.Y,
                IsFullScreen = Settings.Instance.Fullscreen,
                SynchronizeWithVerticalRetrace = false,
                PreferMultiSampling            = true
            };

            // Create our own, localized content manager.
            Content = new LocalizedContentManager(Services)
            {
                RootDirectory = "data"
            };

            // Register packet overloads for XNA value types.
            Packetizable.AddValueTypeOverloads(typeof(Engine.Math.PacketExtensions));
            Packetizable.AddValueTypeOverloads(typeof(Engine.FarMath.PacketExtensions));
            Packetizable.AddValueTypeOverloads(typeof(Engine.XnaExtensions.PacketExtensions));
        }
示例#28
0
        BoardGame(BoardGameScenario initialScenario)
        {
            this.content = Game1.content.CreateTemporary();
            slides       = new List <Texture2D>();
            timers       = new BoardGameTimers();
            scenario     = initialScenario;
            string imagePath = initialScenario.GetImageFolder() + "\\";

            foreach (BoardGameScene currentScene in initialScenario.Scenes)
            {
                string filePath = imagePath + currentScene.Image;
                LoadTextureFromFile(filePath);
            }
            this.border = this.content.Load <Texture2D>("LooseSprites\\boardGameBorder");
            oldMusic    = Game1.getMusicTrackName();
            ChangeSlide();
        }
示例#29
0
        public void robinConstructionMessage()
        {
            this.exitThisMenu(true);
            Game1.player.forceCanMove();
            if (this.magicalConstruction)
            {
                return;
            }
            string str1 = "Data\\ExtraDialogue:Robin_" + (this.upgrading ? "Upgrade" : "New") + "Construction";

            if (Utility.isFestivalDay(Game1.dayOfMonth + 1, Game1.currentSeason))
            {
                str1 += "_Festival";
            }
            NPC characterFromName           = Game1.getCharacterFromName("Robin", false);
            LocalizedContentManager content = Game1.content;
            string path = str1;

            object[] objArray = new object[2]
            {
                (object)(LocalizedContentManager.CurrentLanguageCode == LocalizedContentManager.LanguageCode.de ? this.CurrentBlueprint.displayName : this.CurrentBlueprint.displayName.ToLower()),
                null
            };
            int    index = 1;
            string str2;

            if (LocalizedContentManager.CurrentLanguageCode != LocalizedContentManager.LanguageCode.de)
            {
                if (LocalizedContentManager.CurrentLanguageCode != LocalizedContentManager.LanguageCode.pt && LocalizedContentManager.CurrentLanguageCode != LocalizedContentManager.LanguageCode.es)
                {
                    str2 = ((IEnumerable <string>) this.CurrentBlueprint.displayName.ToLower().Split(' ')).Last <string>();
                }
                else
                {
                    str2 = ((IEnumerable <string>) this.CurrentBlueprint.displayName.ToLower().Split(' ')).First <string>();
                }
            }
            else
            {
                str2 = ((IEnumerable <string>)((IEnumerable <string>) this.CurrentBlueprint.displayName.Split(' ')).Last <string>().Split('-')).Last <string>();
            }
            objArray[index] = (object)str2;
            string dialogue = content.LoadString(path, objArray);

            Game1.drawDialogue(characterFromName, dialogue);
        }
示例#30
0
        public new void robinConstructionMessage()
        {
            this.exitThisMenu(true);
            Game1.player.forceCanMove();
            if (this.magicalConstruction)
            {
                return;
            }
            string str1 = "Data\\ExtraDialogue:Robin_" + (this.upgrading ? "Upgrade" : "New") + "Construction";

            if (Utility.isFestivalDay(Game1.dayOfMonth + 1, Game1.currentSeason))
            {
                str1 += "_Festival";
            }
            if (this.CurrentBlueprint.daysToConstruct <= 0)
            {
                Game1.drawDialogue(Game1.getCharacterFromName("Robin", false), Game1.content.LoadString("Data\\ExtraDialogue:Robin_Instant", LocalizedContentManager.CurrentLanguageCode == LocalizedContentManager.LanguageCode.de ? (object)this.CurrentBlueprint.displayName : (object)this.CurrentBlueprint.displayName.ToLower()));
            }
            else
            {
                NPC characterFromName           = Game1.getCharacterFromName("Robin", false);
                LocalizedContentManager content = Game1.content;
                string path = str1;
                string str2 = LocalizedContentManager.CurrentLanguageCode == LocalizedContentManager.LanguageCode.de ? this.CurrentBlueprint.displayName : this.CurrentBlueprint.displayName.ToLower();
                string str3;
                switch (LocalizedContentManager.CurrentLanguageCode)
                {
                case LocalizedContentManager.LanguageCode.pt:
                case LocalizedContentManager.LanguageCode.es:
                    str3 = ((IEnumerable <string>) this.CurrentBlueprint.displayName.ToLower().Split(' ')).First <string>();
                    break;

                case LocalizedContentManager.LanguageCode.de:
                    str3 = ((IEnumerable <string>)((IEnumerable <string>) this.CurrentBlueprint.displayName.Split(' ')).Last <string>().Split('-')).Last <string>();
                    break;

                default:
                    str3 = ((IEnumerable <string>) this.CurrentBlueprint.displayName.ToLower().Split(' ')).Last <string>();
                    break;
                }
                string dialogue = content.LoadString(path, (object)str2, (object)str3);
                Game1.drawDialogue(characterFromName, dialogue);
            }
        }