Exemple #1
0
        public override void OnConstruction(IPlatoHelper helper, object linkedObject)
        {
            base.OnConstruction(helper, linkedObject);
            SaveIndex.ValidateIndex();
            CheckParentSheetIndex();

#if ANDROID
            if (Base?.heldObject.Value is StardewValley.Object obj && obj.netName.Value.Split(';') is string[] split && split.Length > 1)
            {
                Base?.heldObject.Set(ComicBook.GetNew(split[1]));
            }
        public override void Entry(IModHelper helper)
        {
            config = helper.ReadConfig <Config>();

            assetManager = new AssetManager(helper);

            AssetManager.LoadImagesInShop = config.loadCoversInShop;

            helper.ConsoleCommands.Add("comics", "", (s, p) =>
            {
                var itemPriceAndStock = new Dictionary <ISalable, int[]>();

                foreach (Issue issue in assetManager.LoadIssuesForToday(p.Length > 0 && !string.IsNullOrEmpty(p[0]) && int.TryParse(p[0], out int year) ? year : config.baseYear, Game1.stats.DaysPlayed))
                {
                    itemPriceAndStock.Add(Frame.GetNew(ComicBook.GetNew(issue.Id.ToString())), new int[] { 100, 1 });
                }

                OpenComicsShop(itemPriceAndStock);
            });
        public override void OnConstruction(IPlatoHelper helper, object linkedObject)
        {
            base.OnConstruction(helper, linkedObject);
            SaveIndex.ValidateIndex(Base?.parentSheetIndex.Value ?? -1);
            Data?.Set("IsComicFrameObject", true);
            CheckParentSheetIndex();

            if (!(Base?.heldObject.Value is StardewValley.Object))
            {
                if (Data != null && Data.TryGet("ComicId", out string comicId))
                {
                    Base?.heldObject.Set(ComicBook.GetNew(comicId));
                }
                else
                {
                    Base?.heldObject.Set(ComicBook.GetNew("216384"));
                }
            }

            Base?.updateDrawPosition();
        }