Compare commits

...

258 Commits

Author SHA1 Message Date
janavarr95 0129d292d3 Hopefully fixed the whole no birthday messages for npcs. 2020-01-27 15:02:58 -08:00
Joshua Navarro e6843e7094
Merge pull request #59 from janavarro95/SMAPI3.0
Finally commited work for fixes to Happy Birthday and Save Anywhere.
2020-01-27 15:01:12 -08:00
janavarr95 799ece0d6f Trying to mess with mods to see if I can fix this. 2020-01-27 14:59:37 -08:00
JoshuaNavarro 9584d2e247 Finally commited work for fixes to Happy Birthday and Save Anywhere. 2019-12-30 21:37:42 -08:00
Joshua Navarro 56313d7505
Merge pull request #58 from janavarro95/SMAPI3.0
Smapi3.0
2019-12-13 16:06:45 -08:00
JoshuaNavarro 1453812b50 Finished all of the updates for the SDV 1.4 update! 2019-12-13 16:00:06 -08:00
JoshuaNavarro b4b1f79816 Finished happy birthday update. 2019-12-10 17:16:25 -08:00
JoshuaNavarro ad88e5537d finished sams event. 2019-12-10 15:33:41 -08:00
JoshuaNavarro 64ffd48c8d Elliott birthday finished. 2019-12-10 15:08:01 -08:00
JoshuaNavarro c4864c3e15 Harvey party finished. 2019-12-09 19:02:24 -08:00
JoshuaNavarro ba00754be1 Finished emily birthday event. 2019-12-09 18:12:29 -08:00
JoshuaNavarro 4e0662abe9 Finished abigails party. 2019-12-07 18:27:34 -08:00
JoshuaNavarro 50151b2e69 Finished Leah friendship event. Added in some utility command for friendship for Stardust Core. 2019-12-07 17:54:49 -08:00
JoshuaNavarro c69c05aa93 Added in the events for Maru and Sebastian. 2019-12-07 17:09:40 -08:00
JoshuaNavarro 4c4fc7900b Fixed a bunch of npc event issues. Also finished the penny dating party. 2019-12-06 20:59:05 -08:00
JoshuaNavarro 765e0860ce Finished the junimo birthday event. 2019-12-06 19:38:13 -08:00
JoshuaNavarro e4913d9720 Got junimos to walk in circles. ._. 2019-12-06 19:13:30 -08:00
JoshuaNavarro fe794e7861 Made it where birthday events can repeat. 2019-12-06 15:26:16 -08:00
JoshuaNavarro 3da95865a3 Finished the skeleton of the CC_Junimo birthday event and added in trnaslated string spots for the junimo birthday letter. 2019-12-06 15:18:23 -08:00
JoshuaNavarro 650bfdc84b Added in all of the event requirements for the community center birthday event. 2019-12-06 15:04:48 -08:00
JoshuaNavarro aed54a63ff Fixed animation code not working. 2019-12-06 14:05:58 -08:00
JoshuaNavarro 69170b6d54 Finally fixed concurrent events. Also added in a hex dumper to get all of the sound cues for the sound bank. 2019-12-06 13:31:10 -08:00
JoshuaNavarro 373773906d Added in more functionallity for junimos and moving actors in an event. 2019-12-06 12:09:31 -08:00
JoshuaNavarro 2609f3339a Fixed continuous events causing an error when finished. Found out code to add in junimos as actors. 2019-12-06 11:34:58 -08:00
JoshuaNavarro b553aff0d2 Added in a few more preconditions. Time to make events. 2019-12-05 17:30:42 -08:00
JoshuaNavarro 03e338e279 Cleaned concurrent actions when starting a new event and if an event finishes. 2019-12-05 02:09:31 -08:00
JoshuaNavarro b184c654f4 Added way to run events concurrently so that things like viewport panning can happen at the same time as something else. 2019-12-05 01:40:29 -08:00
JoshuaNavarro 1b1b6d227a Moved events from HappyBirthday to StardustCore. Wrote extension system for flexibility. Added way to add in custom commands for events. 2019-12-05 01:25:46 -08:00
JoshuaNavarro f11ce9bb2f Made some functions that are a little easier to use for npc and farmer movement. 2019-12-04 22:36:53 -08:00
JoshuaNavarro 7c8d0bc6bd Added in fade commands for event helper. 2019-12-04 22:08:00 -08:00
JoshuaNavarro f5db7501f4 Got the set up for events! Now to make them!. 2019-12-04 18:14:45 -08:00
JoshuaNavarro 267ed77092 Finished adding in what seemed to be important events. 2019-12-04 16:50:23 -08:00
JoshuaNavarro ca61342f98 Even more event actions. 2019-12-04 16:05:19 -08:00
JoshuaNavarro 381c13f67f Added more comamnds for events. 2019-12-04 15:12:46 -08:00
JoshuaNavarro e190c9e664 Added in more event data to the event helper class. 2019-12-04 14:11:38 -08:00
JoshuaNavarro 7e17ae90a7 Added in protected fields for event helper. 2019-12-04 13:41:45 -08:00
JoshuaNavarro 71ca6a1938 Finished wrapping all of the event data. Now just need to add in the actions for the event. 2019-12-04 13:33:38 -08:00
JoshuaNavarro 0db4c5452c Added in a location pre-condition for the event. 2019-12-04 13:28:50 -08:00
JoshuaNavarro f450efdcc7 Added in precondition checks for events. Also added in special birthday precondition events. 2019-12-04 13:24:21 -08:00
JoshuaNavarro b550f66233 Figured out clean way to do event actions. Yay. 2019-12-04 01:33:28 -08:00
JoshuaNavarro b5b6f500f9 Added in code to get the sdv event from the event helper. 2019-12-04 01:08:29 -08:00
JoshuaNavarro ac5e291492 Finished moving events to a seperate class for more flexibility. 2019-12-04 01:04:20 -08:00
JoshuaNavarro 717900d3e3 Stared work on event system. 2019-12-04 00:03:31 -08:00
JoshuaNavarro f4060c8c88 Updated happy birthday mod to have all translation issues fixed. Ready for release but I need to add in the secret sauce. 2019-12-02 20:54:30 -08:00
JoshuaNavarro 612bb94cbd Finished translation of birthday menu. 2019-12-02 20:18:43 -08:00
JoshuaNavarro e7e1ff2de5 Changed a few words to pull from SDV translation files instead of having users provide the translations. 2019-12-02 19:33:32 -08:00
JoshuaNavarro 059b2d57be HUGE bug fix to Happy Birthday mod. Fixes many bugs from hardcoded strings, to no spouse messages, to cleaning up translation folder. 2019-12-02 19:10:56 -08:00
JoshuaNavarro 3d50d2e38a Updates to happy birthday to fix some bugs. Also started making spouse messages. 2019-12-01 20:47:31 -08:00
JoshuaNavarro 28adb69bbc Updated night owl and fixed a SSR bug. 2019-12-01 18:37:36 -08:00
JoshuaNavarro dca4d497bb Finished making locational assets for specific locations. There are still some that don't exist but it should be fine. 2019-12-01 16:23:01 -08:00
JoshuaNavarro d28c210d9b Added in club graphic for SSR. 2019-11-29 15:58:25 -08:00
JoshuaNavarro 9c12eedefb Added in cellar graphic for locations for SSR. 2019-11-29 15:55:29 -08:00
JoshuaNavarro 4dc641afce Added in more location graphics for SSR. 2019-11-29 15:51:46 -08:00
JoshuaNavarro c3c467b818 Added in graphic for beach night market for SSR. 2019-11-29 15:38:56 -08:00
JoshuaNavarro eb0d681abe Added in the beach sprite for SSR locations. 2019-11-29 15:31:39 -08:00
JoshuaNavarro 49267030a5 Added in more images for locations for SSR. 2019-11-29 14:54:03 -08:00
JoshuaNavarro 3ce3f57220 Fixed calendar spelling, updated more rain, retired some mods, and updated more mods to be 1.4 compatible. Starded touching up StardewSymphony. 2019-11-29 14:22:20 -08:00
Joshua Navarro d77df1f88c
Merge pull request #56 from janavarro95/PyTKOverhaul
Merged all pytk overhaul branch with development branch. Getting ready for merging all to master branch.
2019-11-27 15:13:41 -08:00
JoshuaNavarro 20acb522ef Updated pathos api package to 3.0 and started updating mods to SMAPI 3.0. Fixed AdvancedSaveBackup and AutoSpeed so far. 2019-11-27 15:10:55 -08:00
JoshuaNavarro 89ef844ab3 Fixed crafting not working for player inventory. Fixed machine summary menu crashing when displaying empty tanks. Fixed animaation managers not copying over correctly. 2019-10-09 00:18:45 -07:00
JoshuaNavarro 106b7a9474 Added in windmills. Also fixed machine summary menu crashing when fluid manager doesn't set fluid tanks on initialization. 2019-10-08 13:01:58 -07:00
JoshuaNavarro 70518a1d38 Updated machine summary menu to hide fluid tanks with no relevance to that machine. 2019-10-08 11:44:43 -07:00
JoshuaNavarro 5604f46a74 Updated the crafting menu to have an extra display box for all of the ingredients. 2019-10-08 11:23:21 -07:00
JoshuaNavarro 53428ae962 Fixed random space infront of non dyed object names when config enables dyed object names. 2019-10-05 18:57:03 -07:00
JoshuaNavarro 6c7f0e8099 Added in steam engine. Updated fluid graph search from output tanks for better optimization. 2019-10-03 23:42:16 -07:00
JoshuaNavarro 09c32bf96f Added in config options for how much water the steam boiler requires per 10 min and how much steam it produces per operation. 2019-09-25 16:12:42 -07:00
JoshuaNavarro 720ac67216 Added in recipe for fluid pump and steam boiler. 2019-09-25 16:09:23 -07:00
JoshuaNavarro 1acfc40639 Added in recipes for chainsaw and mining drill. 2019-09-25 16:03:54 -07:00
JoshuaNavarro 9dfe8a3783 Added in the recipe for the grinder. 2019-09-25 15:56:32 -07:00
JoshuaNavarro 90523d61da Added in the recipes for the capacitor and the charging station. 2019-09-25 15:48:57 -07:00
JoshuaNavarro 54e560f4a2 Added in recipes for battery bin and lighthouse. 2019-09-25 15:41:35 -07:00
JoshuaNavarro 57665d5e8c Added in recipe for solar panel tier 1 and solar array tier 1. 2019-09-25 15:27:40 -07:00
JoshuaNavarro 822ef651f5 Added in recipe for the sandbox. 2019-09-25 15:17:53 -07:00
JoshuaNavarro 486529f250 Added in alloy furnace and iron pipe recipes to crafting tables. 2019-09-25 15:15:08 -07:00
JoshuaNavarro b41da3b9de Made it so that custom mod tools could be trashed. 2019-09-25 15:05:35 -07:00
JoshuaNavarro 32e1c9d3ac Added in pipes and added some optimization checks to searching out energy and fluid networks. 2019-09-25 15:02:58 -07:00
JoshuaNavarro ecfc595751 Fixed fluid manager not transporting fluids. Added in steam boiler, water, and steam. 2019-09-24 17:31:33 -07:00
JoshuaNavarro 43eb60e9b9 Added in fluids to resource manager. Got fluid pump able to be placed in water, added in infinite reach for placing custom objects. 2019-09-24 15:18:57 -07:00
JoshuaNavarro 0a676166f5 implemented code to search out fluids in the network. 2019-09-23 18:13:45 -07:00
JoshuaNavarro a33a39a785 Renamed liquid manager to fluid manager for correctness. 2019-09-23 17:33:28 -07:00
JoshuaNavarro d8b144eac9 Rewrote the liquid manager to be way more managable. Will implement later. 2019-09-22 16:58:56 -07:00
JoshuaNavarro 95593e93ed Created liquid manager. Will test later. 2019-09-22 15:27:15 -07:00
JoshuaNavarro 68bfaa38c9 Fixed tools serialization. Also made modded tools able to be trashed. 2019-09-22 11:49:25 -07:00
JoshuaNavarro caa7653b32 Finally added in the alloy furnace. I think all machines should serialize now. 2019-09-22 11:12:07 -07:00
JoshuaNavarro 4eda84e57d NO MORE MULTIPLAYER. This is my last stardew wish and I'll make what I can. 2019-09-22 02:32:59 -07:00
JoshuaNavarro 0d373b5d83 Probably going to quit. Multiplayer can't sync inventories effectively so what's the point? 2019-09-22 00:18:48 -07:00
JoshuaNavarro 1c6e04929c Added in the mining drill. 2019-09-21 18:48:21 -07:00
JoshuaNavarro 3ca7468fb9 Robin now sells sand and clay. 2019-09-21 17:07:02 -07:00
JoshuaNavarro f0cd3ec80e Added in the chainsaw which chops trees using electricity. 2019-09-21 16:57:23 -07:00
JoshuaNavarro 885436c2b2 Couldn't figure out dagger animation for drill. Instead settled for regular pickaxe animation which is odd looking but works. 2019-09-21 15:59:40 -07:00
JoshuaNavarro d37606844b Adjusted drill power rate to be 1+upgrade level for more balance. 2019-09-21 14:42:49 -07:00
JoshuaNavarro 259f386471 Added in the mining drill, fixed charging station not working, and fixed tool descriptions. 2019-09-21 14:39:16 -07:00
JoshuaNavarro c0ecee5d9d Added in the grinder which grinds ores into sand for ore doubling. 2019-09-19 19:07:15 -07:00
JoshuaNavarro d059017a72 Added in ore sand variants that can be smelted into ore bars. 2019-09-19 17:32:44 -07:00
JoshuaNavarro 7209fec308 Added in dust variations of ore which can be used to double ore when smelted. 2019-09-19 17:03:29 -07:00
JoshuaNavarro b76a5ef39d Added in charging station. 2019-09-19 15:44:02 -07:00
JoshuaNavarro f93fac1637 Added in capacitor. 2019-09-19 14:44:46 -07:00
JoshuaNavarro 0d252799de Inverted all colors in ColorsList, added in ColorManager which deals with blending dyed objects, and prevented objects with different dyes from being stacked on each other. 2019-09-18 22:55:06 -07:00
JoshuaNavarro cd87139168 Fixed dyed color display name from showing. 2019-09-18 17:42:22 -07:00
JoshuaNavarro e20d593c7f Added in dye option. WIP. 2019-09-18 17:33:45 -07:00
JoshuaNavarro 0de19a904f Added in hover bubble for machines which displays when they are full. Also made a config to adjust alpha and if it displays. 2019-09-18 15:05:51 -07:00
JoshuaNavarro 620c1b4b70 Added ability to see how much inventory space remains on summary menu. Also made machines unable to produce items if inventory is full. 2019-09-18 14:30:37 -07:00
JoshuaNavarro 505eaf1c2f Got the machine summary menu to display energy consumed/produced per 10 mins. 2019-09-18 14:13:11 -07:00
JoshuaNavarro 3251d194f7 Fixed the display/ transfer code for inventory transfer menus to display proper inventory bounds. 2019-09-18 13:51:42 -07:00
JoshuaNavarro ea100b1084 Added in wires, the battery bin, fixed machines not consuming energy. 2019-09-18 13:05:31 -07:00
JoshuaNavarro 72da92e842 Added in the lighthouse. <3 2019-09-16 21:53:21 -07:00
JoshuaNavarro 5435157853 Added in glass. 2019-09-16 19:17:23 -07:00
JoshuaNavarro 45aad966c0 Added in status for time remaining for the machine summary menu. 2019-09-16 16:33:19 -07:00
JoshuaNavarro fcf27bdc52 Added in solar pannels and fixed the energy display meter on the machine summary menu. 2019-09-16 15:48:26 -07:00
JoshuaNavarro 5e5c15f692 Updated machine inventory menu to update when an item is crafted. 2019-09-11 22:59:39 -07:00
JoshuaNavarro 048dfc9dc0 Fixed crafting menu multi tiled objects not displaying. 2019-09-11 22:48:38 -07:00
JoshuaNavarro a2b66afb65 Added in crafting menu for machines. For some reason though custom obbjects are broken in crafting menus. 2019-09-11 18:04:12 -07:00
JoshuaNavarro 1a63bcc34d Got the general machine menu tabs to look better with summary and inventory menus. Also fixed inventory transfer menu messing up inventories and not adding things in when they should. 2019-09-11 16:02:55 -07:00
JoshuaNavarro c7b6ba8495 Started work on the machine summary menu. 2019-09-11 14:40:22 -07:00
JoshuaNavarro 82d4fceabf Adjusted sandbox to only produce 1 sand every hour instead of every 10 minutes. 2019-09-09 16:08:49 -07:00
JoshuaNavarro 0f5eb5b60b Added in sand as a resource and made the sandbox generate sand. 2019-09-09 16:07:39 -07:00
JoshuaNavarro 877e40ae39 Added in simple machines and tested to make sure they produce items. They do for non-energy consuming items. Also added in the sandbox which is a wip. 2019-09-09 15:44:25 -07:00
JoshuaNavarro a89cbc2c82 Started work on energy graph searching. Hoping the performance is decent. 2019-09-09 13:31:55 -07:00
JoshuaNavarro 50dcdf0eb6 Added in robin selling the workbench, the anvil crafting trashcans, and craftable trashcans which toss away anything put inside of them. 2019-09-07 19:04:24 -07:00
JoshuaNavarro b6a817608f Fixed bug when getting tools from object manager. Added in all of the crafting recipes for tools. 2019-09-07 15:54:45 -07:00
JoshuaNavarro f4828fae49 Renamed steel tools to be hardened tools. Added in the three new tool tiers into the object manager. 2019-09-07 15:19:33 -07:00
JoshuaNavarro 4b3b1dbaff Added in icons for tools. 2019-09-07 14:45:51 -07:00
JoshuaNavarro 9c7c3ace2a Added in working animation graphics for tools. 2019-09-07 14:03:32 -07:00
JoshuaNavarro 36e7b5e6ef Added in axes, watering cans, and hoes and default color swaps. Now to make content. 2019-09-06 15:18:12 -07:00
JoshuaNavarro a4d8a4c1a8 Figured out the logic of how to have custom pickaxes! Now to make the other tools/upgrades/recipes... 2019-09-06 14:15:54 -07:00
JoshuaNavarro 4bfdef4383 Added in the anvil recipe for the workbench. 2019-09-04 14:34:34 -07:00
JoshuaNavarro cf3029306b Added in crafting books for workbenches and other crafting tables, added in unlockable crafting recipes, and made the menu show up when innteracting with new crafting tables. 2019-09-04 14:20:05 -07:00
JoshuaNavarro 733461ecde Added in a search box which hides elements that don't match the search pattern for recipes. 2019-09-03 15:48:38 -07:00
JoshuaNavarro 010e705b6a Got crafting recipes page to sort itself. 2019-09-03 15:12:34 -07:00
JoshuaNavarro cbf2efc690 Fixed paging issue for crafting menu not going to the right page. 2019-09-03 14:22:00 -07:00
JoshuaNavarro dd4b4a0ee3 Added left and right buttons to the crafting menu. Also centered item name text. 2019-09-03 13:49:21 -07:00
JoshuaNavarro 85592f1b53 The crafting menu works but needs some polish. 2019-09-02 20:48:29 -07:00
JoshuaNavarro 5f48f54079 Added in description and required items. Needs a craft button now to complete the craft information page. Menu still needs scroll. 2019-09-02 20:13:57 -07:00
JoshuaNavarro bd03736e65 Started work on crafting menu. Still need to display all required items, a description, and a craft button. 2019-09-02 19:02:58 -07:00
JoshuaNavarro 70edc9acf0 Moved farmhand inventory recreation to MenuHacks.cs 2019-08-31 18:27:08 -07:00
JoshuaNavarro 0d760f5cfe Got farmhand inventory to be reconstructed even when farmhand is offline. 2019-08-31 18:23:47 -07:00
JoshuaNavarro a3c0e4f8a0 Stopped spamming inventory. Checked and items do sync over the net. 2019-08-31 12:19:05 -07:00
JoshuaNavarro 5be5222b19 Fixed chairs rotating too fast and allowed them to use shift-left click instead for sitting. 2019-08-31 12:08:52 -07:00
JoshuaNavarro 2dab29c6ba Added in configurable sell prices for Clint for custom ores. Fixed machines not tracking custom objects when reloading a save. 2019-08-31 11:47:15 -07:00
JoshuaNavarro 6aa741b689 Updated vocalization to detect heart events. 2019-08-29 22:32:41 -07:00
JoshuaNavarro e849e05161 Added in alloys, alloy recipes in furnace, and vocalization enabling options. 2019-08-29 21:11:34 -07:00
JoshuaNavarro b42dfffde4 Updated prismatic ore spawn chance to be actual non-testing values. 2019-08-29 19:54:58 -07:00
JoshuaNavarro 7143d4548c Added in prismatic ore vein, nugget, and furnace recipe. Also added in gemstone to nugget or shard depending on config. 2019-08-29 19:51:13 -07:00
JoshuaNavarro 44d63f0a13 Added in idea for dyed wool. 2019-08-28 21:13:51 -07:00
JoshuaNavarro 9a1fbd8ab3 Added in idea for dye machine. 2019-08-28 14:33:56 -07:00
JoshuaNavarro dae750bf7c Added in notes for mini-greenhouse idea. 2019-08-28 14:08:20 -07:00
JoshuaNavarro 288912d046 Updated all furniture and objects to sync additional data. Got items to sync better with less issues, and ore seems to not cause as many problems as I thought. 2019-08-28 12:29:51 -07:00
JoshuaNavarro acca21e511 Got multi tiled objects to sync its components so that it displays properly in the world and syncs 100 times better. 2019-08-28 00:31:14 -07:00
JoshuaNavarro a752503964 Got custom furniture to sync before and after saves! 2019-08-27 19:42:05 -07:00
JoshuaNavarro b53379736d Added syncing for custom objects before saving. 2019-08-27 19:27:34 -07:00
JoshuaNavarro 19732ad2bf Got objects to sync across locations even when not present! 2019-08-27 16:47:22 -07:00
JoshuaNavarro e0d61f19cc Got container objects to sync across the net which is good. 2019-08-27 15:10:56 -07:00
JoshuaNavarro 2f07190926 Removed debug message that had a stack trace. 2019-08-26 23:33:26 -07:00
JoshuaNavarro b5ce25d141 Added ability for custom objects to sync guids across the net! 2019-08-26 23:32:30 -07:00
JoshuaNavarro 9950a6d0c0 Better pytk sync. 2019-08-26 21:46:36 -07:00
JoshuaNavarro 94d1595efa Updatedd CustomObject to have proper sell price and semi sync over the net. 2019-08-26 21:14:37 -07:00
JoshuaNavarro 50b77b44e2 URevert "Fixed vanilla machines not rendering CustomObject(s) when finished producing."
This reverts commit f3f4f4da27.
2019-08-26 16:34:03 -07:00
JoshuaNavarro 36528407ba Revert "Fixed vanilla machines not rendering CustomObject(s) when finished producing."
This reverts commit f3f4f4da27.
2019-08-24 15:21:15 -07:00
JoshuaNavarro 36e657db5b Revert "Fixed vanilla machines not rendering CustomObject(s) when finished producing."
This reverts commit f3f4f4da27.
2019-08-24 15:20:26 -07:00
JoshuaNavarro d5b16d96de Revert "Fixed vanilla machines not rendering CustomObject(s) when finished producing."
This reverts commit f3f4f4da27.
2019-08-24 15:19:00 -07:00
JoshuaNavarro e1a9644128 Revert "Fixed vanilla machines not rendering CustomObject(s) when finished producing."
This reverts commit f3f4f4da27.
2019-08-24 15:16:24 -07:00
JoshuaNavarro 0f7252e2c5 network experiment: failure. Focusing on single player experience. 2019-08-24 15:14:10 -07:00
JoshuaNavarro b70b4f1813 More netcode updates. 2019-08-23 14:46:07 -07:00
JoshuaNavarro 6d2d31ce23 Re-enabled simple multiplayer support on revitalize but there would be a TON to do still to fully support it. 2019-08-23 14:28:33 -07:00
JoshuaNavarro f3f4f4da27 Fixed vanilla machines not rendering CustomObject(s) when finished producing. 2019-08-22 21:38:22 -07:00
JoshuaNavarro f194b5eb4f Added in ores to be bought from Clints shop. Added in the rest of the vanilla furnace ingot smelting recipes. 2019-08-22 20:04:49 -07:00
JoshuaNavarro a558c15f26 Added in remaining ore veins, added in tin ore to ingot recipe for smelting, added in ingots. 2019-08-22 19:09:58 -07:00
JoshuaNavarro 449c3a99ae Updated tin ore vein graphic. 2019-08-22 16:34:28 -07:00
JoshuaNavarro 1d07d15ac8 Updated missing pixel on tin ore and named the information appropriately. 2019-08-22 16:32:40 -07:00
JoshuaNavarro a09a246153 Added in new ore/ingot images for ore resource. Removed test ore and the pancakes that spawned. 2019-08-22 16:30:22 -07:00
JoshuaNavarro b65fdeb38d Updated inventory manager to have bug fixes, added in vanilla recipe and recipe books for adding in custom recipes to vanilla furnaces. 2019-08-22 13:43:11 -07:00
JoshuaNavarro 9d3be07daa Got items to be loaded back into player's inventory upon loading a save file. 2019-08-21 20:17:27 -07:00
JoshuaNavarro c7770cb8d7 Fixed more serialization issues. Now to figure out how to get items back to player inventories.... 2019-08-21 20:03:16 -07:00
JoshuaNavarro b24420d368 Fixed serilaization issues with not properly reserializing files back into the world. 2019-08-21 19:06:17 -07:00
JoshuaNavarro bfb0194a66 Updated all items to properly use the price set in BasicItemInformation.cs which allows them to be shipped now. 2019-08-21 01:39:06 -07:00
JoshuaNavarro 14fb72fdb9 Added in tin ore and made ore be stored in ResourceManager.cs 2019-08-16 17:19:20 -07:00
JoshuaNavarro ff9aa226f7 Added some documentation, made it so BasicItemInformation, LightManager, and InventoryManager make copies of themselves per new item fixing a duplication glitch. Updated all objects to use the new copy function for BasicItemInformation. 2019-08-16 15:32:14 -07:00
JoshuaNavarro 0cbae77d28 Fixed serialization item converter to have MUCH nicer output for serializing SDV items. Also removed unnecessary TileLocation field from BasicItemInformation.cs 2019-08-16 14:35:40 -07:00
JoshuaNavarro c51ffa84b6 Got ores to spawn rock debris when broken. 2019-08-16 12:47:27 -07:00
JoshuaNavarro eb5231e81a Added in shake timer for ore veins. 2019-08-16 12:39:27 -07:00
JoshuaNavarro 16d35e2d42 Got ores spawning on the farm, finished resource manager statistics, and made ore use proper health values. 2019-08-16 12:26:50 -07:00
JoshuaNavarro 01cc1d29ec Updated oreResourceInfo class to have more statistics for farm, quarry, skull cave, and mine as well as including functions for checking floors to spawn/exlucde on. 2019-08-15 20:32:12 -07:00
JoshuaNavarro 5ce0e5fb19 Got ore spawning in the quarry! 2019-08-14 21:14:13 -07:00
JoshuaNavarro 8f16593894 Updated resource info to have extra spawn items and made the mine spawn code only spawn ores per unvisited floor pe visit and gets cleared when leaving the mine. (I.E on a mine reset.) 2019-08-14 20:21:44 -07:00
JoshuaNavarro 47c50b6c18 Upgraded resources to have spawn and drop chance. 2019-08-14 14:32:22 -07:00
JoshuaNavarro 5cf0211339 Updated ore spawning to use better handling for floor ranges and easier to add in more varieties. 2019-08-13 23:06:51 -07:00
JoshuaNavarro 768e09cf43 Got the code working for ores to properly spawn in the mine! 2019-08-13 20:13:27 -07:00
JoshuaNavarro 9b8c469eb6 Fixed ore vein spawning code to spawn ores in the correct spot now. 2019-08-13 19:26:20 -07:00
JoshuaNavarro ce904efef3 Reworked object pools to be more sorted out. Also added in ore veins! 2019-08-13 19:05:11 -07:00
JoshuaNavarro 746d1e1613 More comments on future plans. 2019-08-05 23:46:06 -07:00
JoshuaNavarro 1a6ee664b7 Added in storage furniture! 2019-08-05 23:10:56 -07:00
JoshuaNavarro d6fa1672db Finished the work for the first stage of the item transfer menu! 2019-08-05 21:19:56 -07:00
JoshuaNavarro b022947542 Added in hover display text to the inventory menu. 2019-08-05 18:03:52 -07:00
JoshuaNavarro 5af8e025bd Added in arcade cabinet type. Added in seaside scramble. 2019-07-25 17:16:14 -07:00
JoshuaNavarro 9ab33bba38 Added in the icicle gun! 2019-07-24 18:37:43 -07:00
JoshuaNavarro c7633a2a04 Added in a gun manager for easier assignment of guns. Also added in heatwave a gun that spawns fire like crazy. 2019-07-24 17:24:36 -07:00
JoshuaNavarro d0b9b1f1cd Added in game modes for Revitalize. Also fixed bug where players wouldn't update when moving left. 2019-07-24 14:51:12 -07:00
JoshuaNavarro bda8c38c7d Organization+ modularity with pages for inventory menu. 2019-07-24 14:16:04 -07:00
JoshuaNavarro 9caaae43b8 Added in a simple item display menu with a search field. 2019-07-24 08:44:55 -07:00
JoshuaNavarro 87f0ddcb2c Move files and made loby screen to help transition to shooting gallery. 2019-07-23 16:15:13 -07:00
JoshuaNavarro 1c8d973a14 Made the shooting gallery map and figured out more collisions for the player. 2019-07-22 23:22:03 -07:00
JoshuaNavarro 1838c80ccb Added in kill zones but also just made it so if enemies or projectiles go too far off the map they die. Also finished making spawners for targets and reworked managers to be stored in a single entity manager. 2019-07-22 20:46:33 -07:00
JoshuaNavarro c5e4b5ecdc Finished target enemy. They now die on being hit by a projectile. Also cleaned up a debug log. 2019-07-22 17:15:23 -07:00
JoshuaNavarro 1a629e5b47 Made little target enemies and updated more collision logic for everything. 2019-07-22 16:50:49 -07:00
JoshuaNavarro a75a156757 Made status effects and a status effect manager! Also made a simple proof of concept. Needs to reposition drawing though. 2019-07-21 21:54:25 -07:00
JoshuaNavarro 75feed842c Added heart blinking animation. 2019-07-21 19:27:04 -07:00
JoshuaNavarro 0a2c1ee11b Added support for multiplayer HUDs. 2019-07-21 19:12:03 -07:00
JoshuaNavarro 76737c3c7e Added in display for reload for the gun on player's HUD. 2019-07-21 19:07:10 -07:00
JoshuaNavarro 5a2f708e08 Added in player HUD with simple health (with lerp!) and ammo display. 2019-07-21 18:52:53 -07:00
JoshuaNavarro e1553ca6d8 Updated texture string to basically be able to change it's text a lot easier. 2019-07-21 17:12:06 -07:00
JoshuaNavarro b11a37df31 Upgraded Stardust Core Textured Strings to allow for scaling and made custom sprite fonts easier to use. Also implemented super simple HUD into Seaside Scramble. 2019-07-21 16:58:57 -07:00
JoshuaNavarro fac35e0f9d Finished basic guns, fixed collision issues, added hitbox to player, and fixed slow projectiles from gun. 2019-07-20 18:39:57 -07:00
JoshuaNavarro 4ac1473d9e Finished making a basic gun and attaching it to the player! 2019-07-20 18:24:47 -07:00
JoshuaNavarro 71868bd0b6 Got projectiles and a projectile manager working! 2019-07-20 17:00:02 -07:00
JoshuaNavarro feb5302c39 Some little comments. 2019-07-20 15:15:41 -07:00
JoshuaNavarro 650a852f8a Added in support for getting proper mouse direction on player. 2019-07-20 15:11:50 -07:00
JoshuaNavarro 384d69aafe Finished character select screen! 2019-07-20 12:44:47 -07:00
JoshuaNavarro b81037bcb5 Got proper mouse movements for all characters! 2019-07-20 12:36:31 -07:00
JoshuaNavarro c3b439766e Fixed SSC controller support. Added in controllers properly working for color swaping/spawning characters. 2019-07-20 11:35:52 -07:00
JoshuaNavarro 632de2c1a3 Added in visible color selection for characters on selection screen. 2019-07-19 13:30:25 -07:00
JoshuaNavarro 0e1483605a More work on title screen. Also made animated sprite class. 2019-07-19 11:17:37 -07:00
JoshuaNavarro 7c170ade98 Got dialogue boxes working for character select screen. 2019-07-19 10:44:15 -07:00
JoshuaNavarro a63d6a88bb Small comments for where I left off. 2019-07-18 22:11:46 -07:00
JoshuaNavarro 9d58b4b15e Finished color picking for character selection screen! 2019-07-18 22:10:05 -07:00
JoshuaNavarro 7dd02b8b0d Work on character select. 2019-07-18 20:16:41 -07:00
JoshuaNavarro bac0f12dc5 Added in controller support for characters and made the menu a stack. 2019-07-18 17:16:17 -07:00
JoshuaNavarro 02e6bd7e49 Added in some blinking text and the simple title screen. 2019-07-17 16:26:37 -07:00
JoshuaNavarro a75503637d Updated stardust core animation manager to have proper play animation function. Also added in junimo walking animations. 2019-07-17 12:51:29 -07:00
JoshuaNavarro 054077e94d Added camera class and made it to update when screen size changed and center the player. 2019-07-17 12:30:08 -07:00
JoshuaNavarro 01f239f371 Changed animations and animation managers to use Stardust Core. Also started working on Seaside Scramble Lite Edition. 2019-07-17 10:18:51 -07:00
JoshuaNavarro d8e7fa3ddb MASSIVE rework of Revitalize. Seperated PyTK obj data from Revitalize data, added dependency to Stardust Core and swapped to Stardust's Tetxure2DExtended and TextureManagers. 2019-07-16 02:09:42 -07:00
JoshuaNavarro 251cf49114 Updated Happy Birthday manifest. 2019-07-07 17:22:04 -07:00
JoshuaNavarro 04b245d41a Fixed config issue when no legacy birthday files are found. 2019-07-07 17:21:01 -07:00
JoshuaNavarro 5c8a7d8abb Updated time freeze, and fixed many happy birthday bugs regarding gifts and dialogue. 2019-07-07 17:09:28 -07:00
JoshuaNavarro 9072c57013 Updated Symphony to have a way to view song conditionals as well as remove song conditionals in game. 2019-07-07 12:03:10 -07:00
JoshuaNavarro 6b172bb3e8 Adding back/next page buttons to the symphony menu. 2019-06-24 17:03:13 -07:00
JoshuaNavarro bc7cc885f7 Started displaying page numbes for numerous pages for the menu. 2019-06-24 11:23:14 -07:00
JoshuaNavarro 332358f48a Added more hover text for add button to let users know if a conditional already exists for that song or not. 2019-06-24 11:14:01 -07:00
JoshuaNavarro 9595ece1bb Finished delete functionality for Symphony menu. Added more hover text. 2019-06-24 10:44:04 -07:00
JoshuaNavarro bff69c2a96 Deleted some junk. Symphony Menu now works as intended, added save, add button, hover text, better music deciding, and wav volume support. 2019-06-22 14:37:13 -07:00
JoshuaNavarro 2252aa952a Finished restructuring of the menu. Maybe add a multi select button? 2019-06-19 15:42:22 -07:00
JoshuaNavarro 824486d3b8 Rewriting the Stardew Symphony to just be more user friendly. Everything seems to work but it can't be tested until I finish the menu. 2019-06-18 15:06:18 -07:00
JoshuaNavarro c1509c9371 Started object manager. 2019-05-23 16:53:44 -07:00
JoshuaNavarro 76aa7f7894 Got relative path searching working for texture manager. 2019-05-21 12:31:09 -07:00
JoshuaNavarro d3fc042b82 Fixed searching when not supposed to. 2019-05-21 12:19:29 -07:00
JoshuaNavarro 03d230c4af Merge branch 'Development' of https://github.com/janavarro95/Stardew_Valley_Mods into Development 2019-05-21 12:16:52 -07:00
JoshuaNavarro 072c3d511b Fully fixed the TextureManager scan this time. Issue was with the texture2DConverter.cs file. 2019-05-21 12:10:57 -07:00
JoshuaNavarro 596aedac77 Updated texture manager to support content packs but also load in textures without having to hard code them. 2019-05-20 03:05:11 -07:00
JoshuaNavarro c026702f09 Got lamps working with a furniture factory. 2019-05-17 11:04:16 -07:00
JoshuaNavarro 6c02af4596 Fixed the light manager not handling removing lights properly. Also have it so now alll CustomObjects handle lights. 2019-05-17 09:43:50 -07:00
JoshuaNavarro 05aeabed12 Fixed tables not removing items on clean up. 2019-05-16 13:00:43 -07:00
JoshuaNavarro 42f8d2595b Finally got tables working!!!!!!! 2019-05-15 23:50:24 -07:00
JoshuaNavarro e63b48ab6a Fixed tabled held object logic. 2019-05-15 22:27:38 -07:00
JoshuaNavarro 7eaaa44910 Fixed ignoring bounding boxes from letting you pick up items again. 2019-05-15 14:27:33 -07:00
JoshuaNavarro c8a1ce8e86 Added in the skeleton for tables but they don't do anything yet. Also the hack for no bounding boxes does make things super derpy for removal/placement of objects. 2019-05-15 13:43:09 -07:00
JoshuaNavarro c2f5657ef0 Got the base working for the FurnitureFactory which makes adding in new furniture objects 100000000x easier. 2019-05-15 12:42:48 -07:00
JoshuaNavarro e4c734a1d7 Forgot to clean out junk mods. However Stardew Symphony has been updated to support hourly music. 2019-05-13 10:59:26 -07:00
JoshuaNavarro e62610631d Fixed render issue on billboard where player portrait and would appear over mouse and hover text. 2019-04-11 17:25:54 -07:00
838 changed files with 48523 additions and 2481 deletions

