Files
crystall-punk-14/Content.Client/_CP14/Cooking/CP14ClientCookingSystem.cs

139 lines
4.3 KiB
C#
Raw Normal View History

Cooking Simulator (#1529) * frying pan start * fix data saving * Refactor cooking system and add localization support Refactored food data handling in the cooking system to use Visuals instead of FoodData on holders, improved food transfer logic, and added popups and examine messages for user feedback. Added English and Russian localization files for cooking examine and meal descriptions, and updated prototype files to increase plate solution volume and add a whitelist for the cooking furnace. * Refactor cooking system solution handling Removed Solution field from CP14FoodData and updated CP14SharedCookingSystem to use solution containers directly. Improved solution transfer, mixing, and overflow handling during cooking. Increased pan max volume from 30 to 100 in cooking_furnace.yml. * Improve cooking system trash handling and update food sprites Enhanced trash distribution in CP14SharedCookingSystem to randomly assign trash to plates, only adding all trash to the last plate. Updated meat_dish and salad prototypes to use new wooden plate sprites. Added wideAnimationRotation and DrainableSolution to cooking_furnace for improved functionality. * Remove unused usings and redundant comments in cooking components Cleaned up CP14 cooking-related components by removing unused using directives and empty XML comments. This improves code readability and maintainability. * Add tag-based cooking requirements and new meal recipes Introduces tag-based cooking requirement classes (TagRequired, TagBlocked, SolutionRequired) and updates the cooking system to support tag checks. Adds new tags for food items, updates food and meal prototypes to include relevant tags, and implements new meal recipes (Zellasian Breakfast, Monster Egg) with corresponding sprites and localization. Also refactors and renames some tag and structure prototype files for better organization. * Refactor and expand CP14 cooking recipes and tags Reworked meal recipes to use tag-based requirements, added new tags for food categorization (meat, cheese, vegetables, etc.), and removed hardcoded entity recipes for ham in cheese and stuffed potato. Updated and added new meal recipes (bread plate, ham in cheese, stuffed potato), localized their names and descriptions, and migrated/added corresponding sprites. Deprecated SolutionRequired requirement, cleaned up unused tags, and improved TagRequired/TagBlocked logic. Updated prototype files to use new tags and added missing tags to food entities. * Refactor and expand green salad recipes and assets Replaces the old green salad entity and workbench recipe with new cooking recipes for green salad and green salad with meat. Updates English and Russian localization, moves and adds new salad textures, and removes obsolete salad assets and trading request. * mashed potatoes * Add mashed potatoes with herbs meal Introduced a new 'mashed potatoes with herbs' meal, including English and Russian localization, recipe definition, and associated sprite. Updated the texture metadata and added the new image asset. * Update dye.yml * Fix frying pan item size and update plate recipe Moved the 'size: Ginormous' property to the correct component in frying_pen.yml. Renamed the plate recipe and result from 'CP14Plate' to 'CP14PlateWooden' in misc.yml for clarity. * Update meals.yml * Update migration.yml * fixes * fix heating food sounds * Nyranu temperature transmission * Update plate.yml * Cooking DoAfter works * burning logic * cooking more work * auto transform transformable * Update CP14SharedCookingSystem.DoAfter.cs * cool burning visuals! * Add MIT license headers to cooking system files Added sublicensing notice and MIT license header to all files in the CP14 cooking system. Also made minor code cleanups, such as removing unnecessary default initializations and improving XML documentation for clarity. * constant heating required * cooking visuals improve! * sandwiches with processed cheese + reagent burnt fuckuping * inhand pan sprites + FIRE fuckup * crafting & buying pan * fix predicting * random food spawner + chef closet * mapping update * Update frying_pen.yml * move WIP to blacksmith lol
2025-07-16 08:15:08 +03:00
/*
* This file is sublicensed under MIT License
* https://github.com/space-wizards/space-station-14/blob/master/LICENSE.TXT
*/
using System.Numerics;
using Content.Client.DisplacementMap;
Cooking Simulator (#1529) * frying pan start * fix data saving * Refactor cooking system and add localization support Refactored food data handling in the cooking system to use Visuals instead of FoodData on holders, improved food transfer logic, and added popups and examine messages for user feedback. Added English and Russian localization files for cooking examine and meal descriptions, and updated prototype files to increase plate solution volume and add a whitelist for the cooking furnace. * Refactor cooking system solution handling Removed Solution field from CP14FoodData and updated CP14SharedCookingSystem to use solution containers directly. Improved solution transfer, mixing, and overflow handling during cooking. Increased pan max volume from 30 to 100 in cooking_furnace.yml. * Improve cooking system trash handling and update food sprites Enhanced trash distribution in CP14SharedCookingSystem to randomly assign trash to plates, only adding all trash to the last plate. Updated meat_dish and salad prototypes to use new wooden plate sprites. Added wideAnimationRotation and DrainableSolution to cooking_furnace for improved functionality. * Remove unused usings and redundant comments in cooking components Cleaned up CP14 cooking-related components by removing unused using directives and empty XML comments. This improves code readability and maintainability. * Add tag-based cooking requirements and new meal recipes Introduces tag-based cooking requirement classes (TagRequired, TagBlocked, SolutionRequired) and updates the cooking system to support tag checks. Adds new tags for food items, updates food and meal prototypes to include relevant tags, and implements new meal recipes (Zellasian Breakfast, Monster Egg) with corresponding sprites and localization. Also refactors and renames some tag and structure prototype files for better organization. * Refactor and expand CP14 cooking recipes and tags Reworked meal recipes to use tag-based requirements, added new tags for food categorization (meat, cheese, vegetables, etc.), and removed hardcoded entity recipes for ham in cheese and stuffed potato. Updated and added new meal recipes (bread plate, ham in cheese, stuffed potato), localized their names and descriptions, and migrated/added corresponding sprites. Deprecated SolutionRequired requirement, cleaned up unused tags, and improved TagRequired/TagBlocked logic. Updated prototype files to use new tags and added missing tags to food entities. * Refactor and expand green salad recipes and assets Replaces the old green salad entity and workbench recipe with new cooking recipes for green salad and green salad with meat. Updates English and Russian localization, moves and adds new salad textures, and removes obsolete salad assets and trading request. * mashed potatoes * Add mashed potatoes with herbs meal Introduced a new 'mashed potatoes with herbs' meal, including English and Russian localization, recipe definition, and associated sprite. Updated the texture metadata and added the new image asset. * Update dye.yml * Fix frying pan item size and update plate recipe Moved the 'size: Ginormous' property to the correct component in frying_pen.yml. Renamed the plate recipe and result from 'CP14Plate' to 'CP14PlateWooden' in misc.yml for clarity. * Update meals.yml * Update migration.yml * fixes * fix heating food sounds * Nyranu temperature transmission * Update plate.yml * Cooking DoAfter works * burning logic * cooking more work * auto transform transformable * Update CP14SharedCookingSystem.DoAfter.cs * cool burning visuals! * Add MIT license headers to cooking system files Added sublicensing notice and MIT license header to all files in the CP14 cooking system. Also made minor code cleanups, such as removing unnecessary default initializations and improving XML documentation for clarity. * constant heating required * cooking visuals improve! * sandwiches with processed cheese + reagent burnt fuckuping * inhand pan sprites + FIRE fuckup * crafting & buying pan * fix predicting * random food spawner + chef closet * mapping update * Update frying_pen.yml * move WIP to blacksmith lol
2025-07-16 08:15:08 +03:00
using Content.Shared._CP14.Cooking;
using Content.Shared._CP14.Cooking.Components;
using Content.Shared.DisplacementMap;
using Content.Shared.Rounding;
Cooking Simulator (#1529) * frying pan start * fix data saving * Refactor cooking system and add localization support Refactored food data handling in the cooking system to use Visuals instead of FoodData on holders, improved food transfer logic, and added popups and examine messages for user feedback. Added English and Russian localization files for cooking examine and meal descriptions, and updated prototype files to increase plate solution volume and add a whitelist for the cooking furnace. * Refactor cooking system solution handling Removed Solution field from CP14FoodData and updated CP14SharedCookingSystem to use solution containers directly. Improved solution transfer, mixing, and overflow handling during cooking. Increased pan max volume from 30 to 100 in cooking_furnace.yml. * Improve cooking system trash handling and update food sprites Enhanced trash distribution in CP14SharedCookingSystem to randomly assign trash to plates, only adding all trash to the last plate. Updated meat_dish and salad prototypes to use new wooden plate sprites. Added wideAnimationRotation and DrainableSolution to cooking_furnace for improved functionality. * Remove unused usings and redundant comments in cooking components Cleaned up CP14 cooking-related components by removing unused using directives and empty XML comments. This improves code readability and maintainability. * Add tag-based cooking requirements and new meal recipes Introduces tag-based cooking requirement classes (TagRequired, TagBlocked, SolutionRequired) and updates the cooking system to support tag checks. Adds new tags for food items, updates food and meal prototypes to include relevant tags, and implements new meal recipes (Zellasian Breakfast, Monster Egg) with corresponding sprites and localization. Also refactors and renames some tag and structure prototype files for better organization. * Refactor and expand CP14 cooking recipes and tags Reworked meal recipes to use tag-based requirements, added new tags for food categorization (meat, cheese, vegetables, etc.), and removed hardcoded entity recipes for ham in cheese and stuffed potato. Updated and added new meal recipes (bread plate, ham in cheese, stuffed potato), localized their names and descriptions, and migrated/added corresponding sprites. Deprecated SolutionRequired requirement, cleaned up unused tags, and improved TagRequired/TagBlocked logic. Updated prototype files to use new tags and added missing tags to food entities. * Refactor and expand green salad recipes and assets Replaces the old green salad entity and workbench recipe with new cooking recipes for green salad and green salad with meat. Updates English and Russian localization, moves and adds new salad textures, and removes obsolete salad assets and trading request. * mashed potatoes * Add mashed potatoes with herbs meal Introduced a new 'mashed potatoes with herbs' meal, including English and Russian localization, recipe definition, and associated sprite. Updated the texture metadata and added the new image asset. * Update dye.yml * Fix frying pan item size and update plate recipe Moved the 'size: Ginormous' property to the correct component in frying_pen.yml. Renamed the plate recipe and result from 'CP14Plate' to 'CP14PlateWooden' in misc.yml for clarity. * Update meals.yml * Update migration.yml * fixes * fix heating food sounds * Nyranu temperature transmission * Update plate.yml * Cooking DoAfter works * burning logic * cooking more work * auto transform transformable * Update CP14SharedCookingSystem.DoAfter.cs * cool burning visuals! * Add MIT license headers to cooking system files Added sublicensing notice and MIT license header to all files in the CP14 cooking system. Also made minor code cleanups, such as removing unnecessary default initializations and improving XML documentation for clarity. * constant heating required * cooking visuals improve! * sandwiches with processed cheese + reagent burnt fuckuping * inhand pan sprites + FIRE fuckup * crafting & buying pan * fix predicting * random food spawner + chef closet * mapping update * Update frying_pen.yml * move WIP to blacksmith lol
2025-07-16 08:15:08 +03:00
using Robust.Client.GameObjects;
using Robust.Shared.Random;
namespace Content.Client._CP14.Cooking;
public sealed class CP14ClientCookingSystem : CP14SharedCookingSystem
{
[Dependency] private readonly SpriteSystem _sprite = default!;
[Dependency] private readonly DisplacementMapSystem _displacement = default!;
Cooking Simulator (#1529) * frying pan start * fix data saving * Refactor cooking system and add localization support Refactored food data handling in the cooking system to use Visuals instead of FoodData on holders, improved food transfer logic, and added popups and examine messages for user feedback. Added English and Russian localization files for cooking examine and meal descriptions, and updated prototype files to increase plate solution volume and add a whitelist for the cooking furnace. * Refactor cooking system solution handling Removed Solution field from CP14FoodData and updated CP14SharedCookingSystem to use solution containers directly. Improved solution transfer, mixing, and overflow handling during cooking. Increased pan max volume from 30 to 100 in cooking_furnace.yml. * Improve cooking system trash handling and update food sprites Enhanced trash distribution in CP14SharedCookingSystem to randomly assign trash to plates, only adding all trash to the last plate. Updated meat_dish and salad prototypes to use new wooden plate sprites. Added wideAnimationRotation and DrainableSolution to cooking_furnace for improved functionality. * Remove unused usings and redundant comments in cooking components Cleaned up CP14 cooking-related components by removing unused using directives and empty XML comments. This improves code readability and maintainability. * Add tag-based cooking requirements and new meal recipes Introduces tag-based cooking requirement classes (TagRequired, TagBlocked, SolutionRequired) and updates the cooking system to support tag checks. Adds new tags for food items, updates food and meal prototypes to include relevant tags, and implements new meal recipes (Zellasian Breakfast, Monster Egg) with corresponding sprites and localization. Also refactors and renames some tag and structure prototype files for better organization. * Refactor and expand CP14 cooking recipes and tags Reworked meal recipes to use tag-based requirements, added new tags for food categorization (meat, cheese, vegetables, etc.), and removed hardcoded entity recipes for ham in cheese and stuffed potato. Updated and added new meal recipes (bread plate, ham in cheese, stuffed potato), localized their names and descriptions, and migrated/added corresponding sprites. Deprecated SolutionRequired requirement, cleaned up unused tags, and improved TagRequired/TagBlocked logic. Updated prototype files to use new tags and added missing tags to food entities. * Refactor and expand green salad recipes and assets Replaces the old green salad entity and workbench recipe with new cooking recipes for green salad and green salad with meat. Updates English and Russian localization, moves and adds new salad textures, and removes obsolete salad assets and trading request. * mashed potatoes * Add mashed potatoes with herbs meal Introduced a new 'mashed potatoes with herbs' meal, including English and Russian localization, recipe definition, and associated sprite. Updated the texture metadata and added the new image asset. * Update dye.yml * Fix frying pan item size and update plate recipe Moved the 'size: Ginormous' property to the correct component in frying_pen.yml. Renamed the plate recipe and result from 'CP14Plate' to 'CP14PlateWooden' in misc.yml for clarity. * Update meals.yml * Update migration.yml * fixes * fix heating food sounds * Nyranu temperature transmission * Update plate.yml * Cooking DoAfter works * burning logic * cooking more work * auto transform transformable * Update CP14SharedCookingSystem.DoAfter.cs * cool burning visuals! * Add MIT license headers to cooking system files Added sublicensing notice and MIT license header to all files in the CP14 cooking system. Also made minor code cleanups, such as removing unnecessary default initializations and improving XML documentation for clarity. * constant heating required * cooking visuals improve! * sandwiches with processed cheese + reagent burnt fuckuping * inhand pan sprites + FIRE fuckup * crafting & buying pan * fix predicting * random food spawner + chef closet * mapping update * Update frying_pen.yml * move WIP to blacksmith lol
2025-07-16 08:15:08 +03:00
public override void Initialize()
{
base.Initialize();
SubscribeLocalEvent<CP14FoodHolderComponent, AfterAutoHandleStateEvent>(OnAfterHandleState);
SubscribeLocalEvent<CP14FoodHolderComponent, AppearanceChangeEvent>(OnAppearanceChange);
Cooking Simulator (#1529) * frying pan start * fix data saving * Refactor cooking system and add localization support Refactored food data handling in the cooking system to use Visuals instead of FoodData on holders, improved food transfer logic, and added popups and examine messages for user feedback. Added English and Russian localization files for cooking examine and meal descriptions, and updated prototype files to increase plate solution volume and add a whitelist for the cooking furnace. * Refactor cooking system solution handling Removed Solution field from CP14FoodData and updated CP14SharedCookingSystem to use solution containers directly. Improved solution transfer, mixing, and overflow handling during cooking. Increased pan max volume from 30 to 100 in cooking_furnace.yml. * Improve cooking system trash handling and update food sprites Enhanced trash distribution in CP14SharedCookingSystem to randomly assign trash to plates, only adding all trash to the last plate. Updated meat_dish and salad prototypes to use new wooden plate sprites. Added wideAnimationRotation and DrainableSolution to cooking_furnace for improved functionality. * Remove unused usings and redundant comments in cooking components Cleaned up CP14 cooking-related components by removing unused using directives and empty XML comments. This improves code readability and maintainability. * Add tag-based cooking requirements and new meal recipes Introduces tag-based cooking requirement classes (TagRequired, TagBlocked, SolutionRequired) and updates the cooking system to support tag checks. Adds new tags for food items, updates food and meal prototypes to include relevant tags, and implements new meal recipes (Zellasian Breakfast, Monster Egg) with corresponding sprites and localization. Also refactors and renames some tag and structure prototype files for better organization. * Refactor and expand CP14 cooking recipes and tags Reworked meal recipes to use tag-based requirements, added new tags for food categorization (meat, cheese, vegetables, etc.), and removed hardcoded entity recipes for ham in cheese and stuffed potato. Updated and added new meal recipes (bread plate, ham in cheese, stuffed potato), localized their names and descriptions, and migrated/added corresponding sprites. Deprecated SolutionRequired requirement, cleaned up unused tags, and improved TagRequired/TagBlocked logic. Updated prototype files to use new tags and added missing tags to food entities. * Refactor and expand green salad recipes and assets Replaces the old green salad entity and workbench recipe with new cooking recipes for green salad and green salad with meat. Updates English and Russian localization, moves and adds new salad textures, and removes obsolete salad assets and trading request. * mashed potatoes * Add mashed potatoes with herbs meal Introduced a new 'mashed potatoes with herbs' meal, including English and Russian localization, recipe definition, and associated sprite. Updated the texture metadata and added the new image asset. * Update dye.yml * Fix frying pan item size and update plate recipe Moved the 'size: Ginormous' property to the correct component in frying_pen.yml. Renamed the plate recipe and result from 'CP14Plate' to 'CP14PlateWooden' in misc.yml for clarity. * Update meals.yml * Update migration.yml * fixes * fix heating food sounds * Nyranu temperature transmission * Update plate.yml * Cooking DoAfter works * burning logic * cooking more work * auto transform transformable * Update CP14SharedCookingSystem.DoAfter.cs * cool burning visuals! * Add MIT license headers to cooking system files Added sublicensing notice and MIT license header to all files in the CP14 cooking system. Also made minor code cleanups, such as removing unnecessary default initializations and improving XML documentation for clarity. * constant heating required * cooking visuals improve! * sandwiches with processed cheese + reagent burnt fuckuping * inhand pan sprites + FIRE fuckup * crafting & buying pan * fix predicting * random food spawner + chef closet * mapping update * Update frying_pen.yml * move WIP to blacksmith lol
2025-07-16 08:15:08 +03:00
}
private void OnAppearanceChange(Entity<CP14FoodHolderComponent> ent, ref AppearanceChangeEvent args)
Cooking Simulator (#1529) * frying pan start * fix data saving * Refactor cooking system and add localization support Refactored food data handling in the cooking system to use Visuals instead of FoodData on holders, improved food transfer logic, and added popups and examine messages for user feedback. Added English and Russian localization files for cooking examine and meal descriptions, and updated prototype files to increase plate solution volume and add a whitelist for the cooking furnace. * Refactor cooking system solution handling Removed Solution field from CP14FoodData and updated CP14SharedCookingSystem to use solution containers directly. Improved solution transfer, mixing, and overflow handling during cooking. Increased pan max volume from 30 to 100 in cooking_furnace.yml. * Improve cooking system trash handling and update food sprites Enhanced trash distribution in CP14SharedCookingSystem to randomly assign trash to plates, only adding all trash to the last plate. Updated meat_dish and salad prototypes to use new wooden plate sprites. Added wideAnimationRotation and DrainableSolution to cooking_furnace for improved functionality. * Remove unused usings and redundant comments in cooking components Cleaned up CP14 cooking-related components by removing unused using directives and empty XML comments. This improves code readability and maintainability. * Add tag-based cooking requirements and new meal recipes Introduces tag-based cooking requirement classes (TagRequired, TagBlocked, SolutionRequired) and updates the cooking system to support tag checks. Adds new tags for food items, updates food and meal prototypes to include relevant tags, and implements new meal recipes (Zellasian Breakfast, Monster Egg) with corresponding sprites and localization. Also refactors and renames some tag and structure prototype files for better organization. * Refactor and expand CP14 cooking recipes and tags Reworked meal recipes to use tag-based requirements, added new tags for food categorization (meat, cheese, vegetables, etc.), and removed hardcoded entity recipes for ham in cheese and stuffed potato. Updated and added new meal recipes (bread plate, ham in cheese, stuffed potato), localized their names and descriptions, and migrated/added corresponding sprites. Deprecated SolutionRequired requirement, cleaned up unused tags, and improved TagRequired/TagBlocked logic. Updated prototype files to use new tags and added missing tags to food entities. * Refactor and expand green salad recipes and assets Replaces the old green salad entity and workbench recipe with new cooking recipes for green salad and green salad with meat. Updates English and Russian localization, moves and adds new salad textures, and removes obsolete salad assets and trading request. * mashed potatoes * Add mashed potatoes with herbs meal Introduced a new 'mashed potatoes with herbs' meal, including English and Russian localization, recipe definition, and associated sprite. Updated the texture metadata and added the new image asset. * Update dye.yml * Fix frying pan item size and update plate recipe Moved the 'size: Ginormous' property to the correct component in frying_pen.yml. Renamed the plate recipe and result from 'CP14Plate' to 'CP14PlateWooden' in misc.yml for clarity. * Update meals.yml * Update migration.yml * fixes * fix heating food sounds * Nyranu temperature transmission * Update plate.yml * Cooking DoAfter works * burning logic * cooking more work * auto transform transformable * Update CP14SharedCookingSystem.DoAfter.cs * cool burning visuals! * Add MIT license headers to cooking system files Added sublicensing notice and MIT license header to all files in the CP14 cooking system. Also made minor code cleanups, such as removing unnecessary default initializations and improving XML documentation for clarity. * constant heating required * cooking visuals improve! * sandwiches with processed cheese + reagent burnt fuckuping * inhand pan sprites + FIRE fuckup * crafting & buying pan * fix predicting * random food spawner + chef closet * mapping update * Update frying_pen.yml * move WIP to blacksmith lol
2025-07-16 08:15:08 +03:00
{
var solutionId = string.Empty;
if (TryComp<CP14FoodHolderComponent>(ent, out var holder))
solutionId = holder.SolutionId;
UpdateVisuals(
ent,
solutionId,
ref ent.Comp.RevealedLayers,
ent.Comp.TargetLayerMap,
ent.Comp.MaxDisplacementFillLevels,
ent.Comp.DisplacementRsiPath,
ent.Comp.FoodData);
}
private void OnAfterHandleState(Entity<CP14FoodHolderComponent> ent, ref AfterAutoHandleStateEvent args)
{
var solutionId = string.Empty;
if (TryComp<CP14FoodHolderComponent>(ent, out var holder))
solutionId = holder.SolutionId;
UpdateVisuals(
ent,
solutionId,
ref ent.Comp.RevealedLayers,
ent.Comp.TargetLayerMap,
ent.Comp.MaxDisplacementFillLevels,
ent.Comp.DisplacementRsiPath,
ent.Comp.FoodData);
}
Cooking Simulator (#1529) * frying pan start * fix data saving * Refactor cooking system and add localization support Refactored food data handling in the cooking system to use Visuals instead of FoodData on holders, improved food transfer logic, and added popups and examine messages for user feedback. Added English and Russian localization files for cooking examine and meal descriptions, and updated prototype files to increase plate solution volume and add a whitelist for the cooking furnace. * Refactor cooking system solution handling Removed Solution field from CP14FoodData and updated CP14SharedCookingSystem to use solution containers directly. Improved solution transfer, mixing, and overflow handling during cooking. Increased pan max volume from 30 to 100 in cooking_furnace.yml. * Improve cooking system trash handling and update food sprites Enhanced trash distribution in CP14SharedCookingSystem to randomly assign trash to plates, only adding all trash to the last plate. Updated meat_dish and salad prototypes to use new wooden plate sprites. Added wideAnimationRotation and DrainableSolution to cooking_furnace for improved functionality. * Remove unused usings and redundant comments in cooking components Cleaned up CP14 cooking-related components by removing unused using directives and empty XML comments. This improves code readability and maintainability. * Add tag-based cooking requirements and new meal recipes Introduces tag-based cooking requirement classes (TagRequired, TagBlocked, SolutionRequired) and updates the cooking system to support tag checks. Adds new tags for food items, updates food and meal prototypes to include relevant tags, and implements new meal recipes (Zellasian Breakfast, Monster Egg) with corresponding sprites and localization. Also refactors and renames some tag and structure prototype files for better organization. * Refactor and expand CP14 cooking recipes and tags Reworked meal recipes to use tag-based requirements, added new tags for food categorization (meat, cheese, vegetables, etc.), and removed hardcoded entity recipes for ham in cheese and stuffed potato. Updated and added new meal recipes (bread plate, ham in cheese, stuffed potato), localized their names and descriptions, and migrated/added corresponding sprites. Deprecated SolutionRequired requirement, cleaned up unused tags, and improved TagRequired/TagBlocked logic. Updated prototype files to use new tags and added missing tags to food entities. * Refactor and expand green salad recipes and assets Replaces the old green salad entity and workbench recipe with new cooking recipes for green salad and green salad with meat. Updates English and Russian localization, moves and adds new salad textures, and removes obsolete salad assets and trading request. * mashed potatoes * Add mashed potatoes with herbs meal Introduced a new 'mashed potatoes with herbs' meal, including English and Russian localization, recipe definition, and associated sprite. Updated the texture metadata and added the new image asset. * Update dye.yml * Fix frying pan item size and update plate recipe Moved the 'size: Ginormous' property to the correct component in frying_pen.yml. Renamed the plate recipe and result from 'CP14Plate' to 'CP14PlateWooden' in misc.yml for clarity. * Update meals.yml * Update migration.yml * fixes * fix heating food sounds * Nyranu temperature transmission * Update plate.yml * Cooking DoAfter works * burning logic * cooking more work * auto transform transformable * Update CP14SharedCookingSystem.DoAfter.cs * cool burning visuals! * Add MIT license headers to cooking system files Added sublicensing notice and MIT license header to all files in the CP14 cooking system. Also made minor code cleanups, such as removing unnecessary default initializations and improving XML documentation for clarity. * constant heating required * cooking visuals improve! * sandwiches with processed cheese + reagent burnt fuckuping * inhand pan sprites + FIRE fuckup * crafting & buying pan * fix predicting * random food spawner + chef closet * mapping update * Update frying_pen.yml * move WIP to blacksmith lol
2025-07-16 08:15:08 +03:00
private void UpdateVisuals(
EntityUid ent,
string? solutionId,
ref HashSet<string> revealedLayers,
string targetLayerMap,
int maxDisplacementFillLevels,
string? displacementRsiPath,
CP14FoodData? data)
{
if (!TryComp<SpriteComponent>(ent, out var sprite))
Cooking Simulator (#1529) * frying pan start * fix data saving * Refactor cooking system and add localization support Refactored food data handling in the cooking system to use Visuals instead of FoodData on holders, improved food transfer logic, and added popups and examine messages for user feedback. Added English and Russian localization files for cooking examine and meal descriptions, and updated prototype files to increase plate solution volume and add a whitelist for the cooking furnace. * Refactor cooking system solution handling Removed Solution field from CP14FoodData and updated CP14SharedCookingSystem to use solution containers directly. Improved solution transfer, mixing, and overflow handling during cooking. Increased pan max volume from 30 to 100 in cooking_furnace.yml. * Improve cooking system trash handling and update food sprites Enhanced trash distribution in CP14SharedCookingSystem to randomly assign trash to plates, only adding all trash to the last plate. Updated meat_dish and salad prototypes to use new wooden plate sprites. Added wideAnimationRotation and DrainableSolution to cooking_furnace for improved functionality. * Remove unused usings and redundant comments in cooking components Cleaned up CP14 cooking-related components by removing unused using directives and empty XML comments. This improves code readability and maintainability. * Add tag-based cooking requirements and new meal recipes Introduces tag-based cooking requirement classes (TagRequired, TagBlocked, SolutionRequired) and updates the cooking system to support tag checks. Adds new tags for food items, updates food and meal prototypes to include relevant tags, and implements new meal recipes (Zellasian Breakfast, Monster Egg) with corresponding sprites and localization. Also refactors and renames some tag and structure prototype files for better organization. * Refactor and expand CP14 cooking recipes and tags Reworked meal recipes to use tag-based requirements, added new tags for food categorization (meat, cheese, vegetables, etc.), and removed hardcoded entity recipes for ham in cheese and stuffed potato. Updated and added new meal recipes (bread plate, ham in cheese, stuffed potato), localized their names and descriptions, and migrated/added corresponding sprites. Deprecated SolutionRequired requirement, cleaned up unused tags, and improved TagRequired/TagBlocked logic. Updated prototype files to use new tags and added missing tags to food entities. * Refactor and expand green salad recipes and assets Replaces the old green salad entity and workbench recipe with new cooking recipes for green salad and green salad with meat. Updates English and Russian localization, moves and adds new salad textures, and removes obsolete salad assets and trading request. * mashed potatoes * Add mashed potatoes with herbs meal Introduced a new 'mashed potatoes with herbs' meal, including English and Russian localization, recipe definition, and associated sprite. Updated the texture metadata and added the new image asset. * Update dye.yml * Fix frying pan item size and update plate recipe Moved the 'size: Ginormous' property to the correct component in frying_pen.yml. Renamed the plate recipe and result from 'CP14Plate' to 'CP14PlateWooden' in misc.yml for clarity. * Update meals.yml * Update migration.yml * fixes * fix heating food sounds * Nyranu temperature transmission * Update plate.yml * Cooking DoAfter works * burning logic * cooking more work * auto transform transformable * Update CP14SharedCookingSystem.DoAfter.cs * cool burning visuals! * Add MIT license headers to cooking system files Added sublicensing notice and MIT license header to all files in the CP14 cooking system. Also made minor code cleanups, such as removing unnecessary default initializations and improving XML documentation for clarity. * constant heating required * cooking visuals improve! * sandwiches with processed cheese + reagent burnt fuckuping * inhand pan sprites + FIRE fuckup * crafting & buying pan * fix predicting * random food spawner + chef closet * mapping update * Update frying_pen.yml * move WIP to blacksmith lol
2025-07-16 08:15:08 +03:00
return;
//Remove old layers
foreach (var key in revealedLayers)
Cooking Simulator (#1529) * frying pan start * fix data saving * Refactor cooking system and add localization support Refactored food data handling in the cooking system to use Visuals instead of FoodData on holders, improved food transfer logic, and added popups and examine messages for user feedback. Added English and Russian localization files for cooking examine and meal descriptions, and updated prototype files to increase plate solution volume and add a whitelist for the cooking furnace. * Refactor cooking system solution handling Removed Solution field from CP14FoodData and updated CP14SharedCookingSystem to use solution containers directly. Improved solution transfer, mixing, and overflow handling during cooking. Increased pan max volume from 30 to 100 in cooking_furnace.yml. * Improve cooking system trash handling and update food sprites Enhanced trash distribution in CP14SharedCookingSystem to randomly assign trash to plates, only adding all trash to the last plate. Updated meat_dish and salad prototypes to use new wooden plate sprites. Added wideAnimationRotation and DrainableSolution to cooking_furnace for improved functionality. * Remove unused usings and redundant comments in cooking components Cleaned up CP14 cooking-related components by removing unused using directives and empty XML comments. This improves code readability and maintainability. * Add tag-based cooking requirements and new meal recipes Introduces tag-based cooking requirement classes (TagRequired, TagBlocked, SolutionRequired) and updates the cooking system to support tag checks. Adds new tags for food items, updates food and meal prototypes to include relevant tags, and implements new meal recipes (Zellasian Breakfast, Monster Egg) with corresponding sprites and localization. Also refactors and renames some tag and structure prototype files for better organization. * Refactor and expand CP14 cooking recipes and tags Reworked meal recipes to use tag-based requirements, added new tags for food categorization (meat, cheese, vegetables, etc.), and removed hardcoded entity recipes for ham in cheese and stuffed potato. Updated and added new meal recipes (bread plate, ham in cheese, stuffed potato), localized their names and descriptions, and migrated/added corresponding sprites. Deprecated SolutionRequired requirement, cleaned up unused tags, and improved TagRequired/TagBlocked logic. Updated prototype files to use new tags and added missing tags to food entities. * Refactor and expand green salad recipes and assets Replaces the old green salad entity and workbench recipe with new cooking recipes for green salad and green salad with meat. Updates English and Russian localization, moves and adds new salad textures, and removes obsolete salad assets and trading request. * mashed potatoes * Add mashed potatoes with herbs meal Introduced a new 'mashed potatoes with herbs' meal, including English and Russian localization, recipe definition, and associated sprite. Updated the texture metadata and added the new image asset. * Update dye.yml * Fix frying pan item size and update plate recipe Moved the 'size: Ginormous' property to the correct component in frying_pen.yml. Renamed the plate recipe and result from 'CP14Plate' to 'CP14PlateWooden' in misc.yml for clarity. * Update meals.yml * Update migration.yml * fixes * fix heating food sounds * Nyranu temperature transmission * Update plate.yml * Cooking DoAfter works * burning logic * cooking more work * auto transform transformable * Update CP14SharedCookingSystem.DoAfter.cs * cool burning visuals! * Add MIT license headers to cooking system files Added sublicensing notice and MIT license header to all files in the CP14 cooking system. Also made minor code cleanups, such as removing unnecessary default initializations and improving XML documentation for clarity. * constant heating required * cooking visuals improve! * sandwiches with processed cheese + reagent burnt fuckuping * inhand pan sprites + FIRE fuckup * crafting & buying pan * fix predicting * random food spawner + chef closet * mapping update * Update frying_pen.yml * move WIP to blacksmith lol
2025-07-16 08:15:08 +03:00
{
_sprite.RemoveLayer((ent, sprite), key);
Cooking Simulator (#1529) * frying pan start * fix data saving * Refactor cooking system and add localization support Refactored food data handling in the cooking system to use Visuals instead of FoodData on holders, improved food transfer logic, and added popups and examine messages for user feedback. Added English and Russian localization files for cooking examine and meal descriptions, and updated prototype files to increase plate solution volume and add a whitelist for the cooking furnace. * Refactor cooking system solution handling Removed Solution field from CP14FoodData and updated CP14SharedCookingSystem to use solution containers directly. Improved solution transfer, mixing, and overflow handling during cooking. Increased pan max volume from 30 to 100 in cooking_furnace.yml. * Improve cooking system trash handling and update food sprites Enhanced trash distribution in CP14SharedCookingSystem to randomly assign trash to plates, only adding all trash to the last plate. Updated meat_dish and salad prototypes to use new wooden plate sprites. Added wideAnimationRotation and DrainableSolution to cooking_furnace for improved functionality. * Remove unused usings and redundant comments in cooking components Cleaned up CP14 cooking-related components by removing unused using directives and empty XML comments. This improves code readability and maintainability. * Add tag-based cooking requirements and new meal recipes Introduces tag-based cooking requirement classes (TagRequired, TagBlocked, SolutionRequired) and updates the cooking system to support tag checks. Adds new tags for food items, updates food and meal prototypes to include relevant tags, and implements new meal recipes (Zellasian Breakfast, Monster Egg) with corresponding sprites and localization. Also refactors and renames some tag and structure prototype files for better organization. * Refactor and expand CP14 cooking recipes and tags Reworked meal recipes to use tag-based requirements, added new tags for food categorization (meat, cheese, vegetables, etc.), and removed hardcoded entity recipes for ham in cheese and stuffed potato. Updated and added new meal recipes (bread plate, ham in cheese, stuffed potato), localized their names and descriptions, and migrated/added corresponding sprites. Deprecated SolutionRequired requirement, cleaned up unused tags, and improved TagRequired/TagBlocked logic. Updated prototype files to use new tags and added missing tags to food entities. * Refactor and expand green salad recipes and assets Replaces the old green salad entity and workbench recipe with new cooking recipes for green salad and green salad with meat. Updates English and Russian localization, moves and adds new salad textures, and removes obsolete salad assets and trading request. * mashed potatoes * Add mashed potatoes with herbs meal Introduced a new 'mashed potatoes with herbs' meal, including English and Russian localization, recipe definition, and associated sprite. Updated the texture metadata and added the new image asset. * Update dye.yml * Fix frying pan item size and update plate recipe Moved the 'size: Ginormous' property to the correct component in frying_pen.yml. Renamed the plate recipe and result from 'CP14Plate' to 'CP14PlateWooden' in misc.yml for clarity. * Update meals.yml * Update migration.yml * fixes * fix heating food sounds * Nyranu temperature transmission * Update plate.yml * Cooking DoAfter works * burning logic * cooking more work * auto transform transformable * Update CP14SharedCookingSystem.DoAfter.cs * cool burning visuals! * Add MIT license headers to cooking system files Added sublicensing notice and MIT license header to all files in the CP14 cooking system. Also made minor code cleanups, such as removing unnecessary default initializations and improving XML documentation for clarity. * constant heating required * cooking visuals improve! * sandwiches with processed cheese + reagent burnt fuckuping * inhand pan sprites + FIRE fuckup * crafting & buying pan * fix predicting * random food spawner + chef closet * mapping update * Update frying_pen.yml * move WIP to blacksmith lol
2025-07-16 08:15:08 +03:00
}
revealedLayers.Clear();
if (data is null)
return;
if (!_solution.TryGetSolution(ent, solutionId, out var soln, out var solution))
return;
_sprite.LayerMapTryGet((ent, sprite), targetLayerMap, out var index, false);
var fillLevel = (float)solution.Volume / (float)solution.MaxVolume;
if (fillLevel > 1)
fillLevel = 1;
var closestFillSprite = ContentHelpers.RoundToLevels(fillLevel, 1, maxDisplacementFillLevels + 1);
Cooking Simulator (#1529) * frying pan start * fix data saving * Refactor cooking system and add localization support Refactored food data handling in the cooking system to use Visuals instead of FoodData on holders, improved food transfer logic, and added popups and examine messages for user feedback. Added English and Russian localization files for cooking examine and meal descriptions, and updated prototype files to increase plate solution volume and add a whitelist for the cooking furnace. * Refactor cooking system solution handling Removed Solution field from CP14FoodData and updated CP14SharedCookingSystem to use solution containers directly. Improved solution transfer, mixing, and overflow handling during cooking. Increased pan max volume from 30 to 100 in cooking_furnace.yml. * Improve cooking system trash handling and update food sprites Enhanced trash distribution in CP14SharedCookingSystem to randomly assign trash to plates, only adding all trash to the last plate. Updated meat_dish and salad prototypes to use new wooden plate sprites. Added wideAnimationRotation and DrainableSolution to cooking_furnace for improved functionality. * Remove unused usings and redundant comments in cooking components Cleaned up CP14 cooking-related components by removing unused using directives and empty XML comments. This improves code readability and maintainability. * Add tag-based cooking requirements and new meal recipes Introduces tag-based cooking requirement classes (TagRequired, TagBlocked, SolutionRequired) and updates the cooking system to support tag checks. Adds new tags for food items, updates food and meal prototypes to include relevant tags, and implements new meal recipes (Zellasian Breakfast, Monster Egg) with corresponding sprites and localization. Also refactors and renames some tag and structure prototype files for better organization. * Refactor and expand CP14 cooking recipes and tags Reworked meal recipes to use tag-based requirements, added new tags for food categorization (meat, cheese, vegetables, etc.), and removed hardcoded entity recipes for ham in cheese and stuffed potato. Updated and added new meal recipes (bread plate, ham in cheese, stuffed potato), localized their names and descriptions, and migrated/added corresponding sprites. Deprecated SolutionRequired requirement, cleaned up unused tags, and improved TagRequired/TagBlocked logic. Updated prototype files to use new tags and added missing tags to food entities. * Refactor and expand green salad recipes and assets Replaces the old green salad entity and workbench recipe with new cooking recipes for green salad and green salad with meat. Updates English and Russian localization, moves and adds new salad textures, and removes obsolete salad assets and trading request. * mashed potatoes * Add mashed potatoes with herbs meal Introduced a new 'mashed potatoes with herbs' meal, including English and Russian localization, recipe definition, and associated sprite. Updated the texture metadata and added the new image asset. * Update dye.yml * Fix frying pan item size and update plate recipe Moved the 'size: Ginormous' property to the correct component in frying_pen.yml. Renamed the plate recipe and result from 'CP14Plate' to 'CP14PlateWooden' in misc.yml for clarity. * Update meals.yml * Update migration.yml * fixes * fix heating food sounds * Nyranu temperature transmission * Update plate.yml * Cooking DoAfter works * burning logic * cooking more work * auto transform transformable * Update CP14SharedCookingSystem.DoAfter.cs * cool burning visuals! * Add MIT license headers to cooking system files Added sublicensing notice and MIT license header to all files in the CP14 cooking system. Also made minor code cleanups, such as removing unnecessary default initializations and improving XML documentation for clarity. * constant heating required * cooking visuals improve! * sandwiches with processed cheese + reagent burnt fuckuping * inhand pan sprites + FIRE fuckup * crafting & buying pan * fix predicting * random food spawner + chef closet * mapping update * Update frying_pen.yml * move WIP to blacksmith lol
2025-07-16 08:15:08 +03:00
//Add new layers
var counter = 0;
foreach (var layer in data.Visuals)
Cooking Simulator (#1529) * frying pan start * fix data saving * Refactor cooking system and add localization support Refactored food data handling in the cooking system to use Visuals instead of FoodData on holders, improved food transfer logic, and added popups and examine messages for user feedback. Added English and Russian localization files for cooking examine and meal descriptions, and updated prototype files to increase plate solution volume and add a whitelist for the cooking furnace. * Refactor cooking system solution handling Removed Solution field from CP14FoodData and updated CP14SharedCookingSystem to use solution containers directly. Improved solution transfer, mixing, and overflow handling during cooking. Increased pan max volume from 30 to 100 in cooking_furnace.yml. * Improve cooking system trash handling and update food sprites Enhanced trash distribution in CP14SharedCookingSystem to randomly assign trash to plates, only adding all trash to the last plate. Updated meat_dish and salad prototypes to use new wooden plate sprites. Added wideAnimationRotation and DrainableSolution to cooking_furnace for improved functionality. * Remove unused usings and redundant comments in cooking components Cleaned up CP14 cooking-related components by removing unused using directives and empty XML comments. This improves code readability and maintainability. * Add tag-based cooking requirements and new meal recipes Introduces tag-based cooking requirement classes (TagRequired, TagBlocked, SolutionRequired) and updates the cooking system to support tag checks. Adds new tags for food items, updates food and meal prototypes to include relevant tags, and implements new meal recipes (Zellasian Breakfast, Monster Egg) with corresponding sprites and localization. Also refactors and renames some tag and structure prototype files for better organization. * Refactor and expand CP14 cooking recipes and tags Reworked meal recipes to use tag-based requirements, added new tags for food categorization (meat, cheese, vegetables, etc.), and removed hardcoded entity recipes for ham in cheese and stuffed potato. Updated and added new meal recipes (bread plate, ham in cheese, stuffed potato), localized their names and descriptions, and migrated/added corresponding sprites. Deprecated SolutionRequired requirement, cleaned up unused tags, and improved TagRequired/TagBlocked logic. Updated prototype files to use new tags and added missing tags to food entities. * Refactor and expand green salad recipes and assets Replaces the old green salad entity and workbench recipe with new cooking recipes for green salad and green salad with meat. Updates English and Russian localization, moves and adds new salad textures, and removes obsolete salad assets and trading request. * mashed potatoes * Add mashed potatoes with herbs meal Introduced a new 'mashed potatoes with herbs' meal, including English and Russian localization, recipe definition, and associated sprite. Updated the texture metadata and added the new image asset. * Update dye.yml * Fix frying pan item size and update plate recipe Moved the 'size: Ginormous' property to the correct component in frying_pen.yml. Renamed the plate recipe and result from 'CP14Plate' to 'CP14PlateWooden' in misc.yml for clarity. * Update meals.yml * Update migration.yml * fixes * fix heating food sounds * Nyranu temperature transmission * Update plate.yml * Cooking DoAfter works * burning logic * cooking more work * auto transform transformable * Update CP14SharedCookingSystem.DoAfter.cs * cool burning visuals! * Add MIT license headers to cooking system files Added sublicensing notice and MIT license header to all files in the CP14 cooking system. Also made minor code cleanups, such as removing unnecessary default initializations and improving XML documentation for clarity. * constant heating required * cooking visuals improve! * sandwiches with processed cheese + reagent burnt fuckuping * inhand pan sprites + FIRE fuckup * crafting & buying pan * fix predicting * random food spawner + chef closet * mapping update * Update frying_pen.yml * move WIP to blacksmith lol
2025-07-16 08:15:08 +03:00
{
var layerIndex = index + counter;
Cooking Simulator (#1529) * frying pan start * fix data saving * Refactor cooking system and add localization support Refactored food data handling in the cooking system to use Visuals instead of FoodData on holders, improved food transfer logic, and added popups and examine messages for user feedback. Added English and Russian localization files for cooking examine and meal descriptions, and updated prototype files to increase plate solution volume and add a whitelist for the cooking furnace. * Refactor cooking system solution handling Removed Solution field from CP14FoodData and updated CP14SharedCookingSystem to use solution containers directly. Improved solution transfer, mixing, and overflow handling during cooking. Increased pan max volume from 30 to 100 in cooking_furnace.yml. * Improve cooking system trash handling and update food sprites Enhanced trash distribution in CP14SharedCookingSystem to randomly assign trash to plates, only adding all trash to the last plate. Updated meat_dish and salad prototypes to use new wooden plate sprites. Added wideAnimationRotation and DrainableSolution to cooking_furnace for improved functionality. * Remove unused usings and redundant comments in cooking components Cleaned up CP14 cooking-related components by removing unused using directives and empty XML comments. This improves code readability and maintainability. * Add tag-based cooking requirements and new meal recipes Introduces tag-based cooking requirement classes (TagRequired, TagBlocked, SolutionRequired) and updates the cooking system to support tag checks. Adds new tags for food items, updates food and meal prototypes to include relevant tags, and implements new meal recipes (Zellasian Breakfast, Monster Egg) with corresponding sprites and localization. Also refactors and renames some tag and structure prototype files for better organization. * Refactor and expand CP14 cooking recipes and tags Reworked meal recipes to use tag-based requirements, added new tags for food categorization (meat, cheese, vegetables, etc.), and removed hardcoded entity recipes for ham in cheese and stuffed potato. Updated and added new meal recipes (bread plate, ham in cheese, stuffed potato), localized their names and descriptions, and migrated/added corresponding sprites. Deprecated SolutionRequired requirement, cleaned up unused tags, and improved TagRequired/TagBlocked logic. Updated prototype files to use new tags and added missing tags to food entities. * Refactor and expand green salad recipes and assets Replaces the old green salad entity and workbench recipe with new cooking recipes for green salad and green salad with meat. Updates English and Russian localization, moves and adds new salad textures, and removes obsolete salad assets and trading request. * mashed potatoes * Add mashed potatoes with herbs meal Introduced a new 'mashed potatoes with herbs' meal, including English and Russian localization, recipe definition, and associated sprite. Updated the texture metadata and added the new image asset. * Update dye.yml * Fix frying pan item size and update plate recipe Moved the 'size: Ginormous' property to the correct component in frying_pen.yml. Renamed the plate recipe and result from 'CP14Plate' to 'CP14PlateWooden' in misc.yml for clarity. * Update meals.yml * Update migration.yml * fixes * fix heating food sounds * Nyranu temperature transmission * Update plate.yml * Cooking DoAfter works * burning logic * cooking more work * auto transform transformable * Update CP14SharedCookingSystem.DoAfter.cs * cool burning visuals! * Add MIT license headers to cooking system files Added sublicensing notice and MIT license header to all files in the CP14 cooking system. Also made minor code cleanups, such as removing unnecessary default initializations and improving XML documentation for clarity. * constant heating required * cooking visuals improve! * sandwiches with processed cheese + reagent burnt fuckuping * inhand pan sprites + FIRE fuckup * crafting & buying pan * fix predicting * random food spawner + chef closet * mapping update * Update frying_pen.yml * move WIP to blacksmith lol
2025-07-16 08:15:08 +03:00
var keyCode = $"cp14-food-layer-{counter}";
revealedLayers.Add(keyCode);
Cooking Simulator (#1529) * frying pan start * fix data saving * Refactor cooking system and add localization support Refactored food data handling in the cooking system to use Visuals instead of FoodData on holders, improved food transfer logic, and added popups and examine messages for user feedback. Added English and Russian localization files for cooking examine and meal descriptions, and updated prototype files to increase plate solution volume and add a whitelist for the cooking furnace. * Refactor cooking system solution handling Removed Solution field from CP14FoodData and updated CP14SharedCookingSystem to use solution containers directly. Improved solution transfer, mixing, and overflow handling during cooking. Increased pan max volume from 30 to 100 in cooking_furnace.yml. * Improve cooking system trash handling and update food sprites Enhanced trash distribution in CP14SharedCookingSystem to randomly assign trash to plates, only adding all trash to the last plate. Updated meat_dish and salad prototypes to use new wooden plate sprites. Added wideAnimationRotation and DrainableSolution to cooking_furnace for improved functionality. * Remove unused usings and redundant comments in cooking components Cleaned up CP14 cooking-related components by removing unused using directives and empty XML comments. This improves code readability and maintainability. * Add tag-based cooking requirements and new meal recipes Introduces tag-based cooking requirement classes (TagRequired, TagBlocked, SolutionRequired) and updates the cooking system to support tag checks. Adds new tags for food items, updates food and meal prototypes to include relevant tags, and implements new meal recipes (Zellasian Breakfast, Monster Egg) with corresponding sprites and localization. Also refactors and renames some tag and structure prototype files for better organization. * Refactor and expand CP14 cooking recipes and tags Reworked meal recipes to use tag-based requirements, added new tags for food categorization (meat, cheese, vegetables, etc.), and removed hardcoded entity recipes for ham in cheese and stuffed potato. Updated and added new meal recipes (bread plate, ham in cheese, stuffed potato), localized their names and descriptions, and migrated/added corresponding sprites. Deprecated SolutionRequired requirement, cleaned up unused tags, and improved TagRequired/TagBlocked logic. Updated prototype files to use new tags and added missing tags to food entities. * Refactor and expand green salad recipes and assets Replaces the old green salad entity and workbench recipe with new cooking recipes for green salad and green salad with meat. Updates English and Russian localization, moves and adds new salad textures, and removes obsolete salad assets and trading request. * mashed potatoes * Add mashed potatoes with herbs meal Introduced a new 'mashed potatoes with herbs' meal, including English and Russian localization, recipe definition, and associated sprite. Updated the texture metadata and added the new image asset. * Update dye.yml * Fix frying pan item size and update plate recipe Moved the 'size: Ginormous' property to the correct component in frying_pen.yml. Renamed the plate recipe and result from 'CP14Plate' to 'CP14PlateWooden' in misc.yml for clarity. * Update meals.yml * Update migration.yml * fixes * fix heating food sounds * Nyranu temperature transmission * Update plate.yml * Cooking DoAfter works * burning logic * cooking more work * auto transform transformable * Update CP14SharedCookingSystem.DoAfter.cs * cool burning visuals! * Add MIT license headers to cooking system files Added sublicensing notice and MIT license header to all files in the CP14 cooking system. Also made minor code cleanups, such as removing unnecessary default initializations and improving XML documentation for clarity. * constant heating required * cooking visuals improve! * sandwiches with processed cheese + reagent burnt fuckuping * inhand pan sprites + FIRE fuckup * crafting & buying pan * fix predicting * random food spawner + chef closet * mapping update * Update frying_pen.yml * move WIP to blacksmith lol
2025-07-16 08:15:08 +03:00
_sprite.AddBlankLayer((ent, sprite), layerIndex);
_sprite.LayerMapSet((ent, sprite), keyCode, layerIndex);
_sprite.LayerSetData((ent, sprite), layerIndex, layer);
Cooking Simulator (#1529) * frying pan start * fix data saving * Refactor cooking system and add localization support Refactored food data handling in the cooking system to use Visuals instead of FoodData on holders, improved food transfer logic, and added popups and examine messages for user feedback. Added English and Russian localization files for cooking examine and meal descriptions, and updated prototype files to increase plate solution volume and add a whitelist for the cooking furnace. * Refactor cooking system solution handling Removed Solution field from CP14FoodData and updated CP14SharedCookingSystem to use solution containers directly. Improved solution transfer, mixing, and overflow handling during cooking. Increased pan max volume from 30 to 100 in cooking_furnace.yml. * Improve cooking system trash handling and update food sprites Enhanced trash distribution in CP14SharedCookingSystem to randomly assign trash to plates, only adding all trash to the last plate. Updated meat_dish and salad prototypes to use new wooden plate sprites. Added wideAnimationRotation and DrainableSolution to cooking_furnace for improved functionality. * Remove unused usings and redundant comments in cooking components Cleaned up CP14 cooking-related components by removing unused using directives and empty XML comments. This improves code readability and maintainability. * Add tag-based cooking requirements and new meal recipes Introduces tag-based cooking requirement classes (TagRequired, TagBlocked, SolutionRequired) and updates the cooking system to support tag checks. Adds new tags for food items, updates food and meal prototypes to include relevant tags, and implements new meal recipes (Zellasian Breakfast, Monster Egg) with corresponding sprites and localization. Also refactors and renames some tag and structure prototype files for better organization. * Refactor and expand CP14 cooking recipes and tags Reworked meal recipes to use tag-based requirements, added new tags for food categorization (meat, cheese, vegetables, etc.), and removed hardcoded entity recipes for ham in cheese and stuffed potato. Updated and added new meal recipes (bread plate, ham in cheese, stuffed potato), localized their names and descriptions, and migrated/added corresponding sprites. Deprecated SolutionRequired requirement, cleaned up unused tags, and improved TagRequired/TagBlocked logic. Updated prototype files to use new tags and added missing tags to food entities. * Refactor and expand green salad recipes and assets Replaces the old green salad entity and workbench recipe with new cooking recipes for green salad and green salad with meat. Updates English and Russian localization, moves and adds new salad textures, and removes obsolete salad assets and trading request. * mashed potatoes * Add mashed potatoes with herbs meal Introduced a new 'mashed potatoes with herbs' meal, including English and Russian localization, recipe definition, and associated sprite. Updated the texture metadata and added the new image asset. * Update dye.yml * Fix frying pan item size and update plate recipe Moved the 'size: Ginormous' property to the correct component in frying_pen.yml. Renamed the plate recipe and result from 'CP14Plate' to 'CP14PlateWooden' in misc.yml for clarity. * Update meals.yml * Update migration.yml * fixes * fix heating food sounds * Nyranu temperature transmission * Update plate.yml * Cooking DoAfter works * burning logic * cooking more work * auto transform transformable * Update CP14SharedCookingSystem.DoAfter.cs * cool burning visuals! * Add MIT license headers to cooking system files Added sublicensing notice and MIT license header to all files in the CP14 cooking system. Also made minor code cleanups, such as removing unnecessary default initializations and improving XML documentation for clarity. * constant heating required * cooking visuals improve! * sandwiches with processed cheese + reagent burnt fuckuping * inhand pan sprites + FIRE fuckup * crafting & buying pan * fix predicting * random food spawner + chef closet * mapping update * Update frying_pen.yml * move WIP to blacksmith lol
2025-07-16 08:15:08 +03:00
if (displacementRsiPath is not null)
{
var displaceData = new DisplacementData
{
SizeMaps = new Dictionary<int, PrototypeLayerData>
{
{
32, new PrototypeLayerData
{
RsiPath = displacementRsiPath,
State = "fill-" + closestFillSprite,
}
},
}
};
if (_displacement.TryAddDisplacement(displaceData,
(ent, sprite),
layerIndex,
keyCode,
out var displacementKey))
{
revealedLayers.Add(displacementKey);
}
}
Cooking Simulator (#1529) * frying pan start * fix data saving * Refactor cooking system and add localization support Refactored food data handling in the cooking system to use Visuals instead of FoodData on holders, improved food transfer logic, and added popups and examine messages for user feedback. Added English and Russian localization files for cooking examine and meal descriptions, and updated prototype files to increase plate solution volume and add a whitelist for the cooking furnace. * Refactor cooking system solution handling Removed Solution field from CP14FoodData and updated CP14SharedCookingSystem to use solution containers directly. Improved solution transfer, mixing, and overflow handling during cooking. Increased pan max volume from 30 to 100 in cooking_furnace.yml. * Improve cooking system trash handling and update food sprites Enhanced trash distribution in CP14SharedCookingSystem to randomly assign trash to plates, only adding all trash to the last plate. Updated meat_dish and salad prototypes to use new wooden plate sprites. Added wideAnimationRotation and DrainableSolution to cooking_furnace for improved functionality. * Remove unused usings and redundant comments in cooking components Cleaned up CP14 cooking-related components by removing unused using directives and empty XML comments. This improves code readability and maintainability. * Add tag-based cooking requirements and new meal recipes Introduces tag-based cooking requirement classes (TagRequired, TagBlocked, SolutionRequired) and updates the cooking system to support tag checks. Adds new tags for food items, updates food and meal prototypes to include relevant tags, and implements new meal recipes (Zellasian Breakfast, Monster Egg) with corresponding sprites and localization. Also refactors and renames some tag and structure prototype files for better organization. * Refactor and expand CP14 cooking recipes and tags Reworked meal recipes to use tag-based requirements, added new tags for food categorization (meat, cheese, vegetables, etc.), and removed hardcoded entity recipes for ham in cheese and stuffed potato. Updated and added new meal recipes (bread plate, ham in cheese, stuffed potato), localized their names and descriptions, and migrated/added corresponding sprites. Deprecated SolutionRequired requirement, cleaned up unused tags, and improved TagRequired/TagBlocked logic. Updated prototype files to use new tags and added missing tags to food entities. * Refactor and expand green salad recipes and assets Replaces the old green salad entity and workbench recipe with new cooking recipes for green salad and green salad with meat. Updates English and Russian localization, moves and adds new salad textures, and removes obsolete salad assets and trading request. * mashed potatoes * Add mashed potatoes with herbs meal Introduced a new 'mashed potatoes with herbs' meal, including English and Russian localization, recipe definition, and associated sprite. Updated the texture metadata and added the new image asset. * Update dye.yml * Fix frying pan item size and update plate recipe Moved the 'size: Ginormous' property to the correct component in frying_pen.yml. Renamed the plate recipe and result from 'CP14Plate' to 'CP14PlateWooden' in misc.yml for clarity. * Update meals.yml * Update migration.yml * fixes * fix heating food sounds * Nyranu temperature transmission * Update plate.yml * Cooking DoAfter works * burning logic * cooking more work * auto transform transformable * Update CP14SharedCookingSystem.DoAfter.cs * cool burning visuals! * Add MIT license headers to cooking system files Added sublicensing notice and MIT license header to all files in the CP14 cooking system. Also made minor code cleanups, such as removing unnecessary default initializations and improving XML documentation for clarity. * constant heating required * cooking visuals improve! * sandwiches with processed cheese + reagent burnt fuckuping * inhand pan sprites + FIRE fuckup * crafting & buying pan * fix predicting * random food spawner + chef closet * mapping update * Update frying_pen.yml * move WIP to blacksmith lol
2025-07-16 08:15:08 +03:00
counter++;
}
}
}