Example #1
0
 private void GameLoop_GameLaunched(object sender, GameLaunchedEventArgs e)
 {
     api = Helper.ModRegistry.GetApi <IMobilePhoneApi>("aedenthorn.MobilePhone");
     if (api != null)
     {
         Texture2D appIcon = Helper.Content.Load <Texture2D>(Path.Combine("assets", "app_icon_prairie.png"));
         bool      success = api.AddApp(Helper.ModRegistry.ModID + "Prairie", "Prairie King", OpenPrairieKing, appIcon);
         Monitor.Log($"loaded Prairie King app successfully: {success}", LogLevel.Debug);
         appIcon = Helper.Content.Load <Texture2D>(Path.Combine("assets", "app_icon_junimo.png"));
         success = api.AddApp(Helper.ModRegistry.ModID + "Junimo", "Junimo Kart", OpenJunimoKart, appIcon);
         Monitor.Log($"loaded Junimo Kart app successfully: {success}", LogLevel.Debug);
     }
 }
        private void AddModFunctions()
        {
            var configMenu = this.Helper.ModRegistry.GetApi <IGenericModConfigMenuApi>("spacechase0.GenericModConfigMenu");

            if (configMenu != null)
            {
                // register mod
                configMenu.Register(
                    mod: this.ModManifest,
                    reset: () => this.Config = new ModConfig(),
                    save: () => this.Helper.WriteConfig(this.Config)
                    );

                MainSection(configMenu);
                DurationSection(configMenu);
                InterestSection(configMenu);
                LegacyMoneySection(configMenu);
                AdvancedSelection(configMenu);
            }

            mobileApi = this.Helper.ModRegistry.GetApi <IMobilePhoneApi>("aedenthorn.MobilePhone");
            if (mobileApi != null)
            {
                Texture2D appIcon = Helper.ModContent.Load <Texture2D>(Path.Combine("assets", "app_icon.png"));
                bool      success = mobileApi.AddApp(Helper.ModRegistry.ModID, "Loans", () => StartBorrow(1, "Key_Amount"), appIcon);
                Monitor.Log($"loaded phone app successfully: {success}", LogLevel.Debug);
            }
        }
Example #3
0
 private void GameLoop_GameLaunched(object sender, StardewModdingAPI.Events.GameLaunchedEventArgs e)
 {
     api = Helper.ModRegistry.GetApi <IMobilePhoneApi>("aedenthorn.MobilePhone");
     if (api != null)
     {
         Texture2D appIcon = Helper.Content.Load <Texture2D>(Path.Combine("assets", "app_icon.png"));
         bool      success = api.AddApp(Helper.ModRegistry.ModID, "Random Quote", ShowRandomQuote, appIcon);
         Monitor.Log($"loaded phone app successfully: {success}", LogLevel.Debug);
     }
 }
Example #4
0
        public static void HookToMobilePhoneMod(object sender, StardewModdingAPI.Events.GameLaunchedEventArgs e)
        {
            IMobilePhoneApi api = Data.Helper.ModRegistry.GetApi <IMobilePhoneApi>("aedenthorn.MobilePhone");

            if (api != null)
            {
                Texture2D appIcon = Data.Helper.Content.Load <Texture2D>(System.IO.Path.Combine("assets", "mpmIcon.png"));
                bool      success = api.AddApp(Data.Helper.ModRegistry.ModID, "Recurring Reminders", ModEntry.ShowReminderMenu, appIcon);
                Data.Monitor.Log($"Loaded phone app successfully: {success}", LogLevel.Debug);
            }
        }
Example #5
0
 private void GameLoop_GameLaunched(object sender, GameLaunchedEventArgs e)
 {
     api = Helper.ModRegistry.GetApi <IMobilePhoneApi>("aedenthorn.MobilePhone");
     if (api != null)
     {
         Texture2D appIcon = Helper.Content.Load <Texture2D>(Path.Combine("assets", "app_icon.png"));
         bool      success = api.AddApp(Helper.ModRegistry.ModID, "Audio Player", OpenAudioPlayer, appIcon);
         Monitor.Log($"loaded app successfully: {success}", LogLevel.Debug);
     }
     MakeTextures();
 }
Example #6
0
 private void GameLoop_GameLaunched(object sender, GameLaunchedEventArgs e)
 {
     api = Helper.ModRegistry.GetApi <IMobilePhoneApi>("aedenthorn.MobilePhone");
     if (api != null)
     {
         Texture2D appIcon;
         bool      success;
         appIcon = Helper.Content.Load <Texture2D>(Path.Combine("assets", "app_icon.png"));
         success = api.AddApp(Helper.ModRegistry.ModID, Helper.Translation.Get("television"), OpenTelevision, appIcon);
         Monitor.Log($"loaded app successfully: {success}", LogLevel.Debug);
     }
 }