View File

@ -66,7 +66,7 @@
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Pathoschild.Stardew.ModBuildConfig" Version="2.2.0" />
<PackageReference Include="Pathoschild.Stardew.ModBuildConfig" Version="3.0.0" />
</ItemGroup>
<ItemGroup>
<Reference Include="System" />

View File

@ -1,10 +1,10 @@
{
"Name": "Advanced Save Backup",
"Author": "Alpha_Omegasis",
"Version": "1.7.0",
"Version": "1.7.1",
"Description": "Backs up your save files when loading SMAPI and every in game night when saving.",
"UniqueID": "Omegasis.AdvancedSaveBackup",
"EntryDll": "AdvancedSaveBackup.dll",
"MinimumApiVersion": "2.10.1",
"MinimumApiVersion": "3.0.0",
"UpdateKeys": [ "Nexus:435" ]
}

View File

@ -1,3 +1,5 @@
using System.Collections.Generic;
using System.Linq;
using Omegasis.AutoSpeed.Framework;
using StardewModdingAPI;
using StardewModdingAPI.Events;
@ -8,12 +10,24 @@ namespace Omegasis.AutoSpeed
/// <summary>The mod entry point.</summary>
public class AutoSpeed : Mod
{
/*********
**Static Fields
*********/
/// <summary>
/// All of the speed that is added together for auto speed. This is used for mod authors to hook in their speed boosts before auto speed applies the default speed boost.
/// </summary>
public Dictionary<string, int> combinedAddedSpeed;
/*********
** Fields
*********/
/// <summary>The mod configuration.</summary>
private ModConfig Config;
/// <summary>
/// A static reference to expose public fields.
/// </summary>
public static AutoSpeed Instance;
/*********
** Public methods
@ -24,6 +38,17 @@ namespace Omegasis.AutoSpeed
{
helper.Events.GameLoop.UpdateTicked += this.OnUpdateTicked;
this.Config = helper.ReadConfig<ModConfig>();
this.combinedAddedSpeed = new Dictionary<string, int>();
Instance = this;
}
/// <summary>
/// Returns a copy of the mods' api.
/// </summary>
/// <returns></returns>
public override object GetApi()
{
return new AutoSpeedAPI();
}
@ -36,7 +61,10 @@ namespace Omegasis.AutoSpeed
private void OnUpdateTicked(object sender, UpdateTickedEventArgs e)
{
if (Context.IsPlayerFree)
Game1.player.addedSpeed = this.Config.Speed;
{
int addedSpeed = this.combinedAddedSpeed.Values.Sum();
Game1.player.addedSpeed = this.Config.Speed+addedSpeed;
}
}
}
}

View File

@ -66,7 +66,7 @@
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Pathoschild.Stardew.ModBuildConfig" Version="2.2.0" />
<PackageReference Include="Pathoschild.Stardew.ModBuildConfig" Version="3.0.0" />
</ItemGroup>
<ItemGroup>
<Reference Include="System" />
@ -77,6 +77,8 @@
<Link>Properties\GlobalAssemblyInfo.cs</Link>
</Compile>
<Compile Include="AutoSpeed.cs" />
<Compile Include="Framework\AutoSpeedAPI.cs" />
<Compile Include="Framework\IAutoSpeedAPI.cs" />
<Compile Include="Framework\ModConfig.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
</ItemGroup>

View File

@ -0,0 +1,34 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Omegasis.AutoSpeed.Framework
{
/// <summary>
/// API for auto speed to hook into the Game1.player.addedSpeed function.
/// </summary>
public class AutoSpeedAPI
{
/// <summary>
/// Allows adding a speed for Auto Speed to take acount for when calculating Game1.player.addedSpeed; Will fail if a unique key has already been added.
/// </summary>
/// <param name="ID"></param>
/// <param name="Amount"></param>
public void addSpeedBoost(string ID, int Amount)
{
AutoSpeed.Instance.combinedAddedSpeed.Add(ID, Amount);
}
/// <summary>
/// Removes an added speed boost by passing in the unique key.
/// </summary>
/// <param name="ID"></param>
/// <param name="Amount"></param>
public void remvoveSpeedBoost(string ID, int Amount)
{
AutoSpeed.Instance.combinedAddedSpeed.Remove(ID);
}
}
}

View File

@ -0,0 +1,22 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Omegasis.AutoSpeed.Framework
{
/// <summary>
/// Interface used to interface AutoSpeed's API class.
/// </summary>
public interface IAutoSpeedAPI
{
void addSpeedBoost(string ID, int Amount);
/// <summary>
/// Removes an added speed boost by passing in the unique key.
/// </summary>
/// <param name="ID"></param>
/// <param name="Amount"></param>
void remvoveSpeedBoost(string ID, int Amount);
}
}

View File

@ -1,10 +1,10 @@
{
"Name": "Auto Speed",
"Author": "Alpha_Omegasis",
"Version": "1.8.0",
"Version": "1.9.0",
"Description": "Got to go fast!",
"UniqueID": "Omegasis.AutoSpeed",
"EntryDll": "AutoSpeed.dll",
"MinimumApiVersion": "2.10.1",
"MinimumApiVersion": "3.0.0",
"UpdateKeys": [ "Nexus:443" ]
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 916 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.3 KiB

View File

@ -1,3 +1,7 @@
using System;
using System.IO;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using Omegasis.BillboardAnywhere.Framework;
using StardewModdingAPI;
using StardewModdingAPI.Events;
@ -15,6 +19,23 @@ namespace Omegasis.BillboardAnywhere
/// <summary>The mod configuration.</summary>
private ModConfig Config;
/// <summary>
/// The texture for the calendar button.
/// </summary>
private Texture2D calendarTexture;
/// <summary>
/// The texture for the quest button.
/// </summary>
private Texture2D questTexture;
/// <summary>
/// The button for the calendar menu.
/// </summary>
public ClickableTextureComponent billboardButton;
/// <summary>
/// The button for the quest menu.
/// </summary>
public ClickableTextureComponent questButton;
/*********
** Public methods
@ -25,9 +46,24 @@ namespace Omegasis.BillboardAnywhere
{
this.Config = helper.ReadConfig<ModConfig>();
helper.ConsoleCommands.Add("Omegasis.BillboardAnywhere.ReloadConfig", "Reloads the config file for BillboardAnywhere to reposition the button for the inventory menu page.", this.reloadConfig);
helper.ConsoleCommands.Add("Omegasis.BillboardAnywhere.SetcalendarButtonX", "<int>Sets the x position for the calendar button in the game menu.", this.setcalendarButtonX);
helper.ConsoleCommands.Add("Omegasis.BillboardAnywhere.SetcalendarButtonY", "<int> Sets the y position for the calendar button in the game menu.", this.setcalendarButtonY);
helper.ConsoleCommands.Add("Omegasis.BillboardAnywhere.SetcalendarButtonPosition", "<int,int> Sets the position for the calendar button in the game menu.", this.setcalendarButtonPosition);
helper.ConsoleCommands.Add("Omegasis.BillboardAnywhere.SetQuestButtonX", "<int>Sets the x position for the quest button in the game menu.", this.setQuestButtonX);
helper.ConsoleCommands.Add("Omegasis.BillboardAnywhere.SetQuestButtonY", "<int> Sets the y position for the quest button in the game menu.", this.setQuestButtonX);
helper.ConsoleCommands.Add("Omegasis.BillboardAnywhere.SetQuestButtonPosition", "<int,int> Sets the position for the quest button in the game menu.", this.setQuestButtonPosition);
helper.ConsoleCommands.Add("Omegasis.BillboardAnywhere.SetcalendarButtonVisibility", "<bool> Sets the visibility for the billboard button in the game menu.", this.setcalendarButtonVisibility);
helper.ConsoleCommands.Add("Omegasis.BillboardAnywhere.SetQuestButtonVisibility", "<bool> Sets the visibility for the quest button in the game menu.", this.setQuestButtonVisibility);
helper.Events.Input.ButtonPressed += this.OnButtonPressed;
}
helper.Events.Display.RenderedActiveMenu += this.RenderBillboardMenuButton;
helper.Events.Input.ButtonPressed += this.Input_ButtonPressed;
this.calendarTexture = helper.Content.Load<Texture2D>(Path.Combine("Assets", "Billboard.png"));
this.questTexture= helper.Content.Load<Texture2D>(Path.Combine("Assets", "Quest.png"));
this.billboardButton = new ClickableTextureComponent(new Rectangle((int)this.Config.CalendarOffsetFromMenu.X, (int)this.Config.CalendarOffsetFromMenu.Y, this.calendarTexture.Width, this.calendarTexture.Height), this.calendarTexture, new Rectangle(0, 0, this.calendarTexture.Width, this.calendarTexture.Height), 1f, false);
this.questButton = new ClickableTextureComponent(new Rectangle((int)this.Config.QuestOffsetFromMenu.X, (int)this.Config.QuestOffsetFromMenu.Y, this.questTexture.Width, this.questTexture.Height), this.questTexture, new Rectangle(0, 0, this.questTexture.Width, this.questTexture.Height), 1f, false);
}
/*********
** Private methods
@ -38,8 +74,214 @@ namespace Omegasis.BillboardAnywhere
public void OnButtonPressed(object sender, ButtonPressedEventArgs e)
{
// load menu if key pressed
if (Context.IsPlayerFree && e.Button == this.Config.KeyBinding)
if (Context.IsPlayerFree && e.Button == this.Config.CalendarKeyBinding)
Game1.activeClickableMenu = new Billboard();
if (Context.IsPlayerFree && e.Button == this.Config.QuestBoardKeyBinding)
{
Game1.RefreshQuestOfTheDay();
Game1.activeClickableMenu = new Billboard(true);
}
}
/// <summary>
/// Checks to see if the billboard button is clicked.
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private void Input_ButtonPressed(object sender, ButtonPressedEventArgs e)
{
if (Game1.activeClickableMenu == null) return;
if (e.Button == SButton.MouseLeft)
{
if (this.isInventoryPage())
{
if (this.billboardButton.containsPoint(Game1.getMousePosition().X, Game1.getMousePosition().Y))
{
if (this.Config.EnableInventoryCalendarButton == false) return;
Game1.activeClickableMenu = new Billboard(false);
}
if (this.questButton.containsPoint(Game1.getMousePosition().X, Game1.getMousePosition().Y))
{
if (this.Config.EnableInventoryQuestButton == false) return;
Game1.activeClickableMenu = new Billboard(true);
}
}
}
}
/// <summary>
/// Renders the billboard button to the menu.
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private void RenderBillboardMenuButton(object sender, RenderedActiveMenuEventArgs e)
{
if (this.isInventoryPage())
{
this.billboardButton.bounds = new Rectangle(Game1.activeClickableMenu.xPositionOnScreen + (int)this.Config.CalendarOffsetFromMenu.X, Game1.activeClickableMenu.yPositionOnScreen + (int)this.Config.CalendarOffsetFromMenu.Y, this.calendarTexture.Width, this.calendarTexture.Height);
this.questButton.bounds = new Rectangle(Game1.activeClickableMenu.xPositionOnScreen + (int)this.Config.QuestOffsetFromMenu.X, Game1.activeClickableMenu.yPositionOnScreen + (int)this.Config.QuestOffsetFromMenu.Y, this.calendarTexture.Width, this.calendarTexture.Height);
if(this.Config.EnableInventoryQuestButton) this.questButton.draw(Game1.spriteBatch);
if (this.Config.EnableInventoryCalendarButton) this.billboardButton.draw(Game1.spriteBatch);
GameMenu activeMenu = (Game1.activeClickableMenu as GameMenu);
activeMenu.drawMouse(Game1.spriteBatch);
if (this.billboardButton.containsPoint(Game1.getMousePosition().X, Game1.getMousePosition().Y))
{
//My deepest appologies for not being able to personally translate more text.
if (Game1.content.GetCurrentLanguage() == LocalizedContentManager.LanguageCode.en)
{
if (this.Config.EnableInventoryCalendarButton == false) return;
IClickableMenu.drawHoverText(Game1.spriteBatch, "Open Billboard Menu", Game1.smallFont);
}
}
if (this.questButton.containsPoint(Game1.getMousePosition().X, Game1.getMousePosition().Y))
{
//My deepest appologies once again for not being able to personally translate more text.
if (Game1.content.GetCurrentLanguage() == LocalizedContentManager.LanguageCode.en)
{
if (this.Config.EnableInventoryQuestButton == false) return;
IClickableMenu.drawHoverText(Game1.spriteBatch, "Open Quest Menu", Game1.smallFont);
}
}
}
}
/// <summary>
/// Checks to see if the current active menu is the game menu and the current page is the inventory page.
/// </summary>
/// <returns></returns>
private bool isInventoryPage()
{
if (Game1.activeClickableMenu == null) return false;
if (Game1.activeClickableMenu is StardewValley.Menus.GameMenu)
{
GameMenu activeMenu = (Game1.activeClickableMenu as GameMenu);
IClickableMenu currentTab = activeMenu.GetCurrentPage();
if (currentTab is InventoryPage)
{
return true;
}
}
return false;
}
/// <summary>
/// Reloads the mod's config and repositions the menu button as necessary.
/// </summary>
private void reloadConfig(string Name, string[] Params)
{
this.Config = this.Helper.ReadConfig<ModConfig>();
this.billboardButton = new ClickableTextureComponent(new Rectangle((int)this.Config.CalendarOffsetFromMenu.X, (int)this.Config.CalendarOffsetFromMenu.Y, this.calendarTexture.Width, this.calendarTexture.Height), this.calendarTexture, new Rectangle(0, 0, this.calendarTexture.Width, this.calendarTexture.Height), 1f, false);
this.questButton = new ClickableTextureComponent(new Rectangle((int)this.Config.QuestOffsetFromMenu.X, (int)this.Config.QuestOffsetFromMenu.Y, this.questTexture.Width, this.questTexture.Height), this.questTexture, new Rectangle(0, 0, this.questTexture.Width, this.questTexture.Height), 1f, false);
}
/// <summary>
/// Reloads the mod's config and repositions the menu button as necessary.
/// </summary>
private void reloadConfig()
{
this.Config = this.Helper.ReadConfig<ModConfig>();
this.billboardButton = new ClickableTextureComponent(new Rectangle((int)this.Config.CalendarOffsetFromMenu.X, (int)this.Config.CalendarOffsetFromMenu.Y, this.calendarTexture.Width, this.calendarTexture.Height), this.calendarTexture, new Rectangle(0, 0, this.calendarTexture.Width, this.calendarTexture.Height), 1f, false);
this.questButton = new ClickableTextureComponent(new Rectangle((int)this.Config.QuestOffsetFromMenu.X, (int)this.Config.QuestOffsetFromMenu.Y, this.questTexture.Width, this.questTexture.Height), this.questTexture, new Rectangle(0, 0, this.questTexture.Width, this.questTexture.Height), 1f, false);
}
/// <summary>
/// Sets the x position of the menu button.
/// </summary>
/// <param name="Name">The name of the command.</param>
/// <param name="Params">The parameters passed into the command.</param>
private void setcalendarButtonX(string Name, string[] Params)
{
this.Config.CalendarOffsetFromMenu = new Vector2(Convert.ToInt32(Params[0]), this.Config.CalendarOffsetFromMenu.Y);
this.Helper.WriteConfig<ModConfig>(this.Config);
this.reloadConfig();
}
/// <summary>
/// Sets the y position of the menu button.
/// </summary>
/// <param name="Name">The name of the command.</param>
/// <param name="Params">The parameters passed into the command.</param>
private void setcalendarButtonY(string Name, string[] Params)
{
this.Config.CalendarOffsetFromMenu = new Vector2(this.Config.CalendarOffsetFromMenu.X, Convert.ToInt32(Params[0]));
this.Helper.WriteConfig<ModConfig>(this.Config);
this.reloadConfig();
}
/// <summary>
/// Sets the position of the menu button.
/// </summary>
/// <param name="Name">The name of the command.</param>
/// <param name="Params">The parameters passed into the command.</param>
private void setcalendarButtonPosition(string Name, string[] Params)
{
this.Config.CalendarOffsetFromMenu = new Vector2(Convert.ToInt32(Params[0]), Convert.ToInt32(Params[1]));
this.Helper.WriteConfig<ModConfig>(this.Config);
this.reloadConfig();
}
/// <summary>
/// Sets the x position of the quest menu button.
/// </summary>
/// <param name="Name">The name of the command.</param>
/// <param name="Params">The parameters passed into the command.</param>
private void setQuestButtonX(string Name, string[] Params)
{
this.Config.QuestOffsetFromMenu = new Vector2(Convert.ToInt32(Params[0]), this.Config.QuestOffsetFromMenu.Y);
this.Helper.WriteConfig<ModConfig>(this.Config);
this.reloadConfig();
}
/// <summary>
/// Sets the y position of the quest menu button.
/// </summary>
/// <param name="Name">The name of the command.</param>
/// <param name="Params">The parameters passed into the command.</param>
private void setQuestButtonY(string Name, string[] Params)
{
this.Config.QuestOffsetFromMenu = new Vector2(this.Config.QuestOffsetFromMenu.X, Convert.ToInt32(Params[0]));
this.Helper.WriteConfig<ModConfig>(this.Config);
this.reloadConfig();
}
/// <summary>
/// Sets the position of the quest menu button.
/// </summary>
/// <param name="Name">The name of the command.</param>
/// <param name="Params">The parameters passed into the command.</param>
private void setQuestButtonPosition(string Name, string[] Params)
{
this.Config.QuestOffsetFromMenu = new Vector2(Convert.ToInt32(Params[0]), Convert.ToInt32(Params[1]));
this.Helper.WriteConfig<ModConfig>(this.Config);
this.reloadConfig();
}
/// <summary>
/// Sets the visibility and functionality of the billboard menu button.
/// </summary>
/// <param name="Name">The name of the command.</param>
/// <param name="Params">The parameters passed into the command.</param>
private void setcalendarButtonVisibility(string Name, string[] Params)
{
this.Config.EnableInventoryCalendarButton = Convert.ToBoolean(Params[0]);
this.Helper.WriteConfig<ModConfig>(this.Config);
this.reloadConfig();
}
/// <summary>
/// Sets the visibility and functionality of the quest menu button.
/// </summary>
/// <param name="Name">The name of the command.</param>
/// <param name="Params">The parameters passed into the command.</param>
private void setQuestButtonVisibility(string Name, string[] Params)
{
this.Config.EnableInventoryQuestButton = Convert.ToBoolean(Params[0]);
this.Helper.WriteConfig<ModConfig>(this.Config);
this.reloadConfig();
}
}
}

View File

@ -66,7 +66,7 @@
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Pathoschild.Stardew.ModBuildConfig" Version="2.2.0" />
<PackageReference Include="Pathoschild.Stardew.ModBuildConfig" Version="3.0.0" />
</ItemGroup>
<ItemGroup>
<Reference Include="System" />
@ -86,6 +86,14 @@
<ItemGroup>
<None Include="README.md" />
</ItemGroup>
<ItemGroup>
<Content Include="Assets\Billboard.png">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="Assets\Quest.png">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<Import Project="$(SolutionDir)\deploy.targets" />
</Project>

View File

@ -1,3 +1,4 @@
using Microsoft.Xna.Framework;
using StardewModdingAPI;
namespace Omegasis.BillboardAnywhere.Framework
@ -6,6 +7,21 @@ namespace Omegasis.BillboardAnywhere.Framework
internal class ModConfig
{
/// <summary>The key which shows the billboard menu.</summary>
public SButton KeyBinding { get; set; } = SButton.B;
public SButton CalendarKeyBinding { get; set; } = SButton.B;
/// <summary>The key which shows the quest menu.</summary>
public SButton QuestBoardKeyBinding { get; set; } = SButton.H;
/// <summary>The offset for the calendar button from the active menu</summary>
public Vector2 CalendarOffsetFromMenu { get; set; } = new Vector2(-100, 0);
/// <summary>The offset for the quest button from the active menu</summary>
public Vector2 QuestOffsetFromMenu { get; set; } = new Vector2(-200, 0);
/// <summary>
/// If true the calendar button is enabled for the in-game menu.
/// </summary>
public bool EnableInventoryCalendarButton { get; set; } = true;
/// <summary>
/// If true the quest button is enabled for the in-game menu.
/// </summary>
public bool EnableInventoryQuestButton { get; set; } = true;
}
}

View File

@ -1,10 +1,10 @@
{
"Name": "Billboard Anywhere",
"Author": "Alpha_Omegasis",
"Version": "1.8.0",
"Version": "1.10.1",
"Description": "Lets you view the billboard from anywhere.",
"UniqueID": "Omegasis.BillboardAnywhere",
"EntryDll": "BillboardAnywhere.dll",
"MinimumApiVersion": "2.10.1",
"MinimumApiVersion": "3.0.0",
"UpdateKeys": [ "Nexus:492" ]
}

View File

@ -158,7 +158,7 @@ namespace Omegasis.BuildEndurance
if (this.PlayerData.CurrentLevel < this.Config.MaxLevel)
{
while (this.PlayerData.CurrentExp >= this.PlayerData.ExpToNextLevel)
while (this.PlayerData.CurrentExp >= this.PlayerData.ExpToNextLevel && this.PlayerData.CurrentLevel<this.Config.MaxLevel)
{
this.PlayerData.CurrentLevel += 1;
this.PlayerData.CurrentExp = this.PlayerData.CurrentExp - this.PlayerData.ExpToNextLevel;

View File

@ -66,7 +66,7 @@
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Pathoschild.Stardew.ModBuildConfig" Version="2.2.0" />
<PackageReference Include="Pathoschild.Stardew.ModBuildConfig" Version="3.0.0" />
</ItemGroup>
<ItemGroup>
<Reference Include="System" />

View File

@ -1,10 +1,10 @@
{
"Name": "Build Endurance",
"Author": "Alpha_Omegasis",
"Version": "1.8.0",
"Version": "1.8.2",
"Description": "Increase your health as you play.",
"UniqueID": "Omegasis.BuildEndurance",
"EntryDll": "BuildEndurance.dll",
"MinimumApiVersion": "2.10.1",
"MinimumApiVersion": "3.0.0",
"UpdateKeys": [ "Nexus:445" ]
}

View File

@ -149,7 +149,7 @@ namespace Omegasis.BuildHealth
if (this.PlayerData.CurrentLevel < this.Config.MaxLevel)
{
while (this.PlayerData.CurrentExp >= this.PlayerData.ExpToNextLevel)
while (this.PlayerData.CurrentExp >= this.PlayerData.ExpToNextLevel && this.PlayerData.CurrentLevel<this.Config.MaxLevel)
{
this.PlayerData.CurrentLevel += 1;
this.PlayerData.CurrentExp = this.PlayerData.CurrentExp - this.PlayerData.ExpToNextLevel;

View File

@ -66,7 +66,7 @@
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Pathoschild.Stardew.ModBuildConfig" Version="2.2.0" />
<PackageReference Include="Pathoschild.Stardew.ModBuildConfig" Version="3.0.0" />
</ItemGroup>
<ItemGroup>
<Reference Include="System" />

View File

@ -1,10 +1,10 @@
{
"Name": "Build Health",
"Author": "Alpha_Omegasis",
"Version": "1.8.0",
"Version": "1.8.1",
"Description": "Increase your health as you play.",
"UniqueID": "Omegasis.BuildHealth",
"EntryDll": "BuildHealth.dll",
"MinimumApiVersion": "2.10.1",
"MinimumApiVersion": "3.0.0",
"UpdateKeys": [ "Nexus:446" ]
}

View File

@ -66,7 +66,7 @@
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Pathoschild.Stardew.ModBuildConfig" Version="2.2.0" />
<PackageReference Include="Pathoschild.Stardew.ModBuildConfig" Version="3.0.0" />
</ItemGroup>
<ItemGroup>
<Reference Include="System" />

View File

@ -92,8 +92,8 @@ namespace Omegasis.BuyBackCollectables.Framework
this.Collections.Add(BuyBackMenu.MineralsTab, new List<List<ClickableTextureComponent>>());
this.SideTabs.Add(new ClickableTextureComponent("", new Rectangle(this.xPositionOnScreen - Game1.tileSize * 3 / 4, this.yPositionOnScreen + Game1.tileSize * 6, Game1.tileSize, Game1.tileSize), "", Game1.content.LoadString("Strings\\UI:Collections_Cooking"), Game1.mouseCursors, new Rectangle(688, 64, 16, 16), Game1.pixelZoom));
this.Collections.Add(BuyBackMenu.CookingTab, new List<List<ClickableTextureComponent>>());
this.SideTabs.Add(new ClickableTextureComponent("", new Rectangle(this.xPositionOnScreen - Game1.tileSize * 3 / 4, this.yPositionOnScreen + Game1.tileSize * 7, Game1.tileSize, Game1.tileSize), "", Game1.content.LoadString("Strings\\UI:Collections_Achievements"), Game1.mouseCursors, new Rectangle(656, 80, 16, 16), Game1.pixelZoom));
this.Collections.Add(BuyBackMenu.AchievementsTab, new List<List<ClickableTextureComponent>>());
//this.SideTabs.Add(new ClickableTextureComponent("", new Rectangle(this.xPositionOnScreen - Game1.tileSize * 3 / 4, this.yPositionOnScreen + Game1.tileSize * 7, Game1.tileSize, Game1.tileSize), "", Game1.content.LoadString("Strings\\UI:Collections_Achievements"), Game1.mouseCursors, new Rectangle(656, 80, 16, 16), Game1.pixelZoom));
//this.Collections.Add(BuyBackMenu.AchievementsTab, new List<List<ClickableTextureComponent>>());
this.BackButton = new ClickableTextureComponent(new Rectangle(this.xPositionOnScreen + Game1.tileSize * 3 / 4, this.yPositionOnScreen + this.height - 20 * Game1.pixelZoom, 12 * Game1.pixelZoom, 11 * Game1.pixelZoom), Game1.mouseCursors, new Rectangle(352, 495, 12, 11), Game1.pixelZoom);
this.ForwardButton = new ClickableTextureComponent(new Rectangle(this.xPositionOnScreen + this.width - Game1.tileSize / 2 - 15 * Game1.pixelZoom, this.yPositionOnScreen + this.height - 20 * Game1.pixelZoom, 12 * Game1.pixelZoom, 11 * Game1.pixelZoom), Game1.mouseCursors, new Rectangle(365, 495, 12, 11), Game1.pixelZoom);
int[] array = new int[this.SideTabs.Count];
@ -155,8 +155,9 @@ namespace Omegasis.BuyBackCollectables.Framework
this.Collections[selectedTab].Last().Add(new ClickableTextureComponent(entry.Key + " " + drawShadow, new Rectangle(x2, num5, Game1.tileSize, Game1.tileSize), null, "", Game1.objectSpriteSheet, Game1.getSourceRectForStandardTileSheet(Game1.objectSpriteSheet, entry.Key, 16, 16), Game1.pixelZoom, drawShadow));
array[selectedTab]++;
}
if (this.Collections[5].Count == 0)
this.Collections[5].Add(new List<ClickableTextureComponent>());
/*
//if (this.Collections[5].Count == 0)
//this.Collections[5].Add(new List<ClickableTextureComponent>());
foreach (KeyValuePair<int, string> current2 in Game1.achievements)
{
bool flag = Game1.player.achievements.Contains(current2.Key);
@ -169,6 +170,7 @@ namespace Omegasis.BuyBackCollectables.Framework
array[5]++;
}
}
*/
}
@ -221,9 +223,9 @@ namespace Omegasis.BuyBackCollectables.Framework
}
foreach (ClickableTextureComponent current2 in this.Collections[this.CurrentTab][this.CurrentPage])
{
if (current2.containsPoint(x, y) && this.NewItem != null && Game1.player.money >= this.Value)
if (current2.containsPoint(x, y) && this.NewItem != null && Game1.player.Money >= this.Value)
{
Game1.player.money -= this.Value;
Game1.player.Money -= this.Value;
Game1.playSound("coin");
Game1.player.addItemByMenuIfNecessary(this.NewItem);
}
@ -236,9 +238,9 @@ namespace Omegasis.BuyBackCollectables.Framework
/// <param name="playSound">Whether to enable sound.</param>
public override void receiveRightClick(int x, int y, bool playSound = true)
{
if (this.NewItem != null && Game1.player.money >= this.Value)
if (this.NewItem != null && Game1.player.Money >= this.Value)
{
Game1.player.money -= this.Value;
Game1.player.Money -= this.Value;
Game1.player.addItemByMenuIfNecessary(this.NewItem);
Game1.playSound("coin");
}

View File

@ -1,10 +1,10 @@
{
"Name": "Buy Back Collectables",
"Author": "Alpha_Omegasis",
"Version": "1.7.0",
"Version": "1.8.0",
"Description": "Lets you buy back any obtained collectable.",
"UniqueID": "Omegasis.BuyBackCollectables",
"EntryDll": "BuyBackCollectables.dll",
"MinimumApiVersion": "2.10.1",
"MinimumApiVersion": "3.0.0",
"UpdateKeys": [ "Nexus:507" ]
}

View File

@ -66,7 +66,7 @@
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Pathoschild.Stardew.ModBuildConfig" Version="2.2.0" />
<PackageReference Include="Pathoschild.Stardew.ModBuildConfig" Version="3.0.0" />
</ItemGroup>
<ItemGroup>
<Reference Include="System" />

View File

@ -1,7 +1,7 @@
{
"Name": "Fall 28 Snow Day",
"Author": "Alpha_Omegasis",
"Version": "1.7.0",
"Version": "1.7.1",
"Description": "Makes it snow on Fall 28, which makes a good explanation for all the snow on the next day.",
"UniqueID": "Omegasis.Fall28SnowDay",
"EntryDll": "Fall28SnowDay.dll",

View File

@ -1,26 +0,0 @@
using StardewValley;
namespace Omegasis.HappyBirthday
{
// TODO: Make all the events
// Resources:https://stardewvalleywiki.com/Modding:Event_data
public class BirthdayEvents
{
public Event communityCenterJunimoEvent;
public Event marriedNoKidsEvent;
public Event surpriseBirthdayPartyEvent;
public Event marriedWithOneKidEvent;
public Event marriedWithTwoKidsEvent;
public BirthdayEvents()
{
this.initializeEvents();
}
public void initializeEvents()
{
Event e = new Event("", -1, Game1.player);
Game1.player.currentLocation.currentEvent = new Event();
}
}
}

File diff suppressed because it is too large Load Diff

View File

@ -1,35 +0,0 @@
{
"Robin": "嘿,@,生日快乐!我很高兴你选择搬到这里来。",
"Demetrius": "生日快乐@!记得偶尔要抽出时间来好好享受一下。$h",
"Maru": "生日快乐@。我本来想给我做个永恒不灭的蜡烛,但是好像行不通。也许明年再给你吧?$h",
"Sebastian": "生日快乐@。又是平静的一年。",
"Linus": "生日快乐@。谢谢你在你生日的这天依旧来看我。这让我很开心。",
"Pierre": "嘿@,生日快乐!希望你的下一年会更好!",
"Caroline": "生日快乐@。谢谢你为这个社区做的一切。我相信你的父母一定都很为你骄傲。$h",
"Abigail": "生日快乐@!希望之后的一年我们可以一起去更多的地方冒险!$h",
"Alex": "哟@,生日快乐!也许这会是你有生以来最棒的一年。$h",
"George": "等你到我的年纪,生日就像其他的日子一样来去匆匆。不过还是祝你生日快乐,@。",
"Evelyn": "生日快乐@。你成长成为了一个优秀的人,我相信你还会继续成长的。",
"Lewis": "生日快乐@!我很感激你为这个小镇做的一切,我相信你爷爷也会为你骄傲的。",
"Clint": "嘿生日快乐@。我相信接下来对你来说会是很棒的一年。",
"Penny": "生日快乐@。希望你这一年都能得到所有的祝福。",
"Pam": "生日快乐孩子。我们应该一起去喝一杯,庆祝你生命的又一年。",
"Emily": "我今天感受到了很多关于你的正能量,所以一定是你的生日到了。生日快乐@$h",
"Haley": "生日快乐@。希望你今年能收到些很棒的礼物!$h",
"Jas": "生日快乐@。希望你过个愉快的生日。",
"Vincent": "嘿@,你是来玩的……哦今天是你的生日?生日快乐!",
"Jodi": "你好啊@。听说今天是你的生日。既然如此,祝你生日快乐!$h",
"Kent": "乔迪告诉我今天是你的生日,@。生日快乐,记得要珍惜每一天。",
"Sam": "哟@,生日快乐!有机会我们来给你办个生日派对吧!$h",
"Leah": "嘿@,生日快乐!我们今晚去酒吧庆祝一下吧!$h",
"Shane": "生日快乐@。继续努力工作,我相信你接下来的这一年会更好。",
"Marnie": "你好@。今天大家都在谈论你的生日,我也想跟你说一声生日快乐,那么,生日快乐!$h",
"Elliott": "真是美好的一天不是吗,@?尤其今天是你的生日。我本想给你写一首诗,但我觉得简单的才是最好的,生日快乐。$h",
"Gus": "嘿@,生日快乐!希望你今天过得愉快,酒吧永远都欢迎你!",
"Dwarf": "生日快乐@。我希望我给你的东西是人类可以接受的。",
"Wizard": "有精灵告诉我今天是你的生日。这么说,生日快乐@。希望你下一年辉煌灿烂!",
"Harvey": "嘿@,生日快乐!有空记得到我这来做检查,这能让你多活很多年!",
"Sandy": "你好啊@。我听说今天是你的生日,我可不想让你觉得被冷落了。生日快乐!",
"Willy": "哎@,生日快乐。看到你让我想起了我曾经一个人漂在海上的日子。继续享受青春吧年轻人。$h",
"Krobus": "我听说在别人生日的时候送一份礼物是传统。那么,生日快乐@。"
}

View File

@ -1,35 +0,0 @@
{
"Robin": "Hey @, happy birthday! I'm glad you choose this town to move here to. ",
"Demetrius": "Happy birthday @! Make sure you take some time off today to enjoy yourself. $h",
"Maru": "Happy birthday @. I tried to make you an everlasting candle for you, but sadly that didn't work out. Maybe next year right? $h",
"Sebastian": "Happy birthday @. Here's to another year of chilling. ",
"Linus": "Happy birthday @. Thanks for visiting me even on your birthday. It makes me really happy. ",
"Pierre": "Hey @, happy birthday! Hopefully this next year for you will be a great one! ",
"Caroline": "Happy birthday @. Thank you for all that you've done for our community. I'm sure your parents must be proud of you.$h",
"Abigail": "Happy birthday @! Hopefully this year we can go on even more adventures together $h!",
"Alex": "Yo @, happy birthday! Maybe this will be your best year yet.$h",
"George": "When you get to my age birthdays come and go. Still happy birthday @.",
"Evelyn": "Happy birthday @. You have grown up to be such a fine individual and I'm sure you'll continue to grow. ",
"Lewis": "Happy birthday @! I'm thankful for what you have done for the town and I'm sure your grandfather would be proud of you.",
"Clint": "Hey happy birthday @. I'm sure this year is going to be great for you.",
"Penny": "Happy birthday @. May you enjoy all of life's blessings this year. ",
"Pam": "Happy birthday kid. We should have a drink to celebrate another year of life for you! $h",
"Emily": "I'm sensing a strong positive life energy about you, so it must be your birthday. Happy birthday @!$h",
"Haley": "Happy birthday @. Hopefully this year you'll get some good presents!$h",
"Jas": "Happy birthday @. I hope you have a good birthday.",
"Vincent": "Hey @ have you come to pl...oh it's your birthday? Happy birthday! ",
"Jodi": "Hello there @. Rumor has it that today is your birthday. In that case, happy birthday!$h",
"Kent": "Jodi told me that it was your birthday today @. Happy birthday and make sure to cherish every single day.",
"Sam": "Yo @ happy birthday! We'll have to have a birthday jam session for you some time!$h ",
"Leah": "Hey @ happy birthday! We should go to the saloon tonight and celebrate!$h ",
"Shane": "Happy birthday @. Keep working hard and I'm sure this next year for you will be a great one.",
"Marnie": "Hello there @. Everyone is talking about your birthday today and I wanted to make sure that I wished you a happy birthday as well, so happy birthday! $h ",
"Elliott": "What a wonderful day isn't it @? Especially since today is your birthday. I tried to make you a poem but I feel like the best way of putting it is simply, happy birthday. $h ",
"Gus": "Hey @ happy birthday! Hopefully you enjoy the rest of the day and make sure you aren't a stranger at the saloon!",
"Dwarf": "Happy birthday @. I hope that what I got you is acceptable for humans as well. ",
"Wizard": "The spirits told me that today is your birthday. In that case happy birthday @. May your year shine bright! ",
"Harvey": "Hey @, happy birthday! Make sure to come in for a checkup some time to make sure you live many more years! ",
"Sandy": "Hello there @. I heard that today was your birthday and I didn't want you feeling left out, so happy birthday!",
"Willy": "Aye @ happy birthday. Looking at you reminds me of ye days when I was just a guppy swimming out to sea. Continue to enjoy them youngin.$h",
"Krobus": "I have heard that it is tradition to give a gift to others on their birthday. In that case, happy birthday @."
}

View File

@ -1,6 +0,0 @@
{
"Mail:birthdayMom": "Dear @,^ Happy birthday sweetheart. It's been amazing watching you grow into the kind, hard working person that I've always dreamed that you would become. I hope you continue to make many more fond memories with the ones you love. ^ Love, Mom ^ P.S. Here's a little something that I made for you. %item object 221 1 %%",
"Mail:birthdayDad": "Dear @,^ Happy birthday kiddo. It's been a little quiet around here on your birthday since you aren't around, but your mother and I know that you are making both your grandpa and us proud. We both know that living on your own can be tough but we believe in you one hundred percent, just keep following your dreams.^ Love, Dad ^ P.S. Here's some spending money to help you out on the farm. Good luck! %item money 5000 5001 %%",
"Happy Birthday: Star Message": "It's your birthday today! Happy birthday!",
"Happy Birthday: Farmhand Birthday Message": "It's @'s birthday! Happy birthday to them!"
}

View File

@ -0,0 +1,811 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Omegasis.HappyBirthday.Framework.EventPreconditions;
using StardustCore.Events;
using StardustCore.Events.Preconditions;
using StardustCore.Events.Preconditions.TimeSpecific;
using StardewValley;
using Microsoft.Xna.Framework;
using StardustCore.Events.Preconditions.PlayerSpecific;
namespace Omegasis.HappyBirthday.Framework
{
public class BirthdayEvents
{
/// <summary>
/// Creates the junimo birthday party event.
/// </summary>
/// <returns></returns>
public static EventHelper CommunityCenterJunimoBirthday()
{
List<EventPrecondition> conditions = new List<EventPrecondition>();
conditions.Add(new FarmerBirthdayPrecondition());
conditions.Add(new LocationPrecondition(Game1.getLocationFromName("CommunityCenter")));
conditions.Add(new TimePrecondition(600, 2600));
conditions.Add(new CanReadJunimo());
conditions.Add(new StardustCore.Events.Preconditions.PlayerSpecific.JojaMember(false));
conditions.Add(new CommunityCenterCompleted(false));
//conditions.Add(new HasUnlockedCommunityCenter()); //Infered by the fact that you must enter the community center to trigger this event anyways.
EventHelper e = new EventHelper("CommunityCenterBirthday", 19950, conditions, new EventStartData("playful", 32, 12, new EventStartData.FarmerData(32, 22, EventHelper.FacingDirection.Up), new List<EventStartData.NPCData>()));
e.AddInJunimoActor("Juni", new Microsoft.Xna.Framework.Vector2(32, 10), StardustCore.IlluminateFramework.Colors.getRandomJunimoColor());
e.AddInJunimoActor("Juni2", new Microsoft.Xna.Framework.Vector2(30, 11), StardustCore.IlluminateFramework.Colors.getRandomJunimoColor());
e.AddInJunimoActor("Juni3", new Microsoft.Xna.Framework.Vector2(34, 11), StardustCore.IlluminateFramework.Colors.getRandomJunimoColor());
e.AddInJunimoActor("Juni4", new Microsoft.Xna.Framework.Vector2(26, 11), StardustCore.IlluminateFramework.Colors.getRandomJunimoColor());
e.AddInJunimoActor("Juni5", new Microsoft.Xna.Framework.Vector2(28, 11), StardustCore.IlluminateFramework.Colors.getRandomJunimoColor());
e.AddInJunimoActor("Juni6Tank", new Vector2(38, 10), StardustCore.IlluminateFramework.Colors.getRandomJunimoColor());
e.AddInJunimoActor("Juni7", new Vector2(27, 16), StardustCore.IlluminateFramework.Colors.getRandomJunimoColor());
e.AddInJunimoActor("Juni8", new Vector2(40, 15), StardustCore.IlluminateFramework.Colors.getRandomJunimoColor());
e.AddJunimoAdvanceMoveTiles(new StardustCore.Utilities.JunimoAdvanceMoveData("Juni6Tank", new List<Point>()
{
new Point(38,10),
new Point(38,11),
new Point(39,11),
new Point(40,11),
new Point(41,11),
new Point(42,11),
new Point(42,10),
new Point(41,10),
new Point(40,10),
new Point(39,10),
}, 60, 1, true)); ;
e.FlipJunimoActor("Juni5", true);
e.junimoFaceDirection("Juni4", EventHelper.FacingDirection.Right); //Make a junimo face right.
e.junimoFaceDirection("Juni5", EventHelper.FacingDirection.Left);
e.junimoFaceDirection("Juni7", EventHelper.FacingDirection.Down);
e.animate("Juni", true, true, 250, new List<int>()
{
28,
29,
30,
31
});
e.animate("Juni7", false, true, 250, new List<int>()
{
44,45,46,47
});
e.animate("Juni8", false, true, 250, new List<int>()
{
12,13,14,15
});
e.globalFadeIn();
e.moveFarmerUp(10, EventHelper.FacingDirection.Up, true);
e.junimoFaceDirection("Juni4", EventHelper.FacingDirection.Down);
e.junimoFaceDirection("Juni5", EventHelper.FacingDirection.Down);
e.RemoveJunimoAdvanceMove("Juni6Tank");
e.junimoFaceDirection("Juni6Tank", EventHelper.FacingDirection.Down);
e.junimoFaceDirection("Juni7", EventHelper.FacingDirection.Right);
e.FlipJunimoActor("Juni8", true);
e.junimoFaceDirection("Juni8", EventHelper.FacingDirection.Left);
e.playSound("junimoMeep1");
e.emoteFarmer_ExclamationMark();
e.showMessage(HappyBirthday.Config.translationInfo.getTranslatedString("Event:JunimoBirthdayParty_0"));
e.emoteFarmer_Heart();
e.globalFadeOut(0.010);
e.setViewportPosition(-100, -100);
e.showMessage(HappyBirthday.Config.translationInfo.getTranslatedString("Event:JunimoBirthdayParty_1"));
e.showMessage(HappyBirthday.Config.translationInfo.getTranslatedString("Event:PartyOver"));
e.addObjectToPlayersInventory(220, 1, false);
e.end();
return e;
}
/// <summary>
/// Birthday event for when the player is dating Penny.
/// Status: Completed.
/// </summary>
/// <returns></returns>
public static EventHelper DatingBirthday_Penny()
{
NPC penny = Game1.getCharacterFromName("Penny");
NPC pam = Game1.getCharacterFromName("Pam");
List<EventPrecondition> conditions = new List<EventPrecondition>();
conditions.Add(new FarmerBirthdayPrecondition());
conditions.Add(new LocationPrecondition(Game1.getLocationFromName("Trailer")));
conditions.Add(new TimePrecondition(600, 2600));
conditions.Add(new StardustCore.Events.Preconditions.NPCSpecific.DatingNPC(penny));
//conditions.Add(new StardustCore.Events.Preconditions.NPCSpecific.DatingNPC(Game1.getCharacterFromName("Penny"));
EventHelper e = new EventHelper("BirthdayDating:Penny", 19951, conditions, new EventStartData("playful", 12, 8, new EventStartData.FarmerData(12, 9, EventHelper.FacingDirection.Up), new List<EventStartData.NPCData>() {
new EventStartData.NPCData(penny,12,7, EventHelper.FacingDirection.Up),
new EventStartData.NPCData(pam,15,4, EventHelper.FacingDirection.Down)
}));
e.globalFadeIn();
e.moveFarmerUp(1, EventHelper.FacingDirection.Up, false);
e.actorFaceDirection("Penny", EventHelper.FacingDirection.Down);
//starting = starting.Replace("@", Game1.player.Name);
e.speak(penny, HappyBirthday.Config.translationInfo.getTranslatedString("Event:DatingPennyBirthday_Penny:0"));
e.speak(pam, HappyBirthday.Config.translationInfo.getTranslatedString("Event:DatingPennyBirthday_Pam:0"));
e.speak(penny, HappyBirthday.Config.translationInfo.getTranslatedString("Event:DatingPennyBirthday_Penny:1"));
e.speak(pam, HappyBirthday.Config.translationInfo.getTranslatedString("Event:DatingPennyBirthday_Pam:1"));
e.emote_Angry("Penny");
e.speak(penny, HappyBirthday.Config.translationInfo.getTranslatedString("Event:DatingPennyBirthday_Penny:2")); //penny2
e.speak(penny, HappyBirthday.Config.translationInfo.getTranslatedString("Event:DatingPennyBirthday_Penny:3")); //penny3
e.moveActorLeft("Penny", 3, EventHelper.FacingDirection.Up, true);
e.moveFarmerRight(2, EventHelper.FacingDirection.Up, false);
e.moveFarmerUp(3, EventHelper.FacingDirection.Down, false);
e.moveActorRight("Penny", 5, EventHelper.FacingDirection.Up, true);
e.moveActorUp("Penny", 1, EventHelper.FacingDirection.Up, true);
e.speak(pam, HappyBirthday.Config.translationInfo.getTranslatedString("Event:DatingPennyBirthday_Pam:2")); //pam2
e.speak(penny, HappyBirthday.Config.translationInfo.getTranslatedString("Event:DatingPennyBirthday_Penny:4"));//penny4
e.emoteFarmer_Heart();
e.emote_Heart("Penny");
e.globalFadeOut(0.010);
e.setViewportPosition(-100, -100);
e.showMessage(HappyBirthday.Config.translationInfo.getTranslatedString("Event:DatingPennyBirthday_Finish:0")); //penny party finish 0
e.showMessage(HappyBirthday.Config.translationInfo.getTranslatedString("Event:DatingPennyBirthday_Finish:1"));// penny party finish 1
e.addObjectToPlayersInventory(220, 1, false);
e.addObjectToPlayersInventory(346, 1, false);
e.showMessage(HappyBirthday.Config.translationInfo.getTranslatedString("Event:PartyOver"));
e.end();
return e;
}
public static EventHelper DatingBirthday_Penny_BigHome()
{
NPC penny = Game1.getCharacterFromName("Penny");
NPC pam = Game1.getCharacterFromName("Pam");
List<EventPrecondition> conditions = new List<EventPrecondition>();
conditions.Add(new FarmerBirthdayPrecondition());
conditions.Add(new LocationPrecondition(Game1.getLocationFromName("Trailer_Big")));
conditions.Add(new TimePrecondition(600, 2600));
conditions.Add(new StardustCore.Events.Preconditions.NPCSpecific.DatingNPC(penny));
//conditions.Add(new StardustCore.Events.Preconditions.NPCSpecific.DatingNPC(Game1.getCharacterFromName("Penny"));
EventHelper e = new EventHelper("BirthdayDating:Penny_BigHome", 19951, conditions, new EventStartData("playful", 14, 8, new EventStartData.FarmerData(12, 11, EventHelper.FacingDirection.Up), new List<EventStartData.NPCData>() {
new EventStartData.NPCData(penny,12,7, EventHelper.FacingDirection.Up),
new EventStartData.NPCData(pam,15,4, EventHelper.FacingDirection.Down)
}));
e.globalFadeIn();
e.moveFarmerUp(3, EventHelper.FacingDirection.Up, false);
e.actorFaceDirection("Penny", EventHelper.FacingDirection.Down);
//starting = starting.Replace("@", Game1.player.Name);
e.speak(penny, HappyBirthday.Config.translationInfo.getTranslatedString("Event:DatingPennyBirthday_Penny:0"));
e.speak(pam, HappyBirthday.Config.translationInfo.getTranslatedString("Event:DatingPennyBirthday_Pam:0"));
e.speak(penny, HappyBirthday.Config.translationInfo.getTranslatedString("Event:DatingPennyBirthday_Penny:1"));
e.speak(pam, HappyBirthday.Config.translationInfo.getTranslatedString("Event:DatingPennyBirthday_Pam:1"));
e.emote_Angry("Penny");
e.speak(penny, HappyBirthday.Config.translationInfo.getTranslatedString("Event:DatingPennyBirthday_Penny:2")); //penny2
e.speak(penny, HappyBirthday.Config.translationInfo.getTranslatedString("Event:DatingPennyBirthday_Penny:3")); //penny3
e.moveActorLeft("Penny", 3, EventHelper.FacingDirection.Up, true);
e.moveFarmerRight(2, EventHelper.FacingDirection.Up, false);
e.moveFarmerUp(3, EventHelper.FacingDirection.Down, false);
e.moveActorRight("Penny", 5, EventHelper.FacingDirection.Up, true);
e.moveActorUp("Penny", 1, EventHelper.FacingDirection.Up, true);
e.speak(pam, HappyBirthday.Config.translationInfo.getTranslatedString("Event:DatingPennyBirthday_Pam:2")); //pam2
e.speak(penny, HappyBirthday.Config.translationInfo.getTranslatedString("Event:DatingPennyBirthday_Penny:4"));//penny4
e.emoteFarmer_Heart();
e.emote_Heart("Penny");
e.globalFadeOut(0.010);
e.setViewportPosition(-100, -100);
e.showMessage(HappyBirthday.Config.translationInfo.getTranslatedString("Event:DatingPennyBirthday_Finish:0")); //penny party finish 0
e.showMessage(HappyBirthday.Config.translationInfo.getTranslatedString("Event:DatingPennyBirthday_Finish:1"));// penny party finish 1
e.addObjectToPlayersInventory(220, 1, false);
e.addObjectToPlayersInventory(346, 1, false);
e.showMessage(HappyBirthday.Config.translationInfo.getTranslatedString("Event:PartyOver"));
e.end();
return e;
}
/// <summary>
/// Birthday event for when the player is dating Maru.
/// Finished.
/// </summary>
/// <returns></returns>
public static EventHelper DatingBirthday_Maru()
{
List<EventPrecondition> conditions = new List<EventPrecondition>();
conditions.Add(new FarmerBirthdayPrecondition());
conditions.Add(new LocationPrecondition(Game1.getLocationFromName("ScienceHouse")));
conditions.Add(new TimePrecondition(600, 2600));
NPC maru = Game1.getCharacterFromName("Maru");
NPC sebastian = Game1.getCharacterFromName("Sebastian");
NPC robin = Game1.getCharacterFromName("Robin");
NPC demetrius = Game1.getCharacterFromName("Demetrius");
conditions.Add(new StardustCore.Events.Preconditions.NPCSpecific.DatingNPC(maru));
EventHelper e = new EventHelper("BirthdayDating:Maru", 19952, conditions, new EventStartData("playful", 28, 12, new EventStartData.FarmerData(23, 12, EventHelper.FacingDirection.Right), new List<EventStartData.NPCData>() {
new EventStartData.NPCData(maru,27,11, EventHelper.FacingDirection.Down),
new EventStartData.NPCData(sebastian,26,13, EventHelper.FacingDirection.Up),
new EventStartData.NPCData(robin,28,9, EventHelper.FacingDirection.Up),
new EventStartData.NPCData(demetrius,30,11, EventHelper.FacingDirection.Left)
}));
e.globalFadeIn();
e.moveFarmerRight(3, EventHelper.FacingDirection.Right, true);
e.npcFaceDirection(maru, EventHelper.FacingDirection.Left);
e.npcFaceDirection(demetrius, EventHelper.FacingDirection.Left);
//Seb is already facing up.
e.npcFaceDirection(robin, EventHelper.FacingDirection.Down);
//Dialogue goes here.
//Seriously improve dialogue lines. Maru is probably the NPC I know the least about.
e.speak(maru, GetTranslatedString("Event:DatingMaruBirthday_Maru:0")); //maru 0
e.speak(demetrius, GetTranslatedString("Event:DatingMaruBirthday_Demetrius:0")); //demetrius 0
e.speak(maru, GetTranslatedString("Event:DatingMaruBirthday_Maru:1"));//Maru 1 //Spoiler she doesn't.
e.speak(sebastian, GetTranslatedString("Event:DatingMaruBirthday_Sebastian:0")); //sebastian 0
e.speak(robin, GetTranslatedString("Event:DatingMaruBirthday_Robin:0")); //robin 0
e.speak(demetrius, GetTranslatedString("Event:DatingMaruBirthday_Demetrius:1")); //demetrius 1
e.emote_ExclamationMark("Robin");
e.npcFaceDirection(robin, EventHelper.FacingDirection.Up);
e.speak(robin, GetTranslatedString("Event:DatingMaruBirthday_Robin:1")); //robin 1
e.npcFaceDirection(robin, EventHelper.FacingDirection.Down);
e.moveActorDown("Robin", 1, EventHelper.FacingDirection.Down, false);
e.addObject(27, 12, 220);
e.speak(maru, GetTranslatedString("Event:DatingMaruBirthday_Maru:2")); //maru 2
e.emoteFarmer_Thinking();
e.speak(sebastian, GetTranslatedString("Event:DatingMaruBirthday_Sebastian:1")); //Sebastian 1
e.speak(maru, GetTranslatedString("Event:DatingMaruBirthday_Maru:3")); //maru 3
//Event finish commands.
e.emoteFarmer_Heart();
e.emote_Heart("Maru");
e.globalFadeOut(0.010);
e.setViewportPosition(-100, -100);
e.showMessage(HappyBirthday.Config.translationInfo.getTranslatedString("Event:DatingMaruBirthday_Finish:0")); //maru party finish 0
e.showMessage(HappyBirthday.Config.translationInfo.getTranslatedString("Event:DatingMaruBirthday_Finish:1")); //maru party finish 0
e.addObjectToPlayersInventory(220, 1, false);
e.showMessage(HappyBirthday.Config.translationInfo.getTranslatedString("Event:PartyOver"));
e.end();
return e;
}
/// <summary>
/// Birthday event for when the player is dating Leah.
/// Finished.
/// </summary>
/// <returns></returns>
public static EventHelper DatingBirthday_Leah()
{
List<EventPrecondition> conditions = new List<EventPrecondition>();
conditions.Add(new FarmerBirthdayPrecondition());
conditions.Add(new LocationPrecondition(Game1.getLocationFromName("LeahHouse")));
conditions.Add(new TimePrecondition(600, 2600));
NPC leah = Game1.getCharacterFromName("Leah");
conditions.Add(new StardustCore.Events.Preconditions.NPCSpecific.DatingNPC(leah));
EventHelper e = new EventHelper("BirthdayDating:Leah", 19954, conditions, new EventStartData("playful", 12, 7, new EventStartData.FarmerData(7, 9, EventHelper.FacingDirection.Up), new List<EventStartData.NPCData>() {
new EventStartData.NPCData(leah,14,11, EventHelper.FacingDirection.Left),
}));
e.addObject(11, 11, 220);
e.globalFadeIn();
e.moveFarmerUp(2, EventHelper.FacingDirection.Up, false);
e.moveFarmerRight(5, EventHelper.FacingDirection.Down, false);
e.npcFaceDirection(leah, EventHelper.FacingDirection.Up);
e.speak(leah, GetTranslatedString("Event:DatingLeahBirthday_Leah:0")); //0
e.moveFarmerDown(2, EventHelper.FacingDirection.Down, false);
e.moveFarmerRight(1, EventHelper.FacingDirection.Down, false);
e.moveFarmerDown(1, EventHelper.FacingDirection.Down, false);
e.speak(leah, GetTranslatedString("Event:DatingLeahBirthday_Leah:1")); //1
e.emoteFarmer_Happy();
e.speak(leah, GetTranslatedString("Event:DatingLeahBirthday_Leah:2"));//2
e.speak(leah, GetTranslatedString("Event:DatingLeahBirthday_Leah:3"));//3
e.speak(leah, GetTranslatedString("Event:DatingLeahBirthday_Leah:4"));//4
e.emoteFarmer_Heart();
e.emote_Heart("Leah");
e.globalFadeOut(0.010);
e.setViewportPosition(-100, -100);
e.showMessage(HappyBirthday.Config.translationInfo.getTranslatedString("Event:DatingLeahBirthday_Finish:0")); //maru party finish 0
e.showMessage(HappyBirthday.Config.translationInfo.getTranslatedString("Event:DatingLeahBirthday_Finish:1")); //maru party finish 0
e.addObjectToPlayersInventory(220, 1, false);
e.showMessage(HappyBirthday.Config.translationInfo.getTranslatedString("Event:PartyOver"));
e.end();
return e;
}
/// <summary>
/// Birthday event for when the player is dating Abigail.
/// Finished.
/// </summary>
/// <returns></returns>
public static EventHelper DatingBirthday_Abigail()
{
List<EventPrecondition> conditions = new List<EventPrecondition>();
conditions.Add(new FarmerBirthdayPrecondition());
conditions.Add(new LocationPrecondition(Game1.getLocationFromName("SeedShop")));
conditions.Add(new TimePrecondition(600, 2600));
NPC abigail = Game1.getCharacterFromName("Abigail");
NPC pierre = Game1.getCharacterFromName("Pierre");
NPC caroline = Game1.getCharacterFromName("Caroline");
conditions.Add(new StardustCore.Events.Preconditions.NPCSpecific.DatingNPC(abigail));
EventHelper e = new EventHelper("BirthdayDating:Abigail", 19955, conditions, new EventStartData("playful", 35, 7, new EventStartData.FarmerData(31, 11, EventHelper.FacingDirection.Up), new List<EventStartData.NPCData>() {
new EventStartData.NPCData(abigail,36,9, EventHelper.FacingDirection.Left),
new EventStartData.NPCData(pierre,33,6, EventHelper.FacingDirection.Down),
new EventStartData.NPCData(caroline,35,5, EventHelper.FacingDirection.Up),
}));
e.globalFadeIn();
//Dialogue here.
e.moveFarmerUp(2, EventHelper.FacingDirection.Right, false);
e.moveFarmerRight(4, EventHelper.FacingDirection.Right, false);
e.speak(abigail, GetTranslatedString("Event:DatingAbigailBirthday_Abigail:0")); //abi 0
e.npcFaceDirection(caroline, EventHelper.FacingDirection.Down);
e.speak(pierre, GetTranslatedString("Event:DatingAbigailBirthday_Pierre:0")); //pie 0
e.speak(caroline, GetTranslatedString("Event:DatingAbigailBirthday_Caroline:0")); //car 0
e.addObject(35, 5, 220);
e.speak(abigail, GetTranslatedString("Event:DatingAbigailBirthday_Abigail:1")); //abi 1
e.speak(pierre, GetTranslatedString("Event:DatingAbigailBirthday_Pierre:1")); //pie 1
e.speak(caroline, GetTranslatedString("Event:DatingAbigailBirthday_Caroline:1")); //car 1
e.speak(caroline, GetTranslatedString("Event:DatingAbigailBirthday_Caroline:2")); //car 2
e.speak(abigail, GetTranslatedString("Event:DatingAbigailBirthday_Abigail:2")); //abi 2
e.emoteFarmer_Thinking();
e.speak(abigail, GetTranslatedString("Event:DatingAbigailBirthday_Abigail:3"));//abi 3
e.speak(abigail, GetTranslatedString("Event:DatingAbigailBirthday_Abigail:4"));///abi 4
e.emoteFarmer_Heart();
e.emote_Heart("Abigail");
e.globalFadeOut(0.010);
e.setViewportPosition(-100, -100);
e.showMessage(HappyBirthday.Config.translationInfo.getTranslatedString("Event:DatingAbigailBirthday_Finish:0")); //abi party finish 0
e.showMessage(HappyBirthday.Config.translationInfo.getTranslatedString("Event:DatingAbigailBirthday_Finish:1")); //abi party finish 0
e.addObjectToPlayersInventory(220, 1, false);
e.showMessage(HappyBirthday.Config.translationInfo.getTranslatedString("Event:PartyOver"));
e.end();
return e;
}
public static EventHelper DatingBirthday_Emily()
{
List<EventPrecondition> conditions = new List<EventPrecondition>();
conditions.Add(new FarmerBirthdayPrecondition());
conditions.Add(new LocationPrecondition(Game1.getLocationFromName("HaleyHouse")));
conditions.Add(new TimePrecondition(600, 2600));
NPC emily = Game1.getCharacterFromName("Emily");
conditions.Add(new StardustCore.Events.Preconditions.NPCSpecific.DatingNPC(emily));
EventHelper e = new EventHelper("BirthdayDating:Emily", 19956, conditions, new EventStartData("playful", 20, 18, new EventStartData.FarmerData(11, 20, EventHelper.FacingDirection.Right), new List<EventStartData.NPCData>() {
new EventStartData.NPCData(emily,20,17, EventHelper.FacingDirection.Down),
}));
e.globalFadeIn();
//Dialogue here.
e.moveFarmerRight(9, EventHelper.FacingDirection.Up, false);
e.speak(emily, GetTranslatedString("Event:DatingEmilyBirthday_Emily:0")); //emi 0
e.speak(emily, GetTranslatedString("Event:DatingEmilyBirthday_Emily:1")); //emi 0
e.emoteFarmer_Happy();
e.speak(emily, GetTranslatedString("Event:DatingEmilyBirthday_Emily:2")); //emi 0
e.speak(emily, GetTranslatedString("Event:DatingEmilyBirthday_Emily:3")); //emi 0
e.speak(emily, GetTranslatedString("Event:DatingEmilyBirthday_Emily:4")); //emi 0
e.emoteFarmer_Thinking();
e.speak(emily, GetTranslatedString("Event:DatingEmilyBirthday_Emily:5")); //emi 0
e.emoteFarmer_Heart();
e.emote_Heart("Emily");
e.globalFadeOut(0.010);
e.setViewportPosition(-100, -100);
e.showMessage(HappyBirthday.Config.translationInfo.getTranslatedString("Event:DatingEmilyBirthday_Finish:0")); //abi party finish 0
e.showMessage(HappyBirthday.Config.translationInfo.getTranslatedString("Event:DatingEmilyBirthday_Finish:1")); //abi party finish 0
e.addObjectToPlayersInventory(220, 1, false);
e.showMessage(HappyBirthday.Config.translationInfo.getTranslatedString("Event:PartyOver"));
e.end();
return e;
}
public static EventHelper DatingBirthday_Haley()
{
List<EventPrecondition> conditions = new List<EventPrecondition>();
conditions.Add(new FarmerBirthdayPrecondition());
conditions.Add(new LocationPrecondition(Game1.getLocationFromName("HaleyHouse")));
conditions.Add(new TimePrecondition(600, 2600));
NPC haley = Game1.getCharacterFromName("Haley");
conditions.Add(new StardustCore.Events.Preconditions.NPCSpecific.DatingNPC(haley));
EventHelper e = new EventHelper("BirthdayDating:Haley", 19957, conditions, new EventStartData("playful", 20, 18, new EventStartData.FarmerData(11, 20, EventHelper.FacingDirection.Right), new List<EventStartData.NPCData>() {
new EventStartData.NPCData(haley,20,17, EventHelper.FacingDirection.Down),
}));
e.globalFadeIn();
//Dialogue here.
e.moveFarmerRight(9, EventHelper.FacingDirection.Up, false);
e.speak(haley, GetTranslatedString("Event:DatingHaleyBirthday_Haley:0"));
e.speak(haley, GetTranslatedString("Event:DatingHaleyBirthday_Haley:1"));
e.emoteFarmer_Happy();
e.speak(haley, GetTranslatedString("Event:DatingHaleyBirthday_Haley:2"));
e.speak(haley, GetTranslatedString("Event:DatingHaleyBirthday_Haley:3"));
e.emoteFarmer_Thinking();
e.speak(haley, GetTranslatedString("Event:DatingHaleyBirthday_Haley:4"));
e.emoteFarmer_Heart();
e.emote_Heart("Haley");
e.globalFadeOut(0.010);
e.setViewportPosition(-100, -100);
e.showMessage(HappyBirthday.Config.translationInfo.getTranslatedString("Event:DatingHaleyBirthday_Finish:0")); //abi party finish 0
e.showMessage(HappyBirthday.Config.translationInfo.getTranslatedString("Event:DatingHaleyBirthday_Finish:1")); //abi party finish 0
e.addObjectToPlayersInventory(221, 1, false);
e.showMessage(HappyBirthday.Config.translationInfo.getTranslatedString("Event:PartyOver"));
e.end();
return e;
}
public static EventHelper DatingBirthday_Sam()
{
List<EventPrecondition> conditions = new List<EventPrecondition>();
conditions.Add(new FarmerBirthdayPrecondition());
conditions.Add(new LocationPrecondition(Game1.getLocationFromName("SamHouse")));
conditions.Add(new TimePrecondition(600, 2600));
NPC sam = Game1.getCharacterFromName("Sam");
conditions.Add(new StardustCore.Events.Preconditions.NPCSpecific.DatingNPC(sam));
EventHelper e = new EventHelper("BirthdayDating:Sam", 19959, conditions, new EventStartData("playful", 3, 6, new EventStartData.FarmerData(7, 9, EventHelper.FacingDirection.Up), new List<EventStartData.NPCData>() {
new EventStartData.NPCData(sam,3,5, EventHelper.FacingDirection.Down),
}));
e.globalFadeIn();
//Dialogue here.
e.moveFarmerUp(4, EventHelper.FacingDirection.Up, false);
e.moveFarmerLeft(3, EventHelper.FacingDirection.Left, false);
e.npcFaceDirection(sam, EventHelper.FacingDirection.Right);
e.speak(sam, GetTranslatedString("Event:DatingSamBirthday_Sam:0"));
e.speak(sam, GetTranslatedString("Event:DatingSamBirthday_Sam:1"));
e.speak(sam, GetTranslatedString("Event:DatingSamBirthday_Sam:2"));
e.speak(sam, GetTranslatedString("Event:DatingSamBirthday_Sam:3"));
e.emoteFarmer_Heart();
e.emote_Heart("Sam");
e.globalFadeOut(0.010);
e.setViewportPosition(-100, -100);
e.showMessage(HappyBirthday.Config.translationInfo.getTranslatedString("Event:DatingSamBirthday_Finish:0")); //sam party finish 0
e.showMessage(HappyBirthday.Config.translationInfo.getTranslatedString("Event:DatingSamBirthday_Finish:1")); //sam party finish 0
e.addObjectToPlayersInventory(206, 1, false);
e.addObjectToPlayersInventory(167, 1, false);
e.showMessage(HappyBirthday.Config.translationInfo.getTranslatedString("Event:PartyOver"));
e.end();
return e;
}
/// <summary>
/// Event that occurs when the player is dating Sebastian.
/// Status: Finished.
/// </summary>
/// <returns></returns>
public static EventHelper DatingBirthday_Sebastian()
{
List<EventPrecondition> conditions = new List<EventPrecondition>();
conditions.Add(new FarmerBirthdayPrecondition());
conditions.Add(new LocationPrecondition(Game1.getLocationFromName("ScienceHouse")));
conditions.Add(new TimePrecondition(600, 2600));
NPC maru = Game1.getCharacterFromName("Maru");
NPC sebastian = Game1.getCharacterFromName("Sebastian");
NPC robin = Game1.getCharacterFromName("Robin");
NPC demetrius = Game1.getCharacterFromName("Demetrius");
conditions.Add(new StardustCore.Events.Preconditions.NPCSpecific.DatingNPC(sebastian));
EventHelper e = new EventHelper("BirthdayDating:Sebastian", 19952, conditions, new EventStartData("playful", 28, 12, new EventStartData.FarmerData(23, 12, EventHelper.FacingDirection.Right), new List<EventStartData.NPCData>() {
new EventStartData.NPCData(maru,27,11, EventHelper.FacingDirection.Down),
new EventStartData.NPCData(sebastian,26,13, EventHelper.FacingDirection.Up),
new EventStartData.NPCData(robin,28,9, EventHelper.FacingDirection.Up),
new EventStartData.NPCData(demetrius,30,11, EventHelper.FacingDirection.Left)
}));
e.globalFadeIn();
e.moveFarmerRight(3, EventHelper.FacingDirection.Right, true);
e.npcFaceDirection(maru, EventHelper.FacingDirection.Left);
e.npcFaceDirection(demetrius, EventHelper.FacingDirection.Left);
//Seb is already facing up.
e.npcFaceDirection(robin, EventHelper.FacingDirection.Down);
//Dialogue goes here.
//Seriously improve dialogue lines. Maru is probably the NPC I know the least about.
e.speak(sebastian, GetTranslatedString("Event:DatingSebastianBirthday_Sebastian:0")); //sebastian 0
e.speak(robin, GetTranslatedString("Event:DatingSebastianBirthday_Robin:0")); //maru 0
e.speak(maru, GetTranslatedString("Event:DatingSebastianBirthday_Maru:0"));//Maru 0
e.speak(robin, GetTranslatedString("Event:DatingSebastianBirthday_Robin:1")); //robin 0
e.speak(demetrius, GetTranslatedString("Event:DatingSebastianBirthday_Demetrius:0")); //demetrius 0
e.speak(sebastian, GetTranslatedString("Event:DatingSebastianBirthday_Sebastian:1")); //Sebastian 1
e.emote_ExclamationMark("Robin");
e.npcFaceDirection(robin, EventHelper.FacingDirection.Up);
e.speak(robin, GetTranslatedString("Event:DatingSebastianBirthday_Robin:2")); //robin 1
e.npcFaceDirection(robin, EventHelper.FacingDirection.Down);
e.moveActorDown("Robin", 1, EventHelper.FacingDirection.Down, false);
e.addObject(27, 12, 220);
e.speak(demetrius, GetTranslatedString("Event:DatingSebastianBirthday_Demetrius:1")); //maru 2
e.emoteFarmer_Thinking();
e.speak(maru, GetTranslatedString("Event:DatingSebastianBirthday_Maru:1")); //maru 3
e.speak(sebastian, GetTranslatedString("Event:DatingSebastianBirthday_Sebastian:2")); //Sebastian 1
//Event finish commands.
e.emoteFarmer_Heart();
e.emote_Heart("Sebastian");
e.globalFadeOut(0.010);
e.setViewportPosition(-100, -100);
e.showMessage(HappyBirthday.Config.translationInfo.getTranslatedString("Event:DatingSebastianBirthday_Finish:0")); //maru party finish 0
e.showMessage(HappyBirthday.Config.translationInfo.getTranslatedString("Event:DatingSebastianBirthday_Finish:1")); //maru party finish 0
e.addObjectToPlayersInventory(220, 1, false);
e.showMessage(HappyBirthday.Config.translationInfo.getTranslatedString("Event:PartyOver"));
e.end();
return e;
}
public static EventHelper DatingBirthday_Elliott()
{
List<EventPrecondition> conditions = new List<EventPrecondition>();
conditions.Add(new FarmerBirthdayPrecondition());
conditions.Add(new LocationPrecondition(Game1.getLocationFromName("ElliottHouse")));
conditions.Add(new TimePrecondition(600, 2600));
NPC elliott = Game1.getCharacterFromName("Elliott");
conditions.Add(new StardustCore.Events.Preconditions.NPCSpecific.DatingNPC(elliott));
EventHelper e = new EventHelper("BirthdayDating:Elliott", 19958, conditions, new EventStartData("playful", 3, 5, new EventStartData.FarmerData(3, 8, EventHelper.FacingDirection.Up), new List<EventStartData.NPCData>() {
new EventStartData.NPCData(elliott,3,5, EventHelper.FacingDirection.Down),
}));
e.globalFadeIn();
//Dialogue here.
e.moveFarmerUp(2, EventHelper.FacingDirection.Up, false);
e.speak(elliott, GetTranslatedString("Event:DatingElliottBirthday_Elliott:0"));
e.speak(elliott, GetTranslatedString("Event:DatingElliottBirthday_Elliott:1"));
e.speak(elliott, GetTranslatedString("Event:DatingElliottBirthday_Elliott:2"));
e.speak(elliott, GetTranslatedString("Event:DatingElliottBirthday_Elliott:3"));
e.speak(elliott, GetTranslatedString("Event:DatingElliottBirthday_Elliott:4"));
e.emoteFarmer_Thinking();
e.speak(elliott, GetTranslatedString("Event:DatingElliottBirthday_Elliott:5"));
e.emoteFarmer_Heart();
e.emote_Heart("Elliott");
e.globalFadeOut(0.010);
e.setViewportPosition(-100, -100);
e.showMessage(HappyBirthday.Config.translationInfo.getTranslatedString("Event:DatingElliottBirthday_Finish:0")); //abi party finish 0
e.showMessage(HappyBirthday.Config.translationInfo.getTranslatedString("Event:DatingElliottBirthday_Finish:1")); //abi party finish 0
e.addObjectToPlayersInventory(220, 1, false);
e.showMessage(HappyBirthday.Config.translationInfo.getTranslatedString("Event:PartyOver"));
e.end();
return e;
}
public static EventHelper DatingBirthday_Shane()
{
List<EventPrecondition> conditions = new List<EventPrecondition>();
conditions.Add(new FarmerBirthdayPrecondition());
conditions.Add(new LocationPrecondition(Game1.getLocationFromName("AnimalShop")));
conditions.Add(new TimePrecondition(600, 2600));
NPC shane = Game1.getCharacterFromName("Shane");
conditions.Add(new StardustCore.Events.Preconditions.NPCSpecific.DatingNPC(shane));
EventHelper e = new EventHelper("BirthdayDating:Shane", 19960, conditions, new EventStartData("playful", 26, 15, new EventStartData.FarmerData(19, 18, EventHelper.FacingDirection.Left), new List<EventStartData.NPCData>() {
new EventStartData.NPCData(shane,25,16, EventHelper.FacingDirection.Down),
}));
e.globalFadeIn();
//Dialogue here.
e.moveFarmerRight(3, EventHelper.FacingDirection.Right, false);
e.moveFarmerUp(2, EventHelper.FacingDirection.Up, false);
e.moveFarmerRight(2, EventHelper.FacingDirection.Right, false);
e.npcFaceDirection(shane, EventHelper.FacingDirection.Left);
e.speak(shane, GetTranslatedString("Event:DatingShaneBirthday_Shane:0"));
e.speak(shane, GetTranslatedString("Event:DatingShaneBirthday_Shane:1"));
e.speak(shane, GetTranslatedString("Event:DatingShaneBirthday_Shane:2"));
e.speak(shane, GetTranslatedString("Event:DatingShaneBirthday_Shane:3"));
e.emoteFarmer_Heart();
e.emote_Heart("Shane");
e.globalFadeOut(0.010);
e.setViewportPosition(-100, -100);
e.showMessage(HappyBirthday.Config.translationInfo.getTranslatedString("Event:DatingShaneBirthday_Finish:0")); //sam party finish 0
e.showMessage(HappyBirthday.Config.translationInfo.getTranslatedString("Event:DatingShaneBirthday_Finish:1")); //sam party finish 0
e.addObjectToPlayersInventory(206, 1, false);
e.addObjectToPlayersInventory(167, 1, false);
e.showMessage(HappyBirthday.Config.translationInfo.getTranslatedString("Event:PartyOver"));
e.end();
return e;
}
public static EventHelper DatingBirthday_Harvey()
{
List<EventPrecondition> conditions = new List<EventPrecondition>();
conditions.Add(new FarmerBirthdayPrecondition());
conditions.Add(new LocationPrecondition(Game1.getLocationFromName("HarveyRoom")));
conditions.Add(new TimePrecondition(600, 2600));
NPC harvey = Game1.getCharacterFromName("Harvey");
conditions.Add(new StardustCore.Events.Preconditions.NPCSpecific.DatingNPC(harvey));
EventHelper e = new EventHelper("BirthdayDating:Harvey", 19957, conditions, new EventStartData("playful", 6, 6, new EventStartData.FarmerData(6, 11, EventHelper.FacingDirection.Up), new List<EventStartData.NPCData>() {
new EventStartData.NPCData(harvey,3,6, EventHelper.FacingDirection.Down),
}));
e.globalFadeIn();
//Dialogue here.
e.moveFarmerUp(5, EventHelper.FacingDirection.Up, false);
e.moveFarmerLeft(2, EventHelper.FacingDirection.Left, false);
e.npcFaceDirection(harvey, EventHelper.FacingDirection.Right);
e.speak(harvey, GetTranslatedString("Event:DatingHarveyBirthday_Harvey:0"));
e.speak(harvey, GetTranslatedString("Event:DatingHarveyBirthday_Harvey:1"));
e.emoteFarmer_QuestionMark();
e.speak(harvey, GetTranslatedString("Event:DatingHarveyBirthday_Harvey:2"));
e.speak(harvey, GetTranslatedString("Event:DatingHarveyBirthday_Harvey:3"));
e.emoteFarmer_Heart();
e.emote_Heart("Harvey");
e.globalFadeOut(0.010);
e.setViewportPosition(-100, -100);
e.showMessage(HappyBirthday.Config.translationInfo.getTranslatedString("Event:DatingHarveyBirthday_Finish:0")); //abi party finish 0
e.showMessage(HappyBirthday.Config.translationInfo.getTranslatedString("Event:DatingHarveyBirthday_Finish:1")); //abi party finish 0
e.addObjectToPlayersInventory(237, 1, false);
e.addObjectToPlayersInventory(348, 1, false);
e.showMessage(HappyBirthday.Config.translationInfo.getTranslatedString("Event:PartyOver"));
e.end();
return e;
}
public static EventHelper DatingBirthday_Alex()
{
List<EventPrecondition> conditions = new List<EventPrecondition>();
conditions.Add(new FarmerBirthdayPrecondition());
conditions.Add(new LocationPrecondition(Game1.getLocationFromName("JoshHouse")));
conditions.Add(new TimePrecondition(600, 2600));
NPC alex = Game1.getCharacterFromName("Alex");
conditions.Add(new StardustCore.Events.Preconditions.NPCSpecific.DatingNPC(alex));
EventHelper e = new EventHelper("BirthdayDating:Alex", 19959, conditions, new EventStartData("playful", 3, 20, new EventStartData.FarmerData(7, 19, EventHelper.FacingDirection.Left), new List<EventStartData.NPCData>() {
new EventStartData.NPCData(alex,3,19, EventHelper.FacingDirection.Down),
}));
e.globalFadeIn();
//Dialogue here.
e.moveFarmerLeft(3, EventHelper.FacingDirection.Left, false);
e.npcFaceDirection(alex, EventHelper.FacingDirection.Right);
e.speak(alex, GetTranslatedString("Event:DatingAlexBirthday_Alex:0"));
e.speak(alex, GetTranslatedString("Event:DatingAlexBirthday_Alex:1"));
e.speak(alex, GetTranslatedString("Event:DatingAlexBirthday_Alex:2"));
e.speak(alex, GetTranslatedString("Event:DatingAlexBirthday_Alex:3"));
e.emoteFarmer_Heart();
e.emote_Heart("Alex");
e.globalFadeOut(0.010);
e.setViewportPosition(-100, -100);
e.showMessage(HappyBirthday.Config.translationInfo.getTranslatedString("Event:DatingAlexBirthday_Finish:0")); //sam party finish 0
e.showMessage(HappyBirthday.Config.translationInfo.getTranslatedString("Event:DatingAlexBirthday_Finish:1")); //sam party finish 0
e.addObjectToPlayersInventory(206, 1, false);
e.addObjectToPlayersInventory(167, 1, false);
e.showMessage(HappyBirthday.Config.translationInfo.getTranslatedString("Event:PartyOver"));
e.end();
return e;
}
/// <summary>
/// Todo: Finish this.
/// </summary>
/// <returns></returns>
public static EventHelper CommunityBirthday()
{
List<EventPrecondition> conditions = new List<EventPrecondition>();
conditions.Add(new FarmerBirthdayPrecondition());
conditions.Add(new LocationPrecondition(Game1.getLocationFromName("CommunityCenter")));
conditions.Add(new TimePrecondition(600, 2600));
conditions.Add(new StardustCore.Events.Preconditions.PlayerSpecific.JojaMember(false));
conditions.Add(new CommunityCenterCompleted(true));
//conditions.Add(new HasUnlockedCommunityCenter()); //Infered by the fact that you must enter the community center to trigger this event anyways.
EventHelper e = new EventHelper("CommunityCenterBirthday", 19961, conditions, new EventStartData("playful", -100, -100, new EventStartData.FarmerData(32, 22, EventHelper.FacingDirection.Up), new List<EventStartData.NPCData>()
{
new EventStartData.NPCData(Game1.getCharacterFromName("Lewis"),32,12, EventHelper.FacingDirection.Down),
}));
e.globalFadeIn();
e.moveFarmerUp(10, EventHelper.FacingDirection.Up, true);
e.showMessage("Shhh. I think they are here.");
e.showMessage("Somebody turn on the lights.");
e.setViewportPosition(32, 12);
e.emoteFarmer_ExclamationMark();
e.showMessage(HappyBirthday.Config.translationInfo.getTranslatedString("Event:CommunityBirthdayParty_0"));
e.emoteFarmer_Heart();
e.globalFadeOut(0.010);
e.setViewportPosition(-100, -100);
e.showMessage(HappyBirthday.Config.translationInfo.getTranslatedString("Event:CommunityBirthdayParty_1"));
e.showMessage(HappyBirthday.Config.translationInfo.getTranslatedString("Event:PartyOver"));
e.addObjectToPlayersInventory(220, 1, false);
e.end();
return e;
}
/*
public static EventHelper MarriedBirthday()
{
}
public static EventHelper JojaBirthday()
{
}
*/
public static string GetTranslatedString(string Key)
{
return HappyBirthday.Config.translationInfo.getTranslatedString(Key);
}
}
}

View File

@ -27,6 +27,7 @@ namespace Omegasis.HappyBirthday.Framework
/// <summary>The player's current birthday season.</summary>
private string BirthdaySeason;
private string seasonName;
/// <summary>The player's current birthday day.</summary>
private int BirthdayDay;
@ -45,7 +46,8 @@ namespace Omegasis.HappyBirthday.Framework
public BirthdayMenu(string season, int day, Action<string, int> onChanged)
: base(Game1.viewport.Width / 2 - (632 + IClickableMenu.borderWidth * 2) / 2, Game1.viewport.Height / 2 - (600 + IClickableMenu.borderWidth * 2) / 2 - Game1.tileSize, 632 + IClickableMenu.borderWidth * 2, 600 + IClickableMenu.borderWidth * 2 + Game1.tileSize)
{
this.BirthdaySeason = season;
this.BirthdaySeason = HappyBirthday.Config.translationInfo.getTranslatedString(season);
this.seasonName = season;
this.BirthdayDay = day;
this.OnChanged = onChanged;
this.SetUpPositions();
@ -73,13 +75,14 @@ namespace Omegasis.HappyBirthday.Framework
this.DayButtons.Clear();
this.OkButton = new ClickableTextureComponent("OK", new Rectangle(this.xPositionOnScreen + this.width - IClickableMenu.borderWidth - IClickableMenu.spaceToClearSideBorder - Game1.tileSize, this.yPositionOnScreen + this.height - IClickableMenu.borderWidth - IClickableMenu.spaceToClearTopBorder + Game1.tileSize / 4, Game1.tileSize, Game1.tileSize), "", null, Game1.mouseCursors, Game1.getSourceRectForStandardTileSheet(Game1.mouseCursors, 46), 1f);
this.Labels.Add(new ClickableComponent(new Rectangle(this.xPositionOnScreen + Game1.tileSize / 4 + IClickableMenu.spaceToClearSideBorder + IClickableMenu.borderWidth + Game1.tileSize * 3 + 8, this.yPositionOnScreen + IClickableMenu.borderWidth + IClickableMenu.spaceToClearTopBorder - Game1.tileSize / 8, 1, 1), "Birthday Season: " + this.BirthdaySeason));
this.Labels.Add(new ClickableComponent(new Rectangle(this.xPositionOnScreen + Game1.tileSize / 4 + IClickableMenu.spaceToClearSideBorder + IClickableMenu.borderWidth + Game1.tileSize * 3 + 8, this.yPositionOnScreen + IClickableMenu.borderWidth + IClickableMenu.spaceToClearTopBorder + Game1.tileSize, Game1.tileSize * 2, Game1.tileSize), "Birthday Date: " + this.BirthdayDay));
this.SeasonButtons.Add(new ClickableTextureComponent("Spring", new Rectangle(this.xPositionOnScreen + IClickableMenu.spaceToClearSideBorder + IClickableMenu.borderWidth + Game1.tileSize * 1 - Game1.tileSize / 4, this.yPositionOnScreen + IClickableMenu.borderWidth + IClickableMenu.spaceToClearTopBorder + (int)(Game1.tileSize * 3.10) - Game1.tileSize / 4, Game1.tileSize * 2, Game1.tileSize), "", "", Game1.mouseCursors, new Rectangle(188, 438, 32, 9), Game1.pixelZoom));
this.SeasonButtons.Add(new ClickableTextureComponent("Summer", new Rectangle(this.xPositionOnScreen + IClickableMenu.spaceToClearSideBorder + IClickableMenu.borderWidth + Game1.tileSize * 3 - Game1.tileSize / 4, this.yPositionOnScreen + IClickableMenu.borderWidth + IClickableMenu.spaceToClearTopBorder + (int)(Game1.tileSize * 3.10) - Game1.tileSize / 4, Game1.tileSize * 2, Game1.tileSize), "", "", Game1.mouseCursors, new Rectangle(220, 438, 32, 8), Game1.pixelZoom));
this.SeasonButtons.Add(new ClickableTextureComponent("Fall", new Rectangle(this.xPositionOnScreen + IClickableMenu.spaceToClearSideBorder + IClickableMenu.borderWidth + Game1.tileSize * 5 - Game1.tileSize / 4, this.yPositionOnScreen + IClickableMenu.borderWidth + IClickableMenu.spaceToClearTopBorder + (int)(Game1.tileSize * 3.1) - Game1.tileSize / 4, Game1.tileSize * 2, Game1.tileSize), "", "", Game1.mouseCursors, new Rectangle(188, 447, 32, 10), Game1.pixelZoom));
this.SeasonButtons.Add(new ClickableTextureComponent("Winter", new Rectangle(this.xPositionOnScreen + IClickableMenu.spaceToClearSideBorder + IClickableMenu.borderWidth + Game1.tileSize * 7 - Game1.tileSize / 4, this.yPositionOnScreen + IClickableMenu.borderWidth + IClickableMenu.spaceToClearTopBorder + (int)(Game1.tileSize * 3.1) - Game1.tileSize / 4, Game1.tileSize * 2, Game1.tileSize), "", "", Game1.mouseCursors, new Rectangle(220, 448, 32, 8), Game1.pixelZoom));
string bdaySeason = HappyBirthday.Config.translationInfo.getTranslatedString("Birthday") + " " + HappyBirthday.Config.translationInfo.getTranslatedString("Season");
string bdayDay= HappyBirthday.Config.translationInfo.getTranslatedString("Birthday") + " " + HappyBirthday.Config.translationInfo.getTranslatedString("Date");
this.Labels.Add(new ClickableComponent(new Rectangle(this.xPositionOnScreen + Game1.tileSize / 4 + IClickableMenu.spaceToClearSideBorder + IClickableMenu.borderWidth + Game1.tileSize * 3 + 8, this.yPositionOnScreen + IClickableMenu.borderWidth + IClickableMenu.spaceToClearTopBorder - Game1.tileSize / 8, 1, 1), bdaySeason+": " + this.BirthdaySeason));
this.Labels.Add(new ClickableComponent(new Rectangle(this.xPositionOnScreen + Game1.tileSize / 4 + IClickableMenu.spaceToClearSideBorder + IClickableMenu.borderWidth + Game1.tileSize * 3 + 8, this.yPositionOnScreen + IClickableMenu.borderWidth + IClickableMenu.spaceToClearTopBorder + Game1.tileSize, Game1.tileSize * 2, Game1.tileSize), bdayDay+": " + this.BirthdayDay));
this.SeasonButtons.Add(new ClickableTextureComponent("Spring", new Rectangle(this.xPositionOnScreen + IClickableMenu.spaceToClearSideBorder + IClickableMenu.borderWidth + Game1.tileSize * 1 - Game1.tileSize / 4, this.yPositionOnScreen + IClickableMenu.borderWidth + IClickableMenu.spaceToClearTopBorder + (int)(Game1.tileSize * 3.10) - Game1.tileSize / 4, Game1.tileSize * 2, Game1.tileSize), "", "", Game1.mouseCursors, this.getSpringButton(), Game1.pixelZoom));
this.SeasonButtons.Add(new ClickableTextureComponent("Summer", new Rectangle(this.xPositionOnScreen + IClickableMenu.spaceToClearSideBorder + IClickableMenu.borderWidth + Game1.tileSize * 3 - Game1.tileSize / 4, this.yPositionOnScreen + IClickableMenu.borderWidth + IClickableMenu.spaceToClearTopBorder + (int)(Game1.tileSize * 3.10) - Game1.tileSize / 4, Game1.tileSize * 2, Game1.tileSize), "", "", Game1.mouseCursors, this.getSummerButton(), Game1.pixelZoom));
this.SeasonButtons.Add(new ClickableTextureComponent("Fall", new Rectangle(this.xPositionOnScreen + IClickableMenu.spaceToClearSideBorder + IClickableMenu.borderWidth + Game1.tileSize * 5 - Game1.tileSize / 4, this.yPositionOnScreen + IClickableMenu.borderWidth + IClickableMenu.spaceToClearTopBorder + (int)(Game1.tileSize * 3.1) - Game1.tileSize / 4, Game1.tileSize * 2, Game1.tileSize), "", "", Game1.mouseCursors, this.getFallButton(), Game1.pixelZoom));
this.SeasonButtons.Add(new ClickableTextureComponent("Winter", new Rectangle(this.xPositionOnScreen + IClickableMenu.spaceToClearSideBorder + IClickableMenu.borderWidth + Game1.tileSize * 7 - Game1.tileSize / 4, this.yPositionOnScreen + IClickableMenu.borderWidth + IClickableMenu.spaceToClearTopBorder + (int)(Game1.tileSize * 3.1) - Game1.tileSize / 4, Game1.tileSize * 2, Game1.tileSize), "", "", Game1.mouseCursors, this.getWinterButton(), Game1.pixelZoom));
this.DayButtons.Add(new ClickableTextureComponent("1", new Rectangle(this.xPositionOnScreen + IClickableMenu.spaceToClearSideBorder + IClickableMenu.borderWidth + Game1.tileSize * 1 - Game1.tileSize / 4, this.yPositionOnScreen + IClickableMenu.borderWidth + IClickableMenu.spaceToClearTopBorder + Game1.tileSize * 4 - Game1.tileSize / 4, Game1.tileSize * 1, Game1.tileSize), "", "", Game1.content.Load<Texture2D>("LooseSprites\\font_bold"), new Rectangle(8, 16, 8, 12), Game1.pixelZoom));
this.DayButtons.Add(new ClickableTextureComponent("2", new Rectangle(this.xPositionOnScreen + IClickableMenu.spaceToClearSideBorder + IClickableMenu.borderWidth + Game1.tileSize * 2 - Game1.tileSize / 4, this.yPositionOnScreen + IClickableMenu.borderWidth + IClickableMenu.spaceToClearTopBorder + Game1.tileSize * 4 - Game1.tileSize / 4, Game1.tileSize * 1, Game1.tileSize), "", "", Game1.content.Load<Texture2D>("LooseSprites\\font_bold"), new Rectangle(16, 16, 8, 12), Game1.pixelZoom));
@ -128,6 +131,7 @@ namespace Omegasis.HappyBirthday.Framework
this.DayButtons.Add(new ClickableTextureComponent("27", new Rectangle(this.xPositionOnScreen + IClickableMenu.spaceToClearSideBorder + IClickableMenu.borderWidth + (int)(Game1.tileSize * 6.25) - Game1.tileSize / 3, this.yPositionOnScreen + IClickableMenu.borderWidth + IClickableMenu.spaceToClearTopBorder + Game1.tileSize * 7 - Game1.tileSize / 4, Game1.tileSize / 2, Game1.tileSize), "", "", Game1.content.Load<Texture2D>("LooseSprites\\font_bold"), new Rectangle(56, 16, 8, 12), Game1.pixelZoom));
this.DayButtons.Add(new ClickableTextureComponent("28", new Rectangle(this.xPositionOnScreen + IClickableMenu.spaceToClearSideBorder + IClickableMenu.borderWidth + (int)(Game1.tileSize * 6.75) - Game1.tileSize / 4, this.yPositionOnScreen + IClickableMenu.borderWidth + IClickableMenu.spaceToClearTopBorder + Game1.tileSize * 7 - Game1.tileSize / 4, Game1.tileSize / 2, Game1.tileSize), "", "", Game1.content.Load<Texture2D>("LooseSprites\\font_bold"), new Rectangle(16, 16, 8, 12), Game1.pixelZoom));
this.DayButtons.Add(new ClickableTextureComponent("28", new Rectangle(this.xPositionOnScreen + IClickableMenu.spaceToClearSideBorder + IClickableMenu.borderWidth + (int)(Game1.tileSize * 7.25) - Game1.tileSize / 3, this.yPositionOnScreen + IClickableMenu.borderWidth + IClickableMenu.spaceToClearTopBorder + Game1.tileSize * 7 - Game1.tileSize / 4, Game1.tileSize / 2, Game1.tileSize), "", "", Game1.content.Load<Texture2D>("LooseSprites\\font_bold"), new Rectangle(64, 16, 8, 12), Game1.pixelZoom));
}
/// <summary>Handle a button click.</summary>
@ -144,9 +148,10 @@ namespace Omegasis.HappyBirthday.Framework
case "Summer":
case "Fall":
case "Winter":
this.BirthdaySeason = name.ToLower();
this.OnChanged(this.BirthdaySeason, this.BirthdayDay);
Game1.activeClickableMenu = new BirthdayMenu(this.BirthdaySeason, this.BirthdayDay, this.OnChanged);
this.BirthdaySeason = HappyBirthday.Config.translationInfo.getTranslatedString(name);
this.seasonName = name;
this.OnChanged(this.seasonName, this.BirthdayDay);
Game1.activeClickableMenu = new BirthdayMenu(this.seasonName, this.BirthdayDay, this.OnChanged);
break;
// OK button
@ -158,8 +163,8 @@ namespace Omegasis.HappyBirthday.Framework
default:
this.BirthdayDay = Convert.ToInt32(name);
this.OnChanged(this.BirthdaySeason, this.BirthdayDay);
Game1.activeClickableMenu = new BirthdayMenu(this.BirthdaySeason, this.BirthdayDay, this.OnChanged);
this.OnChanged(this.seasonName, this.BirthdayDay);
Game1.activeClickableMenu = new BirthdayMenu(this.seasonName, this.BirthdayDay, this.OnChanged);
break;
}
Game1.playSound("coin");
@ -172,7 +177,7 @@ namespace Omegasis.HappyBirthday.Framework
public override void receiveLeftClick(int x, int y, bool playSound = true)
{
//If the season is not selected then the day buttons can't be clicked. Thanks to @Potato#5266 on the SDV discord for this tip.
if (this.BirthdaySeason == "spring" || this.BirthdaySeason == "summer" || this.BirthdaySeason == "fall" || this.BirthdaySeason == "winter")
if (string.IsNullOrEmpty(this.seasonName)==false)
{
foreach (ClickableTextureComponent button in this.DayButtons)
{
@ -197,7 +202,7 @@ namespace Omegasis.HappyBirthday.Framework
if (this.OkButton.containsPoint(x, y))
{
if (this.BirthdaySeason == "" || this.BirthdayDay == 0) return;
if (this.seasonName == "" || this.BirthdayDay == 0) return;
this.HandleButtonClick(this.OkButton.name);
this.OkButton.scale -= 0.25f;
this.OkButton.scale = Math.Max(0.75f, this.OkButton.scale);
@ -241,10 +246,11 @@ namespace Omegasis.HappyBirthday.Framework
{
// draw menu box
Game1.drawDialogueBox(this.xPositionOnScreen, this.yPositionOnScreen, this.width, this.height, false, true);
b.Draw(Game1.daybg, new Vector2((this.xPositionOnScreen + Game1.tileSize + Game1.tileSize * 2 / 3 - 2), (this.yPositionOnScreen + IClickableMenu.borderWidth + IClickableMenu.spaceToClearTopBorder - Game1.tileSize / 4)), Color.White);
//b.Draw(Game1.daybg, new Vector2((this.xPositionOnScreen + Game1.tileSize + Game1.tileSize * 2 / 3 - 2), (this.yPositionOnScreen + IClickableMenu.borderWidth + IClickableMenu.spaceToClearTopBorder - Game1.tileSize / 4)), Color.White);
//Game1.player.FarmerSprite.draw(b, new Vector2((this.xPositionOnScreen + Game1.tileSize + Game1.tileSize * 2 / 3 - 2), (this.yPositionOnScreen + IClickableMenu.borderWidth + IClickableMenu.spaceToClearTopBorder - Game1.tileSize / 4)),1f);
// draw day buttons
if (this.BirthdaySeason == "spring" || this.BirthdaySeason == "summer" || this.BirthdaySeason == "fall" || this.BirthdaySeason == "winter")
if (string.IsNullOrEmpty(this.seasonName)==false)
{
foreach (ClickableTextureComponent button in this.DayButtons)
button.draw(b);
@ -270,7 +276,7 @@ namespace Omegasis.HappyBirthday.Framework
}
// draw OK button
if (this.BirthdayDay != 0 && this.BirthdaySeason != "")
if (this.BirthdayDay != 0 && this.seasonName != "")
this.OkButton.draw(b);
else
{
@ -281,5 +287,31 @@ namespace Omegasis.HappyBirthday.Framework
// draw cursor
this.drawMouse(b);
}
public Rectangle getSpringButton()
{
//For some reason turkish and italian don't use translated words for the seasons???
if (HappyBirthday.Config.translationInfo.CurrentTranslation == TranslationInfo.LanguageName.Chinese)
{
return new Rectangle(188, 437, 32, 9);
}
else
{
return new Rectangle(188, 438, 32, 9);
}
}
public Rectangle getSummerButton()
{
return new Rectangle(220, 438, 32, 8);
}
public Rectangle getFallButton()
{
return new Rectangle(188, 447, 32, 10);
}
public Rectangle getWinterButton()
{
return new Rectangle(220, 448, 32, 8);
}
}
}

View File

@ -0,0 +1,30 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using StardustCore.Events.Preconditions;
namespace Omegasis.HappyBirthday.Framework.EventPreconditions
{
public class FarmerBirthdayPrecondition:EventPrecondition
{
public FarmerBirthdayPrecondition()
{
}
public override string ToString()
{
return "Omegasis.HappyBirthday";
}
public override bool meetsCondition()
{
return HappyBirthday.Instance.IsBirthday();
}
}
}

View File

@ -0,0 +1,36 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using StardustCore.Events.Preconditions;
using StardewValley;
namespace Omegasis.HappyBirthday.Framework.EventPreconditions
{
public class SpouseBirthdayPrecondition:EventPrecondition
{
public SpouseBirthdayPrecondition()
{
}
public override bool meetsCondition()
{
if (Game1.player.getSpouse() == null) return false;
else
{
NPC spouse = Game1.player.getSpouse();
if (spouse.isBirthday(Game1.currentSeason, Game1.dayOfMonth)){
return true;
}
else
{
return false;
}
}
}
}
}

View File

@ -28,12 +28,15 @@ namespace Omegasis.HappyBirthday.Framework
/// <summary>The minimum amount of friendship needed to get a happy birthday greeting from an npc.</summary>
public int minimumFriendshipLevelForBirthdayWish = 2;
public bool autoSetTranslation { get; set; } = true;
/// <summary>Handles different translations of files.</summary>
public TranslationInfo translationInfo;
/// <summary>Whether or not to load from the old BirthdayGifts.xnb located in StardewValley/Data or from the new BirthdayGifts.json located in the mod directory.</summary>
public bool useLegacyBirthdayFiles;
/// <summary>Construct an instance.</summary>
public ModConfig()
{

View File

@ -14,6 +14,8 @@ namespace Omegasis.HappyBirthday.Framework
str.Replace("@", Game1.player.name);
HUDMessage message = new HUDMessage(str, 1);
foreach (KeyValuePair<long, Farmer> f in Game1.otherFarmers)
{
HappyBirthday.ModHelper.Multiplayer.SendMessage<string>(message.message, FSTRING_SendBirthdayMessageToOthers, new string[] { HappyBirthday.ModHelper.Multiplayer.ModID }, new long[] { f.Key });

View File

@ -1,5 +1,7 @@
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using StardewValley;
namespace Omegasis.HappyBirthday.Framework
@ -7,195 +9,187 @@ namespace Omegasis.HappyBirthday.Framework
/// <summary>A class which deals with handling different translations for Vocalization should other voice teams ever wish to voice act for that language.</summary>
public class TranslationInfo
{
/// <summary>The list of all supported translations by this mod.</summary>
public List<string> translations;
public enum LanguageName
{
English,
Spanish,
Chinese,
Japanese,
Russian,
German,
Portuguese,
Italian,
French,
Korean,
Turkish,
Hungarian
}
public enum FileType
{
XNB,
JSON
}
/*********
** Accessors
*********/
/// <summary>The language names supported by this mod.</summary>
public LanguageName[] LanguageNames { get; } = (from LanguageName language in Enum.GetValues(typeof(LanguageName)) select language).ToArray();
/// <summary>The current translation mode for the mod, so that it knows what files to load at the beginning of the game.</summary>
public string currentTranslation;
public LanguageName CurrentTranslation { get; set; } = LanguageName.English;
/// <summary>Holds the info for what translation has what file extension.</summary>
public Dictionary<string, string> translationFileInfo;
public Dictionary<LanguageName, string> TranslationFileExtensions { get; } = new Dictionary<LanguageName, string>();
public Dictionary<string, LocalizedContentManager.LanguageCode> translationCodes;
public Dictionary<LanguageName, LocalizedContentManager.LanguageCode> TranslationCodes { get; } = new Dictionary<LanguageName, LocalizedContentManager.LanguageCode>();
/// <summary>Construct an instance..</summary>
/*********
** Public methods
*********/
/// <summary>Construct an instance.</summary>
public TranslationInfo()
{
this.translations = new List<string>();
this.translationFileInfo = new Dictionary<string, string>();
this.translationCodes = new Dictionary<string, LocalizedContentManager.LanguageCode>();
this.translations.Add("English");
this.translations.Add("Spanish");
this.translations.Add("Chinese");
this.translations.Add("Japanese");
this.translations.Add("Russian");
this.translations.Add("German");
this.translations.Add("Brazillian Portuguese");
this.currentTranslation = "English";
this.translationFileInfo.Add("English", ".json");
this.translationFileInfo.Add("Spanish", ".es-ES.json");
this.translationFileInfo.Add("Chinese", ".zh-CN.json");
this.translationFileInfo.Add("Japanese", ".ja-JP.json");
this.translationFileInfo.Add("Russian", ".ru-RU.json");
this.translationFileInfo.Add("German", ".de-DE.json");
this.translationFileInfo.Add("Brazillian Portuguese", ".pt-BR.json");
this.TranslationFileExtensions.Add(LanguageName.English, "en-US");
this.TranslationFileExtensions.Add(LanguageName.Spanish, "es-ES");
this.TranslationFileExtensions.Add(LanguageName.Chinese, "zh-CN");
this.TranslationFileExtensions.Add(LanguageName.Japanese, "ja-JP");
this.TranslationFileExtensions.Add(LanguageName.Russian, "ru-RU");
this.TranslationFileExtensions.Add(LanguageName.German, "de-DE");
this.TranslationFileExtensions.Add(LanguageName.Portuguese, "pt-BR");
//1.3 languages.
this.TranslationFileExtensions.Add(LanguageName.Italian, "it-IT");
this.TranslationFileExtensions.Add(LanguageName.French, "fr-FR");
this.TranslationFileExtensions.Add(LanguageName.Hungarian, "hu-HU");
this.TranslationFileExtensions.Add(LanguageName.Turkish, "tr-TR");
this.TranslationFileExtensions.Add(LanguageName.Korean, "ko-KR");
this.translationCodes.Add("English", LocalizedContentManager.LanguageCode.en);
this.translationCodes.Add("Spanish", LocalizedContentManager.LanguageCode.es);
this.translationCodes.Add("Chinese", LocalizedContentManager.LanguageCode.zh);
this.translationCodes.Add("Japanese", LocalizedContentManager.LanguageCode.ja);
this.translationCodes.Add("Russian", LocalizedContentManager.LanguageCode.ru);
this.translationCodes.Add("German", LocalizedContentManager.LanguageCode.de);
this.translationCodes.Add("Brazillian Portuguese", LocalizedContentManager.LanguageCode.pt);
this.TranslationCodes.Add(LanguageName.English, LocalizedContentManager.LanguageCode.en);
this.TranslationCodes.Add(LanguageName.Spanish, LocalizedContentManager.LanguageCode.es);
this.TranslationCodes.Add(LanguageName.Chinese, LocalizedContentManager.LanguageCode.zh);
this.TranslationCodes.Add(LanguageName.Japanese, LocalizedContentManager.LanguageCode.ja);
this.TranslationCodes.Add(LanguageName.Russian, LocalizedContentManager.LanguageCode.ru);
this.TranslationCodes.Add(LanguageName.German, LocalizedContentManager.LanguageCode.de);
this.TranslationCodes.Add(LanguageName.Portuguese, LocalizedContentManager.LanguageCode.pt);
//1.3 languages
this.TranslationCodes.Add(LanguageName.Italian, LocalizedContentManager.LanguageCode.it);
this.TranslationCodes.Add(LanguageName.French, LocalizedContentManager.LanguageCode.fr);
this.TranslationCodes.Add(LanguageName.Hungarian, LocalizedContentManager.LanguageCode.hu);
this.TranslationCodes.Add(LanguageName.Turkish, LocalizedContentManager.LanguageCode.tr);
this.TranslationCodes.Add(LanguageName.Korean, LocalizedContentManager.LanguageCode.ko);
}
/// <summary>
/// Gets the current SDV translation code.
/// </summary>
/// <returns></returns>
public LocalizedContentManager.LanguageCode getCurrrentLanguageCode()
{
return this.TranslationCodes[this.CurrentTranslation];
}
public string getTranslationNameFromPath(string fullPath)
public void setTranslationFromLanguageCode(LocalizedContentManager.LanguageCode code)
{
return Path.GetFileName(fullPath);
}
public void changeLocalizedContentManagerFromTranslation(string translation)
foreach (var v in this.TranslationCodes)
{
string tra = this.getTranslationNameFromPath(translation);
bool f = this.translationCodes.TryGetValue(tra, out LocalizedContentManager.LanguageCode code);
if (!f) LocalizedContentManager.CurrentLanguageCode = LocalizedContentManager.LanguageCode.en;
else LocalizedContentManager.CurrentLanguageCode = code;
if (v.Value.Equals(code))
{
this.CurrentTranslation = v.Key;
HappyBirthday.ModHelper.WriteConfig<ModConfig>(HappyBirthday.Config);
return;
}
public void resetLocalizationCode()
{
LocalizedContentManager.CurrentLanguageCode = LocalizedContentManager.LanguageCode.en;
}
}
/// <summary>Gets the proper file extension for the current translation.</summary>
/// <param name="path"></param>
public string getFileExtentionForTranslation(string path)
/// <param name="language">The translation language name.</param>
public string getFileExtentionForTranslation(LanguageName language, FileType File)
{
/*
bool f = translationFileInfo.TryGetValue(translation, out string value);
if (!f) return ".json";
else return value;
*/
string translation = Path.GetFileName(path);
try
{
return this.translationFileInfo[translation];
}
catch
if (language == LanguageName.English)
{
return this.getFileExtensionForFileType(File);
}
return "."+this.TranslationFileExtensions[language] + this.getFileExtensionForFileType(File);
}
catch (Exception err)
{
Omegasis.HappyBirthday.HappyBirthday.ModMonitor.Log(err.ToString());
Omegasis.HappyBirthday.HappyBirthday.ModMonitor.Log($"Attempted to get translation: {language}");
return ".xnb";
}
}
public string getFileExtensionForFileType(FileType Type)
{
if (Type == FileType.JSON)
{
HappyBirthday.ModMonitor.Log("WTF SOMETHING IS WRONG!", StardewModdingAPI.LogLevel.Warn);
//Vocalization.ModMonitor.Log(err.ToString());
//Vocalization.ModMonitor.Log("Attempted to get translation: " + translation);
return ".json";
}
}
/// <summary>Gets the proper json for Buildings (aka Blueprints) from the data folder.</summary>
public string getBuildingjsonForTranslation(string translation)
else
{
string buildings = "Blueprints";
return buildings + this.getFileExtentionForTranslation(translation);
return ".xnb";
}
/// <summary>Gets the proper json file for the name passed in. Combines the file name with it's proper translation extension.</summary>
/// <param name="jsonFileName"></param>
/// <param name="translation"></param>
public string getjsonForTranslation(string jsonFileName, string translation)
{
return jsonFileName + this.getFileExtentionForTranslation(translation);
}
/// <summary>Loads an json file from StardewValley/Content</summary>
/// <param name="jsonFileName"></param>
/// <param name="key"></param>
/// <param name="translation"></param>
public string LoadjsonFile(string jsonFileName, string key, string translation)
public string getFileExtentionForDirectory(LanguageName language)
{
string json = jsonFileName + this.getFileExtentionForTranslation(translation);
Dictionary<string, string> loadedDict = Game1.content.Load<Dictionary<string, string>>(json);
bool f = loadedDict.TryGetValue(key, out string loaded);
if (!f)
try
{
//Vocalization.ModMonitor.Log("Big issue: Key not found in file:" + json + " " + key);
string s = this.TranslationFileExtensions[language];
return s;
}
catch (Exception err)
{
Omegasis.HappyBirthday.HappyBirthday.ModMonitor.Log(err.ToString());
Omegasis.HappyBirthday.HappyBirthday.ModMonitor.Log($"Attempted to get translation: {language}");
return "";
}
else return loaded;
}
/// <summary>Loads a string dictionary from a json file.</summary>
/// <param name="jsonFileName"></param>
/// <param name="translation"></param>
public Dictionary<string, string> LoadJsonFileDictionary(string jsonFileName, string translation)
/// <summary>
/// Gets the json file for the translation.
/// </summary>
/// <param name="FileName"></param>
/// <param name="language"></param>
/// <returns></returns>
public string getJSONForTranslation(string FileName, LanguageName language)
{
string json = jsonFileName + this.getFileExtentionForTranslation(translation);
Dictionary<string, string> loadedDict = Game1.content.Load<Dictionary<string, string>>(json);
return loadedDict;
}
public virtual string LoadString(string path, string translation, object sub1, object sub2, object sub3)
if (language != LanguageName.English)
{
string format = this.LoadString(path, translation);
try
return FileName + this.getFileExtentionForTranslation(language, FileType.JSON);
}
else
{
return string.Format(format, sub1, sub2, sub3);
return FileName + this.getFileExtentionForTranslation(language, FileType.JSON);
}
catch { }
return format;
}
public virtual string LoadString(string path, string translation, object sub1, object sub2)
/// <summary>Loads an XNB file from StardewValley/Content</summary>
public string LoadStringFromXNBFile(string xnbFileName, string key, LanguageName language)
{
string format = this.LoadString(path, translation);
try
string xnb = xnbFileName + this.getFileExtentionForTranslation(language, FileType.XNB);
Dictionary<string, string> loadedDict = Game1.content.Load<Dictionary<string, string>>(xnb);
if (!loadedDict.TryGetValue(key, out string loaded))
{
return string.Format(format, sub1, sub2);
Omegasis.HappyBirthday.HappyBirthday.ModMonitor.Log("Big issue: Key not found in file:" + xnb + " " + key);
return "";
}
catch { }
return format;
return loaded;
}
public virtual string LoadString(string path, string translation, object sub1)
{
string format = this.LoadString(path, translation);
try
{
return string.Format(format, sub1);
}
catch { }
return format;
}
public virtual string LoadString(string path, string translation)
public virtual string LoadString(string path, LanguageName language)
{
this.parseStringPath(path, out string assetName, out string key);
return this.LoadjsonFile(assetName, key, translation);
}
public virtual string LoadString(string path, string translation, params object[] substitutions)
{
string format = this.LoadString(path, translation);
if (substitutions.Length != 0)
{
try
{
return string.Format(format, substitutions);
}
catch { }
}
return format;
return this.LoadStringFromXNBFile(assetName, key, language);
}
private void parseStringPath(string path, out string assetName, out string key)
@ -204,5 +198,63 @@ namespace Omegasis.HappyBirthday.Framework
assetName = path.Substring(0, length);
key = path.Substring(length + 1, path.Length - length - 1);
}
/// <summary>
/// Gets a translated string from the the dictionary with the proper translation; Returns an empty string if this fails somehow.
/// </summary>
/// <param name="Language"></param>
/// <param name="Key"></param>
/// <returns></returns>
public string getTranslatedString(LocalizedContentManager.LanguageCode Language, string Key)
{
try
{
return HappyBirthday.Instance.messages.translatedStrings[Language][Key];
}
catch (Exception err)
{
return "";
}
}
public string getTranslatedString(string Key)
{
if (string.IsNullOrEmpty(Key)) return "";
if (Key.Equals("Birthday"))
{
string s = Game1.content.LoadString("Strings\\UI:Profile_Birthday");
return s;
}
if (Key.Equals("Spring") || Key.Equals("spring"))
{
string file = Path.Combine("Strings", "StringsFromCSFiles");
return HappyBirthday.Config.translationInfo.LoadStringFromXNBFile(file, "Utility.cs.5680", HappyBirthday.Config.translationInfo.CurrentTranslation);
}
if (Key.Equals("Summer") || Key.Equals("summer"))
{
string file = Path.Combine("Strings", "StringsFromCSFiles");
return HappyBirthday.Config.translationInfo.LoadStringFromXNBFile(file, "Utility.cs.5681", HappyBirthday.Config.translationInfo.CurrentTranslation);
}
if (Key.Equals("Fall") || Key.Equals("fall"))
{
string file = Path.Combine("Strings", "StringsFromCSFiles");
return HappyBirthday.Config.translationInfo.LoadStringFromXNBFile(file, "Utility.cs.5682", HappyBirthday.Config.translationInfo.CurrentTranslation);
}
if (Key.Equals("Winter") || Key.Equals("winter"))
{
string file = Path.Combine("Strings", "StringsFromCSFiles");
return HappyBirthday.Config.translationInfo.LoadStringFromXNBFile(file, "Utility.cs.5683", HappyBirthday.Config.translationInfo.CurrentTranslation);
}
try
{
return HappyBirthday.Instance.messages.translatedStrings[this.getCurrrentLanguageCode()][Key];
}
catch (Exception err)
{
return "";
}
}
}
}

View File

@ -0,0 +1,27 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Omegasis.HappyBirthday.Framework
{
public class VillagerInfo
{
public bool hasGivenBirthdayWish;
public bool hasGivenBirthdayGift;
public VillagerInfo()
{
this.hasGivenBirthdayGift = false;
this.hasGivenBirthdayWish = false;
}
public void reset()
{
this.hasGivenBirthdayGift = false;
this.hasGivenBirthdayWish = false;
}
}
}

View File

@ -87,14 +87,17 @@ namespace Omegasis.HappyBirthday
/// <summary>Load birthday gift information from disk. Preferably from BirthdayGift.json in the mod's directory.</summary>
public void loadVillagerBirthdayGifts()
{
string villagerGifts = Path.Combine("Content", "Gifts", "BirthdayGifts.json");
string villagerGifts = Path.Combine("ModAssets", "Gifts", "BirthdayGifts.json");
if (!HappyBirthday.Config.useLegacyBirthdayFiles)
{
if (File.Exists(Path.Combine(HappyBirthday.ModHelper.DirectoryPath, villagerGifts)))
this.defaultBirthdayGifts = HappyBirthday.ModHelper.Data.ReadJsonFile<Dictionary<string, string>>(villagerGifts);
else
{
HappyBirthday.ModHelper.Data.WriteJsonFile<Dictionary<string, string>>(villagerGifts, this.defaultBirthdayGifts);
this.defaultBirthdayGifts = HappyBirthday.ModHelper.Data.ReadJsonFile<Dictionary<string, string>>(villagerGifts);
}
}
else
{
@ -109,6 +112,9 @@ namespace Omegasis.HappyBirthday
{
HappyBirthday.ModMonitor.Log("No birthday gift information found. Loading from internal birthday list and generating villagerGifts.json");
HappyBirthday.ModHelper.Data.WriteJsonFile<Dictionary<string, string>>(villagerGifts, this.defaultBirthdayGifts);
HappyBirthday.Config.useLegacyBirthdayFiles = false;
this.defaultBirthdayGifts = HappyBirthday.ModHelper.Data.ReadJsonFile<Dictionary<string, string>>(villagerGifts);
HappyBirthday.ModHelper.WriteConfig<ModConfig>(HappyBirthday.Config);
}
}
}
@ -116,7 +122,7 @@ namespace Omegasis.HappyBirthday
/// <summary>Used to load spouse birthday gifts from disk.</summary>
public void loadSpouseBirthdayGifts()
{
string spouseGifts = Path.Combine("Content", "Gifts", "SpouseBirthdayGifts.json");
string spouseGifts = Path.Combine("ModAssets", "Gifts", "SpouseBirthdayGifts.json");
if (File.Exists(Path.Combine(HappyBirthday.ModHelper.DirectoryPath, spouseGifts)))
{
HappyBirthday.ModMonitor.Log("Load from SpouseBirthdayGifts.json");

View File

@ -5,12 +5,14 @@ using System.Linq;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using Omegasis.HappyBirthday.Framework;
using StardustCore.Events;
using StardewModdingAPI;
using StardewModdingAPI.Events;
using StardewValley;
using StardewValley.Characters;
using StardewValley.Menus;
using StardewValley.Monsters;
using StardustCore.Utilities;
namespace Omegasis.HappyBirthday
{
@ -43,7 +45,7 @@ namespace Omegasis.HappyBirthday
private bool HasChosenBirthday => !string.IsNullOrEmpty(this.PlayerData.BirthdaySeason) && this.PlayerData.BirthdayDay != 0;
/// <summary>The queue of villagers who haven't given a gift yet.</summary>
private List<string> VillagerQueue;
private Dictionary<string,VillagerInfo> VillagerQueue;
/// <summary>Whether we've already checked for and (if applicable) set up the player's birthday today.</summary>
private bool CheckedForBirthday;
@ -67,6 +69,10 @@ namespace Omegasis.HappyBirthday
public static HappyBirthday Instance;
private NPC lastSpeaker;
private EventManager eventManager;
/*********
** Public methods
*********/
@ -76,8 +82,6 @@ namespace Omegasis.HappyBirthday
{
Instance = this;
//helper.Content.AssetLoaders.Add(new PossibleGifts());
Config = helper.ReadConfig<ModConfig>();
helper.Events.GameLoop.DayStarted += this.OnDayStarted;
@ -86,24 +90,90 @@ namespace Omegasis.HappyBirthday
helper.Events.GameLoop.Saving += this.OnSaving;
helper.Events.Input.ButtonPressed += this.OnButtonPressed;
helper.Events.Display.MenuChanged += this.OnMenuChanged;
helper.Events.Display.RenderedActiveMenu += this.OnRenderedActiveMenu;
helper.Events.Display.RenderedHud += this.OnRenderedHud;
//MultiplayerSupport.initializeMultiplayerSupport();
helper.Events.Multiplayer.ModMessageReceived += this.Multiplayer_ModMessageReceived;
helper.Events.Multiplayer.PeerDisconnected += this.Multiplayer_PeerDisconnected;
helper.Events.GameLoop.GameLaunched += this.GameLoop_GameLaunched;
helper.Events.Player.Warped += this.Player_Warped;
helper.Events.GameLoop.ReturnedToTitle += this.GameLoop_ReturnedToTitle;
ModHelper = this.Helper;
ModMonitor = this.Monitor;
this.othersBirthdays = new Dictionary<long, PlayerData>();
this.eventManager = new EventManager();
}
private void GameLoop_ReturnedToTitle(object sender, ReturnedToTitleEventArgs e)
{
this.eventManager = new EventManager();
}
private void Player_Warped(object sender, WarpedEventArgs e)
{
if (e.NewLocation == Game1.getLocationFromName("CommunityCenter"))
{
this.eventManager.startEventAtLocationIfPossible("CommunityCenterBirthday");
}
if (e.NewLocation == Game1.getLocationFromName("Trailer"))
{
this.eventManager.startEventAtLocationIfPossible("BirthdayDating:Penny");
}
if (e.NewLocation == Game1.getLocationFromName("Trailer_Big"))
{
this.eventManager.startEventAtLocationIfPossible("BirthdayDating:Penny_BigHome");
}
if (e.NewLocation == Game1.getLocationFromName("ScienceHouse"))
{
this.eventManager.startEventAtLocationIfPossible("BirthdayDating:Maru");
this.eventManager.startEventAtLocationIfPossible("BirthdayDating:Sebastian");
}
if (e.NewLocation == Game1.getLocationFromName("LeahHouse"))
{
this.eventManager.startEventAtLocationIfPossible("BirthdayDating:Leah");
}
if (e.NewLocation == Game1.getLocationFromName("SeedShop"))
{
this.eventManager.startEventAtLocationIfPossible("BirthdayDating:Abigail");
}
if (e.NewLocation == Game1.getLocationFromName("HaleyHouse"))
{
this.eventManager.startEventAtLocationIfPossible("BirthdayDating:Emily");
this.eventManager.startEventAtLocationIfPossible("BirthdayDating:Haley");
}
if (e.NewLocation == Game1.getLocationFromName("HarveyRoom"))
{
this.eventManager.startEventAtLocationIfPossible("BirthdayDating:Harvey");
}
if (e.NewLocation == Game1.getLocationFromName("ElliottHouse"))
{
this.eventManager.startEventAtLocationIfPossible("BirthdayDating:Elliott");
}
if (e.NewLocation == Game1.getLocationFromName("SamHouse"))
{
this.eventManager.startEventAtLocationIfPossible("BirthdayDating:Sam");
}
if (e.NewLocation == Game1.getLocationFromName("JoshHouse"))
{
this.eventManager.startEventAtLocationIfPossible("BirthdayDating:Alex");
}
if (e.NewLocation == Game1.getLocationFromName("AnimalShop"))
{
this.eventManager.startEventAtLocationIfPossible("BirthdayDating:Shane");
}
}
private void GameLoop_GameLaunched(object sender, GameLaunchedEventArgs e)
{
this.messages = new BirthdayMessages();
this.giftManager = new GiftManager();
this.isDailyQuestBoard = false;
ModHelper.Events.Multiplayer.ModMessageReceived += this.Multiplayer_ModMessageReceived;
ModHelper.Events.Multiplayer.PeerDisconnected += this.Multiplayer_PeerDisconnected;
this.othersBirthdays = new Dictionary<long, PlayerData>();
}
/// <summary>Get whether this instance can edit the given asset.</summary>
@ -119,11 +189,21 @@ namespace Omegasis.HappyBirthday
{
IDictionary<string, string> data = asset.AsDictionary<string, string>().Data;
string momMail = BirthdayMessages.GetTranslatedString("Mail:birthdayMom");
string dadMail = BirthdayMessages.GetTranslatedString("Mail:birthdayDad");
data["birthdayMom"] = momMail;
data["birthdayDad"] = dadMail;
data["birthdayMom"] = BirthdayMessages.GetTranslatedString("Mail:birthdayMom");
data["birthdayDad"] = BirthdayMessages.GetTranslatedString("Mail:birthdayDad");
data["birthdayJunimos"] = BirthdayMessages.GetTranslatedString("Mail:birthdayJunimos");
data["birthdayDatingPenny"] = BirthdayMessages.GetTranslatedString("Mail:birthdayDatingPenny");
data["birthdayDatingMaru"] = BirthdayMessages.GetTranslatedString("Mail:birthdayDatingMaru");
data["birthdayDatingSebastian"] = BirthdayMessages.GetTranslatedString("Mail:birthdayDatingSebastian");
data["birthdayDatingLeah"] = BirthdayMessages.GetTranslatedString("Mail:birthdayDatingLeah");
data["birthdayDatingAbigail"] = BirthdayMessages.GetTranslatedString("Mail:birthdayDatingAbigail");
data["birthdayDatingEmily"] = BirthdayMessages.GetTranslatedString("Mail:birthdayDatingEmily");
data["birthdayDatingHaley"] = BirthdayMessages.GetTranslatedString("Mail:birthdayDatingHaley");
data["birthdayDatingHarvey"] = BirthdayMessages.GetTranslatedString("Mail:birthdayDatingHarvey");
data["birthdayDatingElliott"] = BirthdayMessages.GetTranslatedString("Mail:birthdayDatingElliott");
data["birthdayDatingSam"] = BirthdayMessages.GetTranslatedString("Mail:birthdayDatingSam");
data["birthdayDatingAlex"] = BirthdayMessages.GetTranslatedString("Mail:birthdayDatingAlex");
data["birthdayDatingShane"] = BirthdayMessages.GetTranslatedString("Mail:birthdayDatingShane");
}
@ -153,14 +233,14 @@ namespace Omegasis.HappyBirthday
{
this.othersBirthdays.Add(message.Key, message.Value);
MultiplayerSupport.SendBirthdayInfoToConnectingPlayer(e.FromPlayerID);
this.Monitor.Log("Got other player's birthday data from: " + Game1.getFarmer(e.FromPlayerID).name);
this.Monitor.Log("Got other player's birthday data from: " + Game1.getFarmer(e.FromPlayerID).Name);
}
else
{
//Brute force update birthday info if it has already been recevived but dont send birthday info again.
this.othersBirthdays.Remove(message.Key);
this.othersBirthdays.Add(message.Key, message.Value);
this.Monitor.Log("Got other player's birthday data from: " + Game1.getFarmer(e.FromPlayerID).name);
this.Monitor.Log("Got other player's birthday data from: " + Game1.getFarmer(e.FromPlayerID).Name);
}
}
}
@ -178,8 +258,6 @@ namespace Omegasis.HappyBirthday
if (this.isDailyQuestBoard || billboard.calendarDays == null)
return;
//Game1.player.FarmerRenderer.drawMiniPortrat(Game1.spriteBatch, new Vector2(Game1.activeClickableMenu.xPositionOnScreen + 152 + (index - 1) % 7 * 32 * 4, Game1.activeClickableMenu.yPositionOnScreen + 230 + (index - 1) / 7 * 32 * 4), 1f, 4f, 2, Game1.player);
string hoverText = "";
List<string> texts = new List<string>();
@ -229,6 +307,13 @@ namespace Omegasis.HappyBirthday
{
int index = this.PlayerData.BirthdayDay;
Game1.player.FarmerRenderer.drawMiniPortrat(Game1.spriteBatch, new Vector2(Game1.activeClickableMenu.xPositionOnScreen + 152 + (index - 1) % 7 * 32 * 4, Game1.activeClickableMenu.yPositionOnScreen + 230 + (index - 1) / 7 * 32 * 4), 0.5f, 4f, 2, Game1.player);
(Game1.activeClickableMenu as Billboard).drawMouse(e.SpriteBatch);
string hoverText = this.Helper.Reflection.GetField<string>((Game1.activeClickableMenu as Billboard), "hoverText", true).GetValue();
if (hoverText.Length > 0)
{
IClickableMenu.drawHoverText(Game1.spriteBatch, hoverText, Game1.dialogueFont, 0, 0, -1, (string)null, -1, (string[])null, (Item)null, 0, -1, -1, -1, -1, 1f, (CraftingRecipe)null);
}
}
}
@ -238,8 +323,17 @@ namespace Omegasis.HappyBirthday
if (pair.Value.BirthdaySeason != Game1.currentSeason.ToLower()) continue; //Hide out of season birthdays.
index = pair.Value.BirthdayDay;
Game1.player.FarmerRenderer.drawMiniPortrat(Game1.spriteBatch, new Vector2(Game1.activeClickableMenu.xPositionOnScreen + 152 + (index - 1) % 7 * 32 * 4, Game1.activeClickableMenu.yPositionOnScreen + 230 + (index - 1) / 7 * 32 * 4), 0.5f, 4f, 2, Game1.getFarmer(pair.Key));
(Game1.activeClickableMenu as Billboard).drawMouse(e.SpriteBatch);
string hoverText=this.Helper.Reflection.GetField<string>((Game1.activeClickableMenu as Billboard), "hoverText", true).GetValue();
if (hoverText.Length > 0)
{
IClickableMenu.drawHoverText(Game1.spriteBatch, hoverText, Game1.dialogueFont, 0, 0, -1, (string)null, -1, (string[])null, (Item)null, 0, -1, -1, -1, -1, 1f, (CraftingRecipe)null);
}
}
(Game1.activeClickableMenu).drawMouse(e.SpriteBatch);
}
}
/// <summary>Raised after a game menu is opened, closed, or replaced.</summary>
@ -251,6 +345,20 @@ namespace Omegasis.HappyBirthday
{
case null:
this.isDailyQuestBoard = false;
//Validate the gift and give it to the player.
if (this.lastSpeaker != null)
{
if (this.giftManager.BirthdayGiftToReceive != null && this.VillagerQueue[this.lastSpeaker.Name].hasGivenBirthdayGift == false)
{
while (this.giftManager.BirthdayGiftToReceive.Name == "Error Item" || this.giftManager.BirthdayGiftToReceive.Name == "Rock" || this.giftManager.BirthdayGiftToReceive.Name == "???")
this.giftManager.SetNextBirthdayGift(this.lastSpeaker.Name);
Game1.player.addItemByMenuIfNecessaryElseHoldUp(this.giftManager.BirthdayGiftToReceive);
this.giftManager.BirthdayGiftToReceive = null;
this.VillagerQueue[this.lastSpeaker.Name].hasGivenBirthdayGift = true;
this.lastSpeaker = null;
}
}
return;
case Billboard billboard:
@ -270,8 +378,11 @@ namespace Omegasis.HappyBirthday
if (this.PlayerData.BirthdaySeason.ToLower() == Game1.currentSeason.ToLower())
{
int index = this.PlayerData.BirthdayDay;
string bdayDisplay = Game1.content.LoadString("Strings\\UI:Billboard_Birthday");
Rectangle birthdayRect = new Rectangle(Game1.activeClickableMenu.xPositionOnScreen + 152 + (index - 1) % 7 * 32 * 4, Game1.activeClickableMenu.yPositionOnScreen + 200 + (index - 1) / 7 * 32 * 4, 124, 124);
billboard.calendarDays.Add(new ClickableTextureComponent("", birthdayRect, "", $"{Game1.player.Name}'s Birthday", text, new Rectangle(0, 0, 124, 124), 1f, false));
billboard.calendarDays.Add(new ClickableTextureComponent("", birthdayRect, "", string.Format(bdayDisplay, Game1.player.Name), text, new Rectangle(0, 0, 124, 124), 1f, false));
//billboard.calendarDays.Add(new ClickableTextureComponent("", birthdayRect, "", $"{Game1.player.Name}'s Birthday", text, new Rectangle(0, 0, 124, 124), 1f, false));
}
}
@ -279,13 +390,58 @@ namespace Omegasis.HappyBirthday
{
if (pair.Value.BirthdaySeason != Game1.currentSeason.ToLower()) continue;
int index = pair.Value.BirthdayDay;
string bdayDisplay = Game1.content.LoadString("Strings\\UI:Billboard_Birthday");
Rectangle otherBirthdayRect = new Rectangle(Game1.activeClickableMenu.xPositionOnScreen + 152 + (index - 1) % 7 * 32 * 4, Game1.activeClickableMenu.yPositionOnScreen + 200 + (index - 1) / 7 * 32 * 4, 124, 124);
billboard.calendarDays.Add(new ClickableTextureComponent("", otherBirthdayRect, "", $"{Game1.getFarmer(pair.Key).Name}'s Birthday", text, new Rectangle(0, 0, 124, 124), 1f, false));
billboard.calendarDays.Add(new ClickableTextureComponent("", otherBirthdayRect, "", string.Format(bdayDisplay, Game1.getFarmer(pair.Key).Name), text, new Rectangle(0, 0, 124, 124), 1f, false));
}
break;
}
case DialogueBox dBox:
{
if (Game1.eventUp) return;
//Hijack the dialogue box and ensure that birthday dialogue gets spoken.
if (Game1.currentSpeaker != null)
{
this.lastSpeaker = Game1.currentSpeaker;
if (Game1.activeClickableMenu != null && this.IsBirthday() && this.VillagerQueue.ContainsKey(Game1.currentSpeaker.Name))
{
if ((Game1.player.getFriendshipHeartLevelForNPC(Game1.currentSpeaker.Name) < Config.minimumFriendshipLevelForBirthdayWish)) return;
if (Game1.activeClickableMenu is StardewValley.Menus.DialogueBox && this.VillagerQueue[Game1.currentSpeaker.Name].hasGivenBirthdayWish==false && (Game1.player.getFriendshipHeartLevelForNPC(Game1.currentSpeaker.Name) >= Config.minimumFriendshipLevelForBirthdayWish))
{
//IReflectedField < Dialogue > cDialogue= this.Helper.Reflection.GetField<Dialogue>((Game1.activeClickableMenu as DialogueBox), "characterDialogue", true);
//IReflectedField<List<string>> dialogues = this.Helper.Reflection.GetField<List<string>>((Game1.activeClickableMenu as DialogueBox), "dialogues", true);
Game1.currentSpeaker.resetCurrentDialogue();
Game1.currentSpeaker.resetSeasonalDialogue();
this.Helper.Reflection.GetMethod(Game1.currentSpeaker, "loadCurrentDialogue", true).Invoke();
Game1.npcDialogues[Game1.currentSpeaker.Name] = Game1.currentSpeaker.CurrentDialogue;
if (this.IsBirthday() && this.VillagerQueue[Game1.currentSpeaker.Name].hasGivenBirthdayGift == false && Game1.player.getFriendshipHeartLevelForNPC(Game1.currentSpeaker.Name) >= Config.minNeutralFriendshipGiftLevel)
{
try
{
this.giftManager.SetNextBirthdayGift(Game1.currentSpeaker.Name);
this.Monitor.Log("Setting next birthday gift. 1");
}
catch (Exception ex)
{
this.Monitor.Log(ex.ToString(), LogLevel.Error);
}
}
Game1.activeClickableMenu = new DialogueBox(new Dialogue(this.messages.getBirthdayMessage(Game1.currentSpeaker.Name),Game1.currentSpeaker));
this.VillagerQueue[Game1.currentSpeaker.Name].hasGivenBirthdayWish = true;
// Set birthday gift for the player to recieve from the npc they are currently talking with.
}
}
}
break;
}
}
}
/// <summary>Raised after the game begins a new day (including when the player loads a save).</summary>
@ -293,6 +449,14 @@ namespace Omegasis.HappyBirthday
/// <param name="e">The event arguments.</param>
private void OnDayStarted(object sender, DayStartedEventArgs e)
{
try
{
this.ResetVillagerQueue();
}
catch (Exception ex)
{
this.Monitor.Log(ex.ToString(), LogLevel.Error);
}
this.CheckedForBirthday = false;
}
@ -315,22 +479,116 @@ namespace Omegasis.HappyBirthday
this.DataFilePath = Path.Combine("data", $"{Game1.player.Name}_{Game1.player.UniqueMultiplayerID}.json");
// reset state
this.VillagerQueue = new List<string>();
this.VillagerQueue = new Dictionary<string, VillagerInfo>();
this.CheckedForBirthday = false;
// load settings
this.MigrateLegacyData();
//
//this.MigrateLegacyData();
this.PlayerData = this.Helper.Data.ReadJsonFile<PlayerData>(this.DataFilePath) ?? new PlayerData();
;
if (HappyBirthday.Config.autoSetTranslation)
{
HappyBirthday.Config.translationInfo.setTranslationFromLanguageCode(Game1.content.GetCurrentLanguage());
}
if (PlayerBirthdayData != null)
{
ModMonitor.Log("Send all birthday information from " + Game1.player.name);
//ModMonitor.Log("Send all birthday information from " + Game1.player.Name);
MultiplayerSupport.SendBirthdayInfoToOtherPlayers();
}
//this.SeenEvent = false;
//this.Dialogue = new Dictionary<string, Dialogue>();
if (Game1.player.mailReceived.Contains("birthdayMom"))
{
Game1.player.mailReceived.Remove("birthdayMom");
}
if (Game1.player.mailReceived.Contains("birthdayDad"))
{
Game1.player.mailReceived.Remove("birthdayDad");
}
if (Game1.player.mailReceived.Contains("birthdayJunimos"))
{
Game1.player.mailReceived.Remove("birthdayJunimos");
}
if (Game1.player.mailReceived.Contains("birthdayDatingPenny"))
{
Game1.player.mailReceived.Remove("birthdayDatingPenny");
}
if (Game1.player.mailReceived.Contains("birthdayDatingMaru"))
{
Game1.player.mailReceived.Remove("birthdayDatingMaru");
}
if (Game1.player.mailReceived.Contains("birthdayDatingSebastian"))
{
Game1.player.mailReceived.Remove("birthdayDatingSebastian");
}
if (Game1.player.mailReceived.Contains("birthdayDatingLeah"))
{
Game1.player.mailReceived.Remove("birthdayDatingLeah");
}
if (Game1.player.mailReceived.Contains("birthdayDatingAbigail"))
{
Game1.player.mailReceived.Remove("birthdayDatingAbigail");
}
if (Game1.player.mailReceived.Contains("birthdayDatingEmily"))
{
Game1.player.mailReceived.Remove("birthdayDatingEmily");
}
if (Game1.player.mailReceived.Contains("birthdayDatingHaley"))
{
Game1.player.mailReceived.Remove("birthdayDatingHaley");
}
if (Game1.player.mailReceived.Contains("birthdayDatingHarvey"))
{
Game1.player.mailReceived.Remove("birthdayDatingHarvey");
}
if (Game1.player.mailReceived.Contains("birthdayDatingElliott"))
{
Game1.player.mailReceived.Remove("birthdayDatingElliott");
}
if (Game1.player.mailReceived.Contains("birthdayDatingSam"))
{
Game1.player.mailReceived.Remove("birthdayDatingSam");
}
if (Game1.player.mailReceived.Contains("birthdayDatingAlex"))
{
Game1.player.mailReceived.Remove("birthdayDatingAlex");
}
if (Game1.player.mailReceived.Contains("birthdayDatingShane"))
{
Game1.player.mailReceived.Remove("birthdayDatingShane");
}
EventHelper communityCenterJunimoBirthday = BirthdayEvents.CommunityCenterJunimoBirthday();
EventHelper birthdayDating_Penny = BirthdayEvents.DatingBirthday_Penny();
EventHelper birthdayDating_Penny_Big = BirthdayEvents.DatingBirthday_Penny_BigHome();
EventHelper birthdayDating_Maru = BirthdayEvents.DatingBirthday_Maru();
EventHelper birthdayDating_Sebastian = BirthdayEvents.DatingBirthday_Sebastian();
EventHelper birthdayDating_Leah = BirthdayEvents.DatingBirthday_Leah();
EventHelper birthdayDating_Abigail = BirthdayEvents.DatingBirthday_Abigail();
EventHelper birthdayDating_Emily = BirthdayEvents.DatingBirthday_Emily();
EventHelper birthdayDating_Haley = BirthdayEvents.DatingBirthday_Haley();
EventHelper birthdayDating_Harvey = BirthdayEvents.DatingBirthday_Harvey();
EventHelper birthdayDating_Elliott = BirthdayEvents.DatingBirthday_Elliott();
EventHelper birthdayDating_Sam = BirthdayEvents.DatingBirthday_Sam();
EventHelper birthdayDating_Alex = BirthdayEvents.DatingBirthday_Alex();
EventHelper birthdayDating_Shane = BirthdayEvents.DatingBirthday_Shane();
this.eventManager.addEvent(communityCenterJunimoBirthday);
this.eventManager.addEvent(birthdayDating_Penny);
this.eventManager.addEvent(birthdayDating_Penny_Big);
this.eventManager.addEvent(birthdayDating_Maru);
this.eventManager.addEvent(birthdayDating_Sebastian);
this.eventManager.addEvent(birthdayDating_Leah);
this.eventManager.addEvent(birthdayDating_Abigail);
this.eventManager.addEvent(birthdayDating_Emily);
this.eventManager.addEvent(birthdayDating_Haley);
this.eventManager.addEvent(birthdayDating_Harvey);
this.eventManager.addEvent(birthdayDating_Elliott);
this.eventManager.addEvent(birthdayDating_Sam);
this.eventManager.addEvent(birthdayDating_Alex);
this.eventManager.addEvent(birthdayDating_Shane);
}
/// <summary>Raised before the game begins writes data to the save file (except the initial save creation).</summary>
@ -347,8 +605,28 @@ namespace Omegasis.HappyBirthday
/// <param name="e">The event arguments.</param>
private void OnUpdateTicked(object sender, UpdateTickedEventArgs e)
{
if (!Context.IsWorldReady || Game1.eventUp || Game1.isFestival())
if (!Context.IsWorldReady || Game1.isFestival())
{
return;
}
if (Game1.eventUp)
{
if (this.eventManager != null)
{
this.eventManager.update();
}
return;
}
else
{
if (this.eventManager != null)
{
this.eventManager.update();
}
}
if (!this.HasChosenBirthday && Game1.activeClickableMenu == null && Game1.player.Name.ToLower() != "unnamed farmhand")
{
Game1.activeClickableMenu = new BirthdayMenu(this.PlayerData.BirthdaySeason, this.PlayerData.BirthdayDay, this.SetBirthday);
@ -364,70 +642,120 @@ namespace Omegasis.HappyBirthday
{
string starMessage = BirthdayMessages.GetTranslatedString("Happy Birthday: Star Message");
//ModMonitor.Log(starMessage);
Messages.ShowStarMessage(starMessage);
MultiplayerSupport.SendBirthdayMessageToOtherPlayers();
Game1.player.mailbox.Add("birthdayMom");
Game1.player.mailbox.Add("birthdayDad");
try
if (Game1.player.friendshipData.ContainsKey("Penny"))
{
this.ResetVillagerQueue();
if (Game1.player.friendshipData["Penny"].IsDating()){
Game1.player.mailbox.Add("birthdayDatingPenny");
}
catch (Exception ex)
}
if (Game1.player.friendshipData.ContainsKey("Maru"))
{
this.Monitor.Log(ex.ToString(), LogLevel.Error);
if (Game1.player.friendshipData["Maru"].IsDating())
{
Game1.player.mailbox.Add("birthdayDatingMaru");
}
}
if (Game1.player.friendshipData.ContainsKey("Leah"))
{
if (Game1.player.friendshipData["Leah"].IsDating())
{
Game1.player.mailbox.Add("birthdayDatingLeah");
}
}
if (Game1.player.friendshipData.ContainsKey("Abigail"))
{
if (Game1.player.friendshipData["Abigail"].IsDating())
{
Game1.player.mailbox.Add("birthdayDatingAbigail");
}
}
if (Game1.player.friendshipData.ContainsKey("Emily"))
{
if (Game1.player.friendshipData["Emily"].IsDating())
{
Game1.player.mailbox.Add("birthdayDatingEmily");
}
}
if (Game1.player.friendshipData.ContainsKey("Haley"))
{
if (Game1.player.friendshipData["Haley"].IsDating())
{
Game1.player.mailbox.Add("birthdayDatingHaley");
}
}
if (Game1.player.friendshipData.ContainsKey("Sebastian"))
{
if (Game1.player.friendshipData["Sebastian"].IsDating())
{
Game1.player.mailbox.Add("birthdayDatingSebastian");
}
}
if (Game1.player.friendshipData.ContainsKey("Harvey"))
{
if (Game1.player.friendshipData["Harvey"].IsDating())
{
Game1.player.mailbox.Add("birthdayDatingHarvey");
}
}
if (Game1.player.friendshipData.ContainsKey("Elliott"))
{
if (Game1.player.friendshipData["Elliott"].IsDating())
{
Game1.player.mailbox.Add("birthdayDatingElliott");
}
}
if (Game1.player.friendshipData.ContainsKey("Sam"))
{
if (Game1.player.friendshipData["Sam"].IsDating())
{
Game1.player.mailbox.Add("birthdayDatingSam");
}
}
if (Game1.player.friendshipData.ContainsKey("Alex"))
{
if (Game1.player.friendshipData["Alex"].IsDating())
{
Game1.player.mailbox.Add("birthdayDatingAlex");
}
}
if (Game1.player.friendshipData.ContainsKey("Shane"))
{
if (Game1.player.friendshipData["Shane"].IsDating())
{
Game1.player.mailbox.Add("birthdayDatingShane");
}
}
if (Game1.player.CanReadJunimo())
{
Game1.player.mailbox.Add("birthdayJunimos");
}
foreach (GameLocation location in Game1.locations)
{
foreach (NPC npc in location.characters)
{
if (npc is Child || npc is Horse || npc is Junimo || npc is Monster || npc is Pet)
continue;
//Add in birthday dialogues for npc.
try
{
if (Game1.player.getFriendshipHeartLevelForNPC(npc.Name) >= Config.minimumFriendshipLevelForBirthdayWish)
{
bool spouseMessage = false; //Used to determine if there is a valid spouse message for the player. If false load in the generic birthday wish.
//Check if npc name is spouse's name. If no spouse then add in generic dialogue.
if (this.messages.spouseBirthdayWishes.ContainsKey(npc.Name) && Game1.player.isMarried())
{
//this.Monitor.Log("Spouse Checks out");
//Check to see if spouse message exists.
if (!string.IsNullOrEmpty(this.messages.spouseBirthdayWishes[npc.Name]))
{
spouseMessage = true;
Dialogue d = new Dialogue(this.messages.spouseBirthdayWishes[npc.Name], npc);
string message = this.messages.getBirthdayMessage(npc.Name);
Dialogue d = new Dialogue(message, npc);
npc.CurrentDialogue.Push(d);
if (npc.CurrentDialogue.ElementAt(0) != d) npc.setNewDialogue(this.messages.spouseBirthdayWishes[npc.Name]);
}
else
this.Monitor.Log("No spouse message???", LogLevel.Warn);
}
if (!spouseMessage)
{
//Load in
Dialogue d = new Dialogue(this.messages.birthdayWishes[npc.Name], npc);
npc.CurrentDialogue.Push(d);
if (npc.CurrentDialogue.ElementAt(0) != d) npc.setNewDialogue(this.messages.birthdayWishes[npc.Name]);
}
}
}
catch
{
if (Game1.player.getFriendshipHeartLevelForNPC(npc.Name) >= Config.minimumFriendshipLevelForBirthdayWish)
{
Dialogue d = new Dialogue("Happy Birthday @!", npc);
npc.CurrentDialogue.Push(d);
if (npc.CurrentDialogue.ElementAt(0) != d)
npc.setNewDialogue("Happy Birthday @!");
}
}
if (npc.CurrentDialogue.ElementAt(0) != d) npc.setNewDialogue(message);
}
}
}
@ -444,33 +772,7 @@ namespace Omegasis.HappyBirthday
}
}
// Set birthday gift for the player to recieve from the npc they are currently talking with.
if (Game1.currentSpeaker != null)
{
string name = Game1.currentSpeaker.Name;
if (Game1.player.getFriendshipHeartLevelForNPC(name) <= Config.minNeutralFriendshipGiftLevel) return;
if (this.IsBirthday() && this.VillagerQueue.Contains(name))
{
try
{
this.giftManager.SetNextBirthdayGift(Game1.currentSpeaker.Name);
this.VillagerQueue.Remove(Game1.currentSpeaker.Name);
}
catch (Exception ex)
{
this.Monitor.Log(ex.ToString(), LogLevel.Error);
}
}
//Validate the gift and give it to the player.
if (this.giftManager.BirthdayGiftToReceive != null)
{
while (this.giftManager.BirthdayGiftToReceive.Name == "Error Item" || this.giftManager.BirthdayGiftToReceive.Name == "Rock" || this.giftManager.BirthdayGiftToReceive.Name == "???")
this.giftManager.SetNextBirthdayGift(Game1.currentSpeaker.Name);
Game1.player.addItemByMenuIfNecessaryElseHoldUp(this.giftManager.BirthdayGiftToReceive);
this.giftManager.BirthdayGiftToReceive = null;
}
}
}
/// <summary>Set the player's birthday/</summary>
@ -493,21 +795,22 @@ namespace Omegasis.HappyBirthday
{
if (npc is Child || npc is Horse || npc is Junimo || npc is Monster || npc is Pet)
continue;
if (this.VillagerQueue.Contains(npc.Name))
if (this.VillagerQueue.ContainsKey(npc.Name))
continue;
this.VillagerQueue.Add(npc.Name);
this.VillagerQueue.Add(npc.Name,new VillagerInfo());
}
}
}
/// <summary>Get whether today is the player's birthday.</summary>
private bool IsBirthday()
public bool IsBirthday()
{
return
this.PlayerData.BirthdayDay == Game1.dayOfMonth
&& this.PlayerData.BirthdaySeason == Game1.currentSeason;
&& this.PlayerData.BirthdaySeason.ToLower().Equals(Game1.currentSeason.ToLower());
}
/*
/// <summary>Migrate the legacy settings for the current player.</summary>
private void MigrateLegacyData()
{
@ -543,5 +846,6 @@ namespace Omegasis.HappyBirthday
}
}
}
*/
}
}

