2024-05-12 09:18:21 +10:00
|
|
|
using System.IO;
|
2021-02-17 10:46:44 +01:00
|
|
|
using System.Linq;
|
2023-07-08 14:08:32 +10:00
|
|
|
using System.Numerics;
|
Humanoid appearance refactor (#10882)
* initial commit
- species prototype modifications
- markings points as its own file
- shared humanoid component
* adds a tool to convert sprite accessories to markings (in go)
* removes a fmt call
* converts sprite accessory to markings
* adds hair and facial hair to marking categories
* multiple changes
- humanoid visualizer system
- markings modifications for visualizer
- modifications to shared humanoid component
- lays out a base for humanoid system
* hidden layers, ports some properties from appearance component, shrinks DefaultMarkings a little
* squishes the initialize event calls into one function
adds stuff to set species/skin color externally from a server message - currently laid out as if it a dirty call to a networked component, may be subject to change (server-side has not been implemented yet)
* makes the sprite pipeline more obvious
* apply all markings, hidden layer set replacement
* ensures that markings are cleared when the new set is applied
* starts refactoring markingsset (unfinished)
* more additions to the markingset api
* adds constructor logic to markingset
* adds a method to filter out markings in a set based on a given species
* fixes enumerators in markingset
* adds validator into MarkingSet, fixes ForwardMarkingEnumerator
* modifications to the humanoid visual system
* ensuredefault in markingset
* oop
* fixes up data keys, populates OnAppearanceChange in visualizer
* changes to humanoid component, markings
marking equality is now more strict, humanoidcomponent is now implemented for client as a child of sharedhumanoidcomponent
* markings are now applied the visualizer by diffing them
* base sprites are now applied to humanoids from humanoidvisualizer
* passes along base sprite settings to the marking application so that markings know to follow skin color/alpha or not (see: slimes)
* custom base layers on humanoids
* merges all data keys into one data class for humanoid visualizers
* setappearance in sharedhumanoidsystem, removes custombaselayercolors
* humanoidcomponent, system (empty) in server
* adds some basic public API functions to HumanoidSystem
* add marking, remove marking
* changes appearance MarkingsSet to a List<Marking>, adds listener for PlayerSpawnCompleteEvent in HumanoidSystem
* ensuredefaultmarkings, oninit for humanoids
* markingmanager API changes
* removes MarkingsSet
* LoadProfile, adjusts randomization in humanoid appearance to account for species
* base layer settings in humanoidsystem, eye color from profile
* rearranges files to centralize under Humanoid namespace
* more reorganization, deletes some stuff
gotta break stuff to make other things work, right?
goodbye SpriteAccessory...
* fixes a good chunk of server-side issues
still does not compile, yet
* singlemarkingpicker xaml layout
* singlemarkingpicker logic
* magic mirror window (varying pieces of it, mostly client-oriented)
* removes some imports, gives MagicMirror a BUI class (not filled in yet)
* populates magic mirror BUI functionality / window callbacks
* fixes up some errors in humanoidprofileeditor
* changes to SingleMarkingPicker
SingleMarkingPicker now accepts a List<Marking>, species, and total possible markings available in that marking category
* fixes up hair pickers on humanoid profile editor
* fixes the errors in markingpicker
* markingsystem is now gone
* fixes a bunch of build errors
* so that's why i did it like that
* namespace issues, adds robustxamlloader to singlemarkingpicker
* another robustxamlloader
* human, lizard sprites/points
* prototype fixes, deletion of old spriteaccessory
* component registration, fixes dwarf skin toning
no, 'ReptilianToned' does not exist
* removes component registration from abstract humanoid component
* visualizer data now cloneable
* serialize for visualizer key
* zero-count edge case
* missing semi-colon moment
* setspecies in humanoidsystem
* ensures that default markings, if empty, will cause ensuredefault to skip over that given category
* tryadd instead of add
* whoops
* diff and apply should properly apply markings now
* always ensure default, fixes double load for player spawning
* apply skin color now sets the skin color property in humanoidcomponent
* removes sprite from a few species prototypes
* sprite changes for specific base layers based on humanoid sex
* layer ordering fix, and a missing base layer should now disallow markings on that layer
* anymarking base layer, adds the right leg/foot for humans
* loading a profile will now clear all markings on that humanoid
* adds missing layers for humans
* separates species.yml into respective species prototype files
* ensures that if layer visibility was changed, all markings have to be reapplied
* server-side enforcement of hiding hair (and other head-related markings) when equipping things that hide hair
* slime fix, clothingsystem now dictates layer visibility server side
* sussy
* layer settings should now ensure a marking should match the skin tone
* whoops
* skincolor static class and functions in UI
* skin color validation in humanoidcharacterappearance
* markingpicker now shows only the markings for the selected category in used
* getter for slot in singlemarkingpicker now ensures slot is 0 if markings exists
* FilterSpecies no longer attempts to do removal while iterating
* expands for SingleMarkingPicker
* humanoid base dummy has blank layers now (and snout/tail/headside/headtop)
* fixes an issue with visualizer system if the marking count was different but the markings themselves were (somewhat) the same
* whoops
* adds edge case handlers for count differences in humanoid markings
* preview now loads profile instead of directly setting appearance
* moves marking set loading to update controls
* clones a marking set in markingpicker by using the deep clone constructor
* whoops (deep cloning a marking now copies the marking id)
* adds replace function for markingset
* points should now update after the markings are remove/added
* merging base layer sprites into a humanoid should now clear them before merging
* sets dirty range start to count only if the dirty range start was never set above 0
* fixes up some issues with singlemarkingpicker
* color selector sliders in single marking picker should now expand
* hair from hair pickers should now apply in profile loading (client-side)
* category in singlemarkingpicker now sets the private category variable
* slot selector should now populate
* single marking picker buttons now have text, also shows the category name over all user-clickable elements
* removes a comment
* removing hair slots now sets it to bald, defaults to zero used slots if current hair is bald on hair/facial hair
* random skin color, eye color
* populate colors now checks if the marking count is greater than zero in singlemarkingpicker
* hair/facial hair pickers now just get the first possible hair from the respective species list
* different approach to random skin color
* oh, that's why it wasn't working
* randomize everything now just updates every single control
* selecting a new marking in SingleMarkingPicker should attempt to copy over old colors, populate list now uses cache,
* markingmanager now uses OnlyWhitelisted to populate by category and species
* filterspecies now uses onlyWhitelist to filter markings based on whitelist or not
* oops
* ui fix for singlemarkingpicker, ensures that cache is not null if it is null when populatelist is called
* order of operations for the horizontal expand for add/remove
* hair pickers should now update when you add/remove the hair slot
* fixes variable naming error in character appearance
* loc string fix in singlemarkingpicker
* lizards, vox now have onlyWhitelist, vox restriction for hair/facialhairs
* having zero possible hairs should no longer cause an exception in randomization
* setting species should now update hair pickers
* ignore categories for marking picker
* and a clear as well for the category button
* places that functionality in its own function instead
* adds eye base sprite, vox now also have their own custom eye sprites
* loading a profile client-side should do FilterSpecies for markings now
* client-side load profile does filter species after adding in the hairs now
* magic mirror
* callbacks now call the callback instead of adding it on construct
* whoops
* in removemarking too
* adds missing synchronize calls
* comments out an updateinterface call in magic mirror
* magic mirror window title, minimum sizing
* fixes minsize, adds warning for players who try to set their hair for species that have no hair
* removes spaces in xaml
* namespace changes/organization
* whoopsie (merge conflicts)
* re-enables identity from humanoid component
* damagevisuals now uses the enum given to it instead of the layerstate given on that layer tied to the enum
* removes commas from json
* changes to visuals system so the change is consistent
* chest
* reptilian
* visualizer system now handles body sprite setting/coloration, similar to how characterappearance did it
not a big fan of this
* adds a check in applybasesprites
* adding/removing parts should now make them invisible on a humanoid
* body part removal/adding now enumerates over sublayers instead
* synchro now runs in bodycomponent startup
* parts instead of slots
* humanoidcompnent check
* switches from rsi to actualrsi
* removes all the body stuff (too slow)
* cleans up resolves from humanoid visualizer system
* merging sprites now checks if the base sprites have been modified or not (through things like species changes, or custom base sprite changes)
* not forgetting that one again
* merging now returns an actual dirty value
* replaces the sequenceequal with a more accurate solution
* permanent layers, layer visibility on add/remove part in body
* should send all hidden layers over now
* isdirty in visualizer system for base layers
* isdirty checks count as well
* ok, IsDirty should now set the base layers if the merged sprites are different
* equals override in HumanoidSpritePrototypes.cs
temporary until record prototypes :heck:
* makes fields readonly, equates IDs instead
* adds forced markings through marking picker
* forced in humanoidsystem api, ignorespecies in markingpicker
* marking bui
* makes that serializable as well
* ignore species/forced toggles now work
* adds icon to modifier verb, interface and keys to humanoid bases
* needs the actual enum value to open, no?
* makes the key the actual key
* actions now propagate upwards
* ignore species when set now repopulates markingpicker
* modifiable base layers in the markings window
* oops!
* layout changes
* info box should now appear
* adds ignorespecies for marking picker, collapsible for base layer section of appearance modification window
* collapsible layout moment
* if base layers have changed, all markings are now dirty (and if a base layer is missing, the marking is still 'applied' but it's now just invisible
* small change to marking visibility
* small changes to modifier UI
* markings now match skin on zombification
* zombie stuff
* makes the line edit in marking modifier window more obvious
* disables vox on round start
* horizontal expand on the single label in base layer modifiers
* humanoid profiles in prototypes
* randomhumanoidappearance won't work if the humanoid has a profile already stored
* removes unused code
* documentation in humanoidsystem server-side
* documentation in shared/client
* whoops
* converts accessory into marking in locale files (also adds marking loc string into single marking picker)
* be gone, shared humanoid appearance system from the last upstream merge
* species ignore on randomization (defaults to no ignored species)
* more upstream merge parts that bypassed any errors before merge
* addresses review (also just adds typeserializers in some places)
* submodule moment
* upstream merge issues
2022-09-22 15:19:00 -07:00
|
|
|
using Content.Client.Humanoid;
|
2024-05-12 09:18:21 +10:00
|
|
|
using Content.Client.Lobby.UI.Loadouts;
|
|
|
|
|
using Content.Client.Lobby.UI.Roles;
|
2021-10-03 23:48:29 +02:00
|
|
|
using Content.Client.Message;
|
2022-08-07 08:00:42 +02:00
|
|
|
using Content.Client.Players.PlayTimeTracking;
|
2024-08-01 01:14:19 +10:00
|
|
|
using Content.Client.Sprite;
|
2024-06-03 21:47:06 +03:00
|
|
|
using Content.Client.Stylesheets;
|
2024-03-11 04:01:32 +01:00
|
|
|
using Content.Client.UserInterface.Systems.Guidebook;
|
2022-05-14 08:58:45 +10:00
|
|
|
using Content.Shared.CCVar;
|
2024-04-16 22:57:43 +10:00
|
|
|
using Content.Shared.Clothing;
|
2020-10-14 22:45:53 +02:00
|
|
|
using Content.Shared.GameTicking;
|
2024-06-07 00:05:58 +12:00
|
|
|
using Content.Shared.Guidebook;
|
Humanoid appearance refactor (#10882)
* initial commit
- species prototype modifications
- markings points as its own file
- shared humanoid component
* adds a tool to convert sprite accessories to markings (in go)
* removes a fmt call
* converts sprite accessory to markings
* adds hair and facial hair to marking categories
* multiple changes
- humanoid visualizer system
- markings modifications for visualizer
- modifications to shared humanoid component
- lays out a base for humanoid system
* hidden layers, ports some properties from appearance component, shrinks DefaultMarkings a little
* squishes the initialize event calls into one function
adds stuff to set species/skin color externally from a server message - currently laid out as if it a dirty call to a networked component, may be subject to change (server-side has not been implemented yet)
* makes the sprite pipeline more obvious
* apply all markings, hidden layer set replacement
* ensures that markings are cleared when the new set is applied
* starts refactoring markingsset (unfinished)
* more additions to the markingset api
* adds constructor logic to markingset
* adds a method to filter out markings in a set based on a given species
* fixes enumerators in markingset
* adds validator into MarkingSet, fixes ForwardMarkingEnumerator
* modifications to the humanoid visual system
* ensuredefault in markingset
* oop
* fixes up data keys, populates OnAppearanceChange in visualizer
* changes to humanoid component, markings
marking equality is now more strict, humanoidcomponent is now implemented for client as a child of sharedhumanoidcomponent
* markings are now applied the visualizer by diffing them
* base sprites are now applied to humanoids from humanoidvisualizer
* passes along base sprite settings to the marking application so that markings know to follow skin color/alpha or not (see: slimes)
* custom base layers on humanoids
* merges all data keys into one data class for humanoid visualizers
* setappearance in sharedhumanoidsystem, removes custombaselayercolors
* humanoidcomponent, system (empty) in server
* adds some basic public API functions to HumanoidSystem
* add marking, remove marking
* changes appearance MarkingsSet to a List<Marking>, adds listener for PlayerSpawnCompleteEvent in HumanoidSystem
* ensuredefaultmarkings, oninit for humanoids
* markingmanager API changes
* removes MarkingsSet
* LoadProfile, adjusts randomization in humanoid appearance to account for species
* base layer settings in humanoidsystem, eye color from profile
* rearranges files to centralize under Humanoid namespace
* more reorganization, deletes some stuff
gotta break stuff to make other things work, right?
goodbye SpriteAccessory...
* fixes a good chunk of server-side issues
still does not compile, yet
* singlemarkingpicker xaml layout
* singlemarkingpicker logic
* magic mirror window (varying pieces of it, mostly client-oriented)
* removes some imports, gives MagicMirror a BUI class (not filled in yet)
* populates magic mirror BUI functionality / window callbacks
* fixes up some errors in humanoidprofileeditor
* changes to SingleMarkingPicker
SingleMarkingPicker now accepts a List<Marking>, species, and total possible markings available in that marking category
* fixes up hair pickers on humanoid profile editor
* fixes the errors in markingpicker
* markingsystem is now gone
* fixes a bunch of build errors
* so that's why i did it like that
* namespace issues, adds robustxamlloader to singlemarkingpicker
* another robustxamlloader
* human, lizard sprites/points
* prototype fixes, deletion of old spriteaccessory
* component registration, fixes dwarf skin toning
no, 'ReptilianToned' does not exist
* removes component registration from abstract humanoid component
* visualizer data now cloneable
* serialize for visualizer key
* zero-count edge case
* missing semi-colon moment
* setspecies in humanoidsystem
* ensures that default markings, if empty, will cause ensuredefault to skip over that given category
* tryadd instead of add
* whoops
* diff and apply should properly apply markings now
* always ensure default, fixes double load for player spawning
* apply skin color now sets the skin color property in humanoidcomponent
* removes sprite from a few species prototypes
* sprite changes for specific base layers based on humanoid sex
* layer ordering fix, and a missing base layer should now disallow markings on that layer
* anymarking base layer, adds the right leg/foot for humans
* loading a profile will now clear all markings on that humanoid
* adds missing layers for humans
* separates species.yml into respective species prototype files
* ensures that if layer visibility was changed, all markings have to be reapplied
* server-side enforcement of hiding hair (and other head-related markings) when equipping things that hide hair
* slime fix, clothingsystem now dictates layer visibility server side
* sussy
* layer settings should now ensure a marking should match the skin tone
* whoops
* skincolor static class and functions in UI
* skin color validation in humanoidcharacterappearance
* markingpicker now shows only the markings for the selected category in used
* getter for slot in singlemarkingpicker now ensures slot is 0 if markings exists
* FilterSpecies no longer attempts to do removal while iterating
* expands for SingleMarkingPicker
* humanoid base dummy has blank layers now (and snout/tail/headside/headtop)
* fixes an issue with visualizer system if the marking count was different but the markings themselves were (somewhat) the same
* whoops
* adds edge case handlers for count differences in humanoid markings
* preview now loads profile instead of directly setting appearance
* moves marking set loading to update controls
* clones a marking set in markingpicker by using the deep clone constructor
* whoops (deep cloning a marking now copies the marking id)
* adds replace function for markingset
* points should now update after the markings are remove/added
* merging base layer sprites into a humanoid should now clear them before merging
* sets dirty range start to count only if the dirty range start was never set above 0
* fixes up some issues with singlemarkingpicker
* color selector sliders in single marking picker should now expand
* hair from hair pickers should now apply in profile loading (client-side)
* category in singlemarkingpicker now sets the private category variable
* slot selector should now populate
* single marking picker buttons now have text, also shows the category name over all user-clickable elements
* removes a comment
* removing hair slots now sets it to bald, defaults to zero used slots if current hair is bald on hair/facial hair
* random skin color, eye color
* populate colors now checks if the marking count is greater than zero in singlemarkingpicker
* hair/facial hair pickers now just get the first possible hair from the respective species list
* different approach to random skin color
* oh, that's why it wasn't working
* randomize everything now just updates every single control
* selecting a new marking in SingleMarkingPicker should attempt to copy over old colors, populate list now uses cache,
* markingmanager now uses OnlyWhitelisted to populate by category and species
* filterspecies now uses onlyWhitelist to filter markings based on whitelist or not
* oops
* ui fix for singlemarkingpicker, ensures that cache is not null if it is null when populatelist is called
* order of operations for the horizontal expand for add/remove
* hair pickers should now update when you add/remove the hair slot
* fixes variable naming error in character appearance
* loc string fix in singlemarkingpicker
* lizards, vox now have onlyWhitelist, vox restriction for hair/facialhairs
* having zero possible hairs should no longer cause an exception in randomization
* setting species should now update hair pickers
* ignore categories for marking picker
* and a clear as well for the category button
* places that functionality in its own function instead
* adds eye base sprite, vox now also have their own custom eye sprites
* loading a profile client-side should do FilterSpecies for markings now
* client-side load profile does filter species after adding in the hairs now
* magic mirror
* callbacks now call the callback instead of adding it on construct
* whoops
* in removemarking too
* adds missing synchronize calls
* comments out an updateinterface call in magic mirror
* magic mirror window title, minimum sizing
* fixes minsize, adds warning for players who try to set their hair for species that have no hair
* removes spaces in xaml
* namespace changes/organization
* whoopsie (merge conflicts)
* re-enables identity from humanoid component
* damagevisuals now uses the enum given to it instead of the layerstate given on that layer tied to the enum
* removes commas from json
* changes to visuals system so the change is consistent
* chest
* reptilian
* visualizer system now handles body sprite setting/coloration, similar to how characterappearance did it
not a big fan of this
* adds a check in applybasesprites
* adding/removing parts should now make them invisible on a humanoid
* body part removal/adding now enumerates over sublayers instead
* synchro now runs in bodycomponent startup
* parts instead of slots
* humanoidcompnent check
* switches from rsi to actualrsi
* removes all the body stuff (too slow)
* cleans up resolves from humanoid visualizer system
* merging sprites now checks if the base sprites have been modified or not (through things like species changes, or custom base sprite changes)
* not forgetting that one again
* merging now returns an actual dirty value
* replaces the sequenceequal with a more accurate solution
* permanent layers, layer visibility on add/remove part in body
* should send all hidden layers over now
* isdirty in visualizer system for base layers
* isdirty checks count as well
* ok, IsDirty should now set the base layers if the merged sprites are different
* equals override in HumanoidSpritePrototypes.cs
temporary until record prototypes :heck:
* makes fields readonly, equates IDs instead
* adds forced markings through marking picker
* forced in humanoidsystem api, ignorespecies in markingpicker
* marking bui
* makes that serializable as well
* ignore species/forced toggles now work
* adds icon to modifier verb, interface and keys to humanoid bases
* needs the actual enum value to open, no?
* makes the key the actual key
* actions now propagate upwards
* ignore species when set now repopulates markingpicker
* modifiable base layers in the markings window
* oops!
* layout changes
* info box should now appear
* adds ignorespecies for marking picker, collapsible for base layer section of appearance modification window
* collapsible layout moment
* if base layers have changed, all markings are now dirty (and if a base layer is missing, the marking is still 'applied' but it's now just invisible
* small change to marking visibility
* small changes to modifier UI
* markings now match skin on zombification
* zombie stuff
* makes the line edit in marking modifier window more obvious
* disables vox on round start
* horizontal expand on the single label in base layer modifiers
* humanoid profiles in prototypes
* randomhumanoidappearance won't work if the humanoid has a profile already stored
* removes unused code
* documentation in humanoidsystem server-side
* documentation in shared/client
* whoops
* converts accessory into marking in locale files (also adds marking loc string into single marking picker)
* be gone, shared humanoid appearance system from the last upstream merge
* species ignore on randomization (defaults to no ignored species)
* more upstream merge parts that bypassed any errors before merge
* addresses review (also just adds typeserializers in some places)
* submodule moment
* upstream merge issues
2022-09-22 15:19:00 -07:00
|
|
|
using Content.Shared.Humanoid;
|
|
|
|
|
using Content.Shared.Humanoid.Markings;
|
|
|
|
|
using Content.Shared.Humanoid.Prototypes;
|
2020-01-18 01:54:13 +01:00
|
|
|
using Content.Shared.Preferences;
|
2024-04-16 22:57:43 +10:00
|
|
|
using Content.Shared.Preferences.Loadouts;
|
2020-08-13 14:40:27 +02:00
|
|
|
using Content.Shared.Roles;
|
2022-09-10 17:40:06 +02:00
|
|
|
using Content.Shared.Traits;
|
2021-10-16 06:40:25 -07:00
|
|
|
using Robust.Client.AutoGenerated;
|
2025-04-10 10:47:05 +00:00
|
|
|
using Robust.Client.GameObjects;
|
2021-02-17 10:46:44 +01:00
|
|
|
using Robust.Client.Graphics;
|
2024-05-12 09:18:21 +10:00
|
|
|
using Robust.Client.Player;
|
2020-01-18 01:54:13 +01:00
|
|
|
using Robust.Client.UserInterface;
|
|
|
|
|
using Robust.Client.UserInterface.Controls;
|
2021-10-16 06:40:25 -07:00
|
|
|
using Robust.Client.UserInterface.XAML;
|
2020-01-24 16:31:18 +01:00
|
|
|
using Robust.Client.Utility;
|
2022-05-14 08:58:45 +10:00
|
|
|
using Robust.Shared.Configuration;
|
2024-08-01 01:14:19 +10:00
|
|
|
using Robust.Shared.ContentPack;
|
2021-03-10 14:48:29 +01:00
|
|
|
using Robust.Shared.Enums;
|
2020-01-19 09:34:33 +01:00
|
|
|
using Robust.Shared.Prototypes;
|
2021-02-17 10:46:44 +01:00
|
|
|
using Robust.Shared.Utility;
|
2023-09-11 19:18:06 +10:00
|
|
|
using Direction = Robust.Shared.Maths.Direction;
|
2020-01-18 01:54:13 +01:00
|
|
|
|
2024-05-12 09:18:21 +10:00
|
|
|
namespace Content.Client.Lobby.UI
|
2020-01-18 01:54:13 +01:00
|
|
|
{
|
2021-10-16 06:40:25 -07:00
|
|
|
[GenerateTypedNameReferences]
|
2024-04-16 22:57:43 +10:00
|
|
|
public sealed partial class HumanoidProfileEditor : BoxContainer
|
2021-10-16 06:40:25 -07:00
|
|
|
{
|
2022-05-14 08:58:45 +10:00
|
|
|
private readonly IClientPreferencesManager _preferencesManager;
|
2024-05-12 09:18:21 +10:00
|
|
|
private readonly IConfigurationManager _cfgManager;
|
|
|
|
|
private readonly IEntityManager _entManager;
|
|
|
|
|
private readonly IFileDialogManager _dialogManager;
|
|
|
|
|
private readonly IPlayerManager _playerManager;
|
2024-04-16 22:57:43 +10:00
|
|
|
private readonly IPrototypeManager _prototypeManager;
|
2024-08-01 01:14:19 +10:00
|
|
|
private readonly IResourceManager _resManager;
|
Humanoid appearance refactor (#10882)
* initial commit
- species prototype modifications
- markings points as its own file
- shared humanoid component
* adds a tool to convert sprite accessories to markings (in go)
* removes a fmt call
* converts sprite accessory to markings
* adds hair and facial hair to marking categories
* multiple changes
- humanoid visualizer system
- markings modifications for visualizer
- modifications to shared humanoid component
- lays out a base for humanoid system
* hidden layers, ports some properties from appearance component, shrinks DefaultMarkings a little
* squishes the initialize event calls into one function
adds stuff to set species/skin color externally from a server message - currently laid out as if it a dirty call to a networked component, may be subject to change (server-side has not been implemented yet)
* makes the sprite pipeline more obvious
* apply all markings, hidden layer set replacement
* ensures that markings are cleared when the new set is applied
* starts refactoring markingsset (unfinished)
* more additions to the markingset api
* adds constructor logic to markingset
* adds a method to filter out markings in a set based on a given species
* fixes enumerators in markingset
* adds validator into MarkingSet, fixes ForwardMarkingEnumerator
* modifications to the humanoid visual system
* ensuredefault in markingset
* oop
* fixes up data keys, populates OnAppearanceChange in visualizer
* changes to humanoid component, markings
marking equality is now more strict, humanoidcomponent is now implemented for client as a child of sharedhumanoidcomponent
* markings are now applied the visualizer by diffing them
* base sprites are now applied to humanoids from humanoidvisualizer
* passes along base sprite settings to the marking application so that markings know to follow skin color/alpha or not (see: slimes)
* custom base layers on humanoids
* merges all data keys into one data class for humanoid visualizers
* setappearance in sharedhumanoidsystem, removes custombaselayercolors
* humanoidcomponent, system (empty) in server
* adds some basic public API functions to HumanoidSystem
* add marking, remove marking
* changes appearance MarkingsSet to a List<Marking>, adds listener for PlayerSpawnCompleteEvent in HumanoidSystem
* ensuredefaultmarkings, oninit for humanoids
* markingmanager API changes
* removes MarkingsSet
* LoadProfile, adjusts randomization in humanoid appearance to account for species
* base layer settings in humanoidsystem, eye color from profile
* rearranges files to centralize under Humanoid namespace
* more reorganization, deletes some stuff
gotta break stuff to make other things work, right?
goodbye SpriteAccessory...
* fixes a good chunk of server-side issues
still does not compile, yet
* singlemarkingpicker xaml layout
* singlemarkingpicker logic
* magic mirror window (varying pieces of it, mostly client-oriented)
* removes some imports, gives MagicMirror a BUI class (not filled in yet)
* populates magic mirror BUI functionality / window callbacks
* fixes up some errors in humanoidprofileeditor
* changes to SingleMarkingPicker
SingleMarkingPicker now accepts a List<Marking>, species, and total possible markings available in that marking category
* fixes up hair pickers on humanoid profile editor
* fixes the errors in markingpicker
* markingsystem is now gone
* fixes a bunch of build errors
* so that's why i did it like that
* namespace issues, adds robustxamlloader to singlemarkingpicker
* another robustxamlloader
* human, lizard sprites/points
* prototype fixes, deletion of old spriteaccessory
* component registration, fixes dwarf skin toning
no, 'ReptilianToned' does not exist
* removes component registration from abstract humanoid component
* visualizer data now cloneable
* serialize for visualizer key
* zero-count edge case
* missing semi-colon moment
* setspecies in humanoidsystem
* ensures that default markings, if empty, will cause ensuredefault to skip over that given category
* tryadd instead of add
* whoops
* diff and apply should properly apply markings now
* always ensure default, fixes double load for player spawning
* apply skin color now sets the skin color property in humanoidcomponent
* removes sprite from a few species prototypes
* sprite changes for specific base layers based on humanoid sex
* layer ordering fix, and a missing base layer should now disallow markings on that layer
* anymarking base layer, adds the right leg/foot for humans
* loading a profile will now clear all markings on that humanoid
* adds missing layers for humans
* separates species.yml into respective species prototype files
* ensures that if layer visibility was changed, all markings have to be reapplied
* server-side enforcement of hiding hair (and other head-related markings) when equipping things that hide hair
* slime fix, clothingsystem now dictates layer visibility server side
* sussy
* layer settings should now ensure a marking should match the skin tone
* whoops
* skincolor static class and functions in UI
* skin color validation in humanoidcharacterappearance
* markingpicker now shows only the markings for the selected category in used
* getter for slot in singlemarkingpicker now ensures slot is 0 if markings exists
* FilterSpecies no longer attempts to do removal while iterating
* expands for SingleMarkingPicker
* humanoid base dummy has blank layers now (and snout/tail/headside/headtop)
* fixes an issue with visualizer system if the marking count was different but the markings themselves were (somewhat) the same
* whoops
* adds edge case handlers for count differences in humanoid markings
* preview now loads profile instead of directly setting appearance
* moves marking set loading to update controls
* clones a marking set in markingpicker by using the deep clone constructor
* whoops (deep cloning a marking now copies the marking id)
* adds replace function for markingset
* points should now update after the markings are remove/added
* merging base layer sprites into a humanoid should now clear them before merging
* sets dirty range start to count only if the dirty range start was never set above 0
* fixes up some issues with singlemarkingpicker
* color selector sliders in single marking picker should now expand
* hair from hair pickers should now apply in profile loading (client-side)
* category in singlemarkingpicker now sets the private category variable
* slot selector should now populate
* single marking picker buttons now have text, also shows the category name over all user-clickable elements
* removes a comment
* removing hair slots now sets it to bald, defaults to zero used slots if current hair is bald on hair/facial hair
* random skin color, eye color
* populate colors now checks if the marking count is greater than zero in singlemarkingpicker
* hair/facial hair pickers now just get the first possible hair from the respective species list
* different approach to random skin color
* oh, that's why it wasn't working
* randomize everything now just updates every single control
* selecting a new marking in SingleMarkingPicker should attempt to copy over old colors, populate list now uses cache,
* markingmanager now uses OnlyWhitelisted to populate by category and species
* filterspecies now uses onlyWhitelist to filter markings based on whitelist or not
* oops
* ui fix for singlemarkingpicker, ensures that cache is not null if it is null when populatelist is called
* order of operations for the horizontal expand for add/remove
* hair pickers should now update when you add/remove the hair slot
* fixes variable naming error in character appearance
* loc string fix in singlemarkingpicker
* lizards, vox now have onlyWhitelist, vox restriction for hair/facialhairs
* having zero possible hairs should no longer cause an exception in randomization
* setting species should now update hair pickers
* ignore categories for marking picker
* and a clear as well for the category button
* places that functionality in its own function instead
* adds eye base sprite, vox now also have their own custom eye sprites
* loading a profile client-side should do FilterSpecies for markings now
* client-side load profile does filter species after adding in the hairs now
* magic mirror
* callbacks now call the callback instead of adding it on construct
* whoops
* in removemarking too
* adds missing synchronize calls
* comments out an updateinterface call in magic mirror
* magic mirror window title, minimum sizing
* fixes minsize, adds warning for players who try to set their hair for species that have no hair
* removes spaces in xaml
* namespace changes/organization
* whoopsie (merge conflicts)
* re-enables identity from humanoid component
* damagevisuals now uses the enum given to it instead of the layerstate given on that layer tied to the enum
* removes commas from json
* changes to visuals system so the change is consistent
* chest
* reptilian
* visualizer system now handles body sprite setting/coloration, similar to how characterappearance did it
not a big fan of this
* adds a check in applybasesprites
* adding/removing parts should now make them invisible on a humanoid
* body part removal/adding now enumerates over sublayers instead
* synchro now runs in bodycomponent startup
* parts instead of slots
* humanoidcompnent check
* switches from rsi to actualrsi
* removes all the body stuff (too slow)
* cleans up resolves from humanoid visualizer system
* merging sprites now checks if the base sprites have been modified or not (through things like species changes, or custom base sprite changes)
* not forgetting that one again
* merging now returns an actual dirty value
* replaces the sequenceequal with a more accurate solution
* permanent layers, layer visibility on add/remove part in body
* should send all hidden layers over now
* isdirty in visualizer system for base layers
* isdirty checks count as well
* ok, IsDirty should now set the base layers if the merged sprites are different
* equals override in HumanoidSpritePrototypes.cs
temporary until record prototypes :heck:
* makes fields readonly, equates IDs instead
* adds forced markings through marking picker
* forced in humanoidsystem api, ignorespecies in markingpicker
* marking bui
* makes that serializable as well
* ignore species/forced toggles now work
* adds icon to modifier verb, interface and keys to humanoid bases
* needs the actual enum value to open, no?
* makes the key the actual key
* actions now propagate upwards
* ignore species when set now repopulates markingpicker
* modifiable base layers in the markings window
* oops!
* layout changes
* info box should now appear
* adds ignorespecies for marking picker, collapsible for base layer section of appearance modification window
* collapsible layout moment
* if base layers have changed, all markings are now dirty (and if a base layer is missing, the marking is still 'applied' but it's now just invisible
* small change to marking visibility
* small changes to modifier UI
* markings now match skin on zombification
* zombie stuff
* makes the line edit in marking modifier window more obvious
* disables vox on round start
* horizontal expand on the single label in base layer modifiers
* humanoid profiles in prototypes
* randomhumanoidappearance won't work if the humanoid has a profile already stored
* removes unused code
* documentation in humanoidsystem server-side
* documentation in shared/client
* whoops
* converts accessory into marking in locale files (also adds marking loc string into single marking picker)
* be gone, shared humanoid appearance system from the last upstream merge
* species ignore on randomization (defaults to no ignored species)
* more upstream merge parts that bypassed any errors before merge
* addresses review (also just adds typeserializers in some places)
* submodule moment
* upstream merge issues
2022-09-22 15:19:00 -07:00
|
|
|
private readonly MarkingManager _markingManager;
|
2023-05-27 14:22:22 +10:00
|
|
|
private readonly JobRequirementsManager _requirements;
|
2024-05-12 09:18:21 +10:00
|
|
|
private readonly LobbyUIController _controller;
|
2023-04-20 20:16:01 +10:00
|
|
|
|
2025-04-10 10:47:05 +00:00
|
|
|
private readonly SpriteSystem _sprite;
|
|
|
|
|
|
2025-05-17 00:27:39 -05:00
|
|
|
// CCvar.
|
|
|
|
|
private int _maxNameLength;
|
|
|
|
|
private bool _allowFlavorText;
|
|
|
|
|
|
2024-05-12 09:18:21 +10:00
|
|
|
private FlavorText.FlavorText? _flavorText;
|
2024-04-16 22:57:43 +10:00
|
|
|
private TextEdit? _flavorTextEdit;
|
2024-05-12 09:18:21 +10:00
|
|
|
|
|
|
|
|
// One at a time.
|
|
|
|
|
private LoadoutWindow? _loadoutWindow;
|
|
|
|
|
|
|
|
|
|
private bool _exporting;
|
2024-08-01 01:14:19 +10:00
|
|
|
private bool _imaging;
|
2024-05-12 09:18:21 +10:00
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// If we're attempting to save.
|
|
|
|
|
/// </summary>
|
|
|
|
|
public event Action? Save;
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Entity used for the profile editor preview
|
|
|
|
|
/// </summary>
|
|
|
|
|
public EntityUid PreviewDummy;
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Temporary override of their selected job, used to preview roles.
|
|
|
|
|
/// </summary>
|
|
|
|
|
public JobPrototype? JobOverride;
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// The character slot for the current profile.
|
|
|
|
|
/// </summary>
|
|
|
|
|
public int? CharacterSlot;
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// The work in progress profile being edited.
|
|
|
|
|
/// </summary>
|
|
|
|
|
public HumanoidCharacterProfile? Profile;
|
|
|
|
|
|
|
|
|
|
private List<SpeciesPrototype> _species = new();
|
|
|
|
|
|
|
|
|
|
private List<(string, RequirementsSelector)> _jobPriorities = new();
|
|
|
|
|
|
2021-07-18 18:39:31 +02:00
|
|
|
private readonly Dictionary<string, BoxContainer> _jobCategories;
|
2024-05-12 09:18:21 +10:00
|
|
|
|
2023-09-13 04:57:38 +03:00
|
|
|
private Direction _previewRotation = Direction.North;
|
2022-03-28 11:31:23 +03:00
|
|
|
|
2022-05-05 01:07:42 -07:00
|
|
|
private ColorSelectorSliders _rgbSkinColorSelector;
|
|
|
|
|
|
2020-01-18 01:54:13 +01:00
|
|
|
private bool _isDirty;
|
|
|
|
|
|
2025-07-07 15:57:05 -04:00
|
|
|
private static readonly ProtoId<GuideEntryPrototype> DefaultSpeciesGuidebook = "Species";
|
2024-04-16 22:57:43 +10:00
|
|
|
|
2024-06-07 00:05:58 +12:00
|
|
|
public event Action<List<ProtoId<GuideEntryPrototype>>>? OnOpenGuidebook;
|
|
|
|
|
|
2024-05-12 09:18:21 +10:00
|
|
|
private ISawmill _sawmill;
|
|
|
|
|
|
|
|
|
|
public HumanoidProfileEditor(
|
|
|
|
|
IClientPreferencesManager preferencesManager,
|
|
|
|
|
IConfigurationManager configurationManager,
|
|
|
|
|
IEntityManager entManager,
|
|
|
|
|
IFileDialogManager dialogManager,
|
|
|
|
|
ILogManager logManager,
|
|
|
|
|
IPlayerManager playerManager,
|
|
|
|
|
IPrototypeManager prototypeManager,
|
2024-08-01 01:14:19 +10:00
|
|
|
IResourceManager resManager,
|
2024-05-12 09:18:21 +10:00
|
|
|
JobRequirementsManager requirements,
|
|
|
|
|
MarkingManager markings)
|
2020-01-18 01:54:13 +01:00
|
|
|
{
|
2021-10-16 06:40:25 -07:00
|
|
|
RobustXamlLoader.Load(this);
|
2024-05-12 09:18:21 +10:00
|
|
|
_sawmill = logManager.GetSawmill("profile.editor");
|
|
|
|
|
_cfgManager = configurationManager;
|
|
|
|
|
_entManager = entManager;
|
|
|
|
|
_dialogManager = dialogManager;
|
|
|
|
|
_playerManager = playerManager;
|
2021-02-17 10:46:44 +01:00
|
|
|
_prototypeManager = prototypeManager;
|
2024-05-12 09:18:21 +10:00
|
|
|
_markingManager = markings;
|
2020-01-18 01:54:13 +01:00
|
|
|
_preferencesManager = preferencesManager;
|
2024-08-01 01:14:19 +10:00
|
|
|
_resManager = resManager;
|
2024-05-12 09:18:21 +10:00
|
|
|
_requirements = requirements;
|
|
|
|
|
_controller = UserInterfaceManager.GetUIController<LobbyUIController>();
|
2025-04-10 10:47:05 +00:00
|
|
|
_sprite = _entManager.System<SpriteSystem>();
|
2025-05-17 00:27:39 -05:00
|
|
|
|
|
|
|
|
_maxNameLength = _cfgManager.GetCVar(CCVars.MaxNameLength);
|
|
|
|
|
_allowFlavorText = _cfgManager.GetCVar(CCVars.FlavorText);
|
|
|
|
|
|
2024-05-12 09:18:21 +10:00
|
|
|
ImportButton.OnPressed += args =>
|
|
|
|
|
{
|
|
|
|
|
ImportProfile();
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
ExportButton.OnPressed += args =>
|
|
|
|
|
{
|
|
|
|
|
ExportProfile();
|
|
|
|
|
};
|
2020-01-18 01:54:13 +01:00
|
|
|
|
2024-08-01 01:14:19 +10:00
|
|
|
ExportImageButton.OnPressed += args =>
|
|
|
|
|
{
|
|
|
|
|
ExportImage();
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
OpenImagesButton.OnPressed += args =>
|
|
|
|
|
{
|
|
|
|
|
_resManager.UserData.OpenOsWindow(ContentSpriteSystem.Exports);
|
|
|
|
|
};
|
|
|
|
|
|
2024-05-12 09:18:21 +10:00
|
|
|
ResetButton.OnPressed += args =>
|
|
|
|
|
{
|
|
|
|
|
SetProfile((HumanoidCharacterProfile?) _preferencesManager.Preferences?.SelectedCharacter, _preferencesManager.Preferences?.SelectedCharacterIndex);
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
SaveButton.OnPressed += args =>
|
|
|
|
|
{
|
|
|
|
|
Save?.Invoke();
|
|
|
|
|
};
|
2024-03-11 04:01:32 +01:00
|
|
|
|
2020-11-08 13:44:04 +01:00
|
|
|
#region Left
|
2020-01-18 01:54:13 +01:00
|
|
|
|
|
|
|
|
#region Name
|
|
|
|
|
|
2024-05-12 09:18:21 +10:00
|
|
|
NameEdit.OnTextChanged += args => { SetName(args.Text); };
|
2025-05-17 00:27:39 -05:00
|
|
|
NameEdit.IsValid = args => args.Length <= _maxNameLength;
|
2024-05-12 09:18:21 +10:00
|
|
|
NameRandomize.OnPressed += args => RandomizeName();
|
|
|
|
|
RandomizeEverythingButton.OnPressed += args => { RandomizeEverything(); };
|
|
|
|
|
WarningLabel.SetMarkup($"[color=red]{Loc.GetString("humanoid-profile-editor-naming-rules-warning")}[/color]");
|
2020-01-18 01:54:13 +01:00
|
|
|
|
|
|
|
|
#endregion Name
|
|
|
|
|
|
2020-01-19 09:34:33 +01:00
|
|
|
#region Appearance
|
2020-01-18 01:54:13 +01:00
|
|
|
|
2024-05-12 09:18:21 +10:00
|
|
|
TabContainer.SetTabTitle(0, Loc.GetString("humanoid-profile-editor-appearance-tab"));
|
2020-01-19 09:34:33 +01:00
|
|
|
|
2021-03-07 20:48:24 +01:00
|
|
|
#region Sex
|
2020-01-19 09:34:33 +01:00
|
|
|
|
2024-05-12 09:18:21 +10:00
|
|
|
SexButton.OnItemSelected += args =>
|
2021-03-07 20:48:24 +01:00
|
|
|
{
|
2024-05-12 09:18:21 +10:00
|
|
|
SexButton.SelectId(args.Id);
|
2022-10-15 17:45:47 -04:00
|
|
|
SetSex((Sex) args.Id);
|
2021-03-07 20:48:24 +01:00
|
|
|
};
|
2020-01-19 09:34:33 +01:00
|
|
|
|
2021-03-07 20:48:24 +01:00
|
|
|
#endregion Sex
|
2020-01-19 09:34:33 +01:00
|
|
|
|
2021-03-07 20:48:24 +01:00
|
|
|
#region Age
|
2020-01-19 09:34:33 +01:00
|
|
|
|
2024-05-12 09:18:21 +10:00
|
|
|
AgeEdit.OnTextChanged += args =>
|
2021-03-07 20:48:24 +01:00
|
|
|
{
|
|
|
|
|
if (!int.TryParse(args.Text, out var newAge))
|
|
|
|
|
return;
|
2024-05-12 09:18:21 +10:00
|
|
|
|
2021-03-07 20:48:24 +01:00
|
|
|
SetAge(newAge);
|
|
|
|
|
};
|
2020-01-19 09:34:33 +01:00
|
|
|
|
2021-03-07 20:48:24 +01:00
|
|
|
#endregion Age
|
2020-12-24 13:42:40 +00:00
|
|
|
|
2021-03-07 20:48:24 +01:00
|
|
|
#region Gender
|
2020-12-24 13:42:40 +00:00
|
|
|
|
2024-05-12 09:18:21 +10:00
|
|
|
PronounsButton.AddItem(Loc.GetString("humanoid-profile-editor-pronouns-male-text"), (int) Gender.Male);
|
|
|
|
|
PronounsButton.AddItem(Loc.GetString("humanoid-profile-editor-pronouns-female-text"), (int) Gender.Female);
|
|
|
|
|
PronounsButton.AddItem(Loc.GetString("humanoid-profile-editor-pronouns-epicene-text"), (int) Gender.Epicene);
|
|
|
|
|
PronounsButton.AddItem(Loc.GetString("humanoid-profile-editor-pronouns-neuter-text"), (int) Gender.Neuter);
|
2020-12-24 13:42:40 +00:00
|
|
|
|
2024-05-12 09:18:21 +10:00
|
|
|
PronounsButton.OnItemSelected += args =>
|
2021-03-07 20:48:24 +01:00
|
|
|
{
|
2024-05-12 09:18:21 +10:00
|
|
|
PronounsButton.SelectId(args.Id);
|
2021-03-07 20:48:24 +01:00
|
|
|
SetGender((Gender) args.Id);
|
|
|
|
|
};
|
2020-12-24 13:42:40 +00:00
|
|
|
|
2021-03-07 20:48:24 +01:00
|
|
|
#endregion Gender
|
2020-01-19 09:34:33 +01:00
|
|
|
|
2024-05-12 09:18:21 +10:00
|
|
|
RefreshSpecies();
|
2022-01-08 19:53:14 -06:00
|
|
|
|
2024-05-12 09:18:21 +10:00
|
|
|
SpeciesButton.OnItemSelected += args =>
|
2022-01-08 19:53:14 -06:00
|
|
|
{
|
2024-05-12 09:18:21 +10:00
|
|
|
SpeciesButton.SelectId(args.Id);
|
|
|
|
|
SetSpecies(_species[args.Id].ID);
|
Humanoid appearance refactor (#10882)
* initial commit
- species prototype modifications
- markings points as its own file
- shared humanoid component
* adds a tool to convert sprite accessories to markings (in go)
* removes a fmt call
* converts sprite accessory to markings
* adds hair and facial hair to marking categories
* multiple changes
- humanoid visualizer system
- markings modifications for visualizer
- modifications to shared humanoid component
- lays out a base for humanoid system
* hidden layers, ports some properties from appearance component, shrinks DefaultMarkings a little
* squishes the initialize event calls into one function
adds stuff to set species/skin color externally from a server message - currently laid out as if it a dirty call to a networked component, may be subject to change (server-side has not been implemented yet)
* makes the sprite pipeline more obvious
* apply all markings, hidden layer set replacement
* ensures that markings are cleared when the new set is applied
* starts refactoring markingsset (unfinished)
* more additions to the markingset api
* adds constructor logic to markingset
* adds a method to filter out markings in a set based on a given species
* fixes enumerators in markingset
* adds validator into MarkingSet, fixes ForwardMarkingEnumerator
* modifications to the humanoid visual system
* ensuredefault in markingset
* oop
* fixes up data keys, populates OnAppearanceChange in visualizer
* changes to humanoid component, markings
marking equality is now more strict, humanoidcomponent is now implemented for client as a child of sharedhumanoidcomponent
* markings are now applied the visualizer by diffing them
* base sprites are now applied to humanoids from humanoidvisualizer
* passes along base sprite settings to the marking application so that markings know to follow skin color/alpha or not (see: slimes)
* custom base layers on humanoids
* merges all data keys into one data class for humanoid visualizers
* setappearance in sharedhumanoidsystem, removes custombaselayercolors
* humanoidcomponent, system (empty) in server
* adds some basic public API functions to HumanoidSystem
* add marking, remove marking
* changes appearance MarkingsSet to a List<Marking>, adds listener for PlayerSpawnCompleteEvent in HumanoidSystem
* ensuredefaultmarkings, oninit for humanoids
* markingmanager API changes
* removes MarkingsSet
* LoadProfile, adjusts randomization in humanoid appearance to account for species
* base layer settings in humanoidsystem, eye color from profile
* rearranges files to centralize under Humanoid namespace
* more reorganization, deletes some stuff
gotta break stuff to make other things work, right?
goodbye SpriteAccessory...
* fixes a good chunk of server-side issues
still does not compile, yet
* singlemarkingpicker xaml layout
* singlemarkingpicker logic
* magic mirror window (varying pieces of it, mostly client-oriented)
* removes some imports, gives MagicMirror a BUI class (not filled in yet)
* populates magic mirror BUI functionality / window callbacks
* fixes up some errors in humanoidprofileeditor
* changes to SingleMarkingPicker
SingleMarkingPicker now accepts a List<Marking>, species, and total possible markings available in that marking category
* fixes up hair pickers on humanoid profile editor
* fixes the errors in markingpicker
* markingsystem is now gone
* fixes a bunch of build errors
* so that's why i did it like that
* namespace issues, adds robustxamlloader to singlemarkingpicker
* another robustxamlloader
* human, lizard sprites/points
* prototype fixes, deletion of old spriteaccessory
* component registration, fixes dwarf skin toning
no, 'ReptilianToned' does not exist
* removes component registration from abstract humanoid component
* visualizer data now cloneable
* serialize for visualizer key
* zero-count edge case
* missing semi-colon moment
* setspecies in humanoidsystem
* ensures that default markings, if empty, will cause ensuredefault to skip over that given category
* tryadd instead of add
* whoops
* diff and apply should properly apply markings now
* always ensure default, fixes double load for player spawning
* apply skin color now sets the skin color property in humanoidcomponent
* removes sprite from a few species prototypes
* sprite changes for specific base layers based on humanoid sex
* layer ordering fix, and a missing base layer should now disallow markings on that layer
* anymarking base layer, adds the right leg/foot for humans
* loading a profile will now clear all markings on that humanoid
* adds missing layers for humans
* separates species.yml into respective species prototype files
* ensures that if layer visibility was changed, all markings have to be reapplied
* server-side enforcement of hiding hair (and other head-related markings) when equipping things that hide hair
* slime fix, clothingsystem now dictates layer visibility server side
* sussy
* layer settings should now ensure a marking should match the skin tone
* whoops
* skincolor static class and functions in UI
* skin color validation in humanoidcharacterappearance
* markingpicker now shows only the markings for the selected category in used
* getter for slot in singlemarkingpicker now ensures slot is 0 if markings exists
* FilterSpecies no longer attempts to do removal while iterating
* expands for SingleMarkingPicker
* humanoid base dummy has blank layers now (and snout/tail/headside/headtop)
* fixes an issue with visualizer system if the marking count was different but the markings themselves were (somewhat) the same
* whoops
* adds edge case handlers for count differences in humanoid markings
* preview now loads profile instead of directly setting appearance
* moves marking set loading to update controls
* clones a marking set in markingpicker by using the deep clone constructor
* whoops (deep cloning a marking now copies the marking id)
* adds replace function for markingset
* points should now update after the markings are remove/added
* merging base layer sprites into a humanoid should now clear them before merging
* sets dirty range start to count only if the dirty range start was never set above 0
* fixes up some issues with singlemarkingpicker
* color selector sliders in single marking picker should now expand
* hair from hair pickers should now apply in profile loading (client-side)
* category in singlemarkingpicker now sets the private category variable
* slot selector should now populate
* single marking picker buttons now have text, also shows the category name over all user-clickable elements
* removes a comment
* removing hair slots now sets it to bald, defaults to zero used slots if current hair is bald on hair/facial hair
* random skin color, eye color
* populate colors now checks if the marking count is greater than zero in singlemarkingpicker
* hair/facial hair pickers now just get the first possible hair from the respective species list
* different approach to random skin color
* oh, that's why it wasn't working
* randomize everything now just updates every single control
* selecting a new marking in SingleMarkingPicker should attempt to copy over old colors, populate list now uses cache,
* markingmanager now uses OnlyWhitelisted to populate by category and species
* filterspecies now uses onlyWhitelist to filter markings based on whitelist or not
* oops
* ui fix for singlemarkingpicker, ensures that cache is not null if it is null when populatelist is called
* order of operations for the horizontal expand for add/remove
* hair pickers should now update when you add/remove the hair slot
* fixes variable naming error in character appearance
* loc string fix in singlemarkingpicker
* lizards, vox now have onlyWhitelist, vox restriction for hair/facialhairs
* having zero possible hairs should no longer cause an exception in randomization
* setting species should now update hair pickers
* ignore categories for marking picker
* and a clear as well for the category button
* places that functionality in its own function instead
* adds eye base sprite, vox now also have their own custom eye sprites
* loading a profile client-side should do FilterSpecies for markings now
* client-side load profile does filter species after adding in the hairs now
* magic mirror
* callbacks now call the callback instead of adding it on construct
* whoops
* in removemarking too
* adds missing synchronize calls
* comments out an updateinterface call in magic mirror
* magic mirror window title, minimum sizing
* fixes minsize, adds warning for players who try to set their hair for species that have no hair
* removes spaces in xaml
* namespace changes/organization
* whoopsie (merge conflicts)
* re-enables identity from humanoid component
* damagevisuals now uses the enum given to it instead of the layerstate given on that layer tied to the enum
* removes commas from json
* changes to visuals system so the change is consistent
* chest
* reptilian
* visualizer system now handles body sprite setting/coloration, similar to how characterappearance did it
not a big fan of this
* adds a check in applybasesprites
* adding/removing parts should now make them invisible on a humanoid
* body part removal/adding now enumerates over sublayers instead
* synchro now runs in bodycomponent startup
* parts instead of slots
* humanoidcompnent check
* switches from rsi to actualrsi
* removes all the body stuff (too slow)
* cleans up resolves from humanoid visualizer system
* merging sprites now checks if the base sprites have been modified or not (through things like species changes, or custom base sprite changes)
* not forgetting that one again
* merging now returns an actual dirty value
* replaces the sequenceequal with a more accurate solution
* permanent layers, layer visibility on add/remove part in body
* should send all hidden layers over now
* isdirty in visualizer system for base layers
* isdirty checks count as well
* ok, IsDirty should now set the base layers if the merged sprites are different
* equals override in HumanoidSpritePrototypes.cs
temporary until record prototypes :heck:
* makes fields readonly, equates IDs instead
* adds forced markings through marking picker
* forced in humanoidsystem api, ignorespecies in markingpicker
* marking bui
* makes that serializable as well
* ignore species/forced toggles now work
* adds icon to modifier verb, interface and keys to humanoid bases
* needs the actual enum value to open, no?
* makes the key the actual key
* actions now propagate upwards
* ignore species when set now repopulates markingpicker
* modifiable base layers in the markings window
* oops!
* layout changes
* info box should now appear
* adds ignorespecies for marking picker, collapsible for base layer section of appearance modification window
* collapsible layout moment
* if base layers have changed, all markings are now dirty (and if a base layer is missing, the marking is still 'applied' but it's now just invisible
* small change to marking visibility
* small changes to modifier UI
* markings now match skin on zombification
* zombie stuff
* makes the line edit in marking modifier window more obvious
* disables vox on round start
* horizontal expand on the single label in base layer modifiers
* humanoid profiles in prototypes
* randomhumanoidappearance won't work if the humanoid has a profile already stored
* removes unused code
* documentation in humanoidsystem server-side
* documentation in shared/client
* whoops
* converts accessory into marking in locale files (also adds marking loc string into single marking picker)
* be gone, shared humanoid appearance system from the last upstream merge
* species ignore on randomization (defaults to no ignored species)
* more upstream merge parts that bypassed any errors before merge
* addresses review (also just adds typeserializers in some places)
* submodule moment
* upstream merge issues
2022-09-22 15:19:00 -07:00
|
|
|
UpdateHairPickers();
|
2022-05-05 01:07:42 -07:00
|
|
|
OnSkinColorOnValueChanged();
|
2022-01-08 19:53:14 -06:00
|
|
|
};
|
|
|
|
|
|
2021-11-12 01:55:50 -08:00
|
|
|
#region Skin
|
|
|
|
|
|
2024-05-12 09:18:21 +10:00
|
|
|
Skin.OnValueChanged += _ =>
|
2022-05-05 01:07:42 -07:00
|
|
|
{
|
|
|
|
|
OnSkinColorOnValueChanged();
|
|
|
|
|
};
|
|
|
|
|
|
2024-05-12 09:18:21 +10:00
|
|
|
RgbSkinColorContainer.AddChild(_rgbSkinColorSelector = new ColorSelectorSliders());
|
2025-07-02 20:08:06 -05:00
|
|
|
_rgbSkinColorSelector.SelectorType = ColorSelectorSliders.ColorSelectorType.Hsv; // defaults color selector to HSV
|
2022-05-05 01:07:42 -07:00
|
|
|
_rgbSkinColorSelector.OnColorChanged += _ =>
|
|
|
|
|
{
|
|
|
|
|
OnSkinColorOnValueChanged();
|
|
|
|
|
};
|
2021-11-12 01:55:50 -08:00
|
|
|
|
|
|
|
|
#endregion
|
|
|
|
|
|
2021-03-07 20:48:24 +01:00
|
|
|
#region Hair
|
2020-01-19 09:34:33 +01:00
|
|
|
|
2024-05-12 09:18:21 +10:00
|
|
|
HairStylePicker.OnMarkingSelect += newStyle =>
|
Humanoid appearance refactor (#10882)
* initial commit
- species prototype modifications
- markings points as its own file
- shared humanoid component
* adds a tool to convert sprite accessories to markings (in go)
* removes a fmt call
* converts sprite accessory to markings
* adds hair and facial hair to marking categories
* multiple changes
- humanoid visualizer system
- markings modifications for visualizer
- modifications to shared humanoid component
- lays out a base for humanoid system
* hidden layers, ports some properties from appearance component, shrinks DefaultMarkings a little
* squishes the initialize event calls into one function
adds stuff to set species/skin color externally from a server message - currently laid out as if it a dirty call to a networked component, may be subject to change (server-side has not been implemented yet)
* makes the sprite pipeline more obvious
* apply all markings, hidden layer set replacement
* ensures that markings are cleared when the new set is applied
* starts refactoring markingsset (unfinished)
* more additions to the markingset api
* adds constructor logic to markingset
* adds a method to filter out markings in a set based on a given species
* fixes enumerators in markingset
* adds validator into MarkingSet, fixes ForwardMarkingEnumerator
* modifications to the humanoid visual system
* ensuredefault in markingset
* oop
* fixes up data keys, populates OnAppearanceChange in visualizer
* changes to humanoid component, markings
marking equality is now more strict, humanoidcomponent is now implemented for client as a child of sharedhumanoidcomponent
* markings are now applied the visualizer by diffing them
* base sprites are now applied to humanoids from humanoidvisualizer
* passes along base sprite settings to the marking application so that markings know to follow skin color/alpha or not (see: slimes)
* custom base layers on humanoids
* merges all data keys into one data class for humanoid visualizers
* setappearance in sharedhumanoidsystem, removes custombaselayercolors
* humanoidcomponent, system (empty) in server
* adds some basic public API functions to HumanoidSystem
* add marking, remove marking
* changes appearance MarkingsSet to a List<Marking>, adds listener for PlayerSpawnCompleteEvent in HumanoidSystem
* ensuredefaultmarkings, oninit for humanoids
* markingmanager API changes
* removes MarkingsSet
* LoadProfile, adjusts randomization in humanoid appearance to account for species
* base layer settings in humanoidsystem, eye color from profile
* rearranges files to centralize under Humanoid namespace
* more reorganization, deletes some stuff
gotta break stuff to make other things work, right?
goodbye SpriteAccessory...
* fixes a good chunk of server-side issues
still does not compile, yet
* singlemarkingpicker xaml layout
* singlemarkingpicker logic
* magic mirror window (varying pieces of it, mostly client-oriented)
* removes some imports, gives MagicMirror a BUI class (not filled in yet)
* populates magic mirror BUI functionality / window callbacks
* fixes up some errors in humanoidprofileeditor
* changes to SingleMarkingPicker
SingleMarkingPicker now accepts a List<Marking>, species, and total possible markings available in that marking category
* fixes up hair pickers on humanoid profile editor
* fixes the errors in markingpicker
* markingsystem is now gone
* fixes a bunch of build errors
* so that's why i did it like that
* namespace issues, adds robustxamlloader to singlemarkingpicker
* another robustxamlloader
* human, lizard sprites/points
* prototype fixes, deletion of old spriteaccessory
* component registration, fixes dwarf skin toning
no, 'ReptilianToned' does not exist
* removes component registration from abstract humanoid component
* visualizer data now cloneable
* serialize for visualizer key
* zero-count edge case
* missing semi-colon moment
* setspecies in humanoidsystem
* ensures that default markings, if empty, will cause ensuredefault to skip over that given category
* tryadd instead of add
* whoops
* diff and apply should properly apply markings now
* always ensure default, fixes double load for player spawning
* apply skin color now sets the skin color property in humanoidcomponent
* removes sprite from a few species prototypes
* sprite changes for specific base layers based on humanoid sex
* layer ordering fix, and a missing base layer should now disallow markings on that layer
* anymarking base layer, adds the right leg/foot for humans
* loading a profile will now clear all markings on that humanoid
* adds missing layers for humans
* separates species.yml into respective species prototype files
* ensures that if layer visibility was changed, all markings have to be reapplied
* server-side enforcement of hiding hair (and other head-related markings) when equipping things that hide hair
* slime fix, clothingsystem now dictates layer visibility server side
* sussy
* layer settings should now ensure a marking should match the skin tone
* whoops
* skincolor static class and functions in UI
* skin color validation in humanoidcharacterappearance
* markingpicker now shows only the markings for the selected category in used
* getter for slot in singlemarkingpicker now ensures slot is 0 if markings exists
* FilterSpecies no longer attempts to do removal while iterating
* expands for SingleMarkingPicker
* humanoid base dummy has blank layers now (and snout/tail/headside/headtop)
* fixes an issue with visualizer system if the marking count was different but the markings themselves were (somewhat) the same
* whoops
* adds edge case handlers for count differences in humanoid markings
* preview now loads profile instead of directly setting appearance
* moves marking set loading to update controls
* clones a marking set in markingpicker by using the deep clone constructor
* whoops (deep cloning a marking now copies the marking id)
* adds replace function for markingset
* points should now update after the markings are remove/added
* merging base layer sprites into a humanoid should now clear them before merging
* sets dirty range start to count only if the dirty range start was never set above 0
* fixes up some issues with singlemarkingpicker
* color selector sliders in single marking picker should now expand
* hair from hair pickers should now apply in profile loading (client-side)
* category in singlemarkingpicker now sets the private category variable
* slot selector should now populate
* single marking picker buttons now have text, also shows the category name over all user-clickable elements
* removes a comment
* removing hair slots now sets it to bald, defaults to zero used slots if current hair is bald on hair/facial hair
* random skin color, eye color
* populate colors now checks if the marking count is greater than zero in singlemarkingpicker
* hair/facial hair pickers now just get the first possible hair from the respective species list
* different approach to random skin color
* oh, that's why it wasn't working
* randomize everything now just updates every single control
* selecting a new marking in SingleMarkingPicker should attempt to copy over old colors, populate list now uses cache,
* markingmanager now uses OnlyWhitelisted to populate by category and species
* filterspecies now uses onlyWhitelist to filter markings based on whitelist or not
* oops
* ui fix for singlemarkingpicker, ensures that cache is not null if it is null when populatelist is called
* order of operations for the horizontal expand for add/remove
* hair pickers should now update when you add/remove the hair slot
* fixes variable naming error in character appearance
* loc string fix in singlemarkingpicker
* lizards, vox now have onlyWhitelist, vox restriction for hair/facialhairs
* having zero possible hairs should no longer cause an exception in randomization
* setting species should now update hair pickers
* ignore categories for marking picker
* and a clear as well for the category button
* places that functionality in its own function instead
* adds eye base sprite, vox now also have their own custom eye sprites
* loading a profile client-side should do FilterSpecies for markings now
* client-side load profile does filter species after adding in the hairs now
* magic mirror
* callbacks now call the callback instead of adding it on construct
* whoops
* in removemarking too
* adds missing synchronize calls
* comments out an updateinterface call in magic mirror
* magic mirror window title, minimum sizing
* fixes minsize, adds warning for players who try to set their hair for species that have no hair
* removes spaces in xaml
* namespace changes/organization
* whoopsie (merge conflicts)
* re-enables identity from humanoid component
* damagevisuals now uses the enum given to it instead of the layerstate given on that layer tied to the enum
* removes commas from json
* changes to visuals system so the change is consistent
* chest
* reptilian
* visualizer system now handles body sprite setting/coloration, similar to how characterappearance did it
not a big fan of this
* adds a check in applybasesprites
* adding/removing parts should now make them invisible on a humanoid
* body part removal/adding now enumerates over sublayers instead
* synchro now runs in bodycomponent startup
* parts instead of slots
* humanoidcompnent check
* switches from rsi to actualrsi
* removes all the body stuff (too slow)
* cleans up resolves from humanoid visualizer system
* merging sprites now checks if the base sprites have been modified or not (through things like species changes, or custom base sprite changes)
* not forgetting that one again
* merging now returns an actual dirty value
* replaces the sequenceequal with a more accurate solution
* permanent layers, layer visibility on add/remove part in body
* should send all hidden layers over now
* isdirty in visualizer system for base layers
* isdirty checks count as well
* ok, IsDirty should now set the base layers if the merged sprites are different
* equals override in HumanoidSpritePrototypes.cs
temporary until record prototypes :heck:
* makes fields readonly, equates IDs instead
* adds forced markings through marking picker
* forced in humanoidsystem api, ignorespecies in markingpicker
* marking bui
* makes that serializable as well
* ignore species/forced toggles now work
* adds icon to modifier verb, interface and keys to humanoid bases
* needs the actual enum value to open, no?
* makes the key the actual key
* actions now propagate upwards
* ignore species when set now repopulates markingpicker
* modifiable base layers in the markings window
* oops!
* layout changes
* info box should now appear
* adds ignorespecies for marking picker, collapsible for base layer section of appearance modification window
* collapsible layout moment
* if base layers have changed, all markings are now dirty (and if a base layer is missing, the marking is still 'applied' but it's now just invisible
* small change to marking visibility
* small changes to modifier UI
* markings now match skin on zombification
* zombie stuff
* makes the line edit in marking modifier window more obvious
* disables vox on round start
* horizontal expand on the single label in base layer modifiers
* humanoid profiles in prototypes
* randomhumanoidappearance won't work if the humanoid has a profile already stored
* removes unused code
* documentation in humanoidsystem server-side
* documentation in shared/client
* whoops
* converts accessory into marking in locale files (also adds marking loc string into single marking picker)
* be gone, shared humanoid appearance system from the last upstream merge
* species ignore on randomization (defaults to no ignored species)
* more upstream merge parts that bypassed any errors before merge
* addresses review (also just adds typeserializers in some places)
* submodule moment
* upstream merge issues
2022-09-22 15:19:00 -07:00
|
|
|
{
|
|
|
|
|
if (Profile is null)
|
|
|
|
|
return;
|
|
|
|
|
Profile = Profile.WithCharacterAppearance(
|
|
|
|
|
Profile.Appearance.WithHairStyleName(newStyle.id));
|
2024-05-12 09:18:21 +10:00
|
|
|
ReloadPreview();
|
Humanoid appearance refactor (#10882)
* initial commit
- species prototype modifications
- markings points as its own file
- shared humanoid component
* adds a tool to convert sprite accessories to markings (in go)
* removes a fmt call
* converts sprite accessory to markings
* adds hair and facial hair to marking categories
* multiple changes
- humanoid visualizer system
- markings modifications for visualizer
- modifications to shared humanoid component
- lays out a base for humanoid system
* hidden layers, ports some properties from appearance component, shrinks DefaultMarkings a little
* squishes the initialize event calls into one function
adds stuff to set species/skin color externally from a server message - currently laid out as if it a dirty call to a networked component, may be subject to change (server-side has not been implemented yet)
* makes the sprite pipeline more obvious
* apply all markings, hidden layer set replacement
* ensures that markings are cleared when the new set is applied
* starts refactoring markingsset (unfinished)
* more additions to the markingset api
* adds constructor logic to markingset
* adds a method to filter out markings in a set based on a given species
* fixes enumerators in markingset
* adds validator into MarkingSet, fixes ForwardMarkingEnumerator
* modifications to the humanoid visual system
* ensuredefault in markingset
* oop
* fixes up data keys, populates OnAppearanceChange in visualizer
* changes to humanoid component, markings
marking equality is now more strict, humanoidcomponent is now implemented for client as a child of sharedhumanoidcomponent
* markings are now applied the visualizer by diffing them
* base sprites are now applied to humanoids from humanoidvisualizer
* passes along base sprite settings to the marking application so that markings know to follow skin color/alpha or not (see: slimes)
* custom base layers on humanoids
* merges all data keys into one data class for humanoid visualizers
* setappearance in sharedhumanoidsystem, removes custombaselayercolors
* humanoidcomponent, system (empty) in server
* adds some basic public API functions to HumanoidSystem
* add marking, remove marking
* changes appearance MarkingsSet to a List<Marking>, adds listener for PlayerSpawnCompleteEvent in HumanoidSystem
* ensuredefaultmarkings, oninit for humanoids
* markingmanager API changes
* removes MarkingsSet
* LoadProfile, adjusts randomization in humanoid appearance to account for species
* base layer settings in humanoidsystem, eye color from profile
* rearranges files to centralize under Humanoid namespace
* more reorganization, deletes some stuff
gotta break stuff to make other things work, right?
goodbye SpriteAccessory...
* fixes a good chunk of server-side issues
still does not compile, yet
* singlemarkingpicker xaml layout
* singlemarkingpicker logic
* magic mirror window (varying pieces of it, mostly client-oriented)
* removes some imports, gives MagicMirror a BUI class (not filled in yet)
* populates magic mirror BUI functionality / window callbacks
* fixes up some errors in humanoidprofileeditor
* changes to SingleMarkingPicker
SingleMarkingPicker now accepts a List<Marking>, species, and total possible markings available in that marking category
* fixes up hair pickers on humanoid profile editor
* fixes the errors in markingpicker
* markingsystem is now gone
* fixes a bunch of build errors
* so that's why i did it like that
* namespace issues, adds robustxamlloader to singlemarkingpicker
* another robustxamlloader
* human, lizard sprites/points
* prototype fixes, deletion of old spriteaccessory
* component registration, fixes dwarf skin toning
no, 'ReptilianToned' does not exist
* removes component registration from abstract humanoid component
* visualizer data now cloneable
* serialize for visualizer key
* zero-count edge case
* missing semi-colon moment
* setspecies in humanoidsystem
* ensures that default markings, if empty, will cause ensuredefault to skip over that given category
* tryadd instead of add
* whoops
* diff and apply should properly apply markings now
* always ensure default, fixes double load for player spawning
* apply skin color now sets the skin color property in humanoidcomponent
* removes sprite from a few species prototypes
* sprite changes for specific base layers based on humanoid sex
* layer ordering fix, and a missing base layer should now disallow markings on that layer
* anymarking base layer, adds the right leg/foot for humans
* loading a profile will now clear all markings on that humanoid
* adds missing layers for humans
* separates species.yml into respective species prototype files
* ensures that if layer visibility was changed, all markings have to be reapplied
* server-side enforcement of hiding hair (and other head-related markings) when equipping things that hide hair
* slime fix, clothingsystem now dictates layer visibility server side
* sussy
* layer settings should now ensure a marking should match the skin tone
* whoops
* skincolor static class and functions in UI
* skin color validation in humanoidcharacterappearance
* markingpicker now shows only the markings for the selected category in used
* getter for slot in singlemarkingpicker now ensures slot is 0 if markings exists
* FilterSpecies no longer attempts to do removal while iterating
* expands for SingleMarkingPicker
* humanoid base dummy has blank layers now (and snout/tail/headside/headtop)
* fixes an issue with visualizer system if the marking count was different but the markings themselves were (somewhat) the same
* whoops
* adds edge case handlers for count differences in humanoid markings
* preview now loads profile instead of directly setting appearance
* moves marking set loading to update controls
* clones a marking set in markingpicker by using the deep clone constructor
* whoops (deep cloning a marking now copies the marking id)
* adds replace function for markingset
* points should now update after the markings are remove/added
* merging base layer sprites into a humanoid should now clear them before merging
* sets dirty range start to count only if the dirty range start was never set above 0
* fixes up some issues with singlemarkingpicker
* color selector sliders in single marking picker should now expand
* hair from hair pickers should now apply in profile loading (client-side)
* category in singlemarkingpicker now sets the private category variable
* slot selector should now populate
* single marking picker buttons now have text, also shows the category name over all user-clickable elements
* removes a comment
* removing hair slots now sets it to bald, defaults to zero used slots if current hair is bald on hair/facial hair
* random skin color, eye color
* populate colors now checks if the marking count is greater than zero in singlemarkingpicker
* hair/facial hair pickers now just get the first possible hair from the respective species list
* different approach to random skin color
* oh, that's why it wasn't working
* randomize everything now just updates every single control
* selecting a new marking in SingleMarkingPicker should attempt to copy over old colors, populate list now uses cache,
* markingmanager now uses OnlyWhitelisted to populate by category and species
* filterspecies now uses onlyWhitelist to filter markings based on whitelist or not
* oops
* ui fix for singlemarkingpicker, ensures that cache is not null if it is null when populatelist is called
* order of operations for the horizontal expand for add/remove
* hair pickers should now update when you add/remove the hair slot
* fixes variable naming error in character appearance
* loc string fix in singlemarkingpicker
* lizards, vox now have onlyWhitelist, vox restriction for hair/facialhairs
* having zero possible hairs should no longer cause an exception in randomization
* setting species should now update hair pickers
* ignore categories for marking picker
* and a clear as well for the category button
* places that functionality in its own function instead
* adds eye base sprite, vox now also have their own custom eye sprites
* loading a profile client-side should do FilterSpecies for markings now
* client-side load profile does filter species after adding in the hairs now
* magic mirror
* callbacks now call the callback instead of adding it on construct
* whoops
* in removemarking too
* adds missing synchronize calls
* comments out an updateinterface call in magic mirror
* magic mirror window title, minimum sizing
* fixes minsize, adds warning for players who try to set their hair for species that have no hair
* removes spaces in xaml
* namespace changes/organization
* whoopsie (merge conflicts)
* re-enables identity from humanoid component
* damagevisuals now uses the enum given to it instead of the layerstate given on that layer tied to the enum
* removes commas from json
* changes to visuals system so the change is consistent
* chest
* reptilian
* visualizer system now handles body sprite setting/coloration, similar to how characterappearance did it
not a big fan of this
* adds a check in applybasesprites
* adding/removing parts should now make them invisible on a humanoid
* body part removal/adding now enumerates over sublayers instead
* synchro now runs in bodycomponent startup
* parts instead of slots
* humanoidcompnent check
* switches from rsi to actualrsi
* removes all the body stuff (too slow)
* cleans up resolves from humanoid visualizer system
* merging sprites now checks if the base sprites have been modified or not (through things like species changes, or custom base sprite changes)
* not forgetting that one again
* merging now returns an actual dirty value
* replaces the sequenceequal with a more accurate solution
* permanent layers, layer visibility on add/remove part in body
* should send all hidden layers over now
* isdirty in visualizer system for base layers
* isdirty checks count as well
* ok, IsDirty should now set the base layers if the merged sprites are different
* equals override in HumanoidSpritePrototypes.cs
temporary until record prototypes :heck:
* makes fields readonly, equates IDs instead
* adds forced markings through marking picker
* forced in humanoidsystem api, ignorespecies in markingpicker
* marking bui
* makes that serializable as well
* ignore species/forced toggles now work
* adds icon to modifier verb, interface and keys to humanoid bases
* needs the actual enum value to open, no?
* makes the key the actual key
* actions now propagate upwards
* ignore species when set now repopulates markingpicker
* modifiable base layers in the markings window
* oops!
* layout changes
* info box should now appear
* adds ignorespecies for marking picker, collapsible for base layer section of appearance modification window
* collapsible layout moment
* if base layers have changed, all markings are now dirty (and if a base layer is missing, the marking is still 'applied' but it's now just invisible
* small change to marking visibility
* small changes to modifier UI
* markings now match skin on zombification
* zombie stuff
* makes the line edit in marking modifier window more obvious
* disables vox on round start
* horizontal expand on the single label in base layer modifiers
* humanoid profiles in prototypes
* randomhumanoidappearance won't work if the humanoid has a profile already stored
* removes unused code
* documentation in humanoidsystem server-side
* documentation in shared/client
* whoops
* converts accessory into marking in locale files (also adds marking loc string into single marking picker)
* be gone, shared humanoid appearance system from the last upstream merge
* species ignore on randomization (defaults to no ignored species)
* more upstream merge parts that bypassed any errors before merge
* addresses review (also just adds typeserializers in some places)
* submodule moment
* upstream merge issues
2022-09-22 15:19:00 -07:00
|
|
|
};
|
2020-01-19 09:34:33 +01:00
|
|
|
|
2024-05-12 09:18:21 +10:00
|
|
|
HairStylePicker.OnColorChanged += newColor =>
|
2021-03-07 20:48:24 +01:00
|
|
|
{
|
|
|
|
|
if (Profile is null)
|
|
|
|
|
return;
|
|
|
|
|
Profile = Profile.WithCharacterAppearance(
|
Humanoid appearance refactor (#10882)
* initial commit
- species prototype modifications
- markings points as its own file
- shared humanoid component
* adds a tool to convert sprite accessories to markings (in go)
* removes a fmt call
* converts sprite accessory to markings
* adds hair and facial hair to marking categories
* multiple changes
- humanoid visualizer system
- markings modifications for visualizer
- modifications to shared humanoid component
- lays out a base for humanoid system
* hidden layers, ports some properties from appearance component, shrinks DefaultMarkings a little
* squishes the initialize event calls into one function
adds stuff to set species/skin color externally from a server message - currently laid out as if it a dirty call to a networked component, may be subject to change (server-side has not been implemented yet)
* makes the sprite pipeline more obvious
* apply all markings, hidden layer set replacement
* ensures that markings are cleared when the new set is applied
* starts refactoring markingsset (unfinished)
* more additions to the markingset api
* adds constructor logic to markingset
* adds a method to filter out markings in a set based on a given species
* fixes enumerators in markingset
* adds validator into MarkingSet, fixes ForwardMarkingEnumerator
* modifications to the humanoid visual system
* ensuredefault in markingset
* oop
* fixes up data keys, populates OnAppearanceChange in visualizer
* changes to humanoid component, markings
marking equality is now more strict, humanoidcomponent is now implemented for client as a child of sharedhumanoidcomponent
* markings are now applied the visualizer by diffing them
* base sprites are now applied to humanoids from humanoidvisualizer
* passes along base sprite settings to the marking application so that markings know to follow skin color/alpha or not (see: slimes)
* custom base layers on humanoids
* merges all data keys into one data class for humanoid visualizers
* setappearance in sharedhumanoidsystem, removes custombaselayercolors
* humanoidcomponent, system (empty) in server
* adds some basic public API functions to HumanoidSystem
* add marking, remove marking
* changes appearance MarkingsSet to a List<Marking>, adds listener for PlayerSpawnCompleteEvent in HumanoidSystem
* ensuredefaultmarkings, oninit for humanoids
* markingmanager API changes
* removes MarkingsSet
* LoadProfile, adjusts randomization in humanoid appearance to account for species
* base layer settings in humanoidsystem, eye color from profile
* rearranges files to centralize under Humanoid namespace
* more reorganization, deletes some stuff
gotta break stuff to make other things work, right?
goodbye SpriteAccessory...
* fixes a good chunk of server-side issues
still does not compile, yet
* singlemarkingpicker xaml layout
* singlemarkingpicker logic
* magic mirror window (varying pieces of it, mostly client-oriented)
* removes some imports, gives MagicMirror a BUI class (not filled in yet)
* populates magic mirror BUI functionality / window callbacks
* fixes up some errors in humanoidprofileeditor
* changes to SingleMarkingPicker
SingleMarkingPicker now accepts a List<Marking>, species, and total possible markings available in that marking category
* fixes up hair pickers on humanoid profile editor
* fixes the errors in markingpicker
* markingsystem is now gone
* fixes a bunch of build errors
* so that's why i did it like that
* namespace issues, adds robustxamlloader to singlemarkingpicker
* another robustxamlloader
* human, lizard sprites/points
* prototype fixes, deletion of old spriteaccessory
* component registration, fixes dwarf skin toning
no, 'ReptilianToned' does not exist
* removes component registration from abstract humanoid component
* visualizer data now cloneable
* serialize for visualizer key
* zero-count edge case
* missing semi-colon moment
* setspecies in humanoidsystem
* ensures that default markings, if empty, will cause ensuredefault to skip over that given category
* tryadd instead of add
* whoops
* diff and apply should properly apply markings now
* always ensure default, fixes double load for player spawning
* apply skin color now sets the skin color property in humanoidcomponent
* removes sprite from a few species prototypes
* sprite changes for specific base layers based on humanoid sex
* layer ordering fix, and a missing base layer should now disallow markings on that layer
* anymarking base layer, adds the right leg/foot for humans
* loading a profile will now clear all markings on that humanoid
* adds missing layers for humans
* separates species.yml into respective species prototype files
* ensures that if layer visibility was changed, all markings have to be reapplied
* server-side enforcement of hiding hair (and other head-related markings) when equipping things that hide hair
* slime fix, clothingsystem now dictates layer visibility server side
* sussy
* layer settings should now ensure a marking should match the skin tone
* whoops
* skincolor static class and functions in UI
* skin color validation in humanoidcharacterappearance
* markingpicker now shows only the markings for the selected category in used
* getter for slot in singlemarkingpicker now ensures slot is 0 if markings exists
* FilterSpecies no longer attempts to do removal while iterating
* expands for SingleMarkingPicker
* humanoid base dummy has blank layers now (and snout/tail/headside/headtop)
* fixes an issue with visualizer system if the marking count was different but the markings themselves were (somewhat) the same
* whoops
* adds edge case handlers for count differences in humanoid markings
* preview now loads profile instead of directly setting appearance
* moves marking set loading to update controls
* clones a marking set in markingpicker by using the deep clone constructor
* whoops (deep cloning a marking now copies the marking id)
* adds replace function for markingset
* points should now update after the markings are remove/added
* merging base layer sprites into a humanoid should now clear them before merging
* sets dirty range start to count only if the dirty range start was never set above 0
* fixes up some issues with singlemarkingpicker
* color selector sliders in single marking picker should now expand
* hair from hair pickers should now apply in profile loading (client-side)
* category in singlemarkingpicker now sets the private category variable
* slot selector should now populate
* single marking picker buttons now have text, also shows the category name over all user-clickable elements
* removes a comment
* removing hair slots now sets it to bald, defaults to zero used slots if current hair is bald on hair/facial hair
* random skin color, eye color
* populate colors now checks if the marking count is greater than zero in singlemarkingpicker
* hair/facial hair pickers now just get the first possible hair from the respective species list
* different approach to random skin color
* oh, that's why it wasn't working
* randomize everything now just updates every single control
* selecting a new marking in SingleMarkingPicker should attempt to copy over old colors, populate list now uses cache,
* markingmanager now uses OnlyWhitelisted to populate by category and species
* filterspecies now uses onlyWhitelist to filter markings based on whitelist or not
* oops
* ui fix for singlemarkingpicker, ensures that cache is not null if it is null when populatelist is called
* order of operations for the horizontal expand for add/remove
* hair pickers should now update when you add/remove the hair slot
* fixes variable naming error in character appearance
* loc string fix in singlemarkingpicker
* lizards, vox now have onlyWhitelist, vox restriction for hair/facialhairs
* having zero possible hairs should no longer cause an exception in randomization
* setting species should now update hair pickers
* ignore categories for marking picker
* and a clear as well for the category button
* places that functionality in its own function instead
* adds eye base sprite, vox now also have their own custom eye sprites
* loading a profile client-side should do FilterSpecies for markings now
* client-side load profile does filter species after adding in the hairs now
* magic mirror
* callbacks now call the callback instead of adding it on construct
* whoops
* in removemarking too
* adds missing synchronize calls
* comments out an updateinterface call in magic mirror
* magic mirror window title, minimum sizing
* fixes minsize, adds warning for players who try to set their hair for species that have no hair
* removes spaces in xaml
* namespace changes/organization
* whoopsie (merge conflicts)
* re-enables identity from humanoid component
* damagevisuals now uses the enum given to it instead of the layerstate given on that layer tied to the enum
* removes commas from json
* changes to visuals system so the change is consistent
* chest
* reptilian
* visualizer system now handles body sprite setting/coloration, similar to how characterappearance did it
not a big fan of this
* adds a check in applybasesprites
* adding/removing parts should now make them invisible on a humanoid
* body part removal/adding now enumerates over sublayers instead
* synchro now runs in bodycomponent startup
* parts instead of slots
* humanoidcompnent check
* switches from rsi to actualrsi
* removes all the body stuff (too slow)
* cleans up resolves from humanoid visualizer system
* merging sprites now checks if the base sprites have been modified or not (through things like species changes, or custom base sprite changes)
* not forgetting that one again
* merging now returns an actual dirty value
* replaces the sequenceequal with a more accurate solution
* permanent layers, layer visibility on add/remove part in body
* should send all hidden layers over now
* isdirty in visualizer system for base layers
* isdirty checks count as well
* ok, IsDirty should now set the base layers if the merged sprites are different
* equals override in HumanoidSpritePrototypes.cs
temporary until record prototypes :heck:
* makes fields readonly, equates IDs instead
* adds forced markings through marking picker
* forced in humanoidsystem api, ignorespecies in markingpicker
* marking bui
* makes that serializable as well
* ignore species/forced toggles now work
* adds icon to modifier verb, interface and keys to humanoid bases
* needs the actual enum value to open, no?
* makes the key the actual key
* actions now propagate upwards
* ignore species when set now repopulates markingpicker
* modifiable base layers in the markings window
* oops!
* layout changes
* info box should now appear
* adds ignorespecies for marking picker, collapsible for base layer section of appearance modification window
* collapsible layout moment
* if base layers have changed, all markings are now dirty (and if a base layer is missing, the marking is still 'applied' but it's now just invisible
* small change to marking visibility
* small changes to modifier UI
* markings now match skin on zombification
* zombie stuff
* makes the line edit in marking modifier window more obvious
* disables vox on round start
* horizontal expand on the single label in base layer modifiers
* humanoid profiles in prototypes
* randomhumanoidappearance won't work if the humanoid has a profile already stored
* removes unused code
* documentation in humanoidsystem server-side
* documentation in shared/client
* whoops
* converts accessory into marking in locale files (also adds marking loc string into single marking picker)
* be gone, shared humanoid appearance system from the last upstream merge
* species ignore on randomization (defaults to no ignored species)
* more upstream merge parts that bypassed any errors before merge
* addresses review (also just adds typeserializers in some places)
* submodule moment
* upstream merge issues
2022-09-22 15:19:00 -07:00
|
|
|
Profile.Appearance.WithHairColor(newColor.marking.MarkingColors[0]));
|
2023-03-05 08:59:07 +06:00
|
|
|
UpdateCMarkingsHair();
|
2024-05-12 09:18:21 +10:00
|
|
|
ReloadPreview();
|
2021-03-07 20:48:24 +01:00
|
|
|
};
|
2020-01-19 09:34:33 +01:00
|
|
|
|
2024-05-12 09:18:21 +10:00
|
|
|
FacialHairPicker.OnMarkingSelect += newStyle =>
|
2021-03-07 20:48:24 +01:00
|
|
|
{
|
|
|
|
|
if (Profile is null)
|
|
|
|
|
return;
|
|
|
|
|
Profile = Profile.WithCharacterAppearance(
|
Humanoid appearance refactor (#10882)
* initial commit
- species prototype modifications
- markings points as its own file
- shared humanoid component
* adds a tool to convert sprite accessories to markings (in go)
* removes a fmt call
* converts sprite accessory to markings
* adds hair and facial hair to marking categories
* multiple changes
- humanoid visualizer system
- markings modifications for visualizer
- modifications to shared humanoid component
- lays out a base for humanoid system
* hidden layers, ports some properties from appearance component, shrinks DefaultMarkings a little
* squishes the initialize event calls into one function
adds stuff to set species/skin color externally from a server message - currently laid out as if it a dirty call to a networked component, may be subject to change (server-side has not been implemented yet)
* makes the sprite pipeline more obvious
* apply all markings, hidden layer set replacement
* ensures that markings are cleared when the new set is applied
* starts refactoring markingsset (unfinished)
* more additions to the markingset api
* adds constructor logic to markingset
* adds a method to filter out markings in a set based on a given species
* fixes enumerators in markingset
* adds validator into MarkingSet, fixes ForwardMarkingEnumerator
* modifications to the humanoid visual system
* ensuredefault in markingset
* oop
* fixes up data keys, populates OnAppearanceChange in visualizer
* changes to humanoid component, markings
marking equality is now more strict, humanoidcomponent is now implemented for client as a child of sharedhumanoidcomponent
* markings are now applied the visualizer by diffing them
* base sprites are now applied to humanoids from humanoidvisualizer
* passes along base sprite settings to the marking application so that markings know to follow skin color/alpha or not (see: slimes)
* custom base layers on humanoids
* merges all data keys into one data class for humanoid visualizers
* setappearance in sharedhumanoidsystem, removes custombaselayercolors
* humanoidcomponent, system (empty) in server
* adds some basic public API functions to HumanoidSystem
* add marking, remove marking
* changes appearance MarkingsSet to a List<Marking>, adds listener for PlayerSpawnCompleteEvent in HumanoidSystem
* ensuredefaultmarkings, oninit for humanoids
* markingmanager API changes
* removes MarkingsSet
* LoadProfile, adjusts randomization in humanoid appearance to account for species
* base layer settings in humanoidsystem, eye color from profile
* rearranges files to centralize under Humanoid namespace
* more reorganization, deletes some stuff
gotta break stuff to make other things work, right?
goodbye SpriteAccessory...
* fixes a good chunk of server-side issues
still does not compile, yet
* singlemarkingpicker xaml layout
* singlemarkingpicker logic
* magic mirror window (varying pieces of it, mostly client-oriented)
* removes some imports, gives MagicMirror a BUI class (not filled in yet)
* populates magic mirror BUI functionality / window callbacks
* fixes up some errors in humanoidprofileeditor
* changes to SingleMarkingPicker
SingleMarkingPicker now accepts a List<Marking>, species, and total possible markings available in that marking category
* fixes up hair pickers on humanoid profile editor
* fixes the errors in markingpicker
* markingsystem is now gone
* fixes a bunch of build errors
* so that's why i did it like that
* namespace issues, adds robustxamlloader to singlemarkingpicker
* another robustxamlloader
* human, lizard sprites/points
* prototype fixes, deletion of old spriteaccessory
* component registration, fixes dwarf skin toning
no, 'ReptilianToned' does not exist
* removes component registration from abstract humanoid component
* visualizer data now cloneable
* serialize for visualizer key
* zero-count edge case
* missing semi-colon moment
* setspecies in humanoidsystem
* ensures that default markings, if empty, will cause ensuredefault to skip over that given category
* tryadd instead of add
* whoops
* diff and apply should properly apply markings now
* always ensure default, fixes double load for player spawning
* apply skin color now sets the skin color property in humanoidcomponent
* removes sprite from a few species prototypes
* sprite changes for specific base layers based on humanoid sex
* layer ordering fix, and a missing base layer should now disallow markings on that layer
* anymarking base layer, adds the right leg/foot for humans
* loading a profile will now clear all markings on that humanoid
* adds missing layers for humans
* separates species.yml into respective species prototype files
* ensures that if layer visibility was changed, all markings have to be reapplied
* server-side enforcement of hiding hair (and other head-related markings) when equipping things that hide hair
* slime fix, clothingsystem now dictates layer visibility server side
* sussy
* layer settings should now ensure a marking should match the skin tone
* whoops
* skincolor static class and functions in UI
* skin color validation in humanoidcharacterappearance
* markingpicker now shows only the markings for the selected category in used
* getter for slot in singlemarkingpicker now ensures slot is 0 if markings exists
* FilterSpecies no longer attempts to do removal while iterating
* expands for SingleMarkingPicker
* humanoid base dummy has blank layers now (and snout/tail/headside/headtop)
* fixes an issue with visualizer system if the marking count was different but the markings themselves were (somewhat) the same
* whoops
* adds edge case handlers for count differences in humanoid markings
* preview now loads profile instead of directly setting appearance
* moves marking set loading to update controls
* clones a marking set in markingpicker by using the deep clone constructor
* whoops (deep cloning a marking now copies the marking id)
* adds replace function for markingset
* points should now update after the markings are remove/added
* merging base layer sprites into a humanoid should now clear them before merging
* sets dirty range start to count only if the dirty range start was never set above 0
* fixes up some issues with singlemarkingpicker
* color selector sliders in single marking picker should now expand
* hair from hair pickers should now apply in profile loading (client-side)
* category in singlemarkingpicker now sets the private category variable
* slot selector should now populate
* single marking picker buttons now have text, also shows the category name over all user-clickable elements
* removes a comment
* removing hair slots now sets it to bald, defaults to zero used slots if current hair is bald on hair/facial hair
* random skin color, eye color
* populate colors now checks if the marking count is greater than zero in singlemarkingpicker
* hair/facial hair pickers now just get the first possible hair from the respective species list
* different approach to random skin color
* oh, that's why it wasn't working
* randomize everything now just updates every single control
* selecting a new marking in SingleMarkingPicker should attempt to copy over old colors, populate list now uses cache,
* markingmanager now uses OnlyWhitelisted to populate by category and species
* filterspecies now uses onlyWhitelist to filter markings based on whitelist or not
* oops
* ui fix for singlemarkingpicker, ensures that cache is not null if it is null when populatelist is called
* order of operations for the horizontal expand for add/remove
* hair pickers should now update when you add/remove the hair slot
* fixes variable naming error in character appearance
* loc string fix in singlemarkingpicker
* lizards, vox now have onlyWhitelist, vox restriction for hair/facialhairs
* having zero possible hairs should no longer cause an exception in randomization
* setting species should now update hair pickers
* ignore categories for marking picker
* and a clear as well for the category button
* places that functionality in its own function instead
* adds eye base sprite, vox now also have their own custom eye sprites
* loading a profile client-side should do FilterSpecies for markings now
* client-side load profile does filter species after adding in the hairs now
* magic mirror
* callbacks now call the callback instead of adding it on construct
* whoops
* in removemarking too
* adds missing synchronize calls
* comments out an updateinterface call in magic mirror
* magic mirror window title, minimum sizing
* fixes minsize, adds warning for players who try to set their hair for species that have no hair
* removes spaces in xaml
* namespace changes/organization
* whoopsie (merge conflicts)
* re-enables identity from humanoid component
* damagevisuals now uses the enum given to it instead of the layerstate given on that layer tied to the enum
* removes commas from json
* changes to visuals system so the change is consistent
* chest
* reptilian
* visualizer system now handles body sprite setting/coloration, similar to how characterappearance did it
not a big fan of this
* adds a check in applybasesprites
* adding/removing parts should now make them invisible on a humanoid
* body part removal/adding now enumerates over sublayers instead
* synchro now runs in bodycomponent startup
* parts instead of slots
* humanoidcompnent check
* switches from rsi to actualrsi
* removes all the body stuff (too slow)
* cleans up resolves from humanoid visualizer system
* merging sprites now checks if the base sprites have been modified or not (through things like species changes, or custom base sprite changes)
* not forgetting that one again
* merging now returns an actual dirty value
* replaces the sequenceequal with a more accurate solution
* permanent layers, layer visibility on add/remove part in body
* should send all hidden layers over now
* isdirty in visualizer system for base layers
* isdirty checks count as well
* ok, IsDirty should now set the base layers if the merged sprites are different
* equals override in HumanoidSpritePrototypes.cs
temporary until record prototypes :heck:
* makes fields readonly, equates IDs instead
* adds forced markings through marking picker
* forced in humanoidsystem api, ignorespecies in markingpicker
* marking bui
* makes that serializable as well
* ignore species/forced toggles now work
* adds icon to modifier verb, interface and keys to humanoid bases
* needs the actual enum value to open, no?
* makes the key the actual key
* actions now propagate upwards
* ignore species when set now repopulates markingpicker
* modifiable base layers in the markings window
* oops!
* layout changes
* info box should now appear
* adds ignorespecies for marking picker, collapsible for base layer section of appearance modification window
* collapsible layout moment
* if base layers have changed, all markings are now dirty (and if a base layer is missing, the marking is still 'applied' but it's now just invisible
* small change to marking visibility
* small changes to modifier UI
* markings now match skin on zombification
* zombie stuff
* makes the line edit in marking modifier window more obvious
* disables vox on round start
* horizontal expand on the single label in base layer modifiers
* humanoid profiles in prototypes
* randomhumanoidappearance won't work if the humanoid has a profile already stored
* removes unused code
* documentation in humanoidsystem server-side
* documentation in shared/client
* whoops
* converts accessory into marking in locale files (also adds marking loc string into single marking picker)
* be gone, shared humanoid appearance system from the last upstream merge
* species ignore on randomization (defaults to no ignored species)
* more upstream merge parts that bypassed any errors before merge
* addresses review (also just adds typeserializers in some places)
* submodule moment
* upstream merge issues
2022-09-22 15:19:00 -07:00
|
|
|
Profile.Appearance.WithFacialHairStyleName(newStyle.id));
|
2024-05-12 09:18:21 +10:00
|
|
|
ReloadPreview();
|
2021-03-07 20:48:24 +01:00
|
|
|
};
|
2020-01-19 09:34:33 +01:00
|
|
|
|
2024-05-12 09:18:21 +10:00
|
|
|
FacialHairPicker.OnColorChanged += newColor =>
|
Humanoid appearance refactor (#10882)
* initial commit
- species prototype modifications
- markings points as its own file
- shared humanoid component
* adds a tool to convert sprite accessories to markings (in go)
* removes a fmt call
* converts sprite accessory to markings
* adds hair and facial hair to marking categories
* multiple changes
- humanoid visualizer system
- markings modifications for visualizer
- modifications to shared humanoid component
- lays out a base for humanoid system
* hidden layers, ports some properties from appearance component, shrinks DefaultMarkings a little
* squishes the initialize event calls into one function
adds stuff to set species/skin color externally from a server message - currently laid out as if it a dirty call to a networked component, may be subject to change (server-side has not been implemented yet)
* makes the sprite pipeline more obvious
* apply all markings, hidden layer set replacement
* ensures that markings are cleared when the new set is applied
* starts refactoring markingsset (unfinished)
* more additions to the markingset api
* adds constructor logic to markingset
* adds a method to filter out markings in a set based on a given species
* fixes enumerators in markingset
* adds validator into MarkingSet, fixes ForwardMarkingEnumerator
* modifications to the humanoid visual system
* ensuredefault in markingset
* oop
* fixes up data keys, populates OnAppearanceChange in visualizer
* changes to humanoid component, markings
marking equality is now more strict, humanoidcomponent is now implemented for client as a child of sharedhumanoidcomponent
* markings are now applied the visualizer by diffing them
* base sprites are now applied to humanoids from humanoidvisualizer
* passes along base sprite settings to the marking application so that markings know to follow skin color/alpha or not (see: slimes)
* custom base layers on humanoids
* merges all data keys into one data class for humanoid visualizers
* setappearance in sharedhumanoidsystem, removes custombaselayercolors
* humanoidcomponent, system (empty) in server
* adds some basic public API functions to HumanoidSystem
* add marking, remove marking
* changes appearance MarkingsSet to a List<Marking>, adds listener for PlayerSpawnCompleteEvent in HumanoidSystem
* ensuredefaultmarkings, oninit for humanoids
* markingmanager API changes
* removes MarkingsSet
* LoadProfile, adjusts randomization in humanoid appearance to account for species
* base layer settings in humanoidsystem, eye color from profile
* rearranges files to centralize under Humanoid namespace
* more reorganization, deletes some stuff
gotta break stuff to make other things work, right?
goodbye SpriteAccessory...
* fixes a good chunk of server-side issues
still does not compile, yet
* singlemarkingpicker xaml layout
* singlemarkingpicker logic
* magic mirror window (varying pieces of it, mostly client-oriented)
* removes some imports, gives MagicMirror a BUI class (not filled in yet)
* populates magic mirror BUI functionality / window callbacks
* fixes up some errors in humanoidprofileeditor
* changes to SingleMarkingPicker
SingleMarkingPicker now accepts a List<Marking>, species, and total possible markings available in that marking category
* fixes up hair pickers on humanoid profile editor
* fixes the errors in markingpicker
* markingsystem is now gone
* fixes a bunch of build errors
* so that's why i did it like that
* namespace issues, adds robustxamlloader to singlemarkingpicker
* another robustxamlloader
* human, lizard sprites/points
* prototype fixes, deletion of old spriteaccessory
* component registration, fixes dwarf skin toning
no, 'ReptilianToned' does not exist
* removes component registration from abstract humanoid component
* visualizer data now cloneable
* serialize for visualizer key
* zero-count edge case
* missing semi-colon moment
* setspecies in humanoidsystem
* ensures that default markings, if empty, will cause ensuredefault to skip over that given category
* tryadd instead of add
* whoops
* diff and apply should properly apply markings now
* always ensure default, fixes double load for player spawning
* apply skin color now sets the skin color property in humanoidcomponent
* removes sprite from a few species prototypes
* sprite changes for specific base layers based on humanoid sex
* layer ordering fix, and a missing base layer should now disallow markings on that layer
* anymarking base layer, adds the right leg/foot for humans
* loading a profile will now clear all markings on that humanoid
* adds missing layers for humans
* separates species.yml into respective species prototype files
* ensures that if layer visibility was changed, all markings have to be reapplied
* server-side enforcement of hiding hair (and other head-related markings) when equipping things that hide hair
* slime fix, clothingsystem now dictates layer visibility server side
* sussy
* layer settings should now ensure a marking should match the skin tone
* whoops
* skincolor static class and functions in UI
* skin color validation in humanoidcharacterappearance
* markingpicker now shows only the markings for the selected category in used
* getter for slot in singlemarkingpicker now ensures slot is 0 if markings exists
* FilterSpecies no longer attempts to do removal while iterating
* expands for SingleMarkingPicker
* humanoid base dummy has blank layers now (and snout/tail/headside/headtop)
* fixes an issue with visualizer system if the marking count was different but the markings themselves were (somewhat) the same
* whoops
* adds edge case handlers for count differences in humanoid markings
* preview now loads profile instead of directly setting appearance
* moves marking set loading to update controls
* clones a marking set in markingpicker by using the deep clone constructor
* whoops (deep cloning a marking now copies the marking id)
* adds replace function for markingset
* points should now update after the markings are remove/added
* merging base layer sprites into a humanoid should now clear them before merging
* sets dirty range start to count only if the dirty range start was never set above 0
* fixes up some issues with singlemarkingpicker
* color selector sliders in single marking picker should now expand
* hair from hair pickers should now apply in profile loading (client-side)
* category in singlemarkingpicker now sets the private category variable
* slot selector should now populate
* single marking picker buttons now have text, also shows the category name over all user-clickable elements
* removes a comment
* removing hair slots now sets it to bald, defaults to zero used slots if current hair is bald on hair/facial hair
* random skin color, eye color
* populate colors now checks if the marking count is greater than zero in singlemarkingpicker
* hair/facial hair pickers now just get the first possible hair from the respective species list
* different approach to random skin color
* oh, that's why it wasn't working
* randomize everything now just updates every single control
* selecting a new marking in SingleMarkingPicker should attempt to copy over old colors, populate list now uses cache,
* markingmanager now uses OnlyWhitelisted to populate by category and species
* filterspecies now uses onlyWhitelist to filter markings based on whitelist or not
* oops
* ui fix for singlemarkingpicker, ensures that cache is not null if it is null when populatelist is called
* order of operations for the horizontal expand for add/remove
* hair pickers should now update when you add/remove the hair slot
* fixes variable naming error in character appearance
* loc string fix in singlemarkingpicker
* lizards, vox now have onlyWhitelist, vox restriction for hair/facialhairs
* having zero possible hairs should no longer cause an exception in randomization
* setting species should now update hair pickers
* ignore categories for marking picker
* and a clear as well for the category button
* places that functionality in its own function instead
* adds eye base sprite, vox now also have their own custom eye sprites
* loading a profile client-side should do FilterSpecies for markings now
* client-side load profile does filter species after adding in the hairs now
* magic mirror
* callbacks now call the callback instead of adding it on construct
* whoops
* in removemarking too
* adds missing synchronize calls
* comments out an updateinterface call in magic mirror
* magic mirror window title, minimum sizing
* fixes minsize, adds warning for players who try to set their hair for species that have no hair
* removes spaces in xaml
* namespace changes/organization
* whoopsie (merge conflicts)
* re-enables identity from humanoid component
* damagevisuals now uses the enum given to it instead of the layerstate given on that layer tied to the enum
* removes commas from json
* changes to visuals system so the change is consistent
* chest
* reptilian
* visualizer system now handles body sprite setting/coloration, similar to how characterappearance did it
not a big fan of this
* adds a check in applybasesprites
* adding/removing parts should now make them invisible on a humanoid
* body part removal/adding now enumerates over sublayers instead
* synchro now runs in bodycomponent startup
* parts instead of slots
* humanoidcompnent check
* switches from rsi to actualrsi
* removes all the body stuff (too slow)
* cleans up resolves from humanoid visualizer system
* merging sprites now checks if the base sprites have been modified or not (through things like species changes, or custom base sprite changes)
* not forgetting that one again
* merging now returns an actual dirty value
* replaces the sequenceequal with a more accurate solution
* permanent layers, layer visibility on add/remove part in body
* should send all hidden layers over now
* isdirty in visualizer system for base layers
* isdirty checks count as well
* ok, IsDirty should now set the base layers if the merged sprites are different
* equals override in HumanoidSpritePrototypes.cs
temporary until record prototypes :heck:
* makes fields readonly, equates IDs instead
* adds forced markings through marking picker
* forced in humanoidsystem api, ignorespecies in markingpicker
* marking bui
* makes that serializable as well
* ignore species/forced toggles now work
* adds icon to modifier verb, interface and keys to humanoid bases
* needs the actual enum value to open, no?
* makes the key the actual key
* actions now propagate upwards
* ignore species when set now repopulates markingpicker
* modifiable base layers in the markings window
* oops!
* layout changes
* info box should now appear
* adds ignorespecies for marking picker, collapsible for base layer section of appearance modification window
* collapsible layout moment
* if base layers have changed, all markings are now dirty (and if a base layer is missing, the marking is still 'applied' but it's now just invisible
* small change to marking visibility
* small changes to modifier UI
* markings now match skin on zombification
* zombie stuff
* makes the line edit in marking modifier window more obvious
* disables vox on round start
* horizontal expand on the single label in base layer modifiers
* humanoid profiles in prototypes
* randomhumanoidappearance won't work if the humanoid has a profile already stored
* removes unused code
* documentation in humanoidsystem server-side
* documentation in shared/client
* whoops
* converts accessory into marking in locale files (also adds marking loc string into single marking picker)
* be gone, shared humanoid appearance system from the last upstream merge
* species ignore on randomization (defaults to no ignored species)
* more upstream merge parts that bypassed any errors before merge
* addresses review (also just adds typeserializers in some places)
* submodule moment
* upstream merge issues
2022-09-22 15:19:00 -07:00
|
|
|
{
|
|
|
|
|
if (Profile is null)
|
|
|
|
|
return;
|
|
|
|
|
Profile = Profile.WithCharacterAppearance(
|
|
|
|
|
Profile.Appearance.WithFacialHairColor(newColor.marking.MarkingColors[0]));
|
2023-03-05 08:59:07 +06:00
|
|
|
UpdateCMarkingsFacialHair();
|
2024-05-12 09:18:21 +10:00
|
|
|
ReloadPreview();
|
Humanoid appearance refactor (#10882)
* initial commit
- species prototype modifications
- markings points as its own file
- shared humanoid component
* adds a tool to convert sprite accessories to markings (in go)
* removes a fmt call
* converts sprite accessory to markings
* adds hair and facial hair to marking categories
* multiple changes
- humanoid visualizer system
- markings modifications for visualizer
- modifications to shared humanoid component
- lays out a base for humanoid system
* hidden layers, ports some properties from appearance component, shrinks DefaultMarkings a little
* squishes the initialize event calls into one function
adds stuff to set species/skin color externally from a server message - currently laid out as if it a dirty call to a networked component, may be subject to change (server-side has not been implemented yet)
* makes the sprite pipeline more obvious
* apply all markings, hidden layer set replacement
* ensures that markings are cleared when the new set is applied
* starts refactoring markingsset (unfinished)
* more additions to the markingset api
* adds constructor logic to markingset
* adds a method to filter out markings in a set based on a given species
* fixes enumerators in markingset
* adds validator into MarkingSet, fixes ForwardMarkingEnumerator
* modifications to the humanoid visual system
* ensuredefault in markingset
* oop
* fixes up data keys, populates OnAppearanceChange in visualizer
* changes to humanoid component, markings
marking equality is now more strict, humanoidcomponent is now implemented for client as a child of sharedhumanoidcomponent
* markings are now applied the visualizer by diffing them
* base sprites are now applied to humanoids from humanoidvisualizer
* passes along base sprite settings to the marking application so that markings know to follow skin color/alpha or not (see: slimes)
* custom base layers on humanoids
* merges all data keys into one data class for humanoid visualizers
* setappearance in sharedhumanoidsystem, removes custombaselayercolors
* humanoidcomponent, system (empty) in server
* adds some basic public API functions to HumanoidSystem
* add marking, remove marking
* changes appearance MarkingsSet to a List<Marking>, adds listener for PlayerSpawnCompleteEvent in HumanoidSystem
* ensuredefaultmarkings, oninit for humanoids
* markingmanager API changes
* removes MarkingsSet
* LoadProfile, adjusts randomization in humanoid appearance to account for species
* base layer settings in humanoidsystem, eye color from profile
* rearranges files to centralize under Humanoid namespace
* more reorganization, deletes some stuff
gotta break stuff to make other things work, right?
goodbye SpriteAccessory...
* fixes a good chunk of server-side issues
still does not compile, yet
* singlemarkingpicker xaml layout
* singlemarkingpicker logic
* magic mirror window (varying pieces of it, mostly client-oriented)
* removes some imports, gives MagicMirror a BUI class (not filled in yet)
* populates magic mirror BUI functionality / window callbacks
* fixes up some errors in humanoidprofileeditor
* changes to SingleMarkingPicker
SingleMarkingPicker now accepts a List<Marking>, species, and total possible markings available in that marking category
* fixes up hair pickers on humanoid profile editor
* fixes the errors in markingpicker
* markingsystem is now gone
* fixes a bunch of build errors
* so that's why i did it like that
* namespace issues, adds robustxamlloader to singlemarkingpicker
* another robustxamlloader
* human, lizard sprites/points
* prototype fixes, deletion of old spriteaccessory
* component registration, fixes dwarf skin toning
no, 'ReptilianToned' does not exist
* removes component registration from abstract humanoid component
* visualizer data now cloneable
* serialize for visualizer key
* zero-count edge case
* missing semi-colon moment
* setspecies in humanoidsystem
* ensures that default markings, if empty, will cause ensuredefault to skip over that given category
* tryadd instead of add
* whoops
* diff and apply should properly apply markings now
* always ensure default, fixes double load for player spawning
* apply skin color now sets the skin color property in humanoidcomponent
* removes sprite from a few species prototypes
* sprite changes for specific base layers based on humanoid sex
* layer ordering fix, and a missing base layer should now disallow markings on that layer
* anymarking base layer, adds the right leg/foot for humans
* loading a profile will now clear all markings on that humanoid
* adds missing layers for humans
* separates species.yml into respective species prototype files
* ensures that if layer visibility was changed, all markings have to be reapplied
* server-side enforcement of hiding hair (and other head-related markings) when equipping things that hide hair
* slime fix, clothingsystem now dictates layer visibility server side
* sussy
* layer settings should now ensure a marking should match the skin tone
* whoops
* skincolor static class and functions in UI
* skin color validation in humanoidcharacterappearance
* markingpicker now shows only the markings for the selected category in used
* getter for slot in singlemarkingpicker now ensures slot is 0 if markings exists
* FilterSpecies no longer attempts to do removal while iterating
* expands for SingleMarkingPicker
* humanoid base dummy has blank layers now (and snout/tail/headside/headtop)
* fixes an issue with visualizer system if the marking count was different but the markings themselves were (somewhat) the same
* whoops
* adds edge case handlers for count differences in humanoid markings
* preview now loads profile instead of directly setting appearance
* moves marking set loading to update controls
* clones a marking set in markingpicker by using the deep clone constructor
* whoops (deep cloning a marking now copies the marking id)
* adds replace function for markingset
* points should now update after the markings are remove/added
* merging base layer sprites into a humanoid should now clear them before merging
* sets dirty range start to count only if the dirty range start was never set above 0
* fixes up some issues with singlemarkingpicker
* color selector sliders in single marking picker should now expand
* hair from hair pickers should now apply in profile loading (client-side)
* category in singlemarkingpicker now sets the private category variable
* slot selector should now populate
* single marking picker buttons now have text, also shows the category name over all user-clickable elements
* removes a comment
* removing hair slots now sets it to bald, defaults to zero used slots if current hair is bald on hair/facial hair
* random skin color, eye color
* populate colors now checks if the marking count is greater than zero in singlemarkingpicker
* hair/facial hair pickers now just get the first possible hair from the respective species list
* different approach to random skin color
* oh, that's why it wasn't working
* randomize everything now just updates every single control
* selecting a new marking in SingleMarkingPicker should attempt to copy over old colors, populate list now uses cache,
* markingmanager now uses OnlyWhitelisted to populate by category and species
* filterspecies now uses onlyWhitelist to filter markings based on whitelist or not
* oops
* ui fix for singlemarkingpicker, ensures that cache is not null if it is null when populatelist is called
* order of operations for the horizontal expand for add/remove
* hair pickers should now update when you add/remove the hair slot
* fixes variable naming error in character appearance
* loc string fix in singlemarkingpicker
* lizards, vox now have onlyWhitelist, vox restriction for hair/facialhairs
* having zero possible hairs should no longer cause an exception in randomization
* setting species should now update hair pickers
* ignore categories for marking picker
* and a clear as well for the category button
* places that functionality in its own function instead
* adds eye base sprite, vox now also have their own custom eye sprites
* loading a profile client-side should do FilterSpecies for markings now
* client-side load profile does filter species after adding in the hairs now
* magic mirror
* callbacks now call the callback instead of adding it on construct
* whoops
* in removemarking too
* adds missing synchronize calls
* comments out an updateinterface call in magic mirror
* magic mirror window title, minimum sizing
* fixes minsize, adds warning for players who try to set their hair for species that have no hair
* removes spaces in xaml
* namespace changes/organization
* whoopsie (merge conflicts)
* re-enables identity from humanoid component
* damagevisuals now uses the enum given to it instead of the layerstate given on that layer tied to the enum
* removes commas from json
* changes to visuals system so the change is consistent
* chest
* reptilian
* visualizer system now handles body sprite setting/coloration, similar to how characterappearance did it
not a big fan of this
* adds a check in applybasesprites
* adding/removing parts should now make them invisible on a humanoid
* body part removal/adding now enumerates over sublayers instead
* synchro now runs in bodycomponent startup
* parts instead of slots
* humanoidcompnent check
* switches from rsi to actualrsi
* removes all the body stuff (too slow)
* cleans up resolves from humanoid visualizer system
* merging sprites now checks if the base sprites have been modified or not (through things like species changes, or custom base sprite changes)
* not forgetting that one again
* merging now returns an actual dirty value
* replaces the sequenceequal with a more accurate solution
* permanent layers, layer visibility on add/remove part in body
* should send all hidden layers over now
* isdirty in visualizer system for base layers
* isdirty checks count as well
* ok, IsDirty should now set the base layers if the merged sprites are different
* equals override in HumanoidSpritePrototypes.cs
temporary until record prototypes :heck:
* makes fields readonly, equates IDs instead
* adds forced markings through marking picker
* forced in humanoidsystem api, ignorespecies in markingpicker
* marking bui
* makes that serializable as well
* ignore species/forced toggles now work
* adds icon to modifier verb, interface and keys to humanoid bases
* needs the actual enum value to open, no?
* makes the key the actual key
* actions now propagate upwards
* ignore species when set now repopulates markingpicker
* modifiable base layers in the markings window
* oops!
* layout changes
* info box should now appear
* adds ignorespecies for marking picker, collapsible for base layer section of appearance modification window
* collapsible layout moment
* if base layers have changed, all markings are now dirty (and if a base layer is missing, the marking is still 'applied' but it's now just invisible
* small change to marking visibility
* small changes to modifier UI
* markings now match skin on zombification
* zombie stuff
* makes the line edit in marking modifier window more obvious
* disables vox on round start
* horizontal expand on the single label in base layer modifiers
* humanoid profiles in prototypes
* randomhumanoidappearance won't work if the humanoid has a profile already stored
* removes unused code
* documentation in humanoidsystem server-side
* documentation in shared/client
* whoops
* converts accessory into marking in locale files (also adds marking loc string into single marking picker)
* be gone, shared humanoid appearance system from the last upstream merge
* species ignore on randomization (defaults to no ignored species)
* more upstream merge parts that bypassed any errors before merge
* addresses review (also just adds typeserializers in some places)
* submodule moment
* upstream merge issues
2022-09-22 15:19:00 -07:00
|
|
|
};
|
2020-01-19 09:34:33 +01:00
|
|
|
|
2024-05-12 09:18:21 +10:00
|
|
|
HairStylePicker.OnSlotRemove += _ =>
|
2021-03-07 20:48:24 +01:00
|
|
|
{
|
|
|
|
|
if (Profile is null)
|
|
|
|
|
return;
|
|
|
|
|
Profile = Profile.WithCharacterAppearance(
|
Humanoid appearance refactor (#10882)
* initial commit
- species prototype modifications
- markings points as its own file
- shared humanoid component
* adds a tool to convert sprite accessories to markings (in go)
* removes a fmt call
* converts sprite accessory to markings
* adds hair and facial hair to marking categories
* multiple changes
- humanoid visualizer system
- markings modifications for visualizer
- modifications to shared humanoid component
- lays out a base for humanoid system
* hidden layers, ports some properties from appearance component, shrinks DefaultMarkings a little
* squishes the initialize event calls into one function
adds stuff to set species/skin color externally from a server message - currently laid out as if it a dirty call to a networked component, may be subject to change (server-side has not been implemented yet)
* makes the sprite pipeline more obvious
* apply all markings, hidden layer set replacement
* ensures that markings are cleared when the new set is applied
* starts refactoring markingsset (unfinished)
* more additions to the markingset api
* adds constructor logic to markingset
* adds a method to filter out markings in a set based on a given species
* fixes enumerators in markingset
* adds validator into MarkingSet, fixes ForwardMarkingEnumerator
* modifications to the humanoid visual system
* ensuredefault in markingset
* oop
* fixes up data keys, populates OnAppearanceChange in visualizer
* changes to humanoid component, markings
marking equality is now more strict, humanoidcomponent is now implemented for client as a child of sharedhumanoidcomponent
* markings are now applied the visualizer by diffing them
* base sprites are now applied to humanoids from humanoidvisualizer
* passes along base sprite settings to the marking application so that markings know to follow skin color/alpha or not (see: slimes)
* custom base layers on humanoids
* merges all data keys into one data class for humanoid visualizers
* setappearance in sharedhumanoidsystem, removes custombaselayercolors
* humanoidcomponent, system (empty) in server
* adds some basic public API functions to HumanoidSystem
* add marking, remove marking
* changes appearance MarkingsSet to a List<Marking>, adds listener for PlayerSpawnCompleteEvent in HumanoidSystem
* ensuredefaultmarkings, oninit for humanoids
* markingmanager API changes
* removes MarkingsSet
* LoadProfile, adjusts randomization in humanoid appearance to account for species
* base layer settings in humanoidsystem, eye color from profile
* rearranges files to centralize under Humanoid namespace
* more reorganization, deletes some stuff
gotta break stuff to make other things work, right?
goodbye SpriteAccessory...
* fixes a good chunk of server-side issues
still does not compile, yet
* singlemarkingpicker xaml layout
* singlemarkingpicker logic
* magic mirror window (varying pieces of it, mostly client-oriented)
* removes some imports, gives MagicMirror a BUI class (not filled in yet)
* populates magic mirror BUI functionality / window callbacks
* fixes up some errors in humanoidprofileeditor
* changes to SingleMarkingPicker
SingleMarkingPicker now accepts a List<Marking>, species, and total possible markings available in that marking category
* fixes up hair pickers on humanoid profile editor
* fixes the errors in markingpicker
* markingsystem is now gone
* fixes a bunch of build errors
* so that's why i did it like that
* namespace issues, adds robustxamlloader to singlemarkingpicker
* another robustxamlloader
* human, lizard sprites/points
* prototype fixes, deletion of old spriteaccessory
* component registration, fixes dwarf skin toning
no, 'ReptilianToned' does not exist
* removes component registration from abstract humanoid component
* visualizer data now cloneable
* serialize for visualizer key
* zero-count edge case
* missing semi-colon moment
* setspecies in humanoidsystem
* ensures that default markings, if empty, will cause ensuredefault to skip over that given category
* tryadd instead of add
* whoops
* diff and apply should properly apply markings now
* always ensure default, fixes double load for player spawning
* apply skin color now sets the skin color property in humanoidcomponent
* removes sprite from a few species prototypes
* sprite changes for specific base layers based on humanoid sex
* layer ordering fix, and a missing base layer should now disallow markings on that layer
* anymarking base layer, adds the right leg/foot for humans
* loading a profile will now clear all markings on that humanoid
* adds missing layers for humans
* separates species.yml into respective species prototype files
* ensures that if layer visibility was changed, all markings have to be reapplied
* server-side enforcement of hiding hair (and other head-related markings) when equipping things that hide hair
* slime fix, clothingsystem now dictates layer visibility server side
* sussy
* layer settings should now ensure a marking should match the skin tone
* whoops
* skincolor static class and functions in UI
* skin color validation in humanoidcharacterappearance
* markingpicker now shows only the markings for the selected category in used
* getter for slot in singlemarkingpicker now ensures slot is 0 if markings exists
* FilterSpecies no longer attempts to do removal while iterating
* expands for SingleMarkingPicker
* humanoid base dummy has blank layers now (and snout/tail/headside/headtop)
* fixes an issue with visualizer system if the marking count was different but the markings themselves were (somewhat) the same
* whoops
* adds edge case handlers for count differences in humanoid markings
* preview now loads profile instead of directly setting appearance
* moves marking set loading to update controls
* clones a marking set in markingpicker by using the deep clone constructor
* whoops (deep cloning a marking now copies the marking id)
* adds replace function for markingset
* points should now update after the markings are remove/added
* merging base layer sprites into a humanoid should now clear them before merging
* sets dirty range start to count only if the dirty range start was never set above 0
* fixes up some issues with singlemarkingpicker
* color selector sliders in single marking picker should now expand
* hair from hair pickers should now apply in profile loading (client-side)
* category in singlemarkingpicker now sets the private category variable
* slot selector should now populate
* single marking picker buttons now have text, also shows the category name over all user-clickable elements
* removes a comment
* removing hair slots now sets it to bald, defaults to zero used slots if current hair is bald on hair/facial hair
* random skin color, eye color
* populate colors now checks if the marking count is greater than zero in singlemarkingpicker
* hair/facial hair pickers now just get the first possible hair from the respective species list
* different approach to random skin color
* oh, that's why it wasn't working
* randomize everything now just updates every single control
* selecting a new marking in SingleMarkingPicker should attempt to copy over old colors, populate list now uses cache,
* markingmanager now uses OnlyWhitelisted to populate by category and species
* filterspecies now uses onlyWhitelist to filter markings based on whitelist or not
* oops
* ui fix for singlemarkingpicker, ensures that cache is not null if it is null when populatelist is called
* order of operations for the horizontal expand for add/remove
* hair pickers should now update when you add/remove the hair slot
* fixes variable naming error in character appearance
* loc string fix in singlemarkingpicker
* lizards, vox now have onlyWhitelist, vox restriction for hair/facialhairs
* having zero possible hairs should no longer cause an exception in randomization
* setting species should now update hair pickers
* ignore categories for marking picker
* and a clear as well for the category button
* places that functionality in its own function instead
* adds eye base sprite, vox now also have their own custom eye sprites
* loading a profile client-side should do FilterSpecies for markings now
* client-side load profile does filter species after adding in the hairs now
* magic mirror
* callbacks now call the callback instead of adding it on construct
* whoops
* in removemarking too
* adds missing synchronize calls
* comments out an updateinterface call in magic mirror
* magic mirror window title, minimum sizing
* fixes minsize, adds warning for players who try to set their hair for species that have no hair
* removes spaces in xaml
* namespace changes/organization
* whoopsie (merge conflicts)
* re-enables identity from humanoid component
* damagevisuals now uses the enum given to it instead of the layerstate given on that layer tied to the enum
* removes commas from json
* changes to visuals system so the change is consistent
* chest
* reptilian
* visualizer system now handles body sprite setting/coloration, similar to how characterappearance did it
not a big fan of this
* adds a check in applybasesprites
* adding/removing parts should now make them invisible on a humanoid
* body part removal/adding now enumerates over sublayers instead
* synchro now runs in bodycomponent startup
* parts instead of slots
* humanoidcompnent check
* switches from rsi to actualrsi
* removes all the body stuff (too slow)
* cleans up resolves from humanoid visualizer system
* merging sprites now checks if the base sprites have been modified or not (through things like species changes, or custom base sprite changes)
* not forgetting that one again
* merging now returns an actual dirty value
* replaces the sequenceequal with a more accurate solution
* permanent layers, layer visibility on add/remove part in body
* should send all hidden layers over now
* isdirty in visualizer system for base layers
* isdirty checks count as well
* ok, IsDirty should now set the base layers if the merged sprites are different
* equals override in HumanoidSpritePrototypes.cs
temporary until record prototypes :heck:
* makes fields readonly, equates IDs instead
* adds forced markings through marking picker
* forced in humanoidsystem api, ignorespecies in markingpicker
* marking bui
* makes that serializable as well
* ignore species/forced toggles now work
* adds icon to modifier verb, interface and keys to humanoid bases
* needs the actual enum value to open, no?
* makes the key the actual key
* actions now propagate upwards
* ignore species when set now repopulates markingpicker
* modifiable base layers in the markings window
* oops!
* layout changes
* info box should now appear
* adds ignorespecies for marking picker, collapsible for base layer section of appearance modification window
* collapsible layout moment
* if base layers have changed, all markings are now dirty (and if a base layer is missing, the marking is still 'applied' but it's now just invisible
* small change to marking visibility
* small changes to modifier UI
* markings now match skin on zombification
* zombie stuff
* makes the line edit in marking modifier window more obvious
* disables vox on round start
* horizontal expand on the single label in base layer modifiers
* humanoid profiles in prototypes
* randomhumanoidappearance won't work if the humanoid has a profile already stored
* removes unused code
* documentation in humanoidsystem server-side
* documentation in shared/client
* whoops
* converts accessory into marking in locale files (also adds marking loc string into single marking picker)
* be gone, shared humanoid appearance system from the last upstream merge
* species ignore on randomization (defaults to no ignored species)
* more upstream merge parts that bypassed any errors before merge
* addresses review (also just adds typeserializers in some places)
* submodule moment
* upstream merge issues
2022-09-22 15:19:00 -07:00
|
|
|
Profile.Appearance.WithHairStyleName(HairStyles.DefaultHairStyle)
|
|
|
|
|
);
|
|
|
|
|
UpdateHairPickers();
|
2023-03-05 08:59:07 +06:00
|
|
|
UpdateCMarkingsHair();
|
2024-05-12 09:18:21 +10:00
|
|
|
ReloadPreview();
|
2021-03-07 20:48:24 +01:00
|
|
|
};
|
2020-01-19 09:34:33 +01:00
|
|
|
|
2024-05-12 09:18:21 +10:00
|
|
|
FacialHairPicker.OnSlotRemove += _ =>
|
2021-03-07 20:48:24 +01:00
|
|
|
{
|
|
|
|
|
if (Profile is null)
|
|
|
|
|
return;
|
|
|
|
|
Profile = Profile.WithCharacterAppearance(
|
Humanoid appearance refactor (#10882)
* initial commit
- species prototype modifications
- markings points as its own file
- shared humanoid component
* adds a tool to convert sprite accessories to markings (in go)
* removes a fmt call
* converts sprite accessory to markings
* adds hair and facial hair to marking categories
* multiple changes
- humanoid visualizer system
- markings modifications for visualizer
- modifications to shared humanoid component
- lays out a base for humanoid system
* hidden layers, ports some properties from appearance component, shrinks DefaultMarkings a little
* squishes the initialize event calls into one function
adds stuff to set species/skin color externally from a server message - currently laid out as if it a dirty call to a networked component, may be subject to change (server-side has not been implemented yet)
* makes the sprite pipeline more obvious
* apply all markings, hidden layer set replacement
* ensures that markings are cleared when the new set is applied
* starts refactoring markingsset (unfinished)
* more additions to the markingset api
* adds constructor logic to markingset
* adds a method to filter out markings in a set based on a given species
* fixes enumerators in markingset
* adds validator into MarkingSet, fixes ForwardMarkingEnumerator
* modifications to the humanoid visual system
* ensuredefault in markingset
* oop
* fixes up data keys, populates OnAppearanceChange in visualizer
* changes to humanoid component, markings
marking equality is now more strict, humanoidcomponent is now implemented for client as a child of sharedhumanoidcomponent
* markings are now applied the visualizer by diffing them
* base sprites are now applied to humanoids from humanoidvisualizer
* passes along base sprite settings to the marking application so that markings know to follow skin color/alpha or not (see: slimes)
* custom base layers on humanoids
* merges all data keys into one data class for humanoid visualizers
* setappearance in sharedhumanoidsystem, removes custombaselayercolors
* humanoidcomponent, system (empty) in server
* adds some basic public API functions to HumanoidSystem
* add marking, remove marking
* changes appearance MarkingsSet to a List<Marking>, adds listener for PlayerSpawnCompleteEvent in HumanoidSystem
* ensuredefaultmarkings, oninit for humanoids
* markingmanager API changes
* removes MarkingsSet
* LoadProfile, adjusts randomization in humanoid appearance to account for species
* base layer settings in humanoidsystem, eye color from profile
* rearranges files to centralize under Humanoid namespace
* more reorganization, deletes some stuff
gotta break stuff to make other things work, right?
goodbye SpriteAccessory...
* fixes a good chunk of server-side issues
still does not compile, yet
* singlemarkingpicker xaml layout
* singlemarkingpicker logic
* magic mirror window (varying pieces of it, mostly client-oriented)
* removes some imports, gives MagicMirror a BUI class (not filled in yet)
* populates magic mirror BUI functionality / window callbacks
* fixes up some errors in humanoidprofileeditor
* changes to SingleMarkingPicker
SingleMarkingPicker now accepts a List<Marking>, species, and total possible markings available in that marking category
* fixes up hair pickers on humanoid profile editor
* fixes the errors in markingpicker
* markingsystem is now gone
* fixes a bunch of build errors
* so that's why i did it like that
* namespace issues, adds robustxamlloader to singlemarkingpicker
* another robustxamlloader
* human, lizard sprites/points
* prototype fixes, deletion of old spriteaccessory
* component registration, fixes dwarf skin toning
no, 'ReptilianToned' does not exist
* removes component registration from abstract humanoid component
* visualizer data now cloneable
* serialize for visualizer key
* zero-count edge case
* missing semi-colon moment
* setspecies in humanoidsystem
* ensures that default markings, if empty, will cause ensuredefault to skip over that given category
* tryadd instead of add
* whoops
* diff and apply should properly apply markings now
* always ensure default, fixes double load for player spawning
* apply skin color now sets the skin color property in humanoidcomponent
* removes sprite from a few species prototypes
* sprite changes for specific base layers based on humanoid sex
* layer ordering fix, and a missing base layer should now disallow markings on that layer
* anymarking base layer, adds the right leg/foot for humans
* loading a profile will now clear all markings on that humanoid
* adds missing layers for humans
* separates species.yml into respective species prototype files
* ensures that if layer visibility was changed, all markings have to be reapplied
* server-side enforcement of hiding hair (and other head-related markings) when equipping things that hide hair
* slime fix, clothingsystem now dictates layer visibility server side
* sussy
* layer settings should now ensure a marking should match the skin tone
* whoops
* skincolor static class and functions in UI
* skin color validation in humanoidcharacterappearance
* markingpicker now shows only the markings for the selected category in used
* getter for slot in singlemarkingpicker now ensures slot is 0 if markings exists
* FilterSpecies no longer attempts to do removal while iterating
* expands for SingleMarkingPicker
* humanoid base dummy has blank layers now (and snout/tail/headside/headtop)
* fixes an issue with visualizer system if the marking count was different but the markings themselves were (somewhat) the same
* whoops
* adds edge case handlers for count differences in humanoid markings
* preview now loads profile instead of directly setting appearance
* moves marking set loading to update controls
* clones a marking set in markingpicker by using the deep clone constructor
* whoops (deep cloning a marking now copies the marking id)
* adds replace function for markingset
* points should now update after the markings are remove/added
* merging base layer sprites into a humanoid should now clear them before merging
* sets dirty range start to count only if the dirty range start was never set above 0
* fixes up some issues with singlemarkingpicker
* color selector sliders in single marking picker should now expand
* hair from hair pickers should now apply in profile loading (client-side)
* category in singlemarkingpicker now sets the private category variable
* slot selector should now populate
* single marking picker buttons now have text, also shows the category name over all user-clickable elements
* removes a comment
* removing hair slots now sets it to bald, defaults to zero used slots if current hair is bald on hair/facial hair
* random skin color, eye color
* populate colors now checks if the marking count is greater than zero in singlemarkingpicker
* hair/facial hair pickers now just get the first possible hair from the respective species list
* different approach to random skin color
* oh, that's why it wasn't working
* randomize everything now just updates every single control
* selecting a new marking in SingleMarkingPicker should attempt to copy over old colors, populate list now uses cache,
* markingmanager now uses OnlyWhitelisted to populate by category and species
* filterspecies now uses onlyWhitelist to filter markings based on whitelist or not
* oops
* ui fix for singlemarkingpicker, ensures that cache is not null if it is null when populatelist is called
* order of operations for the horizontal expand for add/remove
* hair pickers should now update when you add/remove the hair slot
* fixes variable naming error in character appearance
* loc string fix in singlemarkingpicker
* lizards, vox now have onlyWhitelist, vox restriction for hair/facialhairs
* having zero possible hairs should no longer cause an exception in randomization
* setting species should now update hair pickers
* ignore categories for marking picker
* and a clear as well for the category button
* places that functionality in its own function instead
* adds eye base sprite, vox now also have their own custom eye sprites
* loading a profile client-side should do FilterSpecies for markings now
* client-side load profile does filter species after adding in the hairs now
* magic mirror
* callbacks now call the callback instead of adding it on construct
* whoops
* in removemarking too
* adds missing synchronize calls
* comments out an updateinterface call in magic mirror
* magic mirror window title, minimum sizing
* fixes minsize, adds warning for players who try to set their hair for species that have no hair
* removes spaces in xaml
* namespace changes/organization
* whoopsie (merge conflicts)
* re-enables identity from humanoid component
* damagevisuals now uses the enum given to it instead of the layerstate given on that layer tied to the enum
* removes commas from json
* changes to visuals system so the change is consistent
* chest
* reptilian
* visualizer system now handles body sprite setting/coloration, similar to how characterappearance did it
not a big fan of this
* adds a check in applybasesprites
* adding/removing parts should now make them invisible on a humanoid
* body part removal/adding now enumerates over sublayers instead
* synchro now runs in bodycomponent startup
* parts instead of slots
* humanoidcompnent check
* switches from rsi to actualrsi
* removes all the body stuff (too slow)
* cleans up resolves from humanoid visualizer system
* merging sprites now checks if the base sprites have been modified or not (through things like species changes, or custom base sprite changes)
* not forgetting that one again
* merging now returns an actual dirty value
* replaces the sequenceequal with a more accurate solution
* permanent layers, layer visibility on add/remove part in body
* should send all hidden layers over now
* isdirty in visualizer system for base layers
* isdirty checks count as well
* ok, IsDirty should now set the base layers if the merged sprites are different
* equals override in HumanoidSpritePrototypes.cs
temporary until record prototypes :heck:
* makes fields readonly, equates IDs instead
* adds forced markings through marking picker
* forced in humanoidsystem api, ignorespecies in markingpicker
* marking bui
* makes that serializable as well
* ignore species/forced toggles now work
* adds icon to modifier verb, interface and keys to humanoid bases
* needs the actual enum value to open, no?
* makes the key the actual key
* actions now propagate upwards
* ignore species when set now repopulates markingpicker
* modifiable base layers in the markings window
* oops!
* layout changes
* info box should now appear
* adds ignorespecies for marking picker, collapsible for base layer section of appearance modification window
* collapsible layout moment
* if base layers have changed, all markings are now dirty (and if a base layer is missing, the marking is still 'applied' but it's now just invisible
* small change to marking visibility
* small changes to modifier UI
* markings now match skin on zombification
* zombie stuff
* makes the line edit in marking modifier window more obvious
* disables vox on round start
* horizontal expand on the single label in base layer modifiers
* humanoid profiles in prototypes
* randomhumanoidappearance won't work if the humanoid has a profile already stored
* removes unused code
* documentation in humanoidsystem server-side
* documentation in shared/client
* whoops
* converts accessory into marking in locale files (also adds marking loc string into single marking picker)
* be gone, shared humanoid appearance system from the last upstream merge
* species ignore on randomization (defaults to no ignored species)
* more upstream merge parts that bypassed any errors before merge
* addresses review (also just adds typeserializers in some places)
* submodule moment
* upstream merge issues
2022-09-22 15:19:00 -07:00
|
|
|
Profile.Appearance.WithFacialHairStyleName(HairStyles.DefaultFacialHairStyle)
|
|
|
|
|
);
|
|
|
|
|
UpdateHairPickers();
|
2023-03-05 08:59:07 +06:00
|
|
|
UpdateCMarkingsFacialHair();
|
2024-05-12 09:18:21 +10:00
|
|
|
ReloadPreview();
|
Humanoid appearance refactor (#10882)
* initial commit
- species prototype modifications
- markings points as its own file
- shared humanoid component
* adds a tool to convert sprite accessories to markings (in go)
* removes a fmt call
* converts sprite accessory to markings
* adds hair and facial hair to marking categories
* multiple changes
- humanoid visualizer system
- markings modifications for visualizer
- modifications to shared humanoid component
- lays out a base for humanoid system
* hidden layers, ports some properties from appearance component, shrinks DefaultMarkings a little
* squishes the initialize event calls into one function
adds stuff to set species/skin color externally from a server message - currently laid out as if it a dirty call to a networked component, may be subject to change (server-side has not been implemented yet)
* makes the sprite pipeline more obvious
* apply all markings, hidden layer set replacement
* ensures that markings are cleared when the new set is applied
* starts refactoring markingsset (unfinished)
* more additions to the markingset api
* adds constructor logic to markingset
* adds a method to filter out markings in a set based on a given species
* fixes enumerators in markingset
* adds validator into MarkingSet, fixes ForwardMarkingEnumerator
* modifications to the humanoid visual system
* ensuredefault in markingset
* oop
* fixes up data keys, populates OnAppearanceChange in visualizer
* changes to humanoid component, markings
marking equality is now more strict, humanoidcomponent is now implemented for client as a child of sharedhumanoidcomponent
* markings are now applied the visualizer by diffing them
* base sprites are now applied to humanoids from humanoidvisualizer
* passes along base sprite settings to the marking application so that markings know to follow skin color/alpha or not (see: slimes)
* custom base layers on humanoids
* merges all data keys into one data class for humanoid visualizers
* setappearance in sharedhumanoidsystem, removes custombaselayercolors
* humanoidcomponent, system (empty) in server
* adds some basic public API functions to HumanoidSystem
* add marking, remove marking
* changes appearance MarkingsSet to a List<Marking>, adds listener for PlayerSpawnCompleteEvent in HumanoidSystem
* ensuredefaultmarkings, oninit for humanoids
* markingmanager API changes
* removes MarkingsSet
* LoadProfile, adjusts randomization in humanoid appearance to account for species
* base layer settings in humanoidsystem, eye color from profile
* rearranges files to centralize under Humanoid namespace
* more reorganization, deletes some stuff
gotta break stuff to make other things work, right?
goodbye SpriteAccessory...
* fixes a good chunk of server-side issues
still does not compile, yet
* singlemarkingpicker xaml layout
* singlemarkingpicker logic
* magic mirror window (varying pieces of it, mostly client-oriented)
* removes some imports, gives MagicMirror a BUI class (not filled in yet)
* populates magic mirror BUI functionality / window callbacks
* fixes up some errors in humanoidprofileeditor
* changes to SingleMarkingPicker
SingleMarkingPicker now accepts a List<Marking>, species, and total possible markings available in that marking category
* fixes up hair pickers on humanoid profile editor
* fixes the errors in markingpicker
* markingsystem is now gone
* fixes a bunch of build errors
* so that's why i did it like that
* namespace issues, adds robustxamlloader to singlemarkingpicker
* another robustxamlloader
* human, lizard sprites/points
* prototype fixes, deletion of old spriteaccessory
* component registration, fixes dwarf skin toning
no, 'ReptilianToned' does not exist
* removes component registration from abstract humanoid component
* visualizer data now cloneable
* serialize for visualizer key
* zero-count edge case
* missing semi-colon moment
* setspecies in humanoidsystem
* ensures that default markings, if empty, will cause ensuredefault to skip over that given category
* tryadd instead of add
* whoops
* diff and apply should properly apply markings now
* always ensure default, fixes double load for player spawning
* apply skin color now sets the skin color property in humanoidcomponent
* removes sprite from a few species prototypes
* sprite changes for specific base layers based on humanoid sex
* layer ordering fix, and a missing base layer should now disallow markings on that layer
* anymarking base layer, adds the right leg/foot for humans
* loading a profile will now clear all markings on that humanoid
* adds missing layers for humans
* separates species.yml into respective species prototype files
* ensures that if layer visibility was changed, all markings have to be reapplied
* server-side enforcement of hiding hair (and other head-related markings) when equipping things that hide hair
* slime fix, clothingsystem now dictates layer visibility server side
* sussy
* layer settings should now ensure a marking should match the skin tone
* whoops
* skincolor static class and functions in UI
* skin color validation in humanoidcharacterappearance
* markingpicker now shows only the markings for the selected category in used
* getter for slot in singlemarkingpicker now ensures slot is 0 if markings exists
* FilterSpecies no longer attempts to do removal while iterating
* expands for SingleMarkingPicker
* humanoid base dummy has blank layers now (and snout/tail/headside/headtop)
* fixes an issue with visualizer system if the marking count was different but the markings themselves were (somewhat) the same
* whoops
* adds edge case handlers for count differences in humanoid markings
* preview now loads profile instead of directly setting appearance
* moves marking set loading to update controls
* clones a marking set in markingpicker by using the deep clone constructor
* whoops (deep cloning a marking now copies the marking id)
* adds replace function for markingset
* points should now update after the markings are remove/added
* merging base layer sprites into a humanoid should now clear them before merging
* sets dirty range start to count only if the dirty range start was never set above 0
* fixes up some issues with singlemarkingpicker
* color selector sliders in single marking picker should now expand
* hair from hair pickers should now apply in profile loading (client-side)
* category in singlemarkingpicker now sets the private category variable
* slot selector should now populate
* single marking picker buttons now have text, also shows the category name over all user-clickable elements
* removes a comment
* removing hair slots now sets it to bald, defaults to zero used slots if current hair is bald on hair/facial hair
* random skin color, eye color
* populate colors now checks if the marking count is greater than zero in singlemarkingpicker
* hair/facial hair pickers now just get the first possible hair from the respective species list
* different approach to random skin color
* oh, that's why it wasn't working
* randomize everything now just updates every single control
* selecting a new marking in SingleMarkingPicker should attempt to copy over old colors, populate list now uses cache,
* markingmanager now uses OnlyWhitelisted to populate by category and species
* filterspecies now uses onlyWhitelist to filter markings based on whitelist or not
* oops
* ui fix for singlemarkingpicker, ensures that cache is not null if it is null when populatelist is called
* order of operations for the horizontal expand for add/remove
* hair pickers should now update when you add/remove the hair slot
* fixes variable naming error in character appearance
* loc string fix in singlemarkingpicker
* lizards, vox now have onlyWhitelist, vox restriction for hair/facialhairs
* having zero possible hairs should no longer cause an exception in randomization
* setting species should now update hair pickers
* ignore categories for marking picker
* and a clear as well for the category button
* places that functionality in its own function instead
* adds eye base sprite, vox now also have their own custom eye sprites
* loading a profile client-side should do FilterSpecies for markings now
* client-side load profile does filter species after adding in the hairs now
* magic mirror
* callbacks now call the callback instead of adding it on construct
* whoops
* in removemarking too
* adds missing synchronize calls
* comments out an updateinterface call in magic mirror
* magic mirror window title, minimum sizing
* fixes minsize, adds warning for players who try to set their hair for species that have no hair
* removes spaces in xaml
* namespace changes/organization
* whoopsie (merge conflicts)
* re-enables identity from humanoid component
* damagevisuals now uses the enum given to it instead of the layerstate given on that layer tied to the enum
* removes commas from json
* changes to visuals system so the change is consistent
* chest
* reptilian
* visualizer system now handles body sprite setting/coloration, similar to how characterappearance did it
not a big fan of this
* adds a check in applybasesprites
* adding/removing parts should now make them invisible on a humanoid
* body part removal/adding now enumerates over sublayers instead
* synchro now runs in bodycomponent startup
* parts instead of slots
* humanoidcompnent check
* switches from rsi to actualrsi
* removes all the body stuff (too slow)
* cleans up resolves from humanoid visualizer system
* merging sprites now checks if the base sprites have been modified or not (through things like species changes, or custom base sprite changes)
* not forgetting that one again
* merging now returns an actual dirty value
* replaces the sequenceequal with a more accurate solution
* permanent layers, layer visibility on add/remove part in body
* should send all hidden layers over now
* isdirty in visualizer system for base layers
* isdirty checks count as well
* ok, IsDirty should now set the base layers if the merged sprites are different
* equals override in HumanoidSpritePrototypes.cs
temporary until record prototypes :heck:
* makes fields readonly, equates IDs instead
* adds forced markings through marking picker
* forced in humanoidsystem api, ignorespecies in markingpicker
* marking bui
* makes that serializable as well
* ignore species/forced toggles now work
* adds icon to modifier verb, interface and keys to humanoid bases
* needs the actual enum value to open, no?
* makes the key the actual key
* actions now propagate upwards
* ignore species when set now repopulates markingpicker
* modifiable base layers in the markings window
* oops!
* layout changes
* info box should now appear
* adds ignorespecies for marking picker, collapsible for base layer section of appearance modification window
* collapsible layout moment
* if base layers have changed, all markings are now dirty (and if a base layer is missing, the marking is still 'applied' but it's now just invisible
* small change to marking visibility
* small changes to modifier UI
* markings now match skin on zombification
* zombie stuff
* makes the line edit in marking modifier window more obvious
* disables vox on round start
* horizontal expand on the single label in base layer modifiers
* humanoid profiles in prototypes
* randomhumanoidappearance won't work if the humanoid has a profile already stored
* removes unused code
* documentation in humanoidsystem server-side
* documentation in shared/client
* whoops
* converts accessory into marking in locale files (also adds marking loc string into single marking picker)
* be gone, shared humanoid appearance system from the last upstream merge
* species ignore on randomization (defaults to no ignored species)
* more upstream merge parts that bypassed any errors before merge
* addresses review (also just adds typeserializers in some places)
* submodule moment
* upstream merge issues
2022-09-22 15:19:00 -07:00
|
|
|
};
|
|
|
|
|
|
2024-05-12 09:18:21 +10:00
|
|
|
HairStylePicker.OnSlotAdd += delegate()
|
Humanoid appearance refactor (#10882)
* initial commit
- species prototype modifications
- markings points as its own file
- shared humanoid component
* adds a tool to convert sprite accessories to markings (in go)
* removes a fmt call
* converts sprite accessory to markings
* adds hair and facial hair to marking categories
* multiple changes
- humanoid visualizer system
- markings modifications for visualizer
- modifications to shared humanoid component
- lays out a base for humanoid system
* hidden layers, ports some properties from appearance component, shrinks DefaultMarkings a little
* squishes the initialize event calls into one function
adds stuff to set species/skin color externally from a server message - currently laid out as if it a dirty call to a networked component, may be subject to change (server-side has not been implemented yet)
* makes the sprite pipeline more obvious
* apply all markings, hidden layer set replacement
* ensures that markings are cleared when the new set is applied
* starts refactoring markingsset (unfinished)
* more additions to the markingset api
* adds constructor logic to markingset
* adds a method to filter out markings in a set based on a given species
* fixes enumerators in markingset
* adds validator into MarkingSet, fixes ForwardMarkingEnumerator
* modifications to the humanoid visual system
* ensuredefault in markingset
* oop
* fixes up data keys, populates OnAppearanceChange in visualizer
* changes to humanoid component, markings
marking equality is now more strict, humanoidcomponent is now implemented for client as a child of sharedhumanoidcomponent
* markings are now applied the visualizer by diffing them
* base sprites are now applied to humanoids from humanoidvisualizer
* passes along base sprite settings to the marking application so that markings know to follow skin color/alpha or not (see: slimes)
* custom base layers on humanoids
* merges all data keys into one data class for humanoid visualizers
* setappearance in sharedhumanoidsystem, removes custombaselayercolors
* humanoidcomponent, system (empty) in server
* adds some basic public API functions to HumanoidSystem
* add marking, remove marking
* changes appearance MarkingsSet to a List<Marking>, adds listener for PlayerSpawnCompleteEvent in HumanoidSystem
* ensuredefaultmarkings, oninit for humanoids
* markingmanager API changes
* removes MarkingsSet
* LoadProfile, adjusts randomization in humanoid appearance to account for species
* base layer settings in humanoidsystem, eye color from profile
* rearranges files to centralize under Humanoid namespace
* more reorganization, deletes some stuff
gotta break stuff to make other things work, right?
goodbye SpriteAccessory...
* fixes a good chunk of server-side issues
still does not compile, yet
* singlemarkingpicker xaml layout
* singlemarkingpicker logic
* magic mirror window (varying pieces of it, mostly client-oriented)
* removes some imports, gives MagicMirror a BUI class (not filled in yet)
* populates magic mirror BUI functionality / window callbacks
* fixes up some errors in humanoidprofileeditor
* changes to SingleMarkingPicker
SingleMarkingPicker now accepts a List<Marking>, species, and total possible markings available in that marking category
* fixes up hair pickers on humanoid profile editor
* fixes the errors in markingpicker
* markingsystem is now gone
* fixes a bunch of build errors
* so that's why i did it like that
* namespace issues, adds robustxamlloader to singlemarkingpicker
* another robustxamlloader
* human, lizard sprites/points
* prototype fixes, deletion of old spriteaccessory
* component registration, fixes dwarf skin toning
no, 'ReptilianToned' does not exist
* removes component registration from abstract humanoid component
* visualizer data now cloneable
* serialize for visualizer key
* zero-count edge case
* missing semi-colon moment
* setspecies in humanoidsystem
* ensures that default markings, if empty, will cause ensuredefault to skip over that given category
* tryadd instead of add
* whoops
* diff and apply should properly apply markings now
* always ensure default, fixes double load for player spawning
* apply skin color now sets the skin color property in humanoidcomponent
* removes sprite from a few species prototypes
* sprite changes for specific base layers based on humanoid sex
* layer ordering fix, and a missing base layer should now disallow markings on that layer
* anymarking base layer, adds the right leg/foot for humans
* loading a profile will now clear all markings on that humanoid
* adds missing layers for humans
* separates species.yml into respective species prototype files
* ensures that if layer visibility was changed, all markings have to be reapplied
* server-side enforcement of hiding hair (and other head-related markings) when equipping things that hide hair
* slime fix, clothingsystem now dictates layer visibility server side
* sussy
* layer settings should now ensure a marking should match the skin tone
* whoops
* skincolor static class and functions in UI
* skin color validation in humanoidcharacterappearance
* markingpicker now shows only the markings for the selected category in used
* getter for slot in singlemarkingpicker now ensures slot is 0 if markings exists
* FilterSpecies no longer attempts to do removal while iterating
* expands for SingleMarkingPicker
* humanoid base dummy has blank layers now (and snout/tail/headside/headtop)
* fixes an issue with visualizer system if the marking count was different but the markings themselves were (somewhat) the same
* whoops
* adds edge case handlers for count differences in humanoid markings
* preview now loads profile instead of directly setting appearance
* moves marking set loading to update controls
* clones a marking set in markingpicker by using the deep clone constructor
* whoops (deep cloning a marking now copies the marking id)
* adds replace function for markingset
* points should now update after the markings are remove/added
* merging base layer sprites into a humanoid should now clear them before merging
* sets dirty range start to count only if the dirty range start was never set above 0
* fixes up some issues with singlemarkingpicker
* color selector sliders in single marking picker should now expand
* hair from hair pickers should now apply in profile loading (client-side)
* category in singlemarkingpicker now sets the private category variable
* slot selector should now populate
* single marking picker buttons now have text, also shows the category name over all user-clickable elements
* removes a comment
* removing hair slots now sets it to bald, defaults to zero used slots if current hair is bald on hair/facial hair
* random skin color, eye color
* populate colors now checks if the marking count is greater than zero in singlemarkingpicker
* hair/facial hair pickers now just get the first possible hair from the respective species list
* different approach to random skin color
* oh, that's why it wasn't working
* randomize everything now just updates every single control
* selecting a new marking in SingleMarkingPicker should attempt to copy over old colors, populate list now uses cache,
* markingmanager now uses OnlyWhitelisted to populate by category and species
* filterspecies now uses onlyWhitelist to filter markings based on whitelist or not
* oops
* ui fix for singlemarkingpicker, ensures that cache is not null if it is null when populatelist is called
* order of operations for the horizontal expand for add/remove
* hair pickers should now update when you add/remove the hair slot
* fixes variable naming error in character appearance
* loc string fix in singlemarkingpicker
* lizards, vox now have onlyWhitelist, vox restriction for hair/facialhairs
* having zero possible hairs should no longer cause an exception in randomization
* setting species should now update hair pickers
* ignore categories for marking picker
* and a clear as well for the category button
* places that functionality in its own function instead
* adds eye base sprite, vox now also have their own custom eye sprites
* loading a profile client-side should do FilterSpecies for markings now
* client-side load profile does filter species after adding in the hairs now
* magic mirror
* callbacks now call the callback instead of adding it on construct
* whoops
* in removemarking too
* adds missing synchronize calls
* comments out an updateinterface call in magic mirror
* magic mirror window title, minimum sizing
* fixes minsize, adds warning for players who try to set their hair for species that have no hair
* removes spaces in xaml
* namespace changes/organization
* whoopsie (merge conflicts)
* re-enables identity from humanoid component
* damagevisuals now uses the enum given to it instead of the layerstate given on that layer tied to the enum
* removes commas from json
* changes to visuals system so the change is consistent
* chest
* reptilian
* visualizer system now handles body sprite setting/coloration, similar to how characterappearance did it
not a big fan of this
* adds a check in applybasesprites
* adding/removing parts should now make them invisible on a humanoid
* body part removal/adding now enumerates over sublayers instead
* synchro now runs in bodycomponent startup
* parts instead of slots
* humanoidcompnent check
* switches from rsi to actualrsi
* removes all the body stuff (too slow)
* cleans up resolves from humanoid visualizer system
* merging sprites now checks if the base sprites have been modified or not (through things like species changes, or custom base sprite changes)
* not forgetting that one again
* merging now returns an actual dirty value
* replaces the sequenceequal with a more accurate solution
* permanent layers, layer visibility on add/remove part in body
* should send all hidden layers over now
* isdirty in visualizer system for base layers
* isdirty checks count as well
* ok, IsDirty should now set the base layers if the merged sprites are different
* equals override in HumanoidSpritePrototypes.cs
temporary until record prototypes :heck:
* makes fields readonly, equates IDs instead
* adds forced markings through marking picker
* forced in humanoidsystem api, ignorespecies in markingpicker
* marking bui
* makes that serializable as well
* ignore species/forced toggles now work
* adds icon to modifier verb, interface and keys to humanoid bases
* needs the actual enum value to open, no?
* makes the key the actual key
* actions now propagate upwards
* ignore species when set now repopulates markingpicker
* modifiable base layers in the markings window
* oops!
* layout changes
* info box should now appear
* adds ignorespecies for marking picker, collapsible for base layer section of appearance modification window
* collapsible layout moment
* if base layers have changed, all markings are now dirty (and if a base layer is missing, the marking is still 'applied' but it's now just invisible
* small change to marking visibility
* small changes to modifier UI
* markings now match skin on zombification
* zombie stuff
* makes the line edit in marking modifier window more obvious
* disables vox on round start
* horizontal expand on the single label in base layer modifiers
* humanoid profiles in prototypes
* randomhumanoidappearance won't work if the humanoid has a profile already stored
* removes unused code
* documentation in humanoidsystem server-side
* documentation in shared/client
* whoops
* converts accessory into marking in locale files (also adds marking loc string into single marking picker)
* be gone, shared humanoid appearance system from the last upstream merge
* species ignore on randomization (defaults to no ignored species)
* more upstream merge parts that bypassed any errors before merge
* addresses review (also just adds typeserializers in some places)
* submodule moment
* upstream merge issues
2022-09-22 15:19:00 -07:00
|
|
|
{
|
|
|
|
|
if (Profile is null)
|
|
|
|
|
return;
|
|
|
|
|
|
|
|
|
|
var hair = _markingManager.MarkingsByCategoryAndSpecies(MarkingCategories.Hair, Profile.Species).Keys
|
|
|
|
|
.FirstOrDefault();
|
|
|
|
|
|
|
|
|
|
if (string.IsNullOrEmpty(hair))
|
|
|
|
|
return;
|
|
|
|
|
|
|
|
|
|
Profile = Profile.WithCharacterAppearance(
|
|
|
|
|
Profile.Appearance.WithHairStyleName(hair)
|
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
UpdateHairPickers();
|
2023-03-05 08:59:07 +06:00
|
|
|
UpdateCMarkingsHair();
|
2024-05-12 09:18:21 +10:00
|
|
|
ReloadPreview();
|
Humanoid appearance refactor (#10882)
* initial commit
- species prototype modifications
- markings points as its own file
- shared humanoid component
* adds a tool to convert sprite accessories to markings (in go)
* removes a fmt call
* converts sprite accessory to markings
* adds hair and facial hair to marking categories
* multiple changes
- humanoid visualizer system
- markings modifications for visualizer
- modifications to shared humanoid component
- lays out a base for humanoid system
* hidden layers, ports some properties from appearance component, shrinks DefaultMarkings a little
* squishes the initialize event calls into one function
adds stuff to set species/skin color externally from a server message - currently laid out as if it a dirty call to a networked component, may be subject to change (server-side has not been implemented yet)
* makes the sprite pipeline more obvious
* apply all markings, hidden layer set replacement
* ensures that markings are cleared when the new set is applied
* starts refactoring markingsset (unfinished)
* more additions to the markingset api
* adds constructor logic to markingset
* adds a method to filter out markings in a set based on a given species
* fixes enumerators in markingset
* adds validator into MarkingSet, fixes ForwardMarkingEnumerator
* modifications to the humanoid visual system
* ensuredefault in markingset
* oop
* fixes up data keys, populates OnAppearanceChange in visualizer
* changes to humanoid component, markings
marking equality is now more strict, humanoidcomponent is now implemented for client as a child of sharedhumanoidcomponent
* markings are now applied the visualizer by diffing them
* base sprites are now applied to humanoids from humanoidvisualizer
* passes along base sprite settings to the marking application so that markings know to follow skin color/alpha or not (see: slimes)
* custom base layers on humanoids
* merges all data keys into one data class for humanoid visualizers
* setappearance in sharedhumanoidsystem, removes custombaselayercolors
* humanoidcomponent, system (empty) in server
* adds some basic public API functions to HumanoidSystem
* add marking, remove marking
* changes appearance MarkingsSet to a List<Marking>, adds listener for PlayerSpawnCompleteEvent in HumanoidSystem
* ensuredefaultmarkings, oninit for humanoids
* markingmanager API changes
* removes MarkingsSet
* LoadProfile, adjusts randomization in humanoid appearance to account for species
* base layer settings in humanoidsystem, eye color from profile
* rearranges files to centralize under Humanoid namespace
* more reorganization, deletes some stuff
gotta break stuff to make other things work, right?
goodbye SpriteAccessory...
* fixes a good chunk of server-side issues
still does not compile, yet
* singlemarkingpicker xaml layout
* singlemarkingpicker logic
* magic mirror window (varying pieces of it, mostly client-oriented)
* removes some imports, gives MagicMirror a BUI class (not filled in yet)
* populates magic mirror BUI functionality / window callbacks
* fixes up some errors in humanoidprofileeditor
* changes to SingleMarkingPicker
SingleMarkingPicker now accepts a List<Marking>, species, and total possible markings available in that marking category
* fixes up hair pickers on humanoid profile editor
* fixes the errors in markingpicker
* markingsystem is now gone
* fixes a bunch of build errors
* so that's why i did it like that
* namespace issues, adds robustxamlloader to singlemarkingpicker
* another robustxamlloader
* human, lizard sprites/points
* prototype fixes, deletion of old spriteaccessory
* component registration, fixes dwarf skin toning
no, 'ReptilianToned' does not exist
* removes component registration from abstract humanoid component
* visualizer data now cloneable
* serialize for visualizer key
* zero-count edge case
* missing semi-colon moment
* setspecies in humanoidsystem
* ensures that default markings, if empty, will cause ensuredefault to skip over that given category
* tryadd instead of add
* whoops
* diff and apply should properly apply markings now
* always ensure default, fixes double load for player spawning
* apply skin color now sets the skin color property in humanoidcomponent
* removes sprite from a few species prototypes
* sprite changes for specific base layers based on humanoid sex
* layer ordering fix, and a missing base layer should now disallow markings on that layer
* anymarking base layer, adds the right leg/foot for humans
* loading a profile will now clear all markings on that humanoid
* adds missing layers for humans
* separates species.yml into respective species prototype files
* ensures that if layer visibility was changed, all markings have to be reapplied
* server-side enforcement of hiding hair (and other head-related markings) when equipping things that hide hair
* slime fix, clothingsystem now dictates layer visibility server side
* sussy
* layer settings should now ensure a marking should match the skin tone
* whoops
* skincolor static class and functions in UI
* skin color validation in humanoidcharacterappearance
* markingpicker now shows only the markings for the selected category in used
* getter for slot in singlemarkingpicker now ensures slot is 0 if markings exists
* FilterSpecies no longer attempts to do removal while iterating
* expands for SingleMarkingPicker
* humanoid base dummy has blank layers now (and snout/tail/headside/headtop)
* fixes an issue with visualizer system if the marking count was different but the markings themselves were (somewhat) the same
* whoops
* adds edge case handlers for count differences in humanoid markings
* preview now loads profile instead of directly setting appearance
* moves marking set loading to update controls
* clones a marking set in markingpicker by using the deep clone constructor
* whoops (deep cloning a marking now copies the marking id)
* adds replace function for markingset
* points should now update after the markings are remove/added
* merging base layer sprites into a humanoid should now clear them before merging
* sets dirty range start to count only if the dirty range start was never set above 0
* fixes up some issues with singlemarkingpicker
* color selector sliders in single marking picker should now expand
* hair from hair pickers should now apply in profile loading (client-side)
* category in singlemarkingpicker now sets the private category variable
* slot selector should now populate
* single marking picker buttons now have text, also shows the category name over all user-clickable elements
* removes a comment
* removing hair slots now sets it to bald, defaults to zero used slots if current hair is bald on hair/facial hair
* random skin color, eye color
* populate colors now checks if the marking count is greater than zero in singlemarkingpicker
* hair/facial hair pickers now just get the first possible hair from the respective species list
* different approach to random skin color
* oh, that's why it wasn't working
* randomize everything now just updates every single control
* selecting a new marking in SingleMarkingPicker should attempt to copy over old colors, populate list now uses cache,
* markingmanager now uses OnlyWhitelisted to populate by category and species
* filterspecies now uses onlyWhitelist to filter markings based on whitelist or not
* oops
* ui fix for singlemarkingpicker, ensures that cache is not null if it is null when populatelist is called
* order of operations for the horizontal expand for add/remove
* hair pickers should now update when you add/remove the hair slot
* fixes variable naming error in character appearance
* loc string fix in singlemarkingpicker
* lizards, vox now have onlyWhitelist, vox restriction for hair/facialhairs
* having zero possible hairs should no longer cause an exception in randomization
* setting species should now update hair pickers
* ignore categories for marking picker
* and a clear as well for the category button
* places that functionality in its own function instead
* adds eye base sprite, vox now also have their own custom eye sprites
* loading a profile client-side should do FilterSpecies for markings now
* client-side load profile does filter species after adding in the hairs now
* magic mirror
* callbacks now call the callback instead of adding it on construct
* whoops
* in removemarking too
* adds missing synchronize calls
* comments out an updateinterface call in magic mirror
* magic mirror window title, minimum sizing
* fixes minsize, adds warning for players who try to set their hair for species that have no hair
* removes spaces in xaml
* namespace changes/organization
* whoopsie (merge conflicts)
* re-enables identity from humanoid component
* damagevisuals now uses the enum given to it instead of the layerstate given on that layer tied to the enum
* removes commas from json
* changes to visuals system so the change is consistent
* chest
* reptilian
* visualizer system now handles body sprite setting/coloration, similar to how characterappearance did it
not a big fan of this
* adds a check in applybasesprites
* adding/removing parts should now make them invisible on a humanoid
* body part removal/adding now enumerates over sublayers instead
* synchro now runs in bodycomponent startup
* parts instead of slots
* humanoidcompnent check
* switches from rsi to actualrsi
* removes all the body stuff (too slow)
* cleans up resolves from humanoid visualizer system
* merging sprites now checks if the base sprites have been modified or not (through things like species changes, or custom base sprite changes)
* not forgetting that one again
* merging now returns an actual dirty value
* replaces the sequenceequal with a more accurate solution
* permanent layers, layer visibility on add/remove part in body
* should send all hidden layers over now
* isdirty in visualizer system for base layers
* isdirty checks count as well
* ok, IsDirty should now set the base layers if the merged sprites are different
* equals override in HumanoidSpritePrototypes.cs
temporary until record prototypes :heck:
* makes fields readonly, equates IDs instead
* adds forced markings through marking picker
* forced in humanoidsystem api, ignorespecies in markingpicker
* marking bui
* makes that serializable as well
* ignore species/forced toggles now work
* adds icon to modifier verb, interface and keys to humanoid bases
* needs the actual enum value to open, no?
* makes the key the actual key
* actions now propagate upwards
* ignore species when set now repopulates markingpicker
* modifiable base layers in the markings window
* oops!
* layout changes
* info box should now appear
* adds ignorespecies for marking picker, collapsible for base layer section of appearance modification window
* collapsible layout moment
* if base layers have changed, all markings are now dirty (and if a base layer is missing, the marking is still 'applied' but it's now just invisible
* small change to marking visibility
* small changes to modifier UI
* markings now match skin on zombification
* zombie stuff
* makes the line edit in marking modifier window more obvious
* disables vox on round start
* horizontal expand on the single label in base layer modifiers
* humanoid profiles in prototypes
* randomhumanoidappearance won't work if the humanoid has a profile already stored
* removes unused code
* documentation in humanoidsystem server-side
* documentation in shared/client
* whoops
* converts accessory into marking in locale files (also adds marking loc string into single marking picker)
* be gone, shared humanoid appearance system from the last upstream merge
* species ignore on randomization (defaults to no ignored species)
* more upstream merge parts that bypassed any errors before merge
* addresses review (also just adds typeserializers in some places)
* submodule moment
* upstream merge issues
2022-09-22 15:19:00 -07:00
|
|
|
};
|
|
|
|
|
|
2024-05-12 09:18:21 +10:00
|
|
|
FacialHairPicker.OnSlotAdd += delegate()
|
Humanoid appearance refactor (#10882)
* initial commit
- species prototype modifications
- markings points as its own file
- shared humanoid component
* adds a tool to convert sprite accessories to markings (in go)
* removes a fmt call
* converts sprite accessory to markings
* adds hair and facial hair to marking categories
* multiple changes
- humanoid visualizer system
- markings modifications for visualizer
- modifications to shared humanoid component
- lays out a base for humanoid system
* hidden layers, ports some properties from appearance component, shrinks DefaultMarkings a little
* squishes the initialize event calls into one function
adds stuff to set species/skin color externally from a server message - currently laid out as if it a dirty call to a networked component, may be subject to change (server-side has not been implemented yet)
* makes the sprite pipeline more obvious
* apply all markings, hidden layer set replacement
* ensures that markings are cleared when the new set is applied
* starts refactoring markingsset (unfinished)
* more additions to the markingset api
* adds constructor logic to markingset
* adds a method to filter out markings in a set based on a given species
* fixes enumerators in markingset
* adds validator into MarkingSet, fixes ForwardMarkingEnumerator
* modifications to the humanoid visual system
* ensuredefault in markingset
* oop
* fixes up data keys, populates OnAppearanceChange in visualizer
* changes to humanoid component, markings
marking equality is now more strict, humanoidcomponent is now implemented for client as a child of sharedhumanoidcomponent
* markings are now applied the visualizer by diffing them
* base sprites are now applied to humanoids from humanoidvisualizer
* passes along base sprite settings to the marking application so that markings know to follow skin color/alpha or not (see: slimes)
* custom base layers on humanoids
* merges all data keys into one data class for humanoid visualizers
* setappearance in sharedhumanoidsystem, removes custombaselayercolors
* humanoidcomponent, system (empty) in server
* adds some basic public API functions to HumanoidSystem
* add marking, remove marking
* changes appearance MarkingsSet to a List<Marking>, adds listener for PlayerSpawnCompleteEvent in HumanoidSystem
* ensuredefaultmarkings, oninit for humanoids
* markingmanager API changes
* removes MarkingsSet
* LoadProfile, adjusts randomization in humanoid appearance to account for species
* base layer settings in humanoidsystem, eye color from profile
* rearranges files to centralize under Humanoid namespace
* more reorganization, deletes some stuff
gotta break stuff to make other things work, right?
goodbye SpriteAccessory...
* fixes a good chunk of server-side issues
still does not compile, yet
* singlemarkingpicker xaml layout
* singlemarkingpicker logic
* magic mirror window (varying pieces of it, mostly client-oriented)
* removes some imports, gives MagicMirror a BUI class (not filled in yet)
* populates magic mirror BUI functionality / window callbacks
* fixes up some errors in humanoidprofileeditor
* changes to SingleMarkingPicker
SingleMarkingPicker now accepts a List<Marking>, species, and total possible markings available in that marking category
* fixes up hair pickers on humanoid profile editor
* fixes the errors in markingpicker
* markingsystem is now gone
* fixes a bunch of build errors
* so that's why i did it like that
* namespace issues, adds robustxamlloader to singlemarkingpicker
* another robustxamlloader
* human, lizard sprites/points
* prototype fixes, deletion of old spriteaccessory
* component registration, fixes dwarf skin toning
no, 'ReptilianToned' does not exist
* removes component registration from abstract humanoid component
* visualizer data now cloneable
* serialize for visualizer key
* zero-count edge case
* missing semi-colon moment
* setspecies in humanoidsystem
* ensures that default markings, if empty, will cause ensuredefault to skip over that given category
* tryadd instead of add
* whoops
* diff and apply should properly apply markings now
* always ensure default, fixes double load for player spawning
* apply skin color now sets the skin color property in humanoidcomponent
* removes sprite from a few species prototypes
* sprite changes for specific base layers based on humanoid sex
* layer ordering fix, and a missing base layer should now disallow markings on that layer
* anymarking base layer, adds the right leg/foot for humans
* loading a profile will now clear all markings on that humanoid
* adds missing layers for humans
* separates species.yml into respective species prototype files
* ensures that if layer visibility was changed, all markings have to be reapplied
* server-side enforcement of hiding hair (and other head-related markings) when equipping things that hide hair
* slime fix, clothingsystem now dictates layer visibility server side
* sussy
* layer settings should now ensure a marking should match the skin tone
* whoops
* skincolor static class and functions in UI
* skin color validation in humanoidcharacterappearance
* markingpicker now shows only the markings for the selected category in used
* getter for slot in singlemarkingpicker now ensures slot is 0 if markings exists
* FilterSpecies no longer attempts to do removal while iterating
* expands for SingleMarkingPicker
* humanoid base dummy has blank layers now (and snout/tail/headside/headtop)
* fixes an issue with visualizer system if the marking count was different but the markings themselves were (somewhat) the same
* whoops
* adds edge case handlers for count differences in humanoid markings
* preview now loads profile instead of directly setting appearance
* moves marking set loading to update controls
* clones a marking set in markingpicker by using the deep clone constructor
* whoops (deep cloning a marking now copies the marking id)
* adds replace function for markingset
* points should now update after the markings are remove/added
* merging base layer sprites into a humanoid should now clear them before merging
* sets dirty range start to count only if the dirty range start was never set above 0
* fixes up some issues with singlemarkingpicker
* color selector sliders in single marking picker should now expand
* hair from hair pickers should now apply in profile loading (client-side)
* category in singlemarkingpicker now sets the private category variable
* slot selector should now populate
* single marking picker buttons now have text, also shows the category name over all user-clickable elements
* removes a comment
* removing hair slots now sets it to bald, defaults to zero used slots if current hair is bald on hair/facial hair
* random skin color, eye color
* populate colors now checks if the marking count is greater than zero in singlemarkingpicker
* hair/facial hair pickers now just get the first possible hair from the respective species list
* different approach to random skin color
* oh, that's why it wasn't working
* randomize everything now just updates every single control
* selecting a new marking in SingleMarkingPicker should attempt to copy over old colors, populate list now uses cache,
* markingmanager now uses OnlyWhitelisted to populate by category and species
* filterspecies now uses onlyWhitelist to filter markings based on whitelist or not
* oops
* ui fix for singlemarkingpicker, ensures that cache is not null if it is null when populatelist is called
* order of operations for the horizontal expand for add/remove
* hair pickers should now update when you add/remove the hair slot
* fixes variable naming error in character appearance
* loc string fix in singlemarkingpicker
* lizards, vox now have onlyWhitelist, vox restriction for hair/facialhairs
* having zero possible hairs should no longer cause an exception in randomization
* setting species should now update hair pickers
* ignore categories for marking picker
* and a clear as well for the category button
* places that functionality in its own function instead
* adds eye base sprite, vox now also have their own custom eye sprites
* loading a profile client-side should do FilterSpecies for markings now
* client-side load profile does filter species after adding in the hairs now
* magic mirror
* callbacks now call the callback instead of adding it on construct
* whoops
* in removemarking too
* adds missing synchronize calls
* comments out an updateinterface call in magic mirror
* magic mirror window title, minimum sizing
* fixes minsize, adds warning for players who try to set their hair for species that have no hair
* removes spaces in xaml
* namespace changes/organization
* whoopsie (merge conflicts)
* re-enables identity from humanoid component
* damagevisuals now uses the enum given to it instead of the layerstate given on that layer tied to the enum
* removes commas from json
* changes to visuals system so the change is consistent
* chest
* reptilian
* visualizer system now handles body sprite setting/coloration, similar to how characterappearance did it
not a big fan of this
* adds a check in applybasesprites
* adding/removing parts should now make them invisible on a humanoid
* body part removal/adding now enumerates over sublayers instead
* synchro now runs in bodycomponent startup
* parts instead of slots
* humanoidcompnent check
* switches from rsi to actualrsi
* removes all the body stuff (too slow)
* cleans up resolves from humanoid visualizer system
* merging sprites now checks if the base sprites have been modified or not (through things like species changes, or custom base sprite changes)
* not forgetting that one again
* merging now returns an actual dirty value
* replaces the sequenceequal with a more accurate solution
* permanent layers, layer visibility on add/remove part in body
* should send all hidden layers over now
* isdirty in visualizer system for base layers
* isdirty checks count as well
* ok, IsDirty should now set the base layers if the merged sprites are different
* equals override in HumanoidSpritePrototypes.cs
temporary until record prototypes :heck:
* makes fields readonly, equates IDs instead
* adds forced markings through marking picker
* forced in humanoidsystem api, ignorespecies in markingpicker
* marking bui
* makes that serializable as well
* ignore species/forced toggles now work
* adds icon to modifier verb, interface and keys to humanoid bases
* needs the actual enum value to open, no?
* makes the key the actual key
* actions now propagate upwards
* ignore species when set now repopulates markingpicker
* modifiable base layers in the markings window
* oops!
* layout changes
* info box should now appear
* adds ignorespecies for marking picker, collapsible for base layer section of appearance modification window
* collapsible layout moment
* if base layers have changed, all markings are now dirty (and if a base layer is missing, the marking is still 'applied' but it's now just invisible
* small change to marking visibility
* small changes to modifier UI
* markings now match skin on zombification
* zombie stuff
* makes the line edit in marking modifier window more obvious
* disables vox on round start
* horizontal expand on the single label in base layer modifiers
* humanoid profiles in prototypes
* randomhumanoidappearance won't work if the humanoid has a profile already stored
* removes unused code
* documentation in humanoidsystem server-side
* documentation in shared/client
* whoops
* converts accessory into marking in locale files (also adds marking loc string into single marking picker)
* be gone, shared humanoid appearance system from the last upstream merge
* species ignore on randomization (defaults to no ignored species)
* more upstream merge parts that bypassed any errors before merge
* addresses review (also just adds typeserializers in some places)
* submodule moment
* upstream merge issues
2022-09-22 15:19:00 -07:00
|
|
|
{
|
|
|
|
|
if (Profile is null)
|
|
|
|
|
return;
|
|
|
|
|
|
|
|
|
|
var hair = _markingManager.MarkingsByCategoryAndSpecies(MarkingCategories.FacialHair, Profile.Species).Keys
|
|
|
|
|
.FirstOrDefault();
|
|
|
|
|
|
|
|
|
|
if (string.IsNullOrEmpty(hair))
|
|
|
|
|
return;
|
|
|
|
|
|
|
|
|
|
Profile = Profile.WithCharacterAppearance(
|
|
|
|
|
Profile.Appearance.WithFacialHairStyleName(hair)
|
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
UpdateHairPickers();
|
2023-03-05 08:59:07 +06:00
|
|
|
UpdateCMarkingsFacialHair();
|
2024-05-12 09:18:21 +10:00
|
|
|
ReloadPreview();
|
2021-03-07 20:48:24 +01:00
|
|
|
};
|
2020-01-19 09:34:33 +01:00
|
|
|
|
2021-03-07 20:48:24 +01:00
|
|
|
#endregion Hair
|
2020-12-24 13:42:40 +00:00
|
|
|
|
2024-02-01 05:12:09 -05:00
|
|
|
#region SpawnPriority
|
|
|
|
|
|
|
|
|
|
foreach (var value in Enum.GetValues<SpawnPriorityPreference>())
|
|
|
|
|
{
|
2024-05-12 09:18:21 +10:00
|
|
|
SpawnPriorityButton.AddItem(Loc.GetString($"humanoid-profile-editor-preference-spawn-priority-{value.ToString().ToLower()}"), (int) value);
|
2024-02-01 05:12:09 -05:00
|
|
|
}
|
|
|
|
|
|
2024-05-12 09:18:21 +10:00
|
|
|
SpawnPriorityButton.OnItemSelected += args =>
|
2024-02-01 05:12:09 -05:00
|
|
|
{
|
2024-05-12 09:18:21 +10:00
|
|
|
SpawnPriorityButton.SelectId(args.Id);
|
2024-02-01 05:12:09 -05:00
|
|
|
SetSpawnPriority((SpawnPriorityPreference) args.Id);
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
#endregion SpawnPriority
|
|
|
|
|
|
2021-03-07 20:48:24 +01:00
|
|
|
#region Eyes
|
|
|
|
|
|
2024-05-12 09:18:21 +10:00
|
|
|
EyeColorPicker.OnEyeColorPicked += newColor =>
|
2020-01-18 01:54:13 +01:00
|
|
|
{
|
2021-03-07 20:48:24 +01:00
|
|
|
if (Profile is null)
|
|
|
|
|
return;
|
|
|
|
|
Profile = Profile.WithCharacterAppearance(
|
|
|
|
|
Profile.Appearance.WithEyeColor(newColor));
|
2024-05-12 09:18:21 +10:00
|
|
|
Markings.CurrentEyeColor = Profile.Appearance.EyeColor;
|
|
|
|
|
ReloadProfilePreview();
|
2021-03-07 20:48:24 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
#endregion Eyes
|
|
|
|
|
|
|
|
|
|
#endregion Appearance
|
|
|
|
|
|
|
|
|
|
#region Jobs
|
|
|
|
|
|
2024-05-12 09:18:21 +10:00
|
|
|
TabContainer.SetTabTitle(1, Loc.GetString("humanoid-profile-editor-jobs-tab"));
|
2020-01-19 09:34:33 +01:00
|
|
|
|
2024-05-12 09:18:21 +10:00
|
|
|
PreferenceUnavailableButton.AddItem(
|
2021-06-21 02:13:54 +02:00
|
|
|
Loc.GetString("humanoid-profile-editor-preference-unavailable-stay-in-lobby-button"),
|
2021-03-07 20:48:24 +01:00
|
|
|
(int) PreferenceUnavailableMode.StayInLobby);
|
2024-05-12 09:18:21 +10:00
|
|
|
PreferenceUnavailableButton.AddItem(
|
2021-06-21 02:13:54 +02:00
|
|
|
Loc.GetString("humanoid-profile-editor-preference-unavailable-spawn-as-overflow-button",
|
2021-11-26 03:02:46 -06:00
|
|
|
("overflowJob", Loc.GetString(SharedGameTicker.FallbackOverflowJobName))),
|
2021-03-07 20:48:24 +01:00
|
|
|
(int) PreferenceUnavailableMode.SpawnAsOverflow);
|
2020-01-19 18:33:22 +01:00
|
|
|
|
2024-05-12 09:18:21 +10:00
|
|
|
PreferenceUnavailableButton.OnItemSelected += args =>
|
2021-03-07 20:48:24 +01:00
|
|
|
{
|
2024-05-12 09:18:21 +10:00
|
|
|
PreferenceUnavailableButton.SelectId(args.Id);
|
2021-03-10 14:48:29 +01:00
|
|
|
Profile = Profile?.WithPreferenceUnavailable((PreferenceUnavailableMode) args.Id);
|
2024-06-10 21:48:23 -05:00
|
|
|
SetDirty();
|
2021-03-07 20:48:24 +01:00
|
|
|
};
|
2020-01-19 18:33:22 +01:00
|
|
|
|
2021-07-18 18:39:31 +02:00
|
|
|
_jobCategories = new Dictionary<string, BoxContainer>();
|
2024-05-12 09:18:21 +10:00
|
|
|
|
|
|
|
|
RefreshAntags();
|
|
|
|
|
RefreshJobs();
|
2020-01-18 01:54:13 +01:00
|
|
|
|
2021-03-07 20:48:24 +01:00
|
|
|
#endregion Jobs
|
2020-01-18 01:54:13 +01:00
|
|
|
|
2024-05-12 09:18:21 +10:00
|
|
|
TabContainer.SetTabTitle(2, Loc.GetString("humanoid-profile-editor-antags-tab"));
|
|
|
|
|
|
|
|
|
|
RefreshTraits();
|
2020-07-06 16:24:29 -05:00
|
|
|
|
2024-05-12 09:18:21 +10:00
|
|
|
#region Markings
|
2022-09-10 17:40:06 +02:00
|
|
|
|
2024-05-12 09:18:21 +10:00
|
|
|
TabContainer.SetTabTitle(4, Loc.GetString("humanoid-profile-editor-markings-tab"));
|
|
|
|
|
|
|
|
|
|
Markings.OnMarkingAdded += OnMarkingChange;
|
|
|
|
|
Markings.OnMarkingRemoved += OnMarkingChange;
|
|
|
|
|
Markings.OnMarkingColorChange += OnMarkingChange;
|
|
|
|
|
Markings.OnMarkingRankChange += OnMarkingChange;
|
|
|
|
|
|
|
|
|
|
#endregion Markings
|
|
|
|
|
|
|
|
|
|
RefreshFlavorText();
|
|
|
|
|
|
|
|
|
|
#region Dummy
|
|
|
|
|
|
|
|
|
|
SpriteRotateLeft.OnPressed += _ =>
|
|
|
|
|
{
|
|
|
|
|
_previewRotation = _previewRotation.TurnCw();
|
|
|
|
|
SetPreviewRotation(_previewRotation);
|
|
|
|
|
};
|
|
|
|
|
SpriteRotateRight.OnPressed += _ =>
|
|
|
|
|
{
|
|
|
|
|
_previewRotation = _previewRotation.TurnCcw();
|
|
|
|
|
SetPreviewRotation(_previewRotation);
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
#endregion Dummy
|
|
|
|
|
|
|
|
|
|
#endregion Left
|
|
|
|
|
|
|
|
|
|
ShowClothes.OnToggled += args =>
|
|
|
|
|
{
|
|
|
|
|
ReloadPreview();
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
SpeciesInfoButton.OnPressed += OnSpeciesInfoButtonPressed;
|
|
|
|
|
|
|
|
|
|
UpdateSpeciesGuidebookIcon();
|
|
|
|
|
IsDirty = false;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Refreshes the flavor text editor status.
|
|
|
|
|
/// </summary>
|
|
|
|
|
public void RefreshFlavorText()
|
|
|
|
|
{
|
2025-05-17 00:27:39 -05:00
|
|
|
if (_allowFlavorText)
|
2024-05-12 09:18:21 +10:00
|
|
|
{
|
|
|
|
|
if (_flavorText != null)
|
|
|
|
|
return;
|
|
|
|
|
|
|
|
|
|
_flavorText = new FlavorText.FlavorText();
|
|
|
|
|
TabContainer.AddChild(_flavorText);
|
|
|
|
|
TabContainer.SetTabTitle(TabContainer.ChildCount - 1, Loc.GetString("humanoid-profile-editor-flavortext-tab"));
|
|
|
|
|
_flavorTextEdit = _flavorText.CFlavorTextInput;
|
|
|
|
|
|
|
|
|
|
_flavorText.OnFlavorTextChanged += OnFlavorTextChange;
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
if (_flavorText == null)
|
|
|
|
|
return;
|
|
|
|
|
|
|
|
|
|
TabContainer.RemoveChild(_flavorText);
|
|
|
|
|
_flavorText.OnFlavorTextChanged -= OnFlavorTextChange;
|
|
|
|
|
_flavorText.Dispose();
|
|
|
|
|
_flavorTextEdit?.Dispose();
|
|
|
|
|
_flavorTextEdit = null;
|
|
|
|
|
_flavorText = null;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Refreshes traits selector
|
|
|
|
|
/// </summary>
|
|
|
|
|
public void RefreshTraits()
|
|
|
|
|
{
|
|
|
|
|
TraitsList.DisposeAllChildren();
|
|
|
|
|
|
|
|
|
|
var traits = _prototypeManager.EnumeratePrototypes<TraitPrototype>().OrderBy(t => Loc.GetString(t.Name)).ToList();
|
|
|
|
|
TabContainer.SetTabTitle(3, Loc.GetString("humanoid-profile-editor-traits-tab"));
|
2022-09-10 17:40:06 +02:00
|
|
|
|
2024-06-03 21:47:06 +03:00
|
|
|
if (traits.Count < 1)
|
2022-09-10 17:40:06 +02:00
|
|
|
{
|
2024-06-03 21:47:06 +03:00
|
|
|
TraitsList.AddChild(new Label
|
2022-09-10 17:40:06 +02:00
|
|
|
{
|
2024-06-03 21:47:06 +03:00
|
|
|
Text = Loc.GetString("humanoid-profile-editor-no-traits"),
|
|
|
|
|
FontColorOverride = Color.Gray,
|
|
|
|
|
});
|
|
|
|
|
return;
|
|
|
|
|
}
|
2024-05-12 09:18:21 +10:00
|
|
|
|
2024-06-29 15:39:57 +10:00
|
|
|
// Setup model
|
|
|
|
|
Dictionary<string, List<string>> traitGroups = new();
|
2024-06-03 21:47:06 +03:00
|
|
|
List<string> defaultTraits = new();
|
2024-06-29 15:39:57 +10:00
|
|
|
traitGroups.Add(TraitCategoryPrototype.Default, defaultTraits);
|
2024-06-03 21:47:06 +03:00
|
|
|
|
|
|
|
|
foreach (var trait in traits)
|
|
|
|
|
{
|
|
|
|
|
if (trait.Category == null)
|
|
|
|
|
{
|
|
|
|
|
defaultTraits.Add(trait.ID);
|
|
|
|
|
continue;
|
|
|
|
|
}
|
|
|
|
|
|
2024-06-29 15:39:57 +10:00
|
|
|
if (!_prototypeManager.HasIndex(trait.Category))
|
|
|
|
|
continue;
|
|
|
|
|
|
|
|
|
|
var group = traitGroups.GetOrNew(trait.Category);
|
|
|
|
|
group.Add(trait.ID);
|
2024-06-03 21:47:06 +03:00
|
|
|
}
|
|
|
|
|
|
2024-06-29 15:39:57 +10:00
|
|
|
// Create UI view from model
|
|
|
|
|
foreach (var (categoryId, categoryTraits) in traitGroups)
|
2024-06-03 21:47:06 +03:00
|
|
|
{
|
|
|
|
|
TraitCategoryPrototype? category = null;
|
2024-06-29 15:39:57 +10:00
|
|
|
|
|
|
|
|
if (categoryId != TraitCategoryPrototype.Default)
|
2024-06-03 21:47:06 +03:00
|
|
|
{
|
|
|
|
|
category = _prototypeManager.Index<TraitCategoryPrototype>(categoryId);
|
|
|
|
|
// Label
|
|
|
|
|
TraitsList.AddChild(new Label
|
2024-05-12 09:18:21 +10:00
|
|
|
{
|
2024-06-03 21:47:06 +03:00
|
|
|
Text = Loc.GetString(category.Name),
|
|
|
|
|
Margin = new Thickness(0, 10, 0, 0),
|
|
|
|
|
StyleClasses = { StyleBase.StyleClassLabelHeading },
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
List<TraitPreferenceSelector?> selectors = new();
|
|
|
|
|
var selectionCount = 0;
|
|
|
|
|
|
2024-06-29 15:39:57 +10:00
|
|
|
foreach (var traitProto in categoryTraits)
|
2024-06-03 21:47:06 +03:00
|
|
|
{
|
|
|
|
|
var trait = _prototypeManager.Index<TraitPrototype>(traitProto);
|
|
|
|
|
var selector = new TraitPreferenceSelector(trait);
|
|
|
|
|
|
|
|
|
|
selector.Preference = Profile?.TraitPreferences.Contains(trait.ID) == true;
|
|
|
|
|
if (selector.Preference)
|
|
|
|
|
selectionCount += trait.Cost;
|
2022-09-10 17:40:06 +02:00
|
|
|
|
|
|
|
|
selector.PreferenceChanged += preference =>
|
|
|
|
|
{
|
2024-06-29 15:39:57 +10:00
|
|
|
if (preference)
|
|
|
|
|
{
|
|
|
|
|
Profile = Profile?.WithTraitPreference(trait.ID, _prototypeManager);
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
Profile = Profile?.WithoutTraitPreference(trait.ID, _prototypeManager);
|
|
|
|
|
}
|
|
|
|
|
|
2024-04-17 12:54:54 +10:00
|
|
|
SetDirty();
|
2024-06-03 21:47:06 +03:00
|
|
|
RefreshTraits(); // If too many traits are selected, they will be reset to the real value.
|
2022-09-10 17:40:06 +02:00
|
|
|
};
|
2024-06-03 21:47:06 +03:00
|
|
|
selectors.Add(selector);
|
|
|
|
|
}
|
2024-05-12 09:18:21 +10:00
|
|
|
|
2024-06-03 21:47:06 +03:00
|
|
|
// Selection counter
|
|
|
|
|
if (category is { MaxTraitPoints: >= 0 })
|
|
|
|
|
{
|
|
|
|
|
TraitsList.AddChild(new Label
|
|
|
|
|
{
|
|
|
|
|
Text = Loc.GetString("humanoid-profile-editor-trait-count-hint", ("current", selectionCount) ,("max", category.MaxTraitPoints)),
|
|
|
|
|
FontColorOverride = Color.Gray
|
|
|
|
|
});
|
2022-09-10 17:40:06 +02:00
|
|
|
}
|
2024-06-03 21:47:06 +03:00
|
|
|
|
|
|
|
|
foreach (var selector in selectors)
|
2022-09-10 17:40:06 +02:00
|
|
|
{
|
2024-06-03 21:47:06 +03:00
|
|
|
if (selector == null)
|
|
|
|
|
continue;
|
|
|
|
|
|
|
|
|
|
if (category is { MaxTraitPoints: >= 0 } &&
|
|
|
|
|
selector.Cost + selectionCount > category.MaxTraitPoints)
|
|
|
|
|
{
|
|
|
|
|
selector.Checkbox.Label.FontColorOverride = Color.Red;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
TraitsList.AddChild(selector);
|
|
|
|
|
}
|
2022-09-10 17:40:06 +02:00
|
|
|
}
|
2024-05-12 09:18:21 +10:00
|
|
|
}
|
2022-09-10 17:40:06 +02:00
|
|
|
|
2024-05-12 09:18:21 +10:00
|
|
|
/// <summary>
|
|
|
|
|
/// Refreshes the species selector.
|
|
|
|
|
/// </summary>
|
|
|
|
|
public void RefreshSpecies()
|
|
|
|
|
{
|
|
|
|
|
SpeciesButton.Clear();
|
|
|
|
|
_species.Clear();
|
2022-09-10 17:40:06 +02:00
|
|
|
|
2024-05-12 09:18:21 +10:00
|
|
|
_species.AddRange(_prototypeManager.EnumeratePrototypes<SpeciesPrototype>().Where(o => o.RoundStart));
|
|
|
|
|
var speciesIds = _species.Select(o => o.ID).ToList();
|
2020-01-18 01:54:13 +01:00
|
|
|
|
2024-05-12 09:18:21 +10:00
|
|
|
for (var i = 0; i < _species.Count; i++)
|
|
|
|
|
{
|
|
|
|
|
var name = Loc.GetString(_species[i].Name);
|
|
|
|
|
SpeciesButton.AddItem(name, i);
|
2020-01-18 01:54:13 +01:00
|
|
|
|
2024-05-12 09:18:21 +10:00
|
|
|
if (Profile?.Species.Equals(_species[i].ID) == true)
|
|
|
|
|
{
|
|
|
|
|
SpeciesButton.SelectId(i);
|
|
|
|
|
}
|
|
|
|
|
}
|
2020-01-18 01:54:13 +01:00
|
|
|
|
2024-05-12 09:18:21 +10:00
|
|
|
// If our species isn't available then reset it to default.
|
|
|
|
|
if (Profile != null)
|
|
|
|
|
{
|
|
|
|
|
if (!speciesIds.Contains(Profile.Species))
|
|
|
|
|
{
|
|
|
|
|
SetSpecies(SharedHumanoidAppearanceSystem.DefaultSpecies);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
2022-05-05 01:07:42 -07:00
|
|
|
|
2024-05-12 09:18:21 +10:00
|
|
|
public void RefreshAntags()
|
|
|
|
|
{
|
|
|
|
|
AntagList.DisposeAllChildren();
|
|
|
|
|
var items = new[]
|
|
|
|
|
{
|
|
|
|
|
("humanoid-profile-editor-antag-preference-yes-button", 0),
|
|
|
|
|
("humanoid-profile-editor-antag-preference-no-button", 1)
|
|
|
|
|
};
|
2022-05-05 01:07:42 -07:00
|
|
|
|
2024-05-12 09:18:21 +10:00
|
|
|
foreach (var antag in _prototypeManager.EnumeratePrototypes<AntagPrototype>().OrderBy(a => Loc.GetString(a.Name)))
|
|
|
|
|
{
|
|
|
|
|
if (!antag.SetPreference)
|
|
|
|
|
continue;
|
2022-05-05 01:07:42 -07:00
|
|
|
|
2024-05-12 09:18:21 +10:00
|
|
|
var antagContainer = new BoxContainer()
|
|
|
|
|
{
|
|
|
|
|
Orientation = LayoutOrientation.Horizontal,
|
|
|
|
|
};
|
2022-05-14 08:58:45 +10:00
|
|
|
|
2024-05-12 09:18:21 +10:00
|
|
|
var selector = new RequirementsSelector()
|
|
|
|
|
{
|
|
|
|
|
Margin = new Thickness(3f, 3f, 3f, 0f),
|
|
|
|
|
};
|
2024-06-07 00:05:58 +12:00
|
|
|
selector.OnOpenGuidebook += OnOpenGuidebook;
|
2022-05-14 08:58:45 +10:00
|
|
|
|
2024-05-12 09:18:21 +10:00
|
|
|
var title = Loc.GetString(antag.Name);
|
|
|
|
|
var description = Loc.GetString(antag.Objective);
|
2024-06-07 00:05:58 +12:00
|
|
|
selector.Setup(items, title, 250, description, guides: antag.Guides);
|
2024-05-12 09:18:21 +10:00
|
|
|
selector.Select(Profile?.AntagPreferences.Contains(antag.ID) == true ? 0 : 1);
|
2022-05-14 08:58:45 +10:00
|
|
|
|
2024-06-08 04:43:02 +12:00
|
|
|
var requirements = _entManager.System<SharedRoleSystem>().GetAntagRequirement(antag);
|
2024-08-05 07:25:49 +03:00
|
|
|
if (!_requirements.CheckRoleRequirements(requirements, (HumanoidCharacterProfile?)_preferencesManager.Preferences?.SelectedCharacter, out var reason))
|
2024-05-12 09:18:21 +10:00
|
|
|
{
|
|
|
|
|
selector.LockRequirements(reason);
|
|
|
|
|
Profile = Profile?.WithAntagPreference(antag.ID, false);
|
|
|
|
|
SetDirty();
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
selector.UnlockRequirements();
|
|
|
|
|
}
|
2022-05-14 08:58:45 +10:00
|
|
|
|
2024-05-12 09:18:21 +10:00
|
|
|
selector.OnSelected += preference =>
|
|
|
|
|
{
|
|
|
|
|
Profile = Profile?.WithAntagPreference(antag.ID, preference == 0);
|
|
|
|
|
SetDirty();
|
|
|
|
|
};
|
2023-09-13 04:57:38 +03:00
|
|
|
|
2024-05-12 09:18:21 +10:00
|
|
|
antagContainer.AddChild(selector);
|
2023-09-13 04:57:38 +03:00
|
|
|
|
2024-05-12 09:18:21 +10:00
|
|
|
antagContainer.AddChild(new Button()
|
|
|
|
|
{
|
|
|
|
|
Disabled = true,
|
|
|
|
|
Text = Loc.GetString("loadout-window"),
|
|
|
|
|
HorizontalAlignment = HAlignment.Right,
|
|
|
|
|
Margin = new Thickness(3f, 0f, 0f, 0f),
|
|
|
|
|
});
|
Humanoid appearance refactor (#10882)
* initial commit
- species prototype modifications
- markings points as its own file
- shared humanoid component
* adds a tool to convert sprite accessories to markings (in go)
* removes a fmt call
* converts sprite accessory to markings
* adds hair and facial hair to marking categories
* multiple changes
- humanoid visualizer system
- markings modifications for visualizer
- modifications to shared humanoid component
- lays out a base for humanoid system
* hidden layers, ports some properties from appearance component, shrinks DefaultMarkings a little
* squishes the initialize event calls into one function
adds stuff to set species/skin color externally from a server message - currently laid out as if it a dirty call to a networked component, may be subject to change (server-side has not been implemented yet)
* makes the sprite pipeline more obvious
* apply all markings, hidden layer set replacement
* ensures that markings are cleared when the new set is applied
* starts refactoring markingsset (unfinished)
* more additions to the markingset api
* adds constructor logic to markingset
* adds a method to filter out markings in a set based on a given species
* fixes enumerators in markingset
* adds validator into MarkingSet, fixes ForwardMarkingEnumerator
* modifications to the humanoid visual system
* ensuredefault in markingset
* oop
* fixes up data keys, populates OnAppearanceChange in visualizer
* changes to humanoid component, markings
marking equality is now more strict, humanoidcomponent is now implemented for client as a child of sharedhumanoidcomponent
* markings are now applied the visualizer by diffing them
* base sprites are now applied to humanoids from humanoidvisualizer
* passes along base sprite settings to the marking application so that markings know to follow skin color/alpha or not (see: slimes)
* custom base layers on humanoids
* merges all data keys into one data class for humanoid visualizers
* setappearance in sharedhumanoidsystem, removes custombaselayercolors
* humanoidcomponent, system (empty) in server
* adds some basic public API functions to HumanoidSystem
* add marking, remove marking
* changes appearance MarkingsSet to a List<Marking>, adds listener for PlayerSpawnCompleteEvent in HumanoidSystem
* ensuredefaultmarkings, oninit for humanoids
* markingmanager API changes
* removes MarkingsSet
* LoadProfile, adjusts randomization in humanoid appearance to account for species
* base layer settings in humanoidsystem, eye color from profile
* rearranges files to centralize under Humanoid namespace
* more reorganization, deletes some stuff
gotta break stuff to make other things work, right?
goodbye SpriteAccessory...
* fixes a good chunk of server-side issues
still does not compile, yet
* singlemarkingpicker xaml layout
* singlemarkingpicker logic
* magic mirror window (varying pieces of it, mostly client-oriented)
* removes some imports, gives MagicMirror a BUI class (not filled in yet)
* populates magic mirror BUI functionality / window callbacks
* fixes up some errors in humanoidprofileeditor
* changes to SingleMarkingPicker
SingleMarkingPicker now accepts a List<Marking>, species, and total possible markings available in that marking category
* fixes up hair pickers on humanoid profile editor
* fixes the errors in markingpicker
* markingsystem is now gone
* fixes a bunch of build errors
* so that's why i did it like that
* namespace issues, adds robustxamlloader to singlemarkingpicker
* another robustxamlloader
* human, lizard sprites/points
* prototype fixes, deletion of old spriteaccessory
* component registration, fixes dwarf skin toning
no, 'ReptilianToned' does not exist
* removes component registration from abstract humanoid component
* visualizer data now cloneable
* serialize for visualizer key
* zero-count edge case
* missing semi-colon moment
* setspecies in humanoidsystem
* ensures that default markings, if empty, will cause ensuredefault to skip over that given category
* tryadd instead of add
* whoops
* diff and apply should properly apply markings now
* always ensure default, fixes double load for player spawning
* apply skin color now sets the skin color property in humanoidcomponent
* removes sprite from a few species prototypes
* sprite changes for specific base layers based on humanoid sex
* layer ordering fix, and a missing base layer should now disallow markings on that layer
* anymarking base layer, adds the right leg/foot for humans
* loading a profile will now clear all markings on that humanoid
* adds missing layers for humans
* separates species.yml into respective species prototype files
* ensures that if layer visibility was changed, all markings have to be reapplied
* server-side enforcement of hiding hair (and other head-related markings) when equipping things that hide hair
* slime fix, clothingsystem now dictates layer visibility server side
* sussy
* layer settings should now ensure a marking should match the skin tone
* whoops
* skincolor static class and functions in UI
* skin color validation in humanoidcharacterappearance
* markingpicker now shows only the markings for the selected category in used
* getter for slot in singlemarkingpicker now ensures slot is 0 if markings exists
* FilterSpecies no longer attempts to do removal while iterating
* expands for SingleMarkingPicker
* humanoid base dummy has blank layers now (and snout/tail/headside/headtop)
* fixes an issue with visualizer system if the marking count was different but the markings themselves were (somewhat) the same
* whoops
* adds edge case handlers for count differences in humanoid markings
* preview now loads profile instead of directly setting appearance
* moves marking set loading to update controls
* clones a marking set in markingpicker by using the deep clone constructor
* whoops (deep cloning a marking now copies the marking id)
* adds replace function for markingset
* points should now update after the markings are remove/added
* merging base layer sprites into a humanoid should now clear them before merging
* sets dirty range start to count only if the dirty range start was never set above 0
* fixes up some issues with singlemarkingpicker
* color selector sliders in single marking picker should now expand
* hair from hair pickers should now apply in profile loading (client-side)
* category in singlemarkingpicker now sets the private category variable
* slot selector should now populate
* single marking picker buttons now have text, also shows the category name over all user-clickable elements
* removes a comment
* removing hair slots now sets it to bald, defaults to zero used slots if current hair is bald on hair/facial hair
* random skin color, eye color
* populate colors now checks if the marking count is greater than zero in singlemarkingpicker
* hair/facial hair pickers now just get the first possible hair from the respective species list
* different approach to random skin color
* oh, that's why it wasn't working
* randomize everything now just updates every single control
* selecting a new marking in SingleMarkingPicker should attempt to copy over old colors, populate list now uses cache,
* markingmanager now uses OnlyWhitelisted to populate by category and species
* filterspecies now uses onlyWhitelist to filter markings based on whitelist or not
* oops
* ui fix for singlemarkingpicker, ensures that cache is not null if it is null when populatelist is called
* order of operations for the horizontal expand for add/remove
* hair pickers should now update when you add/remove the hair slot
* fixes variable naming error in character appearance
* loc string fix in singlemarkingpicker
* lizards, vox now have onlyWhitelist, vox restriction for hair/facialhairs
* having zero possible hairs should no longer cause an exception in randomization
* setting species should now update hair pickers
* ignore categories for marking picker
* and a clear as well for the category button
* places that functionality in its own function instead
* adds eye base sprite, vox now also have their own custom eye sprites
* loading a profile client-side should do FilterSpecies for markings now
* client-side load profile does filter species after adding in the hairs now
* magic mirror
* callbacks now call the callback instead of adding it on construct
* whoops
* in removemarking too
* adds missing synchronize calls
* comments out an updateinterface call in magic mirror
* magic mirror window title, minimum sizing
* fixes minsize, adds warning for players who try to set their hair for species that have no hair
* removes spaces in xaml
* namespace changes/organization
* whoopsie (merge conflicts)
* re-enables identity from humanoid component
* damagevisuals now uses the enum given to it instead of the layerstate given on that layer tied to the enum
* removes commas from json
* changes to visuals system so the change is consistent
* chest
* reptilian
* visualizer system now handles body sprite setting/coloration, similar to how characterappearance did it
not a big fan of this
* adds a check in applybasesprites
* adding/removing parts should now make them invisible on a humanoid
* body part removal/adding now enumerates over sublayers instead
* synchro now runs in bodycomponent startup
* parts instead of slots
* humanoidcompnent check
* switches from rsi to actualrsi
* removes all the body stuff (too slow)
* cleans up resolves from humanoid visualizer system
* merging sprites now checks if the base sprites have been modified or not (through things like species changes, or custom base sprite changes)
* not forgetting that one again
* merging now returns an actual dirty value
* replaces the sequenceequal with a more accurate solution
* permanent layers, layer visibility on add/remove part in body
* should send all hidden layers over now
* isdirty in visualizer system for base layers
* isdirty checks count as well
* ok, IsDirty should now set the base layers if the merged sprites are different
* equals override in HumanoidSpritePrototypes.cs
temporary until record prototypes :heck:
* makes fields readonly, equates IDs instead
* adds forced markings through marking picker
* forced in humanoidsystem api, ignorespecies in markingpicker
* marking bui
* makes that serializable as well
* ignore species/forced toggles now work
* adds icon to modifier verb, interface and keys to humanoid bases
* needs the actual enum value to open, no?
* makes the key the actual key
* actions now propagate upwards
* ignore species when set now repopulates markingpicker
* modifiable base layers in the markings window
* oops!
* layout changes
* info box should now appear
* adds ignorespecies for marking picker, collapsible for base layer section of appearance modification window
* collapsible layout moment
* if base layers have changed, all markings are now dirty (and if a base layer is missing, the marking is still 'applied' but it's now just invisible
* small change to marking visibility
* small changes to modifier UI
* markings now match skin on zombification
* zombie stuff
* makes the line edit in marking modifier window more obvious
* disables vox on round start
* horizontal expand on the single label in base layer modifiers
* humanoid profiles in prototypes
* randomhumanoidappearance won't work if the humanoid has a profile already stored
* removes unused code
* documentation in humanoidsystem server-side
* documentation in shared/client
* whoops
* converts accessory into marking in locale files (also adds marking loc string into single marking picker)
* be gone, shared humanoid appearance system from the last upstream merge
* species ignore on randomization (defaults to no ignored species)
* more upstream merge parts that bypassed any errors before merge
* addresses review (also just adds typeserializers in some places)
* submodule moment
* upstream merge issues
2022-09-22 15:19:00 -07:00
|
|
|
|
2024-05-12 09:18:21 +10:00
|
|
|
AntagList.AddChild(antagContainer);
|
|
|
|
|
}
|
|
|
|
|
}
|
2020-11-08 13:44:04 +01:00
|
|
|
|
2024-05-12 09:18:21 +10:00
|
|
|
private void SetDirty()
|
|
|
|
|
{
|
|
|
|
|
// If it equals default then reset the button.
|
|
|
|
|
if (Profile == null || _preferencesManager.Preferences?.SelectedCharacter.MemberwiseEquals(Profile) == true)
|
2022-01-08 19:53:14 -06:00
|
|
|
{
|
2024-05-12 09:18:21 +10:00
|
|
|
IsDirty = false;
|
|
|
|
|
return;
|
2022-01-08 19:53:14 -06:00
|
|
|
}
|
|
|
|
|
|
2024-05-12 09:18:21 +10:00
|
|
|
// TODO: Check if profile matches default.
|
|
|
|
|
IsDirty = true;
|
|
|
|
|
}
|
2024-04-17 12:54:54 +10:00
|
|
|
|
2024-05-12 09:18:21 +10:00
|
|
|
/// <summary>
|
|
|
|
|
/// Refresh all loadouts.
|
|
|
|
|
/// </summary>
|
|
|
|
|
public void RefreshLoadouts()
|
|
|
|
|
{
|
|
|
|
|
_loadoutWindow?.Dispose();
|
|
|
|
|
}
|
2022-01-08 19:53:14 -06:00
|
|
|
|
2024-05-12 09:18:21 +10:00
|
|
|
/// <summary>
|
|
|
|
|
/// Reloads the entire dummy entity for preview.
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <remarks>
|
|
|
|
|
/// This is expensive so not recommended to run if you have a slider.
|
|
|
|
|
/// </remarks>
|
|
|
|
|
private void ReloadPreview()
|
|
|
|
|
{
|
|
|
|
|
_entManager.DeleteEntity(PreviewDummy);
|
|
|
|
|
PreviewDummy = EntityUid.Invalid;
|
2024-03-11 04:01:32 +01:00
|
|
|
|
2024-08-01 01:14:19 +10:00
|
|
|
if (Profile == null || !_prototypeManager.HasIndex(Profile.Species))
|
2024-05-12 09:18:21 +10:00
|
|
|
return;
|
|
|
|
|
|
|
|
|
|
PreviewDummy = _controller.LoadProfileEntity(Profile, JobOverride, ShowClothes.Pressed);
|
|
|
|
|
SpriteView.SetEntity(PreviewDummy);
|
2024-08-01 01:14:19 +10:00
|
|
|
_entManager.System<MetaDataSystem>().SetEntityName(PreviewDummy, Profile.Name);
|
2024-08-27 11:20:12 +01:00
|
|
|
|
|
|
|
|
// Check and set the dirty flag to enable the save/reset buttons as appropriate.
|
|
|
|
|
SetDirty();
|
2024-05-12 09:18:21 +10:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Resets the profile to the defaults.
|
|
|
|
|
/// </summary>
|
|
|
|
|
public void ResetToDefault()
|
|
|
|
|
{
|
|
|
|
|
SetProfile(
|
|
|
|
|
(HumanoidCharacterProfile?) _preferencesManager.Preferences?.SelectedCharacter,
|
|
|
|
|
_preferencesManager.Preferences?.SelectedCharacterIndex);
|
|
|
|
|
}
|
2022-05-05 01:07:42 -07:00
|
|
|
|
2024-05-12 09:18:21 +10:00
|
|
|
/// <summary>
|
|
|
|
|
/// Sets the editor to the specified profile with the specified slot.
|
|
|
|
|
/// </summary>
|
|
|
|
|
public void SetProfile(HumanoidCharacterProfile? profile, int? slot)
|
|
|
|
|
{
|
|
|
|
|
Profile = profile?.Clone();
|
|
|
|
|
CharacterSlot = slot;
|
2022-01-08 19:53:14 -06:00
|
|
|
IsDirty = false;
|
2024-05-12 09:18:21 +10:00
|
|
|
JobOverride = null;
|
|
|
|
|
|
|
|
|
|
UpdateNameEdit();
|
|
|
|
|
UpdateFlavorTextEdit();
|
|
|
|
|
UpdateSexControls();
|
|
|
|
|
UpdateGenderControls();
|
|
|
|
|
UpdateSkinColor();
|
|
|
|
|
UpdateSpawnPriorityControls();
|
|
|
|
|
UpdateAgeEdit();
|
|
|
|
|
UpdateEyePickers();
|
|
|
|
|
UpdateSaveButton();
|
|
|
|
|
UpdateMarkings();
|
|
|
|
|
UpdateHairPickers();
|
|
|
|
|
UpdateCMarkingsHair();
|
|
|
|
|
UpdateCMarkingsFacialHair();
|
|
|
|
|
|
|
|
|
|
RefreshAntags();
|
|
|
|
|
RefreshJobs();
|
|
|
|
|
RefreshLoadouts();
|
|
|
|
|
RefreshSpecies();
|
|
|
|
|
RefreshTraits();
|
|
|
|
|
RefreshFlavorText();
|
|
|
|
|
ReloadPreview();
|
|
|
|
|
|
|
|
|
|
if (Profile != null)
|
|
|
|
|
{
|
|
|
|
|
PreferenceUnavailableButton.SelectId((int) Profile.PreferenceUnavailable);
|
|
|
|
|
}
|
2024-04-17 12:54:54 +10:00
|
|
|
}
|
|
|
|
|
|
2024-05-12 09:18:21 +10:00
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// A slim reload that only updates the entity itself and not any of the job entities, etc.
|
|
|
|
|
/// </summary>
|
|
|
|
|
private void ReloadProfilePreview()
|
2024-04-17 12:54:54 +10:00
|
|
|
{
|
2024-05-12 09:18:21 +10:00
|
|
|
if (Profile == null || !_entManager.EntityExists(PreviewDummy))
|
|
|
|
|
return;
|
|
|
|
|
|
|
|
|
|
_entManager.System<HumanoidAppearanceSystem>().LoadProfile(PreviewDummy, Profile);
|
2024-08-27 11:20:12 +01:00
|
|
|
|
|
|
|
|
// Check and set the dirty flag to enable the save/reset buttons as appropriate.
|
|
|
|
|
SetDirty();
|
2022-01-08 19:53:14 -06:00
|
|
|
}
|
|
|
|
|
|
2024-03-11 04:01:32 +01:00
|
|
|
private void OnSpeciesInfoButtonPressed(BaseButton.ButtonEventArgs args)
|
|
|
|
|
{
|
2024-06-07 00:05:58 +12:00
|
|
|
// TODO GUIDEBOOK
|
|
|
|
|
// make the species guide book a field on the species prototype.
|
|
|
|
|
// I.e., do what jobs/antags do.
|
|
|
|
|
|
2024-03-11 04:01:32 +01:00
|
|
|
var guidebookController = UserInterfaceManager.GetUIController<GuidebookUIController>();
|
|
|
|
|
var species = Profile?.Species ?? SharedHumanoidAppearanceSystem.DefaultSpecies;
|
2024-04-16 22:57:43 +10:00
|
|
|
var page = DefaultSpeciesGuidebook;
|
2024-03-11 04:01:32 +01:00
|
|
|
if (_prototypeManager.HasIndex<GuideEntryPrototype>(species))
|
2025-07-07 15:57:05 -04:00
|
|
|
page = new ProtoId<GuideEntryPrototype>(species.Id); // Gross. See above todo comment.
|
2024-03-11 04:01:32 +01:00
|
|
|
|
2025-09-09 18:17:56 +02:00
|
|
|
if (_prototypeManager.Resolve(DefaultSpeciesGuidebook, out var guideRoot))
|
2024-03-11 04:01:32 +01:00
|
|
|
{
|
2024-06-07 00:05:58 +12:00
|
|
|
var dict = new Dictionary<ProtoId<GuideEntryPrototype>, GuideEntry>();
|
2024-04-16 22:57:43 +10:00
|
|
|
dict.Add(DefaultSpeciesGuidebook, guideRoot);
|
2024-03-11 04:01:32 +01:00
|
|
|
//TODO: Don't close the guidebook if its already open, just go to the correct page
|
2024-06-07 00:05:58 +12:00
|
|
|
guidebookController.OpenGuidebook(dict, includeChildren:true, selected: page);
|
2024-03-11 04:01:32 +01:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2024-05-12 09:18:21 +10:00
|
|
|
/// <summary>
|
|
|
|
|
/// Refreshes all job selectors.
|
|
|
|
|
/// </summary>
|
|
|
|
|
public void RefreshJobs()
|
2024-04-16 22:57:43 +10:00
|
|
|
{
|
2024-05-12 09:18:21 +10:00
|
|
|
JobList.DisposeAllChildren();
|
2023-05-27 14:22:22 +10:00
|
|
|
_jobCategories.Clear();
|
2024-05-12 09:18:21 +10:00
|
|
|
_jobPriorities.Clear();
|
2023-05-27 14:22:22 +10:00
|
|
|
var firstCategory = true;
|
|
|
|
|
|
2024-06-02 09:49:34 +10:00
|
|
|
// Get all displayed departments
|
|
|
|
|
var departments = new List<DepartmentPrototype>();
|
|
|
|
|
foreach (var department in _prototypeManager.EnumeratePrototypes<DepartmentPrototype>())
|
|
|
|
|
{
|
|
|
|
|
if (department.EditorHidden)
|
|
|
|
|
continue;
|
|
|
|
|
|
|
|
|
|
departments.Add(department);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
departments.Sort(DepartmentUIComparer.Instance);
|
2024-01-21 02:03:10 +04:00
|
|
|
|
2024-05-12 09:18:21 +10:00
|
|
|
var items = new[]
|
|
|
|
|
{
|
|
|
|
|
("humanoid-profile-editor-job-priority-never-button", (int) JobPriority.Never),
|
|
|
|
|
("humanoid-profile-editor-job-priority-low-button", (int) JobPriority.Low),
|
|
|
|
|
("humanoid-profile-editor-job-priority-medium-button", (int) JobPriority.Medium),
|
|
|
|
|
("humanoid-profile-editor-job-priority-high-button", (int) JobPriority.High),
|
|
|
|
|
};
|
|
|
|
|
|
2024-01-21 02:03:10 +04:00
|
|
|
foreach (var department in departments)
|
2023-05-27 14:22:22 +10:00
|
|
|
{
|
2025-01-24 04:46:32 +01:00
|
|
|
var departmentName = Loc.GetString(department.Name);
|
2023-05-27 14:22:22 +10:00
|
|
|
|
|
|
|
|
if (!_jobCategories.TryGetValue(department.ID, out var category))
|
|
|
|
|
{
|
|
|
|
|
category = new BoxContainer
|
|
|
|
|
{
|
|
|
|
|
Orientation = LayoutOrientation.Vertical,
|
|
|
|
|
Name = department.ID,
|
|
|
|
|
ToolTip = Loc.GetString("humanoid-profile-editor-jobs-amount-in-department-tooltip",
|
|
|
|
|
("departmentName", departmentName))
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
if (firstCategory)
|
|
|
|
|
{
|
|
|
|
|
firstCategory = false;
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
category.AddChild(new Control
|
|
|
|
|
{
|
|
|
|
|
MinSize = new Vector2(0, 23),
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
category.AddChild(new PanelContainer
|
|
|
|
|
{
|
|
|
|
|
PanelOverride = new StyleBoxFlat {BackgroundColor = Color.FromHex("#464966")},
|
|
|
|
|
Children =
|
|
|
|
|
{
|
|
|
|
|
new Label
|
|
|
|
|
{
|
|
|
|
|
Text = Loc.GetString("humanoid-profile-editor-department-jobs-label",
|
|
|
|
|
("departmentName", departmentName)),
|
|
|
|
|
Margin = new Thickness(5f, 0, 0, 0)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
_jobCategories[department.ID] = category;
|
2024-05-12 09:18:21 +10:00
|
|
|
JobList.AddChild(category);
|
2023-05-27 14:22:22 +10:00
|
|
|
}
|
|
|
|
|
|
2024-06-02 09:49:34 +10:00
|
|
|
var jobs = department.Roles.Select(jobId => _prototypeManager.Index(jobId))
|
2024-02-23 14:19:52 +01:00
|
|
|
.Where(job => job.SetPreference)
|
|
|
|
|
.ToArray();
|
2024-05-12 09:18:21 +10:00
|
|
|
|
Make department / job list sorting consistent. (#25486)
* Make department / job list sorting consistent.
This makes late join, crew manifest and character profile all apply consistent sorting for jobs and departments.
We use the already-defined weights for departments (so command, then sec, then station specific, then just sort by prototype ID). Jobs also use weight (so heads are always at the top) then prototype ID, then character name (for manifest).
Removed the crewmanifest.ordering CVar as doing it via prototype weight is just easier, and that CVar was already a mess anyways.
* Fix jittery job icons in lists.
They were set to KeepCentered in TextureRect. This has issues because the allocated space is actually an odd number of pixels, so it tries to position the draw at a half pixel offset.
Now, yes, fixing this in TextureRect would make much more sense, but get off my back. (Ok seriously we need better helper functions for doing that in the engine. Don't wanna deal with that right now and I already have this patch made.)
Instead I'm just gonna fix the issue by using VerticalAlignment in all these places instead which ends up doing exactly the same thing YIPPEE.
Also gave a margin next to the icon on the crew manifest. Margins people!
2024-02-23 05:04:44 +01:00
|
|
|
Array.Sort(jobs, JobUIComparer.Instance);
|
2023-05-27 14:22:22 +10:00
|
|
|
|
|
|
|
|
foreach (var job in jobs)
|
|
|
|
|
{
|
2024-05-12 09:18:21 +10:00
|
|
|
var jobContainer = new BoxContainer()
|
|
|
|
|
{
|
|
|
|
|
Orientation = LayoutOrientation.Horizontal,
|
|
|
|
|
};
|
2024-04-17 12:54:54 +10:00
|
|
|
|
2024-05-12 09:18:21 +10:00
|
|
|
var selector = new RequirementsSelector()
|
2024-04-16 22:57:43 +10:00
|
|
|
{
|
|
|
|
|
Margin = new Thickness(3f, 3f, 3f, 0f),
|
|
|
|
|
};
|
2024-06-07 00:05:58 +12:00
|
|
|
selector.OnOpenGuidebook += OnOpenGuidebook;
|
2023-05-27 14:22:22 +10:00
|
|
|
|
2024-05-12 09:18:21 +10:00
|
|
|
var icon = new TextureRect
|
|
|
|
|
{
|
|
|
|
|
TextureScale = new Vector2(2, 2),
|
|
|
|
|
VerticalAlignment = VAlignment.Center
|
|
|
|
|
};
|
2024-06-03 12:12:21 -04:00
|
|
|
var jobIcon = _prototypeManager.Index(job.Icon);
|
2025-04-10 10:47:05 +00:00
|
|
|
icon.Texture = _sprite.Frame0(jobIcon.Icon);
|
2024-06-07 00:05:58 +12:00
|
|
|
selector.Setup(items, job.LocalizedName, 200, job.LocalizedDescription, icon, job.Guides);
|
2024-05-12 09:18:21 +10:00
|
|
|
|
2024-08-05 07:25:49 +03:00
|
|
|
if (!_requirements.IsAllowed(job, (HumanoidCharacterProfile?)_preferencesManager.Preferences?.SelectedCharacter, out var reason))
|
2023-05-27 14:22:22 +10:00
|
|
|
{
|
|
|
|
|
selector.LockRequirements(reason);
|
|
|
|
|
}
|
2024-05-12 09:18:21 +10:00
|
|
|
else
|
2024-04-16 22:57:43 +10:00
|
|
|
{
|
2024-05-12 09:18:21 +10:00
|
|
|
selector.UnlockRequirements();
|
|
|
|
|
}
|
2024-04-16 22:57:43 +10:00
|
|
|
|
2024-05-12 09:18:21 +10:00
|
|
|
selector.OnSelected += selectedPrio =>
|
2023-05-27 14:22:22 +10:00
|
|
|
{
|
2024-05-12 09:18:21 +10:00
|
|
|
var selectedJobPrio = (JobPriority) selectedPrio;
|
|
|
|
|
Profile = Profile?.WithJobPriority(job.ID, selectedJobPrio);
|
2023-05-27 14:22:22 +10:00
|
|
|
|
2024-05-12 09:18:21 +10:00
|
|
|
foreach (var (jobId, other) in _jobPriorities)
|
2023-05-27 14:22:22 +10:00
|
|
|
{
|
|
|
|
|
// Sync other selectors with the same job in case of multiple department jobs
|
2024-05-12 09:18:21 +10:00
|
|
|
if (jobId == job.ID)
|
2023-05-27 14:22:22 +10:00
|
|
|
{
|
2024-05-12 09:18:21 +10:00
|
|
|
other.Select(selectedPrio);
|
2024-06-02 09:49:34 +10:00
|
|
|
continue;
|
2023-05-27 14:22:22 +10:00
|
|
|
}
|
2024-06-02 09:49:34 +10:00
|
|
|
|
|
|
|
|
if (selectedJobPrio != JobPriority.High || (JobPriority) other.Selected != JobPriority.High)
|
|
|
|
|
continue;
|
|
|
|
|
|
|
|
|
|
// Lower any other high priorities to medium.
|
|
|
|
|
other.Select((int)JobPriority.Medium);
|
|
|
|
|
Profile = Profile?.WithJobPriority(jobId, JobPriority.Medium);
|
2023-05-27 14:22:22 +10:00
|
|
|
}
|
2024-04-17 12:54:54 +10:00
|
|
|
|
2024-05-12 09:18:21 +10:00
|
|
|
// TODO: Only reload on high change (either to or from).
|
|
|
|
|
ReloadPreview();
|
|
|
|
|
|
|
|
|
|
UpdateJobPriorities();
|
2024-04-17 12:54:54 +10:00
|
|
|
SetDirty();
|
2023-05-27 14:22:22 +10:00
|
|
|
};
|
|
|
|
|
|
2024-05-12 09:18:21 +10:00
|
|
|
var loadoutWindowBtn = new Button()
|
|
|
|
|
{
|
|
|
|
|
Text = Loc.GetString("loadout-window"),
|
|
|
|
|
HorizontalAlignment = HAlignment.Right,
|
|
|
|
|
VerticalAlignment = VAlignment.Center,
|
|
|
|
|
Margin = new Thickness(3f, 3f, 0f, 0f),
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
var collection = IoCManager.Instance!;
|
|
|
|
|
var protoManager = collection.Resolve<IPrototypeManager>();
|
|
|
|
|
|
|
|
|
|
// If no loadout found then disabled button
|
|
|
|
|
if (!protoManager.TryIndex<RoleLoadoutPrototype>(LoadoutSystem.GetJobPrototype(job.ID), out var roleLoadoutProto))
|
|
|
|
|
{
|
|
|
|
|
loadoutWindowBtn.Disabled = true;
|
|
|
|
|
}
|
|
|
|
|
// else
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
loadoutWindowBtn.OnPressed += args =>
|
|
|
|
|
{
|
|
|
|
|
RoleLoadout? loadout = null;
|
|
|
|
|
|
|
|
|
|
// Clone so we don't modify the underlying loadout.
|
|
|
|
|
Profile?.Loadouts.TryGetValue(LoadoutSystem.GetJobPrototype(job.ID), out loadout);
|
|
|
|
|
loadout = loadout?.Clone();
|
|
|
|
|
|
|
|
|
|
if (loadout == null)
|
|
|
|
|
{
|
|
|
|
|
loadout = new RoleLoadout(roleLoadoutProto.ID);
|
2024-06-15 16:53:42 +10:00
|
|
|
loadout.SetDefault(Profile, _playerManager.LocalSession, _prototypeManager);
|
2024-05-12 09:18:21 +10:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
OpenLoadout(job, loadout, roleLoadoutProto);
|
|
|
|
|
};
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
_jobPriorities.Add((job.ID, selector));
|
|
|
|
|
jobContainer.AddChild(selector);
|
|
|
|
|
jobContainer.AddChild(loadoutWindowBtn);
|
|
|
|
|
category.AddChild(jobContainer);
|
2023-05-27 14:22:22 +10:00
|
|
|
}
|
|
|
|
|
}
|
2024-01-21 02:03:10 +04:00
|
|
|
|
2024-05-12 09:18:21 +10:00
|
|
|
UpdateJobPriorities();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private void OpenLoadout(JobPrototype? jobProto, RoleLoadout roleLoadout, RoleLoadoutPrototype roleLoadoutProto)
|
|
|
|
|
{
|
|
|
|
|
_loadoutWindow?.Dispose();
|
|
|
|
|
_loadoutWindow = null;
|
|
|
|
|
var collection = IoCManager.Instance;
|
|
|
|
|
|
|
|
|
|
if (collection == null || _playerManager.LocalSession == null || Profile == null)
|
|
|
|
|
return;
|
|
|
|
|
|
|
|
|
|
JobOverride = jobProto;
|
|
|
|
|
var session = _playerManager.LocalSession;
|
|
|
|
|
|
|
|
|
|
_loadoutWindow = new LoadoutWindow(Profile, roleLoadout, roleLoadoutProto, _playerManager.LocalSession, collection)
|
2024-01-21 02:03:10 +04:00
|
|
|
{
|
2025-08-05 18:13:04 +03:00
|
|
|
Title = Loc.GetString("loadout-window-title-loadout", ("job", $"{jobProto?.LocalizedName}")),
|
2024-05-12 09:18:21 +10:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
// Refresh the buttons etc.
|
|
|
|
|
_loadoutWindow.RefreshLoadouts(roleLoadout, session, collection);
|
|
|
|
|
_loadoutWindow.OpenCenteredLeft();
|
|
|
|
|
|
2025-02-12 04:30:24 +11:00
|
|
|
_loadoutWindow.OnNameChanged += name =>
|
|
|
|
|
{
|
|
|
|
|
roleLoadout.EntityName = name;
|
|
|
|
|
Profile = Profile.WithLoadout(roleLoadout);
|
|
|
|
|
SetDirty();
|
|
|
|
|
};
|
|
|
|
|
|
2024-05-12 09:18:21 +10:00
|
|
|
_loadoutWindow.OnLoadoutPressed += (loadoutGroup, loadoutProto) =>
|
|
|
|
|
{
|
|
|
|
|
roleLoadout.AddLoadout(loadoutGroup, loadoutProto, _prototypeManager);
|
|
|
|
|
_loadoutWindow.RefreshLoadouts(roleLoadout, session, collection);
|
|
|
|
|
Profile = Profile?.WithLoadout(roleLoadout);
|
|
|
|
|
ReloadPreview();
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
_loadoutWindow.OnLoadoutUnpressed += (loadoutGroup, loadoutProto) =>
|
|
|
|
|
{
|
|
|
|
|
roleLoadout.RemoveLoadout(loadoutGroup, loadoutProto, _prototypeManager);
|
|
|
|
|
_loadoutWindow.RefreshLoadouts(roleLoadout, session, collection);
|
|
|
|
|
Profile = Profile?.WithLoadout(roleLoadout);
|
|
|
|
|
ReloadPreview();
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
JobOverride = jobProto;
|
|
|
|
|
ReloadPreview();
|
|
|
|
|
|
|
|
|
|
_loadoutWindow.OnClose += () =>
|
|
|
|
|
{
|
|
|
|
|
JobOverride = null;
|
|
|
|
|
ReloadPreview();
|
|
|
|
|
};
|
2024-06-02 09:49:34 +10:00
|
|
|
|
|
|
|
|
if (Profile is null)
|
|
|
|
|
return;
|
|
|
|
|
|
|
|
|
|
UpdateJobPriorities();
|
2023-05-27 14:22:22 +10:00
|
|
|
}
|
|
|
|
|
|
2022-05-14 08:58:45 +10:00
|
|
|
private void OnFlavorTextChange(string content)
|
|
|
|
|
{
|
|
|
|
|
if (Profile is null)
|
|
|
|
|
return;
|
|
|
|
|
|
|
|
|
|
Profile = Profile.WithFlavorText(content);
|
2024-04-17 12:54:54 +10:00
|
|
|
SetDirty();
|
2022-05-14 08:58:45 +10:00
|
|
|
}
|
|
|
|
|
|
Humanoid appearance refactor (#10882)
* initial commit
- species prototype modifications
- markings points as its own file
- shared humanoid component
* adds a tool to convert sprite accessories to markings (in go)
* removes a fmt call
* converts sprite accessory to markings
* adds hair and facial hair to marking categories
* multiple changes
- humanoid visualizer system
- markings modifications for visualizer
- modifications to shared humanoid component
- lays out a base for humanoid system
* hidden layers, ports some properties from appearance component, shrinks DefaultMarkings a little
* squishes the initialize event calls into one function
adds stuff to set species/skin color externally from a server message - currently laid out as if it a dirty call to a networked component, may be subject to change (server-side has not been implemented yet)
* makes the sprite pipeline more obvious
* apply all markings, hidden layer set replacement
* ensures that markings are cleared when the new set is applied
* starts refactoring markingsset (unfinished)
* more additions to the markingset api
* adds constructor logic to markingset
* adds a method to filter out markings in a set based on a given species
* fixes enumerators in markingset
* adds validator into MarkingSet, fixes ForwardMarkingEnumerator
* modifications to the humanoid visual system
* ensuredefault in markingset
* oop
* fixes up data keys, populates OnAppearanceChange in visualizer
* changes to humanoid component, markings
marking equality is now more strict, humanoidcomponent is now implemented for client as a child of sharedhumanoidcomponent
* markings are now applied the visualizer by diffing them
* base sprites are now applied to humanoids from humanoidvisualizer
* passes along base sprite settings to the marking application so that markings know to follow skin color/alpha or not (see: slimes)
* custom base layers on humanoids
* merges all data keys into one data class for humanoid visualizers
* setappearance in sharedhumanoidsystem, removes custombaselayercolors
* humanoidcomponent, system (empty) in server
* adds some basic public API functions to HumanoidSystem
* add marking, remove marking
* changes appearance MarkingsSet to a List<Marking>, adds listener for PlayerSpawnCompleteEvent in HumanoidSystem
* ensuredefaultmarkings, oninit for humanoids
* markingmanager API changes
* removes MarkingsSet
* LoadProfile, adjusts randomization in humanoid appearance to account for species
* base layer settings in humanoidsystem, eye color from profile
* rearranges files to centralize under Humanoid namespace
* more reorganization, deletes some stuff
gotta break stuff to make other things work, right?
goodbye SpriteAccessory...
* fixes a good chunk of server-side issues
still does not compile, yet
* singlemarkingpicker xaml layout
* singlemarkingpicker logic
* magic mirror window (varying pieces of it, mostly client-oriented)
* removes some imports, gives MagicMirror a BUI class (not filled in yet)
* populates magic mirror BUI functionality / window callbacks
* fixes up some errors in humanoidprofileeditor
* changes to SingleMarkingPicker
SingleMarkingPicker now accepts a List<Marking>, species, and total possible markings available in that marking category
* fixes up hair pickers on humanoid profile editor
* fixes the errors in markingpicker
* markingsystem is now gone
* fixes a bunch of build errors
* so that's why i did it like that
* namespace issues, adds robustxamlloader to singlemarkingpicker
* another robustxamlloader
* human, lizard sprites/points
* prototype fixes, deletion of old spriteaccessory
* component registration, fixes dwarf skin toning
no, 'ReptilianToned' does not exist
* removes component registration from abstract humanoid component
* visualizer data now cloneable
* serialize for visualizer key
* zero-count edge case
* missing semi-colon moment
* setspecies in humanoidsystem
* ensures that default markings, if empty, will cause ensuredefault to skip over that given category
* tryadd instead of add
* whoops
* diff and apply should properly apply markings now
* always ensure default, fixes double load for player spawning
* apply skin color now sets the skin color property in humanoidcomponent
* removes sprite from a few species prototypes
* sprite changes for specific base layers based on humanoid sex
* layer ordering fix, and a missing base layer should now disallow markings on that layer
* anymarking base layer, adds the right leg/foot for humans
* loading a profile will now clear all markings on that humanoid
* adds missing layers for humans
* separates species.yml into respective species prototype files
* ensures that if layer visibility was changed, all markings have to be reapplied
* server-side enforcement of hiding hair (and other head-related markings) when equipping things that hide hair
* slime fix, clothingsystem now dictates layer visibility server side
* sussy
* layer settings should now ensure a marking should match the skin tone
* whoops
* skincolor static class and functions in UI
* skin color validation in humanoidcharacterappearance
* markingpicker now shows only the markings for the selected category in used
* getter for slot in singlemarkingpicker now ensures slot is 0 if markings exists
* FilterSpecies no longer attempts to do removal while iterating
* expands for SingleMarkingPicker
* humanoid base dummy has blank layers now (and snout/tail/headside/headtop)
* fixes an issue with visualizer system if the marking count was different but the markings themselves were (somewhat) the same
* whoops
* adds edge case handlers for count differences in humanoid markings
* preview now loads profile instead of directly setting appearance
* moves marking set loading to update controls
* clones a marking set in markingpicker by using the deep clone constructor
* whoops (deep cloning a marking now copies the marking id)
* adds replace function for markingset
* points should now update after the markings are remove/added
* merging base layer sprites into a humanoid should now clear them before merging
* sets dirty range start to count only if the dirty range start was never set above 0
* fixes up some issues with singlemarkingpicker
* color selector sliders in single marking picker should now expand
* hair from hair pickers should now apply in profile loading (client-side)
* category in singlemarkingpicker now sets the private category variable
* slot selector should now populate
* single marking picker buttons now have text, also shows the category name over all user-clickable elements
* removes a comment
* removing hair slots now sets it to bald, defaults to zero used slots if current hair is bald on hair/facial hair
* random skin color, eye color
* populate colors now checks if the marking count is greater than zero in singlemarkingpicker
* hair/facial hair pickers now just get the first possible hair from the respective species list
* different approach to random skin color
* oh, that's why it wasn't working
* randomize everything now just updates every single control
* selecting a new marking in SingleMarkingPicker should attempt to copy over old colors, populate list now uses cache,
* markingmanager now uses OnlyWhitelisted to populate by category and species
* filterspecies now uses onlyWhitelist to filter markings based on whitelist or not
* oops
* ui fix for singlemarkingpicker, ensures that cache is not null if it is null when populatelist is called
* order of operations for the horizontal expand for add/remove
* hair pickers should now update when you add/remove the hair slot
* fixes variable naming error in character appearance
* loc string fix in singlemarkingpicker
* lizards, vox now have onlyWhitelist, vox restriction for hair/facialhairs
* having zero possible hairs should no longer cause an exception in randomization
* setting species should now update hair pickers
* ignore categories for marking picker
* and a clear as well for the category button
* places that functionality in its own function instead
* adds eye base sprite, vox now also have their own custom eye sprites
* loading a profile client-side should do FilterSpecies for markings now
* client-side load profile does filter species after adding in the hairs now
* magic mirror
* callbacks now call the callback instead of adding it on construct
* whoops
* in removemarking too
* adds missing synchronize calls
* comments out an updateinterface call in magic mirror
* magic mirror window title, minimum sizing
* fixes minsize, adds warning for players who try to set their hair for species that have no hair
* removes spaces in xaml
* namespace changes/organization
* whoopsie (merge conflicts)
* re-enables identity from humanoid component
* damagevisuals now uses the enum given to it instead of the layerstate given on that layer tied to the enum
* removes commas from json
* changes to visuals system so the change is consistent
* chest
* reptilian
* visualizer system now handles body sprite setting/coloration, similar to how characterappearance did it
not a big fan of this
* adds a check in applybasesprites
* adding/removing parts should now make them invisible on a humanoid
* body part removal/adding now enumerates over sublayers instead
* synchro now runs in bodycomponent startup
* parts instead of slots
* humanoidcompnent check
* switches from rsi to actualrsi
* removes all the body stuff (too slow)
* cleans up resolves from humanoid visualizer system
* merging sprites now checks if the base sprites have been modified or not (through things like species changes, or custom base sprite changes)
* not forgetting that one again
* merging now returns an actual dirty value
* replaces the sequenceequal with a more accurate solution
* permanent layers, layer visibility on add/remove part in body
* should send all hidden layers over now
* isdirty in visualizer system for base layers
* isdirty checks count as well
* ok, IsDirty should now set the base layers if the merged sprites are different
* equals override in HumanoidSpritePrototypes.cs
temporary until record prototypes :heck:
* makes fields readonly, equates IDs instead
* adds forced markings through marking picker
* forced in humanoidsystem api, ignorespecies in markingpicker
* marking bui
* makes that serializable as well
* ignore species/forced toggles now work
* adds icon to modifier verb, interface and keys to humanoid bases
* needs the actual enum value to open, no?
* makes the key the actual key
* actions now propagate upwards
* ignore species when set now repopulates markingpicker
* modifiable base layers in the markings window
* oops!
* layout changes
* info box should now appear
* adds ignorespecies for marking picker, collapsible for base layer section of appearance modification window
* collapsible layout moment
* if base layers have changed, all markings are now dirty (and if a base layer is missing, the marking is still 'applied' but it's now just invisible
* small change to marking visibility
* small changes to modifier UI
* markings now match skin on zombification
* zombie stuff
* makes the line edit in marking modifier window more obvious
* disables vox on round start
* horizontal expand on the single label in base layer modifiers
* humanoid profiles in prototypes
* randomhumanoidappearance won't work if the humanoid has a profile already stored
* removes unused code
* documentation in humanoidsystem server-side
* documentation in shared/client
* whoops
* converts accessory into marking in locale files (also adds marking loc string into single marking picker)
* be gone, shared humanoid appearance system from the last upstream merge
* species ignore on randomization (defaults to no ignored species)
* more upstream merge parts that bypassed any errors before merge
* addresses review (also just adds typeserializers in some places)
* submodule moment
* upstream merge issues
2022-09-22 15:19:00 -07:00
|
|
|
private void OnMarkingChange(MarkingSet markings)
|
2022-05-05 01:07:42 -07:00
|
|
|
{
|
|
|
|
|
if (Profile is null)
|
|
|
|
|
return;
|
|
|
|
|
|
Humanoid appearance refactor (#10882)
* initial commit
- species prototype modifications
- markings points as its own file
- shared humanoid component
* adds a tool to convert sprite accessories to markings (in go)
* removes a fmt call
* converts sprite accessory to markings
* adds hair and facial hair to marking categories
* multiple changes
- humanoid visualizer system
- markings modifications for visualizer
- modifications to shared humanoid component
- lays out a base for humanoid system
* hidden layers, ports some properties from appearance component, shrinks DefaultMarkings a little
* squishes the initialize event calls into one function
adds stuff to set species/skin color externally from a server message - currently laid out as if it a dirty call to a networked component, may be subject to change (server-side has not been implemented yet)
* makes the sprite pipeline more obvious
* apply all markings, hidden layer set replacement
* ensures that markings are cleared when the new set is applied
* starts refactoring markingsset (unfinished)
* more additions to the markingset api
* adds constructor logic to markingset
* adds a method to filter out markings in a set based on a given species
* fixes enumerators in markingset
* adds validator into MarkingSet, fixes ForwardMarkingEnumerator
* modifications to the humanoid visual system
* ensuredefault in markingset
* oop
* fixes up data keys, populates OnAppearanceChange in visualizer
* changes to humanoid component, markings
marking equality is now more strict, humanoidcomponent is now implemented for client as a child of sharedhumanoidcomponent
* markings are now applied the visualizer by diffing them
* base sprites are now applied to humanoids from humanoidvisualizer
* passes along base sprite settings to the marking application so that markings know to follow skin color/alpha or not (see: slimes)
* custom base layers on humanoids
* merges all data keys into one data class for humanoid visualizers
* setappearance in sharedhumanoidsystem, removes custombaselayercolors
* humanoidcomponent, system (empty) in server
* adds some basic public API functions to HumanoidSystem
* add marking, remove marking
* changes appearance MarkingsSet to a List<Marking>, adds listener for PlayerSpawnCompleteEvent in HumanoidSystem
* ensuredefaultmarkings, oninit for humanoids
* markingmanager API changes
* removes MarkingsSet
* LoadProfile, adjusts randomization in humanoid appearance to account for species
* base layer settings in humanoidsystem, eye color from profile
* rearranges files to centralize under Humanoid namespace
* more reorganization, deletes some stuff
gotta break stuff to make other things work, right?
goodbye SpriteAccessory...
* fixes a good chunk of server-side issues
still does not compile, yet
* singlemarkingpicker xaml layout
* singlemarkingpicker logic
* magic mirror window (varying pieces of it, mostly client-oriented)
* removes some imports, gives MagicMirror a BUI class (not filled in yet)
* populates magic mirror BUI functionality / window callbacks
* fixes up some errors in humanoidprofileeditor
* changes to SingleMarkingPicker
SingleMarkingPicker now accepts a List<Marking>, species, and total possible markings available in that marking category
* fixes up hair pickers on humanoid profile editor
* fixes the errors in markingpicker
* markingsystem is now gone
* fixes a bunch of build errors
* so that's why i did it like that
* namespace issues, adds robustxamlloader to singlemarkingpicker
* another robustxamlloader
* human, lizard sprites/points
* prototype fixes, deletion of old spriteaccessory
* component registration, fixes dwarf skin toning
no, 'ReptilianToned' does not exist
* removes component registration from abstract humanoid component
* visualizer data now cloneable
* serialize for visualizer key
* zero-count edge case
* missing semi-colon moment
* setspecies in humanoidsystem
* ensures that default markings, if empty, will cause ensuredefault to skip over that given category
* tryadd instead of add
* whoops
* diff and apply should properly apply markings now
* always ensure default, fixes double load for player spawning
* apply skin color now sets the skin color property in humanoidcomponent
* removes sprite from a few species prototypes
* sprite changes for specific base layers based on humanoid sex
* layer ordering fix, and a missing base layer should now disallow markings on that layer
* anymarking base layer, adds the right leg/foot for humans
* loading a profile will now clear all markings on that humanoid
* adds missing layers for humans
* separates species.yml into respective species prototype files
* ensures that if layer visibility was changed, all markings have to be reapplied
* server-side enforcement of hiding hair (and other head-related markings) when equipping things that hide hair
* slime fix, clothingsystem now dictates layer visibility server side
* sussy
* layer settings should now ensure a marking should match the skin tone
* whoops
* skincolor static class and functions in UI
* skin color validation in humanoidcharacterappearance
* markingpicker now shows only the markings for the selected category in used
* getter for slot in singlemarkingpicker now ensures slot is 0 if markings exists
* FilterSpecies no longer attempts to do removal while iterating
* expands for SingleMarkingPicker
* humanoid base dummy has blank layers now (and snout/tail/headside/headtop)
* fixes an issue with visualizer system if the marking count was different but the markings themselves were (somewhat) the same
* whoops
* adds edge case handlers for count differences in humanoid markings
* preview now loads profile instead of directly setting appearance
* moves marking set loading to update controls
* clones a marking set in markingpicker by using the deep clone constructor
* whoops (deep cloning a marking now copies the marking id)
* adds replace function for markingset
* points should now update after the markings are remove/added
* merging base layer sprites into a humanoid should now clear them before merging
* sets dirty range start to count only if the dirty range start was never set above 0
* fixes up some issues with singlemarkingpicker
* color selector sliders in single marking picker should now expand
* hair from hair pickers should now apply in profile loading (client-side)
* category in singlemarkingpicker now sets the private category variable
* slot selector should now populate
* single marking picker buttons now have text, also shows the category name over all user-clickable elements
* removes a comment
* removing hair slots now sets it to bald, defaults to zero used slots if current hair is bald on hair/facial hair
* random skin color, eye color
* populate colors now checks if the marking count is greater than zero in singlemarkingpicker
* hair/facial hair pickers now just get the first possible hair from the respective species list
* different approach to random skin color
* oh, that's why it wasn't working
* randomize everything now just updates every single control
* selecting a new marking in SingleMarkingPicker should attempt to copy over old colors, populate list now uses cache,
* markingmanager now uses OnlyWhitelisted to populate by category and species
* filterspecies now uses onlyWhitelist to filter markings based on whitelist or not
* oops
* ui fix for singlemarkingpicker, ensures that cache is not null if it is null when populatelist is called
* order of operations for the horizontal expand for add/remove
* hair pickers should now update when you add/remove the hair slot
* fixes variable naming error in character appearance
* loc string fix in singlemarkingpicker
* lizards, vox now have onlyWhitelist, vox restriction for hair/facialhairs
* having zero possible hairs should no longer cause an exception in randomization
* setting species should now update hair pickers
* ignore categories for marking picker
* and a clear as well for the category button
* places that functionality in its own function instead
* adds eye base sprite, vox now also have their own custom eye sprites
* loading a profile client-side should do FilterSpecies for markings now
* client-side load profile does filter species after adding in the hairs now
* magic mirror
* callbacks now call the callback instead of adding it on construct
* whoops
* in removemarking too
* adds missing synchronize calls
* comments out an updateinterface call in magic mirror
* magic mirror window title, minimum sizing
* fixes minsize, adds warning for players who try to set their hair for species that have no hair
* removes spaces in xaml
* namespace changes/organization
* whoopsie (merge conflicts)
* re-enables identity from humanoid component
* damagevisuals now uses the enum given to it instead of the layerstate given on that layer tied to the enum
* removes commas from json
* changes to visuals system so the change is consistent
* chest
* reptilian
* visualizer system now handles body sprite setting/coloration, similar to how characterappearance did it
not a big fan of this
* adds a check in applybasesprites
* adding/removing parts should now make them invisible on a humanoid
* body part removal/adding now enumerates over sublayers instead
* synchro now runs in bodycomponent startup
* parts instead of slots
* humanoidcompnent check
* switches from rsi to actualrsi
* removes all the body stuff (too slow)
* cleans up resolves from humanoid visualizer system
* merging sprites now checks if the base sprites have been modified or not (through things like species changes, or custom base sprite changes)
* not forgetting that one again
* merging now returns an actual dirty value
* replaces the sequenceequal with a more accurate solution
* permanent layers, layer visibility on add/remove part in body
* should send all hidden layers over now
* isdirty in visualizer system for base layers
* isdirty checks count as well
* ok, IsDirty should now set the base layers if the merged sprites are different
* equals override in HumanoidSpritePrototypes.cs
temporary until record prototypes :heck:
* makes fields readonly, equates IDs instead
* adds forced markings through marking picker
* forced in humanoidsystem api, ignorespecies in markingpicker
* marking bui
* makes that serializable as well
* ignore species/forced toggles now work
* adds icon to modifier verb, interface and keys to humanoid bases
* needs the actual enum value to open, no?
* makes the key the actual key
* actions now propagate upwards
* ignore species when set now repopulates markingpicker
* modifiable base layers in the markings window
* oops!
* layout changes
* info box should now appear
* adds ignorespecies for marking picker, collapsible for base layer section of appearance modification window
* collapsible layout moment
* if base layers have changed, all markings are now dirty (and if a base layer is missing, the marking is still 'applied' but it's now just invisible
* small change to marking visibility
* small changes to modifier UI
* markings now match skin on zombification
* zombie stuff
* makes the line edit in marking modifier window more obvious
* disables vox on round start
* horizontal expand on the single label in base layer modifiers
* humanoid profiles in prototypes
* randomhumanoidappearance won't work if the humanoid has a profile already stored
* removes unused code
* documentation in humanoidsystem server-side
* documentation in shared/client
* whoops
* converts accessory into marking in locale files (also adds marking loc string into single marking picker)
* be gone, shared humanoid appearance system from the last upstream merge
* species ignore on randomization (defaults to no ignored species)
* more upstream merge parts that bypassed any errors before merge
* addresses review (also just adds typeserializers in some places)
* submodule moment
* upstream merge issues
2022-09-22 15:19:00 -07:00
|
|
|
Profile = Profile.WithCharacterAppearance(Profile.Appearance.WithMarkings(markings.GetForwardEnumerator().ToList()));
|
2024-05-12 09:18:21 +10:00
|
|
|
ReloadProfilePreview();
|
2022-05-05 01:07:42 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private void OnSkinColorOnValueChanged()
|
2022-01-08 19:53:14 -06:00
|
|
|
{
|
|
|
|
|
if (Profile is null) return;
|
|
|
|
|
|
|
|
|
|
var skin = _prototypeManager.Index<SpeciesPrototype>(Profile.Species).SkinColoration;
|
2025-09-14 01:30:17 -04:00
|
|
|
var strategy = _prototypeManager.Index(skin).Strategy;
|
2022-01-08 19:53:14 -06:00
|
|
|
|
2025-09-14 01:30:17 -04:00
|
|
|
switch (strategy.InputType)
|
2022-01-08 19:53:14 -06:00
|
|
|
{
|
2025-09-14 01:30:17 -04:00
|
|
|
case SkinColorationStrategyInput.Unary:
|
2022-01-08 19:53:14 -06:00
|
|
|
{
|
2024-05-12 09:18:21 +10:00
|
|
|
if (!Skin.Visible)
|
2022-05-05 01:07:42 -07:00
|
|
|
{
|
2024-05-12 09:18:21 +10:00
|
|
|
Skin.Visible = true;
|
|
|
|
|
RgbSkinColorContainer.Visible = false;
|
2022-05-05 01:07:42 -07:00
|
|
|
}
|
|
|
|
|
|
2025-09-14 01:30:17 -04:00
|
|
|
var color = strategy.FromUnary(Skin.Value);
|
2022-01-08 19:53:14 -06:00
|
|
|
|
2024-05-12 09:18:21 +10:00
|
|
|
Markings.CurrentSkinColor = color;
|
2025-09-14 01:30:17 -04:00
|
|
|
Profile = Profile.WithCharacterAppearance(Profile.Appearance.WithSkinColor(color));
|
2022-05-05 01:07:42 -07:00
|
|
|
|
2022-01-08 19:53:14 -06:00
|
|
|
break;
|
|
|
|
|
}
|
2025-09-14 01:30:17 -04:00
|
|
|
case SkinColorationStrategyInput.Color:
|
2022-05-12 19:35:55 -04:00
|
|
|
{
|
2024-05-12 09:18:21 +10:00
|
|
|
if (!RgbSkinColorContainer.Visible)
|
2022-05-12 19:35:55 -04:00
|
|
|
{
|
2024-05-12 09:18:21 +10:00
|
|
|
Skin.Visible = false;
|
|
|
|
|
RgbSkinColorContainer.Visible = true;
|
2022-05-12 19:35:55 -04:00
|
|
|
}
|
|
|
|
|
|
2025-09-14 01:30:17 -04:00
|
|
|
var color = strategy.ClosestSkinColor(_rgbSkinColorSelector.Color);
|
2022-05-12 19:35:55 -04:00
|
|
|
|
2024-05-12 09:18:21 +10:00
|
|
|
Markings.CurrentSkinColor = color;
|
2024-04-27 08:04:51 +02:00
|
|
|
Profile = Profile.WithCharacterAppearance(Profile.Appearance.WithSkinColor(color));
|
|
|
|
|
|
2022-05-12 19:35:55 -04:00
|
|
|
break;
|
|
|
|
|
}
|
2022-01-08 19:53:14 -06:00
|
|
|
}
|
|
|
|
|
|
2024-05-12 09:18:21 +10:00
|
|
|
ReloadProfilePreview();
|
2022-01-08 19:53:14 -06:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
protected override void Dispose(bool disposing)
|
|
|
|
|
{
|
|
|
|
|
base.Dispose(disposing);
|
|
|
|
|
if (!disposing)
|
|
|
|
|
return;
|
|
|
|
|
|
2024-05-12 09:18:21 +10:00
|
|
|
_loadoutWindow?.Dispose();
|
|
|
|
|
_loadoutWindow = null;
|
2024-08-01 01:14:19 +10:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
protected override void EnteredTree()
|
|
|
|
|
{
|
|
|
|
|
base.EnteredTree();
|
|
|
|
|
ReloadPreview();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
protected override void ExitedTree()
|
|
|
|
|
{
|
|
|
|
|
base.ExitedTree();
|
2024-05-12 09:18:21 +10:00
|
|
|
_entManager.DeleteEntity(PreviewDummy);
|
|
|
|
|
PreviewDummy = EntityUid.Invalid;
|
2020-06-26 03:46:08 +02:00
|
|
|
}
|
|
|
|
|
|
2020-01-24 00:56:26 +01:00
|
|
|
private void SetAge(int newAge)
|
|
|
|
|
{
|
|
|
|
|
Profile = Profile?.WithAge(newAge);
|
2024-05-12 09:18:21 +10:00
|
|
|
ReloadPreview();
|
2020-01-24 00:56:26 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private void SetSex(Sex newSex)
|
|
|
|
|
{
|
|
|
|
|
Profile = Profile?.WithSex(newSex);
|
2022-10-15 17:45:47 -04:00
|
|
|
// for convenience, default to most common gender when new sex is selected
|
|
|
|
|
switch (newSex)
|
|
|
|
|
{
|
|
|
|
|
case Sex.Male:
|
|
|
|
|
Profile = Profile?.WithGender(Gender.Male);
|
|
|
|
|
break;
|
|
|
|
|
case Sex.Female:
|
|
|
|
|
Profile = Profile?.WithGender(Gender.Female);
|
|
|
|
|
break;
|
|
|
|
|
default:
|
|
|
|
|
Profile = Profile?.WithGender(Gender.Epicene);
|
|
|
|
|
break;
|
|
|
|
|
}
|
2024-05-12 09:18:21 +10:00
|
|
|
|
2022-10-15 17:45:47 -04:00
|
|
|
UpdateGenderControls();
|
2024-05-12 09:18:21 +10:00
|
|
|
Markings.SetSex(newSex);
|
|
|
|
|
ReloadPreview();
|
2020-01-24 00:56:26 +01:00
|
|
|
}
|
|
|
|
|
|
2020-12-24 13:42:40 +00:00
|
|
|
private void SetGender(Gender newGender)
|
|
|
|
|
{
|
|
|
|
|
Profile = Profile?.WithGender(newGender);
|
2024-05-12 09:18:21 +10:00
|
|
|
ReloadPreview();
|
2020-12-24 13:42:40 +00:00
|
|
|
}
|
|
|
|
|
|
2022-01-08 19:53:14 -06:00
|
|
|
private void SetSpecies(string newSpecies)
|
|
|
|
|
{
|
|
|
|
|
Profile = Profile?.WithSpecies(newSpecies);
|
2022-05-05 01:07:42 -07:00
|
|
|
OnSkinColorOnValueChanged(); // Species may have special color prefs, make sure to update it.
|
2024-05-12 09:18:21 +10:00
|
|
|
Markings.SetSpecies(newSpecies); // Repopulate the markings tab as well.
|
|
|
|
|
// In case there's job restrictions for the species
|
|
|
|
|
RefreshJobs();
|
|
|
|
|
// In case there's species restrictions for loadouts
|
|
|
|
|
RefreshLoadouts();
|
2022-10-15 17:45:47 -04:00
|
|
|
UpdateSexControls(); // update sex for new species
|
2024-03-11 04:01:32 +01:00
|
|
|
UpdateSpeciesGuidebookIcon();
|
2024-05-12 09:18:21 +10:00
|
|
|
ReloadPreview();
|
2022-01-08 19:53:14 -06:00
|
|
|
}
|
|
|
|
|
|
2020-01-24 00:56:26 +01:00
|
|
|
private void SetName(string newName)
|
|
|
|
|
{
|
|
|
|
|
Profile = Profile?.WithName(newName);
|
2024-04-17 12:54:54 +10:00
|
|
|
SetDirty();
|
2024-08-01 01:14:19 +10:00
|
|
|
|
|
|
|
|
if (!IsDirty)
|
|
|
|
|
return;
|
|
|
|
|
|
|
|
|
|
_entManager.System<MetaDataSystem>().SetEntityName(PreviewDummy, newName);
|
2020-01-24 00:56:26 +01:00
|
|
|
}
|
|
|
|
|
|
2024-02-01 05:12:09 -05:00
|
|
|
private void SetSpawnPriority(SpawnPriorityPreference newSpawnPriority)
|
|
|
|
|
{
|
|
|
|
|
Profile = Profile?.WithSpawnPriorityPreference(newSpawnPriority);
|
2024-04-17 12:54:54 +10:00
|
|
|
SetDirty();
|
2024-02-01 05:12:09 -05:00
|
|
|
}
|
|
|
|
|
|
2024-07-11 03:24:37 +03:00
|
|
|
public bool IsDirty
|
2020-01-18 01:54:13 +01:00
|
|
|
{
|
|
|
|
|
get => _isDirty;
|
|
|
|
|
set
|
|
|
|
|
{
|
2024-05-12 09:18:21 +10:00
|
|
|
if (_isDirty == value)
|
|
|
|
|
return;
|
|
|
|
|
|
2020-01-18 01:54:13 +01:00
|
|
|
_isDirty = value;
|
|
|
|
|
UpdateSaveButton();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2020-01-24 00:56:26 +01:00
|
|
|
private void UpdateNameEdit()
|
|
|
|
|
{
|
2024-05-12 09:18:21 +10:00
|
|
|
NameEdit.Text = Profile?.Name ?? "";
|
2020-01-24 00:56:26 +01:00
|
|
|
}
|
|
|
|
|
|
2022-05-14 08:58:45 +10:00
|
|
|
private void UpdateFlavorTextEdit()
|
|
|
|
|
{
|
2024-05-12 09:18:21 +10:00
|
|
|
if (_flavorTextEdit != null)
|
2022-05-14 08:58:45 +10:00
|
|
|
{
|
2023-08-28 13:01:45 +03:00
|
|
|
_flavorTextEdit.TextRope = new Rope.Leaf(Profile?.FlavorText ?? "");
|
2022-05-14 08:58:45 +10:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2020-01-24 00:56:26 +01:00
|
|
|
private void UpdateAgeEdit()
|
|
|
|
|
{
|
2024-05-12 09:18:21 +10:00
|
|
|
AgeEdit.Text = Profile?.Age.ToString() ?? "";
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Updates selected job priorities to the profile's.
|
|
|
|
|
/// </summary>
|
|
|
|
|
private void UpdateJobPriorities()
|
|
|
|
|
{
|
|
|
|
|
foreach (var (jobId, prioritySelector) in _jobPriorities)
|
|
|
|
|
{
|
|
|
|
|
var priority = Profile?.JobPriorities.GetValueOrDefault(jobId, JobPriority.Never) ?? JobPriority.Never;
|
|
|
|
|
prioritySelector.Select((int) priority);
|
|
|
|
|
}
|
2020-01-24 00:56:26 +01:00
|
|
|
}
|
|
|
|
|
|
2020-01-18 01:54:13 +01:00
|
|
|
private void UpdateSexControls()
|
|
|
|
|
{
|
2022-10-15 17:45:47 -04:00
|
|
|
if (Profile == null)
|
|
|
|
|
return;
|
|
|
|
|
|
2024-05-12 09:18:21 +10:00
|
|
|
SexButton.Clear();
|
2022-10-15 17:45:47 -04:00
|
|
|
|
|
|
|
|
var sexes = new List<Sex>();
|
|
|
|
|
|
|
|
|
|
// add species sex options, default to just none if we are in bizzaro world and have no species
|
2025-09-09 18:17:56 +02:00
|
|
|
if (_prototypeManager.Resolve<SpeciesPrototype>(Profile.Species, out var speciesProto))
|
2022-10-15 17:45:47 -04:00
|
|
|
{
|
|
|
|
|
foreach (var sex in speciesProto.Sexes)
|
|
|
|
|
{
|
|
|
|
|
sexes.Add(sex);
|
|
|
|
|
}
|
2024-05-12 09:18:21 +10:00
|
|
|
}
|
|
|
|
|
else
|
2022-10-15 17:45:47 -04:00
|
|
|
{
|
|
|
|
|
sexes.Add(Sex.Unsexed);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// add button for each sex
|
|
|
|
|
foreach (var sex in sexes)
|
|
|
|
|
{
|
2024-05-12 09:18:21 +10:00
|
|
|
SexButton.AddItem(Loc.GetString($"humanoid-profile-editor-sex-{sex.ToString().ToLower()}-text"), (int) sex);
|
2022-10-15 17:45:47 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (sexes.Contains(Profile.Sex))
|
2024-05-12 09:18:21 +10:00
|
|
|
SexButton.SelectId((int) Profile.Sex);
|
2020-01-18 01:54:13 +01:00
|
|
|
else
|
2024-05-12 09:18:21 +10:00
|
|
|
SexButton.SelectId((int) sexes[0]);
|
2020-01-18 01:54:13 +01:00
|
|
|
}
|
|
|
|
|
|
2021-11-12 01:55:50 -08:00
|
|
|
private void UpdateSkinColor()
|
|
|
|
|
{
|
|
|
|
|
if (Profile == null)
|
|
|
|
|
return;
|
|
|
|
|
|
2022-01-08 19:53:14 -06:00
|
|
|
var skin = _prototypeManager.Index<SpeciesPrototype>(Profile.Species).SkinColoration;
|
2025-09-14 01:30:17 -04:00
|
|
|
var strategy = _prototypeManager.Index(skin).Strategy;
|
2022-01-08 19:53:14 -06:00
|
|
|
|
2025-09-14 01:30:17 -04:00
|
|
|
switch (strategy.InputType)
|
2021-11-12 01:55:50 -08:00
|
|
|
{
|
2025-09-14 01:30:17 -04:00
|
|
|
case SkinColorationStrategyInput.Unary:
|
2022-01-08 19:53:14 -06:00
|
|
|
{
|
2024-05-12 09:18:21 +10:00
|
|
|
if (!Skin.Visible)
|
2022-05-05 01:07:42 -07:00
|
|
|
{
|
2024-05-12 09:18:21 +10:00
|
|
|
Skin.Visible = true;
|
|
|
|
|
RgbSkinColorContainer.Visible = false;
|
2022-05-05 01:07:42 -07:00
|
|
|
}
|
|
|
|
|
|
2025-09-14 01:30:17 -04:00
|
|
|
Skin.Value = strategy.ToUnary(Profile.Appearance.SkinColor);
|
Humanoid appearance refactor (#10882)
* initial commit
- species prototype modifications
- markings points as its own file
- shared humanoid component
* adds a tool to convert sprite accessories to markings (in go)
* removes a fmt call
* converts sprite accessory to markings
* adds hair and facial hair to marking categories
* multiple changes
- humanoid visualizer system
- markings modifications for visualizer
- modifications to shared humanoid component
- lays out a base for humanoid system
* hidden layers, ports some properties from appearance component, shrinks DefaultMarkings a little
* squishes the initialize event calls into one function
adds stuff to set species/skin color externally from a server message - currently laid out as if it a dirty call to a networked component, may be subject to change (server-side has not been implemented yet)
* makes the sprite pipeline more obvious
* apply all markings, hidden layer set replacement
* ensures that markings are cleared when the new set is applied
* starts refactoring markingsset (unfinished)
* more additions to the markingset api
* adds constructor logic to markingset
* adds a method to filter out markings in a set based on a given species
* fixes enumerators in markingset
* adds validator into MarkingSet, fixes ForwardMarkingEnumerator
* modifications to the humanoid visual system
* ensuredefault in markingset
* oop
* fixes up data keys, populates OnAppearanceChange in visualizer
* changes to humanoid component, markings
marking equality is now more strict, humanoidcomponent is now implemented for client as a child of sharedhumanoidcomponent
* markings are now applied the visualizer by diffing them
* base sprites are now applied to humanoids from humanoidvisualizer
* passes along base sprite settings to the marking application so that markings know to follow skin color/alpha or not (see: slimes)
* custom base layers on humanoids
* merges all data keys into one data class for humanoid visualizers
* setappearance in sharedhumanoidsystem, removes custombaselayercolors
* humanoidcomponent, system (empty) in server
* adds some basic public API functions to HumanoidSystem
* add marking, remove marking
* changes appearance MarkingsSet to a List<Marking>, adds listener for PlayerSpawnCompleteEvent in HumanoidSystem
* ensuredefaultmarkings, oninit for humanoids
* markingmanager API changes
* removes MarkingsSet
* LoadProfile, adjusts randomization in humanoid appearance to account for species
* base layer settings in humanoidsystem, eye color from profile
* rearranges files to centralize under Humanoid namespace
* more reorganization, deletes some stuff
gotta break stuff to make other things work, right?
goodbye SpriteAccessory...
* fixes a good chunk of server-side issues
still does not compile, yet
* singlemarkingpicker xaml layout
* singlemarkingpicker logic
* magic mirror window (varying pieces of it, mostly client-oriented)
* removes some imports, gives MagicMirror a BUI class (not filled in yet)
* populates magic mirror BUI functionality / window callbacks
* fixes up some errors in humanoidprofileeditor
* changes to SingleMarkingPicker
SingleMarkingPicker now accepts a List<Marking>, species, and total possible markings available in that marking category
* fixes up hair pickers on humanoid profile editor
* fixes the errors in markingpicker
* markingsystem is now gone
* fixes a bunch of build errors
* so that's why i did it like that
* namespace issues, adds robustxamlloader to singlemarkingpicker
* another robustxamlloader
* human, lizard sprites/points
* prototype fixes, deletion of old spriteaccessory
* component registration, fixes dwarf skin toning
no, 'ReptilianToned' does not exist
* removes component registration from abstract humanoid component
* visualizer data now cloneable
* serialize for visualizer key
* zero-count edge case
* missing semi-colon moment
* setspecies in humanoidsystem
* ensures that default markings, if empty, will cause ensuredefault to skip over that given category
* tryadd instead of add
* whoops
* diff and apply should properly apply markings now
* always ensure default, fixes double load for player spawning
* apply skin color now sets the skin color property in humanoidcomponent
* removes sprite from a few species prototypes
* sprite changes for specific base layers based on humanoid sex
* layer ordering fix, and a missing base layer should now disallow markings on that layer
* anymarking base layer, adds the right leg/foot for humans
* loading a profile will now clear all markings on that humanoid
* adds missing layers for humans
* separates species.yml into respective species prototype files
* ensures that if layer visibility was changed, all markings have to be reapplied
* server-side enforcement of hiding hair (and other head-related markings) when equipping things that hide hair
* slime fix, clothingsystem now dictates layer visibility server side
* sussy
* layer settings should now ensure a marking should match the skin tone
* whoops
* skincolor static class and functions in UI
* skin color validation in humanoidcharacterappearance
* markingpicker now shows only the markings for the selected category in used
* getter for slot in singlemarkingpicker now ensures slot is 0 if markings exists
* FilterSpecies no longer attempts to do removal while iterating
* expands for SingleMarkingPicker
* humanoid base dummy has blank layers now (and snout/tail/headside/headtop)
* fixes an issue with visualizer system if the marking count was different but the markings themselves were (somewhat) the same
* whoops
* adds edge case handlers for count differences in humanoid markings
* preview now loads profile instead of directly setting appearance
* moves marking set loading to update controls
* clones a marking set in markingpicker by using the deep clone constructor
* whoops (deep cloning a marking now copies the marking id)
* adds replace function for markingset
* points should now update after the markings are remove/added
* merging base layer sprites into a humanoid should now clear them before merging
* sets dirty range start to count only if the dirty range start was never set above 0
* fixes up some issues with singlemarkingpicker
* color selector sliders in single marking picker should now expand
* hair from hair pickers should now apply in profile loading (client-side)
* category in singlemarkingpicker now sets the private category variable
* slot selector should now populate
* single marking picker buttons now have text, also shows the category name over all user-clickable elements
* removes a comment
* removing hair slots now sets it to bald, defaults to zero used slots if current hair is bald on hair/facial hair
* random skin color, eye color
* populate colors now checks if the marking count is greater than zero in singlemarkingpicker
* hair/facial hair pickers now just get the first possible hair from the respective species list
* different approach to random skin color
* oh, that's why it wasn't working
* randomize everything now just updates every single control
* selecting a new marking in SingleMarkingPicker should attempt to copy over old colors, populate list now uses cache,
* markingmanager now uses OnlyWhitelisted to populate by category and species
* filterspecies now uses onlyWhitelist to filter markings based on whitelist or not
* oops
* ui fix for singlemarkingpicker, ensures that cache is not null if it is null when populatelist is called
* order of operations for the horizontal expand for add/remove
* hair pickers should now update when you add/remove the hair slot
* fixes variable naming error in character appearance
* loc string fix in singlemarkingpicker
* lizards, vox now have onlyWhitelist, vox restriction for hair/facialhairs
* having zero possible hairs should no longer cause an exception in randomization
* setting species should now update hair pickers
* ignore categories for marking picker
* and a clear as well for the category button
* places that functionality in its own function instead
* adds eye base sprite, vox now also have their own custom eye sprites
* loading a profile client-side should do FilterSpecies for markings now
* client-side load profile does filter species after adding in the hairs now
* magic mirror
* callbacks now call the callback instead of adding it on construct
* whoops
* in removemarking too
* adds missing synchronize calls
* comments out an updateinterface call in magic mirror
* magic mirror window title, minimum sizing
* fixes minsize, adds warning for players who try to set their hair for species that have no hair
* removes spaces in xaml
* namespace changes/organization
* whoopsie (merge conflicts)
* re-enables identity from humanoid component
* damagevisuals now uses the enum given to it instead of the layerstate given on that layer tied to the enum
* removes commas from json
* changes to visuals system so the change is consistent
* chest
* reptilian
* visualizer system now handles body sprite setting/coloration, similar to how characterappearance did it
not a big fan of this
* adds a check in applybasesprites
* adding/removing parts should now make them invisible on a humanoid
* body part removal/adding now enumerates over sublayers instead
* synchro now runs in bodycomponent startup
* parts instead of slots
* humanoidcompnent check
* switches from rsi to actualrsi
* removes all the body stuff (too slow)
* cleans up resolves from humanoid visualizer system
* merging sprites now checks if the base sprites have been modified or not (through things like species changes, or custom base sprite changes)
* not forgetting that one again
* merging now returns an actual dirty value
* replaces the sequenceequal with a more accurate solution
* permanent layers, layer visibility on add/remove part in body
* should send all hidden layers over now
* isdirty in visualizer system for base layers
* isdirty checks count as well
* ok, IsDirty should now set the base layers if the merged sprites are different
* equals override in HumanoidSpritePrototypes.cs
temporary until record prototypes :heck:
* makes fields readonly, equates IDs instead
* adds forced markings through marking picker
* forced in humanoidsystem api, ignorespecies in markingpicker
* marking bui
* makes that serializable as well
* ignore species/forced toggles now work
* adds icon to modifier verb, interface and keys to humanoid bases
* needs the actual enum value to open, no?
* makes the key the actual key
* actions now propagate upwards
* ignore species when set now repopulates markingpicker
* modifiable base layers in the markings window
* oops!
* layout changes
* info box should now appear
* adds ignorespecies for marking picker, collapsible for base layer section of appearance modification window
* collapsible layout moment
* if base layers have changed, all markings are now dirty (and if a base layer is missing, the marking is still 'applied' but it's now just invisible
* small change to marking visibility
* small changes to modifier UI
* markings now match skin on zombification
* zombie stuff
* makes the line edit in marking modifier window more obvious
* disables vox on round start
* horizontal expand on the single label in base layer modifiers
* humanoid profiles in prototypes
* randomhumanoidappearance won't work if the humanoid has a profile already stored
* removes unused code
* documentation in humanoidsystem server-side
* documentation in shared/client
* whoops
* converts accessory into marking in locale files (also adds marking loc string into single marking picker)
* be gone, shared humanoid appearance system from the last upstream merge
* species ignore on randomization (defaults to no ignored species)
* more upstream merge parts that bypassed any errors before merge
* addresses review (also just adds typeserializers in some places)
* submodule moment
* upstream merge issues
2022-09-22 15:19:00 -07:00
|
|
|
|
2022-01-08 19:53:14 -06:00
|
|
|
break;
|
|
|
|
|
}
|
2025-09-14 01:30:17 -04:00
|
|
|
case SkinColorationStrategyInput.Color:
|
2022-01-08 19:53:14 -06:00
|
|
|
{
|
2024-05-12 09:18:21 +10:00
|
|
|
if (!RgbSkinColorContainer.Visible)
|
2022-05-12 19:35:55 -04:00
|
|
|
{
|
2024-05-12 09:18:21 +10:00
|
|
|
Skin.Visible = false;
|
|
|
|
|
RgbSkinColorContainer.Visible = true;
|
2022-05-12 19:35:55 -04:00
|
|
|
}
|
|
|
|
|
|
2025-09-14 01:30:17 -04:00
|
|
|
_rgbSkinColorSelector.Color = strategy.ClosestSkinColor(Profile.Appearance.SkinColor);
|
2024-04-27 08:04:51 +02:00
|
|
|
|
|
|
|
|
break;
|
|
|
|
|
}
|
2021-11-12 01:55:50 -08:00
|
|
|
}
|
2022-01-08 19:53:14 -06:00
|
|
|
}
|
|
|
|
|
|
2024-03-11 04:01:32 +01:00
|
|
|
public void UpdateSpeciesGuidebookIcon()
|
|
|
|
|
{
|
|
|
|
|
SpeciesInfoButton.StyleClasses.Clear();
|
|
|
|
|
|
|
|
|
|
var species = Profile?.Species;
|
|
|
|
|
if (species is null)
|
|
|
|
|
return;
|
|
|
|
|
|
2025-09-09 18:17:56 +02:00
|
|
|
if (!_prototypeManager.Resolve<SpeciesPrototype>(species, out var speciesProto))
|
2024-03-11 04:01:32 +01:00
|
|
|
return;
|
|
|
|
|
|
|
|
|
|
// Don't display the info button if no guide entry is found
|
|
|
|
|
if (!_prototypeManager.HasIndex<GuideEntryPrototype>(species))
|
|
|
|
|
return;
|
|
|
|
|
|
2024-04-16 22:57:43 +10:00
|
|
|
const string style = "SpeciesInfoDefault";
|
2024-03-11 04:01:32 +01:00
|
|
|
SpeciesInfoButton.StyleClasses.Add(style);
|
|
|
|
|
}
|
|
|
|
|
|
2022-05-05 01:07:42 -07:00
|
|
|
private void UpdateMarkings()
|
|
|
|
|
{
|
|
|
|
|
if (Profile == null)
|
|
|
|
|
{
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
2024-05-12 09:18:21 +10:00
|
|
|
Markings.SetData(Profile.Appearance.Markings, Profile.Species,
|
2023-09-19 23:56:10 +03:00
|
|
|
Profile.Sex, Profile.Appearance.SkinColor, Profile.Appearance.EyeColor
|
2023-03-05 08:59:07 +06:00
|
|
|
);
|
2022-05-05 01:07:42 -07:00
|
|
|
}
|
|
|
|
|
|
2020-12-24 13:42:40 +00:00
|
|
|
private void UpdateGenderControls()
|
|
|
|
|
{
|
2021-03-10 14:48:29 +01:00
|
|
|
if (Profile == null)
|
|
|
|
|
{
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
2024-05-12 09:18:21 +10:00
|
|
|
PronounsButton.SelectId((int) Profile.Gender);
|
2020-12-24 13:42:40 +00:00
|
|
|
}
|
|
|
|
|
|
2024-02-01 05:12:09 -05:00
|
|
|
private void UpdateSpawnPriorityControls()
|
|
|
|
|
{
|
|
|
|
|
if (Profile == null)
|
|
|
|
|
{
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
2024-05-12 09:18:21 +10:00
|
|
|
SpawnPriorityButton.SelectId((int) Profile.SpawnPriority);
|
2024-02-01 05:12:09 -05:00
|
|
|
}
|
|
|
|
|
|
2020-01-18 01:54:13 +01:00
|
|
|
private void UpdateHairPickers()
|
|
|
|
|
{
|
2021-03-10 14:48:29 +01:00
|
|
|
if (Profile == null)
|
|
|
|
|
{
|
|
|
|
|
return;
|
|
|
|
|
}
|
2025-07-07 15:57:05 -04:00
|
|
|
var hairMarking = Profile.Appearance.HairStyleId == HairStyles.DefaultHairStyle
|
|
|
|
|
? new List<Marking>()
|
|
|
|
|
: new() { new(Profile.Appearance.HairStyleId, new List<Color>() { Profile.Appearance.HairColor }) };
|
Humanoid appearance refactor (#10882)
* initial commit
- species prototype modifications
- markings points as its own file
- shared humanoid component
* adds a tool to convert sprite accessories to markings (in go)
* removes a fmt call
* converts sprite accessory to markings
* adds hair and facial hair to marking categories
* multiple changes
- humanoid visualizer system
- markings modifications for visualizer
- modifications to shared humanoid component
- lays out a base for humanoid system
* hidden layers, ports some properties from appearance component, shrinks DefaultMarkings a little
* squishes the initialize event calls into one function
adds stuff to set species/skin color externally from a server message - currently laid out as if it a dirty call to a networked component, may be subject to change (server-side has not been implemented yet)
* makes the sprite pipeline more obvious
* apply all markings, hidden layer set replacement
* ensures that markings are cleared when the new set is applied
* starts refactoring markingsset (unfinished)
* more additions to the markingset api
* adds constructor logic to markingset
* adds a method to filter out markings in a set based on a given species
* fixes enumerators in markingset
* adds validator into MarkingSet, fixes ForwardMarkingEnumerator
* modifications to the humanoid visual system
* ensuredefault in markingset
* oop
* fixes up data keys, populates OnAppearanceChange in visualizer
* changes to humanoid component, markings
marking equality is now more strict, humanoidcomponent is now implemented for client as a child of sharedhumanoidcomponent
* markings are now applied the visualizer by diffing them
* base sprites are now applied to humanoids from humanoidvisualizer
* passes along base sprite settings to the marking application so that markings know to follow skin color/alpha or not (see: slimes)
* custom base layers on humanoids
* merges all data keys into one data class for humanoid visualizers
* setappearance in sharedhumanoidsystem, removes custombaselayercolors
* humanoidcomponent, system (empty) in server
* adds some basic public API functions to HumanoidSystem
* add marking, remove marking
* changes appearance MarkingsSet to a List<Marking>, adds listener for PlayerSpawnCompleteEvent in HumanoidSystem
* ensuredefaultmarkings, oninit for humanoids
* markingmanager API changes
* removes MarkingsSet
* LoadProfile, adjusts randomization in humanoid appearance to account for species
* base layer settings in humanoidsystem, eye color from profile
* rearranges files to centralize under Humanoid namespace
* more reorganization, deletes some stuff
gotta break stuff to make other things work, right?
goodbye SpriteAccessory...
* fixes a good chunk of server-side issues
still does not compile, yet
* singlemarkingpicker xaml layout
* singlemarkingpicker logic
* magic mirror window (varying pieces of it, mostly client-oriented)
* removes some imports, gives MagicMirror a BUI class (not filled in yet)
* populates magic mirror BUI functionality / window callbacks
* fixes up some errors in humanoidprofileeditor
* changes to SingleMarkingPicker
SingleMarkingPicker now accepts a List<Marking>, species, and total possible markings available in that marking category
* fixes up hair pickers on humanoid profile editor
* fixes the errors in markingpicker
* markingsystem is now gone
* fixes a bunch of build errors
* so that's why i did it like that
* namespace issues, adds robustxamlloader to singlemarkingpicker
* another robustxamlloader
* human, lizard sprites/points
* prototype fixes, deletion of old spriteaccessory
* component registration, fixes dwarf skin toning
no, 'ReptilianToned' does not exist
* removes component registration from abstract humanoid component
* visualizer data now cloneable
* serialize for visualizer key
* zero-count edge case
* missing semi-colon moment
* setspecies in humanoidsystem
* ensures that default markings, if empty, will cause ensuredefault to skip over that given category
* tryadd instead of add
* whoops
* diff and apply should properly apply markings now
* always ensure default, fixes double load for player spawning
* apply skin color now sets the skin color property in humanoidcomponent
* removes sprite from a few species prototypes
* sprite changes for specific base layers based on humanoid sex
* layer ordering fix, and a missing base layer should now disallow markings on that layer
* anymarking base layer, adds the right leg/foot for humans
* loading a profile will now clear all markings on that humanoid
* adds missing layers for humans
* separates species.yml into respective species prototype files
* ensures that if layer visibility was changed, all markings have to be reapplied
* server-side enforcement of hiding hair (and other head-related markings) when equipping things that hide hair
* slime fix, clothingsystem now dictates layer visibility server side
* sussy
* layer settings should now ensure a marking should match the skin tone
* whoops
* skincolor static class and functions in UI
* skin color validation in humanoidcharacterappearance
* markingpicker now shows only the markings for the selected category in used
* getter for slot in singlemarkingpicker now ensures slot is 0 if markings exists
* FilterSpecies no longer attempts to do removal while iterating
* expands for SingleMarkingPicker
* humanoid base dummy has blank layers now (and snout/tail/headside/headtop)
* fixes an issue with visualizer system if the marking count was different but the markings themselves were (somewhat) the same
* whoops
* adds edge case handlers for count differences in humanoid markings
* preview now loads profile instead of directly setting appearance
* moves marking set loading to update controls
* clones a marking set in markingpicker by using the deep clone constructor
* whoops (deep cloning a marking now copies the marking id)
* adds replace function for markingset
* points should now update after the markings are remove/added
* merging base layer sprites into a humanoid should now clear them before merging
* sets dirty range start to count only if the dirty range start was never set above 0
* fixes up some issues with singlemarkingpicker
* color selector sliders in single marking picker should now expand
* hair from hair pickers should now apply in profile loading (client-side)
* category in singlemarkingpicker now sets the private category variable
* slot selector should now populate
* single marking picker buttons now have text, also shows the category name over all user-clickable elements
* removes a comment
* removing hair slots now sets it to bald, defaults to zero used slots if current hair is bald on hair/facial hair
* random skin color, eye color
* populate colors now checks if the marking count is greater than zero in singlemarkingpicker
* hair/facial hair pickers now just get the first possible hair from the respective species list
* different approach to random skin color
* oh, that's why it wasn't working
* randomize everything now just updates every single control
* selecting a new marking in SingleMarkingPicker should attempt to copy over old colors, populate list now uses cache,
* markingmanager now uses OnlyWhitelisted to populate by category and species
* filterspecies now uses onlyWhitelist to filter markings based on whitelist or not
* oops
* ui fix for singlemarkingpicker, ensures that cache is not null if it is null when populatelist is called
* order of operations for the horizontal expand for add/remove
* hair pickers should now update when you add/remove the hair slot
* fixes variable naming error in character appearance
* loc string fix in singlemarkingpicker
* lizards, vox now have onlyWhitelist, vox restriction for hair/facialhairs
* having zero possible hairs should no longer cause an exception in randomization
* setting species should now update hair pickers
* ignore categories for marking picker
* and a clear as well for the category button
* places that functionality in its own function instead
* adds eye base sprite, vox now also have their own custom eye sprites
* loading a profile client-side should do FilterSpecies for markings now
* client-side load profile does filter species after adding in the hairs now
* magic mirror
* callbacks now call the callback instead of adding it on construct
* whoops
* in removemarking too
* adds missing synchronize calls
* comments out an updateinterface call in magic mirror
* magic mirror window title, minimum sizing
* fixes minsize, adds warning for players who try to set their hair for species that have no hair
* removes spaces in xaml
* namespace changes/organization
* whoopsie (merge conflicts)
* re-enables identity from humanoid component
* damagevisuals now uses the enum given to it instead of the layerstate given on that layer tied to the enum
* removes commas from json
* changes to visuals system so the change is consistent
* chest
* reptilian
* visualizer system now handles body sprite setting/coloration, similar to how characterappearance did it
not a big fan of this
* adds a check in applybasesprites
* adding/removing parts should now make them invisible on a humanoid
* body part removal/adding now enumerates over sublayers instead
* synchro now runs in bodycomponent startup
* parts instead of slots
* humanoidcompnent check
* switches from rsi to actualrsi
* removes all the body stuff (too slow)
* cleans up resolves from humanoid visualizer system
* merging sprites now checks if the base sprites have been modified or not (through things like species changes, or custom base sprite changes)
* not forgetting that one again
* merging now returns an actual dirty value
* replaces the sequenceequal with a more accurate solution
* permanent layers, layer visibility on add/remove part in body
* should send all hidden layers over now
* isdirty in visualizer system for base layers
* isdirty checks count as well
* ok, IsDirty should now set the base layers if the merged sprites are different
* equals override in HumanoidSpritePrototypes.cs
temporary until record prototypes :heck:
* makes fields readonly, equates IDs instead
* adds forced markings through marking picker
* forced in humanoidsystem api, ignorespecies in markingpicker
* marking bui
* makes that serializable as well
* ignore species/forced toggles now work
* adds icon to modifier verb, interface and keys to humanoid bases
* needs the actual enum value to open, no?
* makes the key the actual key
* actions now propagate upwards
* ignore species when set now repopulates markingpicker
* modifiable base layers in the markings window
* oops!
* layout changes
* info box should now appear
* adds ignorespecies for marking picker, collapsible for base layer section of appearance modification window
* collapsible layout moment
* if base layers have changed, all markings are now dirty (and if a base layer is missing, the marking is still 'applied' but it's now just invisible
* small change to marking visibility
* small changes to modifier UI
* markings now match skin on zombification
* zombie stuff
* makes the line edit in marking modifier window more obvious
* disables vox on round start
* horizontal expand on the single label in base layer modifiers
* humanoid profiles in prototypes
* randomhumanoidappearance won't work if the humanoid has a profile already stored
* removes unused code
* documentation in humanoidsystem server-side
* documentation in shared/client
* whoops
* converts accessory into marking in locale files (also adds marking loc string into single marking picker)
* be gone, shared humanoid appearance system from the last upstream merge
* species ignore on randomization (defaults to no ignored species)
* more upstream merge parts that bypassed any errors before merge
* addresses review (also just adds typeserializers in some places)
* submodule moment
* upstream merge issues
2022-09-22 15:19:00 -07:00
|
|
|
|
2025-07-07 15:57:05 -04:00
|
|
|
var facialHairMarking = Profile.Appearance.FacialHairStyleId == HairStyles.DefaultFacialHairStyle
|
|
|
|
|
? new List<Marking>()
|
|
|
|
|
: new() { new(Profile.Appearance.FacialHairStyleId, new List<Color>() { Profile.Appearance.FacialHairColor }) };
|
Humanoid appearance refactor (#10882)
* initial commit
- species prototype modifications
- markings points as its own file
- shared humanoid component
* adds a tool to convert sprite accessories to markings (in go)
* removes a fmt call
* converts sprite accessory to markings
* adds hair and facial hair to marking categories
* multiple changes
- humanoid visualizer system
- markings modifications for visualizer
- modifications to shared humanoid component
- lays out a base for humanoid system
* hidden layers, ports some properties from appearance component, shrinks DefaultMarkings a little
* squishes the initialize event calls into one function
adds stuff to set species/skin color externally from a server message - currently laid out as if it a dirty call to a networked component, may be subject to change (server-side has not been implemented yet)
* makes the sprite pipeline more obvious
* apply all markings, hidden layer set replacement
* ensures that markings are cleared when the new set is applied
* starts refactoring markingsset (unfinished)
* more additions to the markingset api
* adds constructor logic to markingset
* adds a method to filter out markings in a set based on a given species
* fixes enumerators in markingset
* adds validator into MarkingSet, fixes ForwardMarkingEnumerator
* modifications to the humanoid visual system
* ensuredefault in markingset
* oop
* fixes up data keys, populates OnAppearanceChange in visualizer
* changes to humanoid component, markings
marking equality is now more strict, humanoidcomponent is now implemented for client as a child of sharedhumanoidcomponent
* markings are now applied the visualizer by diffing them
* base sprites are now applied to humanoids from humanoidvisualizer
* passes along base sprite settings to the marking application so that markings know to follow skin color/alpha or not (see: slimes)
* custom base layers on humanoids
* merges all data keys into one data class for humanoid visualizers
* setappearance in sharedhumanoidsystem, removes custombaselayercolors
* humanoidcomponent, system (empty) in server
* adds some basic public API functions to HumanoidSystem
* add marking, remove marking
* changes appearance MarkingsSet to a List<Marking>, adds listener for PlayerSpawnCompleteEvent in HumanoidSystem
* ensuredefaultmarkings, oninit for humanoids
* markingmanager API changes
* removes MarkingsSet
* LoadProfile, adjusts randomization in humanoid appearance to account for species
* base layer settings in humanoidsystem, eye color from profile
* rearranges files to centralize under Humanoid namespace
* more reorganization, deletes some stuff
gotta break stuff to make other things work, right?
goodbye SpriteAccessory...
* fixes a good chunk of server-side issues
still does not compile, yet
* singlemarkingpicker xaml layout
* singlemarkingpicker logic
* magic mirror window (varying pieces of it, mostly client-oriented)
* removes some imports, gives MagicMirror a BUI class (not filled in yet)
* populates magic mirror BUI functionality / window callbacks
* fixes up some errors in humanoidprofileeditor
* changes to SingleMarkingPicker
SingleMarkingPicker now accepts a List<Marking>, species, and total possible markings available in that marking category
* fixes up hair pickers on humanoid profile editor
* fixes the errors in markingpicker
* markingsystem is now gone
* fixes a bunch of build errors
* so that's why i did it like that
* namespace issues, adds robustxamlloader to singlemarkingpicker
* another robustxamlloader
* human, lizard sprites/points
* prototype fixes, deletion of old spriteaccessory
* component registration, fixes dwarf skin toning
no, 'ReptilianToned' does not exist
* removes component registration from abstract humanoid component
* visualizer data now cloneable
* serialize for visualizer key
* zero-count edge case
* missing semi-colon moment
* setspecies in humanoidsystem
* ensures that default markings, if empty, will cause ensuredefault to skip over that given category
* tryadd instead of add
* whoops
* diff and apply should properly apply markings now
* always ensure default, fixes double load for player spawning
* apply skin color now sets the skin color property in humanoidcomponent
* removes sprite from a few species prototypes
* sprite changes for specific base layers based on humanoid sex
* layer ordering fix, and a missing base layer should now disallow markings on that layer
* anymarking base layer, adds the right leg/foot for humans
* loading a profile will now clear all markings on that humanoid
* adds missing layers for humans
* separates species.yml into respective species prototype files
* ensures that if layer visibility was changed, all markings have to be reapplied
* server-side enforcement of hiding hair (and other head-related markings) when equipping things that hide hair
* slime fix, clothingsystem now dictates layer visibility server side
* sussy
* layer settings should now ensure a marking should match the skin tone
* whoops
* skincolor static class and functions in UI
* skin color validation in humanoidcharacterappearance
* markingpicker now shows only the markings for the selected category in used
* getter for slot in singlemarkingpicker now ensures slot is 0 if markings exists
* FilterSpecies no longer attempts to do removal while iterating
* expands for SingleMarkingPicker
* humanoid base dummy has blank layers now (and snout/tail/headside/headtop)
* fixes an issue with visualizer system if the marking count was different but the markings themselves were (somewhat) the same
* whoops
* adds edge case handlers for count differences in humanoid markings
* preview now loads profile instead of directly setting appearance
* moves marking set loading to update controls
* clones a marking set in markingpicker by using the deep clone constructor
* whoops (deep cloning a marking now copies the marking id)
* adds replace function for markingset
* points should now update after the markings are remove/added
* merging base layer sprites into a humanoid should now clear them before merging
* sets dirty range start to count only if the dirty range start was never set above 0
* fixes up some issues with singlemarkingpicker
* color selector sliders in single marking picker should now expand
* hair from hair pickers should now apply in profile loading (client-side)
* category in singlemarkingpicker now sets the private category variable
* slot selector should now populate
* single marking picker buttons now have text, also shows the category name over all user-clickable elements
* removes a comment
* removing hair slots now sets it to bald, defaults to zero used slots if current hair is bald on hair/facial hair
* random skin color, eye color
* populate colors now checks if the marking count is greater than zero in singlemarkingpicker
* hair/facial hair pickers now just get the first possible hair from the respective species list
* different approach to random skin color
* oh, that's why it wasn't working
* randomize everything now just updates every single control
* selecting a new marking in SingleMarkingPicker should attempt to copy over old colors, populate list now uses cache,
* markingmanager now uses OnlyWhitelisted to populate by category and species
* filterspecies now uses onlyWhitelist to filter markings based on whitelist or not
* oops
* ui fix for singlemarkingpicker, ensures that cache is not null if it is null when populatelist is called
* order of operations for the horizontal expand for add/remove
* hair pickers should now update when you add/remove the hair slot
* fixes variable naming error in character appearance
* loc string fix in singlemarkingpicker
* lizards, vox now have onlyWhitelist, vox restriction for hair/facialhairs
* having zero possible hairs should no longer cause an exception in randomization
* setting species should now update hair pickers
* ignore categories for marking picker
* and a clear as well for the category button
* places that functionality in its own function instead
* adds eye base sprite, vox now also have their own custom eye sprites
* loading a profile client-side should do FilterSpecies for markings now
* client-side load profile does filter species after adding in the hairs now
* magic mirror
* callbacks now call the callback instead of adding it on construct
* whoops
* in removemarking too
* adds missing synchronize calls
* comments out an updateinterface call in magic mirror
* magic mirror window title, minimum sizing
* fixes minsize, adds warning for players who try to set their hair for species that have no hair
* removes spaces in xaml
* namespace changes/organization
* whoopsie (merge conflicts)
* re-enables identity from humanoid component
* damagevisuals now uses the enum given to it instead of the layerstate given on that layer tied to the enum
* removes commas from json
* changes to visuals system so the change is consistent
* chest
* reptilian
* visualizer system now handles body sprite setting/coloration, similar to how characterappearance did it
not a big fan of this
* adds a check in applybasesprites
* adding/removing parts should now make them invisible on a humanoid
* body part removal/adding now enumerates over sublayers instead
* synchro now runs in bodycomponent startup
* parts instead of slots
* humanoidcompnent check
* switches from rsi to actualrsi
* removes all the body stuff (too slow)
* cleans up resolves from humanoid visualizer system
* merging sprites now checks if the base sprites have been modified or not (through things like species changes, or custom base sprite changes)
* not forgetting that one again
* merging now returns an actual dirty value
* replaces the sequenceequal with a more accurate solution
* permanent layers, layer visibility on add/remove part in body
* should send all hidden layers over now
* isdirty in visualizer system for base layers
* isdirty checks count as well
* ok, IsDirty should now set the base layers if the merged sprites are different
* equals override in HumanoidSpritePrototypes.cs
temporary until record prototypes :heck:
* makes fields readonly, equates IDs instead
* adds forced markings through marking picker
* forced in humanoidsystem api, ignorespecies in markingpicker
* marking bui
* makes that serializable as well
* ignore species/forced toggles now work
* adds icon to modifier verb, interface and keys to humanoid bases
* needs the actual enum value to open, no?
* makes the key the actual key
* actions now propagate upwards
* ignore species when set now repopulates markingpicker
* modifiable base layers in the markings window
* oops!
* layout changes
* info box should now appear
* adds ignorespecies for marking picker, collapsible for base layer section of appearance modification window
* collapsible layout moment
* if base layers have changed, all markings are now dirty (and if a base layer is missing, the marking is still 'applied' but it's now just invisible
* small change to marking visibility
* small changes to modifier UI
* markings now match skin on zombification
* zombie stuff
* makes the line edit in marking modifier window more obvious
* disables vox on round start
* horizontal expand on the single label in base layer modifiers
* humanoid profiles in prototypes
* randomhumanoidappearance won't work if the humanoid has a profile already stored
* removes unused code
* documentation in humanoidsystem server-side
* documentation in shared/client
* whoops
* converts accessory into marking in locale files (also adds marking loc string into single marking picker)
* be gone, shared humanoid appearance system from the last upstream merge
* species ignore on randomization (defaults to no ignored species)
* more upstream merge parts that bypassed any errors before merge
* addresses review (also just adds typeserializers in some places)
* submodule moment
* upstream merge issues
2022-09-22 15:19:00 -07:00
|
|
|
|
2024-05-12 09:18:21 +10:00
|
|
|
HairStylePicker.UpdateData(
|
Humanoid appearance refactor (#10882)
* initial commit
- species prototype modifications
- markings points as its own file
- shared humanoid component
* adds a tool to convert sprite accessories to markings (in go)
* removes a fmt call
* converts sprite accessory to markings
* adds hair and facial hair to marking categories
* multiple changes
- humanoid visualizer system
- markings modifications for visualizer
- modifications to shared humanoid component
- lays out a base for humanoid system
* hidden layers, ports some properties from appearance component, shrinks DefaultMarkings a little
* squishes the initialize event calls into one function
adds stuff to set species/skin color externally from a server message - currently laid out as if it a dirty call to a networked component, may be subject to change (server-side has not been implemented yet)
* makes the sprite pipeline more obvious
* apply all markings, hidden layer set replacement
* ensures that markings are cleared when the new set is applied
* starts refactoring markingsset (unfinished)
* more additions to the markingset api
* adds constructor logic to markingset
* adds a method to filter out markings in a set based on a given species
* fixes enumerators in markingset
* adds validator into MarkingSet, fixes ForwardMarkingEnumerator
* modifications to the humanoid visual system
* ensuredefault in markingset
* oop
* fixes up data keys, populates OnAppearanceChange in visualizer
* changes to humanoid component, markings
marking equality is now more strict, humanoidcomponent is now implemented for client as a child of sharedhumanoidcomponent
* markings are now applied the visualizer by diffing them
* base sprites are now applied to humanoids from humanoidvisualizer
* passes along base sprite settings to the marking application so that markings know to follow skin color/alpha or not (see: slimes)
* custom base layers on humanoids
* merges all data keys into one data class for humanoid visualizers
* setappearance in sharedhumanoidsystem, removes custombaselayercolors
* humanoidcomponent, system (empty) in server
* adds some basic public API functions to HumanoidSystem
* add marking, remove marking
* changes appearance MarkingsSet to a List<Marking>, adds listener for PlayerSpawnCompleteEvent in HumanoidSystem
* ensuredefaultmarkings, oninit for humanoids
* markingmanager API changes
* removes MarkingsSet
* LoadProfile, adjusts randomization in humanoid appearance to account for species
* base layer settings in humanoidsystem, eye color from profile
* rearranges files to centralize under Humanoid namespace
* more reorganization, deletes some stuff
gotta break stuff to make other things work, right?
goodbye SpriteAccessory...
* fixes a good chunk of server-side issues
still does not compile, yet
* singlemarkingpicker xaml layout
* singlemarkingpicker logic
* magic mirror window (varying pieces of it, mostly client-oriented)
* removes some imports, gives MagicMirror a BUI class (not filled in yet)
* populates magic mirror BUI functionality / window callbacks
* fixes up some errors in humanoidprofileeditor
* changes to SingleMarkingPicker
SingleMarkingPicker now accepts a List<Marking>, species, and total possible markings available in that marking category
* fixes up hair pickers on humanoid profile editor
* fixes the errors in markingpicker
* markingsystem is now gone
* fixes a bunch of build errors
* so that's why i did it like that
* namespace issues, adds robustxamlloader to singlemarkingpicker
* another robustxamlloader
* human, lizard sprites/points
* prototype fixes, deletion of old spriteaccessory
* component registration, fixes dwarf skin toning
no, 'ReptilianToned' does not exist
* removes component registration from abstract humanoid component
* visualizer data now cloneable
* serialize for visualizer key
* zero-count edge case
* missing semi-colon moment
* setspecies in humanoidsystem
* ensures that default markings, if empty, will cause ensuredefault to skip over that given category
* tryadd instead of add
* whoops
* diff and apply should properly apply markings now
* always ensure default, fixes double load for player spawning
* apply skin color now sets the skin color property in humanoidcomponent
* removes sprite from a few species prototypes
* sprite changes for specific base layers based on humanoid sex
* layer ordering fix, and a missing base layer should now disallow markings on that layer
* anymarking base layer, adds the right leg/foot for humans
* loading a profile will now clear all markings on that humanoid
* adds missing layers for humans
* separates species.yml into respective species prototype files
* ensures that if layer visibility was changed, all markings have to be reapplied
* server-side enforcement of hiding hair (and other head-related markings) when equipping things that hide hair
* slime fix, clothingsystem now dictates layer visibility server side
* sussy
* layer settings should now ensure a marking should match the skin tone
* whoops
* skincolor static class and functions in UI
* skin color validation in humanoidcharacterappearance
* markingpicker now shows only the markings for the selected category in used
* getter for slot in singlemarkingpicker now ensures slot is 0 if markings exists
* FilterSpecies no longer attempts to do removal while iterating
* expands for SingleMarkingPicker
* humanoid base dummy has blank layers now (and snout/tail/headside/headtop)
* fixes an issue with visualizer system if the marking count was different but the markings themselves were (somewhat) the same
* whoops
* adds edge case handlers for count differences in humanoid markings
* preview now loads profile instead of directly setting appearance
* moves marking set loading to update controls
* clones a marking set in markingpicker by using the deep clone constructor
* whoops (deep cloning a marking now copies the marking id)
* adds replace function for markingset
* points should now update after the markings are remove/added
* merging base layer sprites into a humanoid should now clear them before merging
* sets dirty range start to count only if the dirty range start was never set above 0
* fixes up some issues with singlemarkingpicker
* color selector sliders in single marking picker should now expand
* hair from hair pickers should now apply in profile loading (client-side)
* category in singlemarkingpicker now sets the private category variable
* slot selector should now populate
* single marking picker buttons now have text, also shows the category name over all user-clickable elements
* removes a comment
* removing hair slots now sets it to bald, defaults to zero used slots if current hair is bald on hair/facial hair
* random skin color, eye color
* populate colors now checks if the marking count is greater than zero in singlemarkingpicker
* hair/facial hair pickers now just get the first possible hair from the respective species list
* different approach to random skin color
* oh, that's why it wasn't working
* randomize everything now just updates every single control
* selecting a new marking in SingleMarkingPicker should attempt to copy over old colors, populate list now uses cache,
* markingmanager now uses OnlyWhitelisted to populate by category and species
* filterspecies now uses onlyWhitelist to filter markings based on whitelist or not
* oops
* ui fix for singlemarkingpicker, ensures that cache is not null if it is null when populatelist is called
* order of operations for the horizontal expand for add/remove
* hair pickers should now update when you add/remove the hair slot
* fixes variable naming error in character appearance
* loc string fix in singlemarkingpicker
* lizards, vox now have onlyWhitelist, vox restriction for hair/facialhairs
* having zero possible hairs should no longer cause an exception in randomization
* setting species should now update hair pickers
* ignore categories for marking picker
* and a clear as well for the category button
* places that functionality in its own function instead
* adds eye base sprite, vox now also have their own custom eye sprites
* loading a profile client-side should do FilterSpecies for markings now
* client-side load profile does filter species after adding in the hairs now
* magic mirror
* callbacks now call the callback instead of adding it on construct
* whoops
* in removemarking too
* adds missing synchronize calls
* comments out an updateinterface call in magic mirror
* magic mirror window title, minimum sizing
* fixes minsize, adds warning for players who try to set their hair for species that have no hair
* removes spaces in xaml
* namespace changes/organization
* whoopsie (merge conflicts)
* re-enables identity from humanoid component
* damagevisuals now uses the enum given to it instead of the layerstate given on that layer tied to the enum
* removes commas from json
* changes to visuals system so the change is consistent
* chest
* reptilian
* visualizer system now handles body sprite setting/coloration, similar to how characterappearance did it
not a big fan of this
* adds a check in applybasesprites
* adding/removing parts should now make them invisible on a humanoid
* body part removal/adding now enumerates over sublayers instead
* synchro now runs in bodycomponent startup
* parts instead of slots
* humanoidcompnent check
* switches from rsi to actualrsi
* removes all the body stuff (too slow)
* cleans up resolves from humanoid visualizer system
* merging sprites now checks if the base sprites have been modified or not (through things like species changes, or custom base sprite changes)
* not forgetting that one again
* merging now returns an actual dirty value
* replaces the sequenceequal with a more accurate solution
* permanent layers, layer visibility on add/remove part in body
* should send all hidden layers over now
* isdirty in visualizer system for base layers
* isdirty checks count as well
* ok, IsDirty should now set the base layers if the merged sprites are different
* equals override in HumanoidSpritePrototypes.cs
temporary until record prototypes :heck:
* makes fields readonly, equates IDs instead
* adds forced markings through marking picker
* forced in humanoidsystem api, ignorespecies in markingpicker
* marking bui
* makes that serializable as well
* ignore species/forced toggles now work
* adds icon to modifier verb, interface and keys to humanoid bases
* needs the actual enum value to open, no?
* makes the key the actual key
* actions now propagate upwards
* ignore species when set now repopulates markingpicker
* modifiable base layers in the markings window
* oops!
* layout changes
* info box should now appear
* adds ignorespecies for marking picker, collapsible for base layer section of appearance modification window
* collapsible layout moment
* if base layers have changed, all markings are now dirty (and if a base layer is missing, the marking is still 'applied' but it's now just invisible
* small change to marking visibility
* small changes to modifier UI
* markings now match skin on zombification
* zombie stuff
* makes the line edit in marking modifier window more obvious
* disables vox on round start
* horizontal expand on the single label in base layer modifiers
* humanoid profiles in prototypes
* randomhumanoidappearance won't work if the humanoid has a profile already stored
* removes unused code
* documentation in humanoidsystem server-side
* documentation in shared/client
* whoops
* converts accessory into marking in locale files (also adds marking loc string into single marking picker)
* be gone, shared humanoid appearance system from the last upstream merge
* species ignore on randomization (defaults to no ignored species)
* more upstream merge parts that bypassed any errors before merge
* addresses review (also just adds typeserializers in some places)
* submodule moment
* upstream merge issues
2022-09-22 15:19:00 -07:00
|
|
|
hairMarking,
|
|
|
|
|
Profile.Species,
|
|
|
|
|
1);
|
2024-05-12 09:18:21 +10:00
|
|
|
FacialHairPicker.UpdateData(
|
Humanoid appearance refactor (#10882)
* initial commit
- species prototype modifications
- markings points as its own file
- shared humanoid component
* adds a tool to convert sprite accessories to markings (in go)
* removes a fmt call
* converts sprite accessory to markings
* adds hair and facial hair to marking categories
* multiple changes
- humanoid visualizer system
- markings modifications for visualizer
- modifications to shared humanoid component
- lays out a base for humanoid system
* hidden layers, ports some properties from appearance component, shrinks DefaultMarkings a little
* squishes the initialize event calls into one function
adds stuff to set species/skin color externally from a server message - currently laid out as if it a dirty call to a networked component, may be subject to change (server-side has not been implemented yet)
* makes the sprite pipeline more obvious
* apply all markings, hidden layer set replacement
* ensures that markings are cleared when the new set is applied
* starts refactoring markingsset (unfinished)
* more additions to the markingset api
* adds constructor logic to markingset
* adds a method to filter out markings in a set based on a given species
* fixes enumerators in markingset
* adds validator into MarkingSet, fixes ForwardMarkingEnumerator
* modifications to the humanoid visual system
* ensuredefault in markingset
* oop
* fixes up data keys, populates OnAppearanceChange in visualizer
* changes to humanoid component, markings
marking equality is now more strict, humanoidcomponent is now implemented for client as a child of sharedhumanoidcomponent
* markings are now applied the visualizer by diffing them
* base sprites are now applied to humanoids from humanoidvisualizer
* passes along base sprite settings to the marking application so that markings know to follow skin color/alpha or not (see: slimes)
* custom base layers on humanoids
* merges all data keys into one data class for humanoid visualizers
* setappearance in sharedhumanoidsystem, removes custombaselayercolors
* humanoidcomponent, system (empty) in server
* adds some basic public API functions to HumanoidSystem
* add marking, remove marking
* changes appearance MarkingsSet to a List<Marking>, adds listener for PlayerSpawnCompleteEvent in HumanoidSystem
* ensuredefaultmarkings, oninit for humanoids
* markingmanager API changes
* removes MarkingsSet
* LoadProfile, adjusts randomization in humanoid appearance to account for species
* base layer settings in humanoidsystem, eye color from profile
* rearranges files to centralize under Humanoid namespace
* more reorganization, deletes some stuff
gotta break stuff to make other things work, right?
goodbye SpriteAccessory...
* fixes a good chunk of server-side issues
still does not compile, yet
* singlemarkingpicker xaml layout
* singlemarkingpicker logic
* magic mirror window (varying pieces of it, mostly client-oriented)
* removes some imports, gives MagicMirror a BUI class (not filled in yet)
* populates magic mirror BUI functionality / window callbacks
* fixes up some errors in humanoidprofileeditor
* changes to SingleMarkingPicker
SingleMarkingPicker now accepts a List<Marking>, species, and total possible markings available in that marking category
* fixes up hair pickers on humanoid profile editor
* fixes the errors in markingpicker
* markingsystem is now gone
* fixes a bunch of build errors
* so that's why i did it like that
* namespace issues, adds robustxamlloader to singlemarkingpicker
* another robustxamlloader
* human, lizard sprites/points
* prototype fixes, deletion of old spriteaccessory
* component registration, fixes dwarf skin toning
no, 'ReptilianToned' does not exist
* removes component registration from abstract humanoid component
* visualizer data now cloneable
* serialize for visualizer key
* zero-count edge case
* missing semi-colon moment
* setspecies in humanoidsystem
* ensures that default markings, if empty, will cause ensuredefault to skip over that given category
* tryadd instead of add
* whoops
* diff and apply should properly apply markings now
* always ensure default, fixes double load for player spawning
* apply skin color now sets the skin color property in humanoidcomponent
* removes sprite from a few species prototypes
* sprite changes for specific base layers based on humanoid sex
* layer ordering fix, and a missing base layer should now disallow markings on that layer
* anymarking base layer, adds the right leg/foot for humans
* loading a profile will now clear all markings on that humanoid
* adds missing layers for humans
* separates species.yml into respective species prototype files
* ensures that if layer visibility was changed, all markings have to be reapplied
* server-side enforcement of hiding hair (and other head-related markings) when equipping things that hide hair
* slime fix, clothingsystem now dictates layer visibility server side
* sussy
* layer settings should now ensure a marking should match the skin tone
* whoops
* skincolor static class and functions in UI
* skin color validation in humanoidcharacterappearance
* markingpicker now shows only the markings for the selected category in used
* getter for slot in singlemarkingpicker now ensures slot is 0 if markings exists
* FilterSpecies no longer attempts to do removal while iterating
* expands for SingleMarkingPicker
* humanoid base dummy has blank layers now (and snout/tail/headside/headtop)
* fixes an issue with visualizer system if the marking count was different but the markings themselves were (somewhat) the same
* whoops
* adds edge case handlers for count differences in humanoid markings
* preview now loads profile instead of directly setting appearance
* moves marking set loading to update controls
* clones a marking set in markingpicker by using the deep clone constructor
* whoops (deep cloning a marking now copies the marking id)
* adds replace function for markingset
* points should now update after the markings are remove/added
* merging base layer sprites into a humanoid should now clear them before merging
* sets dirty range start to count only if the dirty range start was never set above 0
* fixes up some issues with singlemarkingpicker
* color selector sliders in single marking picker should now expand
* hair from hair pickers should now apply in profile loading (client-side)
* category in singlemarkingpicker now sets the private category variable
* slot selector should now populate
* single marking picker buttons now have text, also shows the category name over all user-clickable elements
* removes a comment
* removing hair slots now sets it to bald, defaults to zero used slots if current hair is bald on hair/facial hair
* random skin color, eye color
* populate colors now checks if the marking count is greater than zero in singlemarkingpicker
* hair/facial hair pickers now just get the first possible hair from the respective species list
* different approach to random skin color
* oh, that's why it wasn't working
* randomize everything now just updates every single control
* selecting a new marking in SingleMarkingPicker should attempt to copy over old colors, populate list now uses cache,
* markingmanager now uses OnlyWhitelisted to populate by category and species
* filterspecies now uses onlyWhitelist to filter markings based on whitelist or not
* oops
* ui fix for singlemarkingpicker, ensures that cache is not null if it is null when populatelist is called
* order of operations for the horizontal expand for add/remove
* hair pickers should now update when you add/remove the hair slot
* fixes variable naming error in character appearance
* loc string fix in singlemarkingpicker
* lizards, vox now have onlyWhitelist, vox restriction for hair/facialhairs
* having zero possible hairs should no longer cause an exception in randomization
* setting species should now update hair pickers
* ignore categories for marking picker
* and a clear as well for the category button
* places that functionality in its own function instead
* adds eye base sprite, vox now also have their own custom eye sprites
* loading a profile client-side should do FilterSpecies for markings now
* client-side load profile does filter species after adding in the hairs now
* magic mirror
* callbacks now call the callback instead of adding it on construct
* whoops
* in removemarking too
* adds missing synchronize calls
* comments out an updateinterface call in magic mirror
* magic mirror window title, minimum sizing
* fixes minsize, adds warning for players who try to set their hair for species that have no hair
* removes spaces in xaml
* namespace changes/organization
* whoopsie (merge conflicts)
* re-enables identity from humanoid component
* damagevisuals now uses the enum given to it instead of the layerstate given on that layer tied to the enum
* removes commas from json
* changes to visuals system so the change is consistent
* chest
* reptilian
* visualizer system now handles body sprite setting/coloration, similar to how characterappearance did it
not a big fan of this
* adds a check in applybasesprites
* adding/removing parts should now make them invisible on a humanoid
* body part removal/adding now enumerates over sublayers instead
* synchro now runs in bodycomponent startup
* parts instead of slots
* humanoidcompnent check
* switches from rsi to actualrsi
* removes all the body stuff (too slow)
* cleans up resolves from humanoid visualizer system
* merging sprites now checks if the base sprites have been modified or not (through things like species changes, or custom base sprite changes)
* not forgetting that one again
* merging now returns an actual dirty value
* replaces the sequenceequal with a more accurate solution
* permanent layers, layer visibility on add/remove part in body
* should send all hidden layers over now
* isdirty in visualizer system for base layers
* isdirty checks count as well
* ok, IsDirty should now set the base layers if the merged sprites are different
* equals override in HumanoidSpritePrototypes.cs
temporary until record prototypes :heck:
* makes fields readonly, equates IDs instead
* adds forced markings through marking picker
* forced in humanoidsystem api, ignorespecies in markingpicker
* marking bui
* makes that serializable as well
* ignore species/forced toggles now work
* adds icon to modifier verb, interface and keys to humanoid bases
* needs the actual enum value to open, no?
* makes the key the actual key
* actions now propagate upwards
* ignore species when set now repopulates markingpicker
* modifiable base layers in the markings window
* oops!
* layout changes
* info box should now appear
* adds ignorespecies for marking picker, collapsible for base layer section of appearance modification window
* collapsible layout moment
* if base layers have changed, all markings are now dirty (and if a base layer is missing, the marking is still 'applied' but it's now just invisible
* small change to marking visibility
* small changes to modifier UI
* markings now match skin on zombification
* zombie stuff
* makes the line edit in marking modifier window more obvious
* disables vox on round start
* horizontal expand on the single label in base layer modifiers
* humanoid profiles in prototypes
* randomhumanoidappearance won't work if the humanoid has a profile already stored
* removes unused code
* documentation in humanoidsystem server-side
* documentation in shared/client
* whoops
* converts accessory into marking in locale files (also adds marking loc string into single marking picker)
* be gone, shared humanoid appearance system from the last upstream merge
* species ignore on randomization (defaults to no ignored species)
* more upstream merge parts that bypassed any errors before merge
* addresses review (also just adds typeserializers in some places)
* submodule moment
* upstream merge issues
2022-09-22 15:19:00 -07:00
|
|
|
facialHairMarking,
|
|
|
|
|
Profile.Species,
|
|
|
|
|
1);
|
2020-01-18 01:54:13 +01:00
|
|
|
}
|
|
|
|
|
|
2023-03-05 08:59:07 +06:00
|
|
|
private void UpdateCMarkingsHair()
|
|
|
|
|
{
|
|
|
|
|
if (Profile == null)
|
|
|
|
|
{
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// hair color
|
|
|
|
|
Color? hairColor = null;
|
|
|
|
|
if ( Profile.Appearance.HairStyleId != HairStyles.DefaultHairStyle &&
|
|
|
|
|
_markingManager.Markings.TryGetValue(Profile.Appearance.HairStyleId, out var hairProto)
|
|
|
|
|
)
|
|
|
|
|
{
|
2023-09-19 23:56:10 +03:00
|
|
|
if (_markingManager.CanBeApplied(Profile.Species, Profile.Sex, hairProto, _prototypeManager))
|
2023-03-05 08:59:07 +06:00
|
|
|
{
|
2023-03-12 03:04:58 +06:00
|
|
|
if (_markingManager.MustMatchSkin(Profile.Species, HumanoidVisualLayers.Hair, out var _, _prototypeManager))
|
2023-03-05 08:59:07 +06:00
|
|
|
{
|
|
|
|
|
hairColor = Profile.Appearance.SkinColor;
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
hairColor = Profile.Appearance.HairColor;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
if (hairColor != null)
|
|
|
|
|
{
|
2024-05-12 09:18:21 +10:00
|
|
|
Markings.HairMarking = new (Profile.Appearance.HairStyleId, new List<Color>() { hairColor.Value });
|
2023-03-05 08:59:07 +06:00
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
2024-05-12 09:18:21 +10:00
|
|
|
Markings.HairMarking = null;
|
2023-03-05 08:59:07 +06:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private void UpdateCMarkingsFacialHair()
|
|
|
|
|
{
|
|
|
|
|
if (Profile == null)
|
|
|
|
|
{
|
|
|
|
|
return;
|
|
|
|
|
}
|
2023-04-20 20:16:01 +10:00
|
|
|
|
2023-03-05 08:59:07 +06:00
|
|
|
// facial hair color
|
|
|
|
|
Color? facialHairColor = null;
|
|
|
|
|
if ( Profile.Appearance.FacialHairStyleId != HairStyles.DefaultFacialHairStyle &&
|
2024-05-12 09:18:21 +10:00
|
|
|
_markingManager.Markings.TryGetValue(Profile.Appearance.FacialHairStyleId, out var facialHairProto))
|
2023-03-05 08:59:07 +06:00
|
|
|
{
|
2023-09-19 23:56:10 +03:00
|
|
|
if (_markingManager.CanBeApplied(Profile.Species, Profile.Sex, facialHairProto, _prototypeManager))
|
2023-03-05 08:59:07 +06:00
|
|
|
{
|
2023-03-12 03:04:58 +06:00
|
|
|
if (_markingManager.MustMatchSkin(Profile.Species, HumanoidVisualLayers.Hair, out var _, _prototypeManager))
|
2023-03-05 08:59:07 +06:00
|
|
|
{
|
|
|
|
|
facialHairColor = Profile.Appearance.SkinColor;
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
facialHairColor = Profile.Appearance.FacialHairColor;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
if (facialHairColor != null)
|
|
|
|
|
{
|
2024-05-12 09:18:21 +10:00
|
|
|
Markings.FacialHairMarking = new (Profile.Appearance.FacialHairStyleId, new List<Color>() { facialHairColor.Value });
|
2023-03-05 08:59:07 +06:00
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
2024-05-12 09:18:21 +10:00
|
|
|
Markings.FacialHairMarking = null;
|
2023-03-05 08:59:07 +06:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2021-03-07 20:48:24 +01:00
|
|
|
private void UpdateEyePickers()
|
|
|
|
|
{
|
2021-03-10 14:48:29 +01:00
|
|
|
if (Profile == null)
|
|
|
|
|
{
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
2024-05-12 09:18:21 +10:00
|
|
|
Markings.CurrentEyeColor = Profile.Appearance.EyeColor;
|
|
|
|
|
EyeColorPicker.SetData(Profile.Appearance.EyeColor);
|
2021-03-07 20:48:24 +01:00
|
|
|
}
|
|
|
|
|
|
2020-01-18 01:54:13 +01:00
|
|
|
private void UpdateSaveButton()
|
|
|
|
|
{
|
2024-05-12 09:18:21 +10:00
|
|
|
SaveButton.Disabled = Profile is null || !IsDirty;
|
|
|
|
|
ResetButton.Disabled = Profile is null || !IsDirty;
|
2020-01-18 01:54:13 +01:00
|
|
|
}
|
|
|
|
|
|
2024-05-12 09:18:21 +10:00
|
|
|
private void SetPreviewRotation(Direction direction)
|
2020-11-08 13:44:04 +01:00
|
|
|
{
|
2024-05-12 09:18:21 +10:00
|
|
|
SpriteView.OverrideDirection = (Direction) ((int) direction % 4 * 2);
|
2024-04-16 22:57:43 +10:00
|
|
|
}
|
2023-09-13 04:57:38 +03:00
|
|
|
|
2024-05-12 09:18:21 +10:00
|
|
|
private void RandomizeEverything()
|
2024-04-16 22:57:43 +10:00
|
|
|
{
|
2024-05-12 09:18:21 +10:00
|
|
|
Profile = HumanoidCharacterProfile.Random();
|
|
|
|
|
SetProfile(Profile, CharacterSlot);
|
|
|
|
|
SetDirty();
|
2020-11-08 13:44:04 +01:00
|
|
|
}
|
|
|
|
|
|
2024-05-12 09:18:21 +10:00
|
|
|
private void RandomizeName()
|
2020-01-18 01:54:13 +01:00
|
|
|
{
|
2024-05-12 09:18:21 +10:00
|
|
|
if (Profile == null) return;
|
|
|
|
|
var name = HumanoidCharacterProfile.GetName(Profile.Species, Profile.Gender);
|
|
|
|
|
SetName(name);
|
2020-01-24 00:56:26 +01:00
|
|
|
UpdateNameEdit();
|
2020-01-19 09:34:33 +01:00
|
|
|
}
|
|
|
|
|
|
2024-08-01 01:14:19 +10:00
|
|
|
private async void ExportImage()
|
|
|
|
|
{
|
|
|
|
|
if (_imaging)
|
|
|
|
|
return;
|
|
|
|
|
|
|
|
|
|
var dir = SpriteView.OverrideDirection ?? Direction.South;
|
|
|
|
|
|
|
|
|
|
// I tried disabling the button but it looks sorta goofy as it only takes a frame or two to save
|
|
|
|
|
_imaging = true;
|
|
|
|
|
await _entManager.System<ContentSpriteSystem>().Export(PreviewDummy, dir, includeId: false);
|
|
|
|
|
_imaging = false;
|
|
|
|
|
}
|
|
|
|
|
|
2024-05-12 09:18:21 +10:00
|
|
|
private async void ImportProfile()
|
2020-01-19 09:34:33 +01:00
|
|
|
{
|
2024-05-12 09:18:21 +10:00
|
|
|
if (_exporting || CharacterSlot == null || Profile == null)
|
|
|
|
|
return;
|
2020-01-19 09:34:33 +01:00
|
|
|
|
2024-05-12 09:18:21 +10:00
|
|
|
StartExport();
|
|
|
|
|
await using var file = await _dialogManager.OpenFile(new FileDialogFilters(new FileDialogFilters.Group("yml")));
|
2020-01-19 09:34:33 +01:00
|
|
|
|
2024-05-12 09:18:21 +10:00
|
|
|
if (file == null)
|
|
|
|
|
{
|
|
|
|
|
EndExport();
|
|
|
|
|
return;
|
2020-01-19 09:34:33 +01:00
|
|
|
}
|
|
|
|
|
|
2024-05-12 09:18:21 +10:00
|
|
|
try
|
2023-09-20 08:54:53 +01:00
|
|
|
{
|
2024-05-12 09:18:21 +10:00
|
|
|
var profile = _entManager.System<HumanoidAppearanceSystem>().FromStream(file, _playerManager.LocalSession!);
|
|
|
|
|
var oldProfile = Profile;
|
|
|
|
|
SetProfile(profile, CharacterSlot);
|
2020-07-06 16:24:29 -05:00
|
|
|
|
2024-05-12 09:18:21 +10:00
|
|
|
IsDirty = !profile.MemberwiseEquals(oldProfile);
|
|
|
|
|
}
|
|
|
|
|
catch (Exception exc)
|
2020-07-06 16:24:29 -05:00
|
|
|
{
|
2024-05-12 09:18:21 +10:00
|
|
|
_sawmill.Error($"Error when importing profile\n{exc.StackTrace}");
|
2020-07-06 16:24:29 -05:00
|
|
|
}
|
2024-05-12 09:18:21 +10:00
|
|
|
finally
|
2022-09-10 17:40:06 +02:00
|
|
|
{
|
2024-05-12 09:18:21 +10:00
|
|
|
EndExport();
|
2022-09-10 17:40:06 +02:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2024-05-12 09:18:21 +10:00
|
|
|
private async void ExportProfile()
|
2022-09-10 17:40:06 +02:00
|
|
|
{
|
2024-05-12 09:18:21 +10:00
|
|
|
if (Profile == null || _exporting)
|
|
|
|
|
return;
|
2022-09-10 17:40:06 +02:00
|
|
|
|
2024-05-12 09:18:21 +10:00
|
|
|
StartExport();
|
|
|
|
|
var file = await _dialogManager.SaveFile(new FileDialogFilters(new FileDialogFilters.Group("yml")));
|
|
|
|
|
|
|
|
|
|
if (file == null)
|
2022-09-10 17:40:06 +02:00
|
|
|
{
|
2024-05-12 09:18:21 +10:00
|
|
|
EndExport();
|
|
|
|
|
return;
|
2022-09-10 17:40:06 +02:00
|
|
|
}
|
|
|
|
|
|
2024-05-12 09:18:21 +10:00
|
|
|
try
|
2022-09-10 17:40:06 +02:00
|
|
|
{
|
2024-05-12 09:18:21 +10:00
|
|
|
var dataNode = _entManager.System<HumanoidAppearanceSystem>().ToDataNode(Profile);
|
|
|
|
|
await using var writer = new StreamWriter(file.Value.fileStream);
|
|
|
|
|
dataNode.Write(writer);
|
2022-09-10 17:40:06 +02:00
|
|
|
}
|
2024-05-12 09:18:21 +10:00
|
|
|
catch (Exception exc)
|
2022-09-10 17:40:06 +02:00
|
|
|
{
|
2024-05-12 09:18:21 +10:00
|
|
|
_sawmill.Error($"Error when exporting profile\n{exc.StackTrace}");
|
2022-09-10 17:40:06 +02:00
|
|
|
}
|
2024-05-12 09:18:21 +10:00
|
|
|
finally
|
|
|
|
|
{
|
|
|
|
|
EndExport();
|
|
|
|
|
await file.Value.fileStream.DisposeAsync();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private void StartExport()
|
|
|
|
|
{
|
|
|
|
|
_exporting = true;
|
|
|
|
|
ImportButton.Disabled = true;
|
|
|
|
|
ExportButton.Disabled = true;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private void EndExport()
|
|
|
|
|
{
|
|
|
|
|
_exporting = false;
|
|
|
|
|
ImportButton.Disabled = false;
|
|
|
|
|
ExportButton.Disabled = false;
|
2022-09-10 17:40:06 +02:00
|
|
|
}
|
2020-01-18 01:54:13 +01:00
|
|
|
}
|
|
|
|
|
}
|