Add color customization options - #5
Conversation
catapillie
left a comment
There was a problem hiding this comment.
thank you for the PR, i think there's a confusion with how the particle structs should be stored in the BatterySwitch class
Also, you may have forgotten the tooltips in Ahorn/lang/en_gb.lang (not big deal no one uses Ahorn anymore)
| private static ParticleType P_Signal_A = new(DashSwitch.P_PressA); | ||
| private static ParticleType P_Signal_B = new(DashSwitch.P_PressA); |
There was a problem hiding this comment.
since particles are now customizable for each BatterySwitch entity, these fields should be marked as static.
|
|
||
| private static bool particlesSetup = false; | ||
| private static ParticleType P_Signal_A = new(DashSwitch.P_PressA); | ||
| private static ParticleType P_Signal_B = new(DashSwitch.P_PressA); |
There was a problem hiding this comment.
you probably intended this:
| private static ParticleType P_Signal_B = new(DashSwitch.P_PressA); | |
| private static ParticleType P_Signal_B = new(DashSwitch.P_PressB); |
| P_Signal.LifeMin = 0.3f; | ||
| P_Signal.SpeedMultiplier = 0.1f; | ||
| P_Signal.DirectionRange = (float)(Math.PI / 5); | ||
| private static void SetupParticles(EntityData e) { |
There was a problem hiding this comment.
should no longer be a staticmethod
| private static void SetupParticles(EntityData e) { | |
| private void SetupParticles(EntityData e) { |
| local COLOR_CYAN = "00ffff" | ||
| local COLOR_FOREST_GREEN = "228b22" | ||
| local COLOR_LIGHT_GOLDENROD_YELLOW = "fafad2" | ||
| local COLOR_LIME = "00ff00" | ||
| local COLOR_ORANGE_RED = "ff4500" |
There was a problem hiding this comment.
you don't need to redefine these XNA colors, they are available in consts/xna_colors.lua in the Lönn repository. (they are defined as RGBA values, not hex codes, but IIRC Lönn converts them automatically)
you may import the constants and use them as follows
local xna_colors = require "consts.xna_colors"
xna_colors.Cyan
xna_colors.ForestGreen
-- etc..| local COLOR_AQUA = "00ffff" | ||
| local COLOR_LIME = "00ff00" | ||
| local COLOR_WHITE = "ffffff" |
There was a problem hiding this comment.
same comment about XNA colors here.
| entities.batteries/battery_switch.placements.name.left=Battery Switch (Left) | ||
| entities.batteries/battery_switch.placements.name.right=Battery Switch (Right) | ||
| entities.batteries/battery_switch.attributes.name.particleColorA=Particle Color 1 | ||
| entities.batteries/battery_switch.attributes.name.particleColorB=Particle Color 2 |
There was a problem hiding this comment.
(nit.) more precise description would be appreciated.
Although batteries and battery switches can be easily resprited, their particle and death effect colors are hardcoded into the entity, which made non-green reskins mismatch. This is a proposal to expose particle colors for the 4 battery states, the battery's death effect color, and battery switch particle and glow colors for customization in Lonn and Ahorn. This contribution adds the following options:
Batteries
Battery Switch
particle_customization.mp4