View File

@ -70,9 +70,12 @@
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Newtonsoft.Json" Version="11.0.2" />
<PackageReference Include="Pathoschild.Stardew.ModBuildConfig" Version="2.2.0" />
<PackageReference Include="Pathoschild.Stardew.ModBuildConfig" Version="3.0.0" />
</ItemGroup>
<ItemGroup>
<Reference Include="StardustCore">
<HintPath>$(GamePath)\Mods\StardustCore\StardustCore.dll</HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="System.Xml" />
</ItemGroup>
@ -80,13 +83,16 @@
<Compile Include="..\GlobalAssemblyInfo.cs">
<Link>Properties\GlobalAssemblyInfo.cs</Link>
</Compile>
<Compile Include="BirthdayEvents.cs" />
<Compile Include="BirthdayMessages.cs" />
<Compile Include="Framework\BirthdayEvents.cs" />
<Compile Include="Framework\BirthdayMenu.cs" />
<Compile Include="Framework\ModConfig.cs" />
<Compile Include="Framework\MultiplayerSupport.cs" />
<Compile Include="Framework\PlayerData.cs" />
<Compile Include="Framework\EventPreconditions\FarmerBirthdayPrecondition.cs" />
<Compile Include="Framework\EventPreconditions\SpouseBirthdayPrecondition.cs" />
<Compile Include="Framework\TranslationInfo.cs" />
<Compile Include="Framework\VillagerInfo.cs" />
<Compile Include="HappyBirthday.cs" />
<Compile Include="Framework\Messages.cs" />
<Compile Include="Framework\ObjectUtility.cs" />
@ -94,50 +100,8 @@
<Compile Include="Properties\AssemblyInfo.cs" />
</ItemGroup>
<ItemGroup>
<None Include="Content\Dialogue\Brazillian Portuguese\BirthdayWishes.pt-BR.json">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Include="Content\Dialogue\Brazillian Portuguese\SpouseBirthdayWishes.pt-BR.json">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Include="Content\Dialogue\Chinese\BirthdayWishes.zh-CN.json">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Include="Content\Dialogue\Chinese\SpouseBirthdayWishes.zh-CN.json">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Include="Content\Dialogue\English\BirthdayWishes.json">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Include="Content\Dialogue\English\SpouseBirthdayWishes.json">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Include="Content\Dialogue\German\BirthdayWishes.de-DE.json">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Include="Content\Dialogue\German\SpouseBirthdayWishes.de-DE.json">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Include="Content\Dialogue\Japanese\BirthdayWishes.ja-JP.json">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Include="Content\Dialogue\Japanese\SpouseBirthdayWishes.ja-JP.json">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Include="Content\Dialogue\Russian\BirthdayWishes.ru-RU.json">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Include="Content\Dialogue\Russian\SpouseBirthdayWishes.ru-RU.json">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Include="Content\Dialogue\Spanish\BirthdayWishes.es-ES.json">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Include="Content\Dialogue\Spanish\SpouseBirthdayWishes.es-ES.json">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Include="Content\Gifts\BirthdayGifts.json" />
<None Include="Content\Gifts\SpouseBirthdayGifts.json" />
<None Include="ModAssets\Gifts\BirthdayGifts.json" />
<None Include="ModAssets\Gifts\SpouseBirthdayGifts.json" />
<None Include="manifest.json" />
</ItemGroup>
<ItemGroup>
@ -146,6 +110,7 @@
<ItemGroup>
<Content Include="Changelog.txt" />
</ItemGroup>
<ItemGroup />
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<Import Project="$(SolutionDir)\deploy.targets" />
</Project>

View File

@ -2,5 +2,7 @@
"Mail:birthdayMom": "",
"Mail:birthdayDad": "",
"Happy Birthday: Star Message": "",
"Happy Birthday: Farmhand Birthday Message": ""
"Happy Birthday: Farmhand Birthday Message": "",
"Season": "Season",
"Date": "Date"
}

View File

@ -2,5 +2,7 @@
"Mail:birthdayMom": "",
"Mail:birthdayDad": "",
"Happy Birthday: Star Message": "",
"Happy Birthday: Farmhand Birthday Message": ""
"Happy Birthday: Farmhand Birthday Message": "",
"Season": "Season",
"Date": "Date"
}

View File

@ -2,5 +2,7 @@
"Mail:birthdayMom": "",
"Mail:birthdayDad": "",
"Happy Birthday: Star Message": "",
"Happy Birthday: Farmhand Birthday Message": ""
"Happy Birthday: Farmhand Birthday Message": "",
"Season": "Season",
"Date": "Date"
}

View File

@ -0,0 +1,8 @@
{
"Mail:birthdayMom": "",
"Mail:birthdayDad": "",
"Happy Birthday: Star Message": "",
"Happy Birthday: Farmhand Birthday Message": "",
"Season": "Season",
"Date": "Date"
}

View File