Example #7
0
 private void GameLoop_GameLaunched(object sender, GameLaunchedEventArgs e)
 {
     api = Helper.ModRegistry.GetApi <IMobilePhoneApi>("aedenthorn.MobilePhone");
     if (api != null)
     {
         Texture2D appIcon;
         bool      success;
         if (Config.EnableCatalogue)
         {
             appIcon = Helper.Content.Load <Texture2D>(Path.Combine("assets", "app_icon_catalogue.png"));
             success = api.AddApp(Helper.ModRegistry.ModID + "Catalogue", Helper.Translation.Get("catalogue"), OpenCatalogue, appIcon);
             Monitor.Log($"loaded catalogue app successfully: {success}", LogLevel.Debug);
         }
         if (Config.EnableFurnitureCatalogue)
         {
             appIcon = Helper.Content.Load <Texture2D>(Path.Combine("assets", "app_icon_furniture_catalogue.png"));
             success = api.AddApp(Helper.ModRegistry.ModID + "FurnitureCatalogue", Helper.Translation.Get("furniture-catalogue"), OpenFurnitureCatalogue, appIcon);
             Monitor.Log($"loaded furniture catalogue app successfully: {success}", LogLevel.Debug);
         }
     }
 }
Example #8
0
 private void OnGameLaunched(object sender, GameLaunchedEventArgs e)
 {
     if (Config.EnableMobileApp)
     {
         api = Helper.ModRegistry.GetApi <IMobilePhoneApi>("aedenthorn.MobilePhone");
         if (api != null)
         {
             Texture2D appIcon;
             bool      success;
             appIcon = Helper.Content.Load <Texture2D>(Path.Combine("assets", "app_icon.png"));
             success = api.AddApp(Helper.ModRegistry.ModID, Helper.Translation.Get("app-name"), OpenApp, appIcon);
             Monitor.Log($"loaded app successfully: {success}", LogLevel.Debug);
             JoJa84PlusApp.Initialize(Helper, Monitor, Config, api);
         }
     }
 }
        /* code used from
         *      https://github.com/spacechase0/StardewValleyMods/tree/develop/GenericModConfigMenu#for-c-mod-authors
         *      https://www.nexusmods.com/stardewvalley/articles/467
         */
        /// <summary>Sets up the mod config menu on launch</summary>
        private void OnGameLaunched(object sender, GameLaunchedEventArgs e)
        {
            // Generic Mod Config Menu stuff here
            // get Generic Mod Config Menu's API (if it's installed)
            var configMenu = this.Helper.ModRegistry.GetApi <IGenericModConfigMenuApi>("spacechase0.GenericModConfigMenu");

            if (configMenu is null)
            {
                return;
            }

            // register mod
            configMenu.Register(
                mod: this.ModManifest,
                reset: () => this.Config = new ModConfig(),
                save: () => this.Helper.WriteConfig(this.Config)
                );

            // add boolean option
            configMenu.AddBoolOption(
                mod: this.ModManifest,
                name: () => "Blue title instead of default",
                tooltip: () => "The title in the pop up menu will be blue if true and default text color if false",
                getValue: () => this.Config.BlueNotDefaultTitle,
                setValue: value => this.Config.BlueNotDefaultTitle = value
                );

            // add KeyBindList option
            configMenu.AddKeybindList(
                mod: this.ModManifest,
                name: () => "Menu Keybind",
                tooltip: () => "The keybind to click to open up the menu",
                getValue: () => this.Config.ToggleKey,
                setValue: value => this.Config.ToggleKey = value
                );

            // add boolean option
            configMenu.AddBoolOption(
                mod: this.ModManifest,
                name: () => "Only usable with Mobile Phone",
                tooltip: () => "If this is true, the keybind hotkey is disabled, making it only openable via the Mobile Phone mod. Essentially, this just disables the keybind activation. Restart your game for this to take effect.",
                getValue: () => this.Config.OnlyUsableWithPhone,
                setValue: value => this.Config.OnlyUsableWithPhone = value
                );

            // Mobile Phone app stuff here
            IMobilePhoneApi api = Helper.ModRegistry.GetApi <IMobilePhoneApi>("aedenthorn.MobilePhone");

            if (api != null)
            {
                void setSMKAsMenu()
                {
                    api.SetAppRunning(true);
                    Game1.activeClickableMenu = new SMKMenu(this.helper, this.Config, true);
                }

                Texture2D appIcon = Helper.Content.Load <Texture2D>(System.IO.Path.Combine("assets", "SMKApp.png"));
                bool      success = api.AddApp(Helper.ModRegistry.ModID, "Stardew Media Keys", setSMKAsMenu, appIcon);
                Monitor.Log($"loaded phone app successfully: {success}", LogLevel.Debug);
            }
        }