@ -0,0 +1,8 @@
{
"Mail:birthdayMom": "",
"Mail:birthdayDad": "",
"Happy Birthday: Star Message": "",
"Happy Birthday: Farmhand Birthday Message": "",
"Season": "Season",
"Date": "Date"
}

View File

@ -0,0 +1,35 @@
{
"Robin": "",
"Demetrius": "",
"Maru": "",
"Sebastian": "",
"Linus": "",
"Pierre": "",
"Caroline": "",
"Abigail": "",
"Alex": "",
"George": "",
"Evelyn": "",
"Lewis": "",
"Clint": "",
"Penny": "",
"Pam": "",
"Emily": "",
"Haley": "",
"Jas": "",
"Vincent": "",
"Jodi": "",
"Kent": "",
"Sam": "",
"Leah": "",
"Shane": "",
"Marnie": "",
"Elliott": "",
"Gus": "",
"Dwarf": "",
"Wizard": "",
"Harvey": "",
"Sandy": "",
"Willy": "",
"Krobus": ""
}

View File

@ -2,5 +2,7 @@
"Mail:birthdayMom": "",
"Mail:birthdayDad": "",
"Happy Birthday: Star Message": "",
"Happy Birthday: Farmhand Birthday Message": ""
"Happy Birthday: Farmhand Birthday Message": "",
"Season": "Season",
"Date": "Date"
}

View File

@ -0,0 +1,35 @@
{
"Robin": "",
"Demetrius": "",
"Maru": "",
"Sebastian": "",
"Linus": "",
"Pierre": "",
"Caroline": "",
"Abigail": "",
"Alex": "",
"George": "",
"Evelyn": "",
"Lewis": "",
"Clint": "",
"Penny": "",
"Pam": "",
"Emily": "",
"Haley": "",
"Jas": "",
"Vincent": "",
"Jodi": "",
"Kent": "",
"Sam": "",
"Leah": "",
"Shane": "",
"Marnie": "",
"Elliott": "",
"Gus": "",
"Dwarf": "",
"Wizard": "",
"Harvey": "",
"Sandy": "",
"Willy": "",
"Krobus": ""
}

View File

@ -0,0 +1,8 @@
{
"Mail:birthdayMom": "",
"Mail:birthdayDad": "",
"Happy Birthday: Star Message": "",
"Happy Birthday: Farmhand Birthday Message": "",
"Season": "Season",
"Date": "Date"
}

View File

@ -0,0 +1,35 @@
{
"Robin": "",
"Demetrius": "",
"Maru": "",
"Sebastian": "",
"Linus": "",
"Pierre": "",
"Caroline": "",
"Abigail": "",
"Alex": "",
"George": "",
"Evelyn": "",
"Lewis": "",
"Clint": "",
"Penny": "",
"Pam": "",
"Emily": "",
"Haley": "",
"Jas": "",
"Vincent": "",
"Jodi": "",
"Kent": "",
"Sam": "",
"Leah": "",
"Shane": "",
"Marnie": "",
"Elliott": "",
"Gus": "",
"Dwarf": "",
"Wizard": "",
"Harvey": "",
"Sandy": "",
"Willy": "",
"Krobus": ""
}

View File

@ -0,0 +1,14 @@
{
"Alex": "",
"Elliott": "",
"Harvey": "",
"Sam": "",
"Sebastian": "",
"Shane": "",
"Abigail": "",
"Emily": "",
"Haley": "",
"Leah": "",
"Maru": "",
"Penny": ""
}

View File

@ -2,5 +2,7 @@
"Mail:birthdayMom": "",
"Mail:birthdayDad": "",
"Happy Birthday: Star Message": "",
"Happy Birthday: Farmhand Birthday Message": ""
"Happy Birthday: Farmhand Birthday Message": "",
"Season": "Season",
"Date": "Date"
}

View File

@ -0,0 +1,35 @@
{
"Robin": "",
"Demetrius": "",
"Maru": "",
"Sebastian": "",
"Linus": "",
"Pierre": "",
"Caroline": "",
"Abigail": "",
"Alex": "",
"George": "",
"Evelyn": "",
"Lewis": "",
"Clint": "",
"Penny": "",
"Pam": "",
"Emily": "",
"Haley": "",
"Jas": "",
"Vincent": "",
"Jodi": "",
"Kent": "",
"Sam": "",
"Leah": "",
"Shane": "",
"Marnie": "",
"Elliott": "",
"Gus": "",
"Dwarf": "",
"Wizard": "",
"Harvey": "",
"Sandy": "",
"Willy": "",
"Krobus": ""
}

View File

@ -0,0 +1,14 @@
{
"Alex": "",
"Elliott": "",
"Harvey": "",
"Sam": "",
"Sebastian": "",
"Shane": "",
"Abigail": "",
"Emily": "",
"Haley": "",
"Leah": "",
"Maru": "",
"Penny": ""
}

View File

@ -0,0 +1,8 @@
{
"Mail:birthdayMom": "ƒорогой @,^ — днем рождени¤, мо¤ радость. Ёто были замечательные моменты, когда ты выростал в доброго, трудолюбивого человека. я надеюсь, в твоей жизни будет куча превосходных моментов. ^ — любовью, мама ^ P.S. «десь находить небольшой подарок, который ¤ сделала дл¤ теб¤. %item object 221 1 %%",
"Mail:birthdayDad": "ƒорогой @,^ — днем рождени¤, мой ребенок. «десь немного тихо в твой день рождени¤ с тех пор, как ты уехал на ферму, но тво¤ мать и ¤ знаем, что ты со своим дедушкой делаешь нас гордыми. ћы оба знаем, что жить на ферме может быть трудно, но мы верим в теб¤ на все 100%, просто продолжай следовать своим мечтам.^ — любовью папа ^ P.S. “ут есть немного денег, которые помогут тебе на ферме. ”дачи! %item money 5000 5001%%",
"Happy Birthday: Star Message": "Ёто твой день рождени¤! — днем рождени¤!",
"Happy Birthday: Farmhand Birthday Message": "Ёто твой день рождени¤! ѕоздравл¤ю с этим!",
"Season": "Season",
"Date": "Date"
}

View File

@ -0,0 +1,35 @@
{
"Robin": "",
"Demetrius": "",
"Maru": "",
"Sebastian": "",
"Linus": "",
"Pierre": "",
"Caroline": "",
"Abigail": "",
"Alex": "",
"George": "",
"Evelyn": "",
"Lewis": "",
"Clint": "",
"Penny": "",
"Pam": "",
"Emily": "",
"Haley": "",
"Jas": "",
"Vincent": "",
"Jodi": "",
"Kent": "",
"Sam": "",
"Leah": "",
"Shane": "",
"Marnie": "",
"Elliott": "",
"Gus": "",
"Dwarf": "",
"Wizard": "",
"Harvey": "",
"Sandy": "",
"Willy": "",
"Krobus": ""
}

View File

@ -0,0 +1,14 @@
{
"Alex": "",
"Elliott": "",
"Harvey": "",
"Sam": "",
"Sebastian": "",
"Shane": "",
"Abigail": "",
"Emily": "",
"Haley": "",
"Leah": "",
"Maru": "",
"Penny": ""
}

View File

@ -0,0 +1,8 @@
{
"Mail:birthdayMom": "",
"Mail:birthdayDad": "",
"Happy Birthday: Star Message": "",
"Happy Birthday: Farmhand Birthday Message": "",
"Season": "Season",
"Date": "Date"
}

View File

@ -0,0 +1,35 @@
{
"Robin": "",
"Demetrius": "",
"Maru": "",
"Sebastian": "",
"Linus": "",
"Pierre": "",
"Caroline": "",
"Abigail": "",
"Alex": "",
"George": "",
"Evelyn": "",
"Lewis": "",
"Clint": "",
"Penny": "",
"Pam": "",
"Emily": "",
"Haley": "",
"Jas": "",
"Vincent": "",
"Jodi": "",
"Kent": "",
"Sam": "",
"Leah": "",
"Shane": "",
"Marnie": "",
"Elliott": "",
"Gus": "",
"Dwarf": "",
"Wizard": "",
"Harvey": "",
"Sandy": "",
"Willy": "",
"Krobus": ""
}

View File

@ -0,0 +1,14 @@
{
"Alex": "",
"Elliott": "",
"Harvey": "",
"Sam": "",
"Sebastian": "",
"Shane": "",
"Abigail": "",
"Emily": "",
"Haley": "",
"Leah": "",
"Maru": "",
"Penny": ""
}

View File

@ -2,5 +2,7 @@
"Mail:birthdayMom": "亲爱的@^ 生日快乐宝贝。看着你成长成为一个善良努力的人,就如我一直梦想着你成为的样子,我感到十分欣喜。我希望你能继续跟你爱的人制造更多美好的回忆。 ^ 爱你的,妈妈 ^ 附言:这是我给你做的一点小礼物。 %item object 221 1 %%",
"Mail:birthdayDad": "亲爱的@^ 生日快乐孩子。你生日的这天没有你,我们这儿还挺寂寞的,但我和你妈妈都知道你让我们和你爷爷感到骄傲。我们知道你一个人生活可能会很艰难,但我们百分百相信你能做到,所以继续追求你的梦想吧。^ 爱你的,爸爸 ^ 附言:这是能在农场上帮到你的一些零用钱。祝你好运! %item money 5000 5001 %%",
"Happy Birthday: Star Message": "今天是你的生日!生日快乐!",
"Happy Birthday: Farmhand Birthday Message": ""
"Happy Birthday: Farmhand Birthday Message": "",
"Season": "Season",
"Date": "Date"
}

View File

@ -1,10 +1,13 @@
{
"Name": "Happy Birthday",
"Author": "Alpha_Omegasis",
"Version": "1.9.0",
"Version": "1.10.5",
"Description": "Adds the farmer's birthday to the game.",
"UniqueID": "Omegasis.HappyBirthday",
"EntryDll": "HappyBirthday.dll",
"MinimumApiVersion": "2.10.1",
"UpdateKeys": [ "Nexus:520" ]
"UpdateKeys": [ "Nexus:520" ],
"Dependencies": [
{ "UniqueID": "Omegasis.StardustCore" },
]
}

View File

@ -66,7 +66,7 @@
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Pathoschild.Stardew.ModBuildConfig" Version="2.2.0" />
<PackageReference Include="Pathoschild.Stardew.ModBuildConfig" Version="3.0.0" />
</ItemGroup>
<ItemGroup>
<Reference Include="System" />

View File

@ -9,21 +9,65 @@ namespace Omegasis.MoreRain.Framework
/// <summary>The chance out of 100 that it will storm tomorrow if it's spring.</summary>
public int SpringThunderChance { get; set; } = 5;
/// <summary>
/// Changes the mod's logic to prioritize setting a thunderstorm before checking for just a normal rainy day.
/// False = The mod will try to set a normal rainy day first.
/// True = The mod will try to set a thunderstorm (stormy) day first.
/// Default:False
/// </summary>
public bool PrioritizeSpringStorms { get; set; } = false;
/// <summary>The chance out of 100 that it will rain tomorrow if it's summer.</summary>
public int SummerRainChance { get; set; } = 5;
/// <summary>The chance out of 100 that it will storm tomorrow if it's summer.</summary>
public int SummerThunderChance { get; set; } = 10;
/// <summary>
/// Changes the mod's logic to prioritize setting a thunderstorm before checking for just a normal rainy day.
/// False = The mod will try to set a normal rainy day first.
/// True = The mod will try to set a thunderstorm (stormy) day first.
/// Default:True
/// </summary>
public bool PrioritizeSummerStorms { get; set; } = true;
/// <summary>The chance out of 100 that it will rain tomorrow if it's fall.</summary>
public int FallRainChance { get; set; } = 15;
/// <summary>The chance out of 100 that it will storm tomorrow if it's fall.</summary>
public int FallThunderChance { get; set; } = 5;
/// <summary>
/// Changes the mod's logic to prioritize setting a thunderstorm before checking for just a normal rainy day.
/// False = The mod will try to set a normal rainy day first.
/// True = The mod will try to set a thunderstorm (stormy) day first.
/// Default:False
/// </summary>
public bool PrioritizeFallStorms { get; set; } = false;
/// <summary>
/// If set to true the mod will try to make it snow in fall just for fun.
/// </summary>
public bool SnowInFall { get; set; } = false;
/// <summary>
/// The chance amouunt for it to snow in the fall.
/// </summary>
public int FallSnowChance { get; set; } = 5;
/// <summary>The chance out of 100 that it will snow tomorrow if it's winter.</summary>
public int WinterSnowChance { get; set; } = 15;
/// <summary>
/// If set to true then the mod will check to set rainy days in the winter. Default: False
/// </summary>
public bool RainInWinter { get; set; } = false;
/// <summary>
/// The chance that it will rain on a winter day. Only checked if the RainInWinter config option is true.
/// </summary>
public int WinterRainChance { get; set; } = 10;
/// <summary>Whether to suppress verbose logging.</summary>
public bool SuppressLog { get; set; } = true;
}

View File

@ -75,6 +75,23 @@ namespace Omegasis.MoreRain
{
case "spring":
// set rain
if (this.Config.PrioritizeSpringStorms)
{
if (chance <= this.Config.SpringThunderChance)
{
Game1.weatherForTomorrow = Game1.weather_lightning;
this.VerboseLog("It will be stormy tomorrow.");
return;
}
if (chance <= this.Config.SpringRainChance)
{
Game1.weatherForTomorrow = Game1.weather_rain;
this.VerboseLog("It will rain tomorrow.");
return;
}
}
else
{
if (chance <= this.Config.SpringRainChance)
{
Game1.weatherForTomorrow = Game1.weather_rain;
@ -88,29 +105,66 @@ namespace Omegasis.MoreRain
this.VerboseLog("It will be stormy tomorrow.");
return;
}
}
break;
case "summer":
// set rain
if (chance <= this.Config.SummerRainChance)
if (this.Config.PrioritizeSummerStorms)
{
Game1.weatherForTomorrow = Game1.weather_rain;
this.VerboseLog("It will rain tomorrow.");
return;
}
if (chance <= this.Config.SummerThunderChance)
{
Game1.weatherForTomorrow = Game1.weather_lightning;
this.VerboseLog("It will be stormy tomorrow.");
return;
}
if (chance <= this.Config.SummerRainChance)
{
Game1.weatherForTomorrow = Game1.weather_rain;
this.VerboseLog("It will rain tomorrow.");
return;
}
}
else
{
if (chance <= this.Config.SummerRainChance)
{
Game1.weatherForTomorrow = Game1.weather_rain;
this.VerboseLog("It will rain tomorrow.");
return;
}
if (chance <= this.Config.SummerThunderChance)
{
Game1.weatherForTomorrow = Game1.weather_lightning;
this.VerboseLog("It will be stormy tomorrow.");
return;
}
}
break;
case "fall":
case "autumn":
// set rain
if (this.Config.PrioritizeFallStorms)
{
if (chance <= this.Config.FallThunderChance)
{
Game1.weatherForTomorrow = Game1.weather_lightning;
this.VerboseLog("It will be stormy tomorrow.");
return;
}
if (this.Config.SnowInFall)
{
if (chance <= this.Config.FallSnowChance)
{
Game1.weatherForTomorrow = Game1.weather_snow;
this.VerboseLog("It will snow tomorrow.");
}
}
if (chance <= this.Config.FallRainChance)
{
Game1.weatherForTomorrow = Game1.weather_rain;
@ -118,12 +172,33 @@ namespace Omegasis.MoreRain
return;
}
}
else
{
if (chance <= this.Config.FallRainChance)
{
Game1.weatherForTomorrow = Game1.weather_rain;
this.VerboseLog("It will rain tomorrow.");
return;
}
if (this.Config.SnowInFall)
{
if (chance <= this.Config.FallSnowChance)
{
Game1.weatherForTomorrow = Game1.weather_snow;
this.VerboseLog("It will snow tomorrow.");
}
}
if (chance <= this.Config.FallThunderChance)
{
Game1.weatherForTomorrow = Game1.weather_lightning;
this.VerboseLog("It will be stormy tomorrow.");
return;
}
}
break;
case "winter":
@ -133,10 +208,13 @@ namespace Omegasis.MoreRain
Game1.weatherForTomorrow = Game1.weather_snow;
this.VerboseLog("It will snow tomorrow.");
}
else
if (this.Config.RainInWinter)
{
//StardewValley.Game1.weatherForTomorrow = StardewValley.Game1.weather_sunny;
this.VerboseLog("It will not snow tomorrow.");
if (chance <= this.Config.WinterRainChance)
{
Game1.weatherForTomorrow = Game1.weather_rain;
this.VerboseLog("It will snow tomorrow.");
}
}
break;
}

View File

@ -66,7 +66,7 @@
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Pathoschild.Stardew.ModBuildConfig" Version="2.2.0" />
<PackageReference Include="Pathoschild.Stardew.ModBuildConfig" Version="3.0.0" />
</ItemGroup>
<ItemGroup>
<Reference Include="System" />

View File

@ -1,7 +1,7 @@
{
"Name": "More Rain",
"Author": "Alpha_Omegasis",
"Version": "1.8.0",
"Version": "1.9.0",
"Description": "Change how much it rains in the game.",
"UniqueID": "Omegasis.MoreRain",
"EntryDll": "MoreRain.dll",

View File

@ -0,0 +1,59 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Omegasis.NightOwl.Framework
{
public class NightOwlAPI
{
/// <summary>
/// Adds an event that triggers after the player has been warped to their pre-collapse position.
/// </summary>
/// <param name="ID">The id of the event.</param>
/// <param name="Action">The code that triggers.</param>
public void addPostWarpEvent(string ID,Func<bool> Action)
{
NightOwl.PostWarpCharacter.Add(ID, Action);
}
/// <summary>
/// Removes an event that triggers when the player has been warped to their pre-collapse position.
/// </summary>
/// <param name="ID"></param>
public void removePostWarpEvent(string ID)
{
if (NightOwl.PostWarpCharacter.ContainsKey(ID))
{
NightOwl.PostWarpCharacter.Remove(ID);
}
}
/// <summary>
/// Adds an event that triggers when the player has stayed up all night until 6:00 A.M.
/// </summary>
/// <param name="ID">The id of the event.</param>
/// <param name="Action">The code that triggers.</param>
public void addPlayerUpLateEvent(string ID, Func<bool> Action)
{
NightOwl.OnPlayerStayingUpLate.Add(ID, Action);
}
/// <summary>
/// Removes an event that triggers when the player has stayed up all night.
/// </summary>
/// <param name="ID"></param>
public void removePlayerUpLateEvent(string ID)
{
if (NightOwl.OnPlayerStayingUpLate.ContainsKey(ID))
{
NightOwl.OnPlayerStayingUpLate.Remove(ID);
}
}
}
}

View File

@ -20,6 +20,19 @@ namespace Omegasis.NightOwl
/// <summary>The mod entry point.</summary>
public class NightOwl : Mod
{
/*********
** Static Fields
*********/
/// <summary>
/// Events that are handled after the player has warped after they have stayed up late.
/// </summary>
public static Dictionary<string, Func<bool>> PostWarpCharacter = new Dictionary<string, Func<bool>>();
/// <summary>
/// Events that are handled when the player has stayed up late and are going to collapse.
/// </summary>
public static Dictionary<string, Func<bool>> OnPlayerStayingUpLate = new Dictionary<string, Func<bool>>();
/*********
** Fields
*********/
@ -71,12 +84,13 @@ namespace Omegasis.NightOwl
/// <summary>Determines whehther or not to rewarp the player's horse to them.</summary>
private bool shouldWarpHorse;
/// <summary>Event in the night taht simulates the earthquake event that should happen.</summary>
/// <summary>Event in the night that simulates the earthquake event that should happen.</summary>
StardewValley.Events.SoundInTheNightEvent eve;
private List<NetByte> oldAnimalHappiness;
/*********
** Public methods
*********/
@ -98,6 +112,10 @@ namespace Omegasis.NightOwl
this.shouldWarpHorse = false;
}
public override object GetApi()
{
return new NightOwlAPI();
}
/*********
** Private methods
@ -117,7 +135,13 @@ namespace Omegasis.NightOwl
if (Context.IsWorldReady && this.JustStartedNewDay && this.Config.KeepPositionAfterCollapse)
{
if (this.PreCollapseMap != null)
{
Game1.warpFarmer(this.PreCollapseMap, this.PreCollapseTile.X, this.PreCollapseTile.Y, false);
foreach (var v in PostWarpCharacter)
{
v.Value.Invoke();
}
}
this.PreCollapseMap = null;
this.JustStartedNewDay = false;
@ -148,7 +172,7 @@ namespace Omegasis.NightOwl
}
if (this.Config.KeepMoneyAfterCollapse)
Game1.player.money += collapseFee;
Game1.player.Money += collapseFee;
}
/// <summary>Raised after the player loads a save slot and the world is initialised.</summary>
@ -183,7 +207,13 @@ namespace Omegasis.NightOwl
if (this.Config.KeepPositionAfterCollapse)
{
if (!Game1.weddingToday)
{
Game1.warpFarmer(this.PreCollapseMap, this.PreCollapseTile.X, this.PreCollapseTile.Y, false);
foreach(var v in PostWarpCharacter)
{
v.Value.Invoke();
}
}
}
if (this.horse != null && this.shouldWarpHorse)
@ -196,7 +226,7 @@ namespace Omegasis.NightOwl
if (this.isBathing)
Game1.player.swimming.Value = true;
//Reflction to ensure that the railroad becomes properly unblocked.
//Reflection to ensure that the railroad becomes properly unblocked.
if (Game1.dayOfMonth == 1 && Game1.currentSeason == "summer" && Game1.year == 1)
{
Mountain mountain = (Mountain)Game1.getLocationFromName("Mountain");
@ -304,7 +334,7 @@ namespace Omegasis.NightOwl
this.PreCollapseMap = Game1.player.currentLocation.Name;
this.PreCollapseStamina = Game1.player.stamina;
this.PreCollapseHealth = Game1.player.health;
this.PreCollapseMoney = Game1.player.money;
this.PreCollapseMoney = Game1.player.Money;
this.isInSwimSuit = Game1.player.bathingClothes.Value;
this.isBathing = Game1.player.swimming.Value;
@ -314,7 +344,7 @@ namespace Omegasis.NightOwl
if (Game1.activeClickableMenu != null) Game1.activeClickableMenu.exitThisMenu(true); //Exit menus.
Game1.timeOfDay += 2400; //Recalculate for the sake of technically being up a whole day.
//Game1.timeOfDay += 2400; //Recalculate for the sake of technically being up a whole day. Why did I put this here?
//Reset animal happiness since it drains over night.
for (int i = 0; i < this.oldAnimalHappiness.Count; i++)
@ -322,6 +352,11 @@ namespace Omegasis.NightOwl
Game1.getFarm().getAllFarmAnimals()[i].happiness.Value = this.oldAnimalHappiness[i].Value;
}
foreach(var v in OnPlayerStayingUpLate)
{
v.Value.Invoke();
}
Game1.player.startToPassOut();
}
}

View File

@ -66,7 +66,7 @@
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Pathoschild.Stardew.ModBuildConfig" Version="2.2.0" />
<PackageReference Include="Pathoschild.Stardew.ModBuildConfig" Version="3.0.0" />
</ItemGroup>
<ItemGroup>
<Reference Include="System" />
@ -78,6 +78,7 @@
</Compile>
<Compile Include="Framework\ModConfig.cs" />
<Compile Include="Framework\NightFishing.cs" />
<Compile Include="Framework\NightOwlAPI.cs" />
<Compile Include="NightOwl.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
</ItemGroup>

View File

@ -1,10 +1,10 @@
{
"Name": "Night Owl",
"Author": "Alpha_Omegasis",
"Version": "1.9.0",
"Version": "1.10.0",
"Description": "Lets you stay up all night.",
"UniqueID": "Omegasis.NightOwl",
"EntryDll": "NightOwl.dll",
"MinimumApiVersion": "2.10.1",
"MinimumApiVersion": "3.0.0",
"UpdateKeys": [ "Nexus:433" ]
}

View File

@ -68,7 +68,7 @@
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Pathoschild.Stardew.ModBuildConfig" Version="2.2.0" />
<PackageReference Include="Pathoschild.Stardew.ModBuildConfig" Version="3.0.0" />
</ItemGroup>
<ItemGroup>
<Reference Include="System" />

Some files were not shown because too many files have changed in this diff Show More