ProffieOS6 Style Library "using" Function (Phase 4)

As part of my Phase 4 update (coming soon) I will be adding a new feature as suggested by profezzorn. This thread is being created now so I can point users to the usage instructions.

The ProffieOS6 Style Library “using” functions allow you to simplify your config files by only needing to have the style code appear once and then reference that style by a “using” function in all of your presets. With the introduction of Edit Mode and Style Options in OS6, you no longer need to make unique copies of the same style code for each preset to change the color, effects or transitions. Instead you can use the same style code in multiple presets with unique colors and options thereby saving memory on the board.

The new “using” functions allow you to further simplify your presets by simply referencing the “using” function name within the preset. You will only need to add each unique style once above the Preset presets[] array and then refer to it within the StylePtr<>().

So instead of pasting the same Style code in each preset you’ll paste the “using” code once and then refer to it in each preset you want to use it by the using name like below.

Example:

#ifdef CONFIG_PROP
#include "../props/saber_fett263_buttons.h"
#endif

#ifdef CONFIG_PRESETS
/*--------------------------------- MainFallenOrderCalKestisRed -------------------------
copyright Fett263 FallenOrder (Primary Blade) OS6 Style
https://fett263.com/fett263-proffieOS6-style-library.html#FallenOrder
OS6.6 v4.0
Single Style
Base Style: Fallen Order Cal Kestis


--Effects Included--
Ignition Effect: Standard Ignition
Retraction Effect: Standard Retraction
Lockup Effect: Intensity Lockup V1, Begin Effect: Real Clash, End Effect: Full Blade Absorb
LightningBlock Effect: Responsive Lightning Block
Drag Effect: Intensity Sparking Drag
Melt Effect: Intensity Melt
Blast Effect: Blast Wave (Random)
Clash Effect: Real Clash V1
*/
using MainFallenOrderCalKestisRed = Layers<...>;
/*
Add to preset as StylePtr<MainFallenOrderCalKestisRed>()
--------------------------------------------------------------------------*/

Preset presets[] = {

{ "Anakin;common", "Anakin/tracks/intro.wav",
StylePtr<MainFallenOrderCalKestisRed>(), "Preset1"
},

{ "Luke;common", "Luke/tracks/intro.wav",
StylePtr<MainFallenOrderCalKestisRed>(), "Preset2"
},
...

In the above example the library produced the copyright, style info and a using function (the name will need to be unique for each style).

The line

using MainFallenOrderCalKestisRed = Layers<...>

“MainFallenOrderCalKestisRed” is the function name that you will then use in each preset you want that style to be used in, you can then edit colors, settings, options, etc. all using Edit Mode, ProffieOS Workbench or by editing your presets.ini. The using function lets you simplify your Presets by only need to include the function name like so in each preset you want.

StylePtr<MainFallenOrderCalKestisRed>()

In addition, you can mix and match normal Style code and using functions in your presets, this is particularly useful for sabers with Crystal Chambers or Accents that you want to repeat the same style code (perhaps with a single Options style to customize in each preset) but then have unique styles for the main blade.

In this example with 2 “blades” the first is the main blade the second is the Crystal Chamber.

#ifdef CONFIG_PROP
#include "../props/saber_fett263_buttons.h"
#endif

#ifdef CONFIG_PRESETS

/*--------------------------------- CrystalFallenOrderCalKestisRed -------------------------
copyright Fett263 (Crystal Chamber) OS6 Style
https://fett263.com/fett263-proffieOS6-style-library.html#FallenOrder
OS6.6 v4.0
This Style Contains 16 Unique Combinations
On Behavior Options: Default (0): Kyber Flow Up, 1: Heart Beat, 2: Fast Pulse Dim-On, 3: Fast Run Forward
Off Behavior Options: Default (0): Slow Pulse Dim-On, 1: Kyber Flow Down, 2: Heart Beat, 3: Pulsing Flicker (Single Color)


--Effects Included--
Ignition Effect: Instant
Retraction Effect: Instant
*/
using CrystalFallenOrderCalKestisRed = Layers<...>;

/*
Add to preset as StylePtr<CrystalFallenOrderCalKestisRed>()
--------------------------------------------------------------------------*/

Preset presets[] = {
{ "Blue;common", "Blue/tracks/JFO6.wav",

/* copyright Fett263 KyberSelect (Primary Blade) OS6 Style
https://fett263.com/fett263-proffieOS6-style-library.html#KyberSelect
OS6.5 v2.2
Single Style
Base Style: Kyber Select Fallen Order (Hidden Selection)
Kyber Select Fallen Order (Hidden Selection) Interactive Control: Before Igniting Rotate Hilt to change Kyber Crystal selection (Twist Angle).

--Effects Included--
Ignition Effect: Standard Ignition
Retraction Effect: Standard Retraction
Lockup Effect: Intensity Lockup V1
LightningBlock Effect: Responsive Lightning Block
Drag Effect: Intensity Sparking Drag
Melt Effect: Intensity Melt
Blast Effect: Blast Wave (Random)
Clash Effect: Real Clash V1
*/
StylePtr<Layers<...>(),

StylePtr<CrystalFallenOrderCalKestisRed>(),

"Blue preset"
},

{ "Green;common", "Blue/tracks/JFO6.wav",
/* © Fett263 Rotoscope (Primary Blade) OS6 Style
Style Options
Default(0): Base Color (Original)
1: Base Color + Alt Color (Original)
2: Base Color (Fast)
3: Base Color + Alt Color (Fast)
4: Base Color (Slow)
5: Base Color + Alt Color (Slow)
Effects =
Ignition Effect Options: Default (0): Standard Ignition, 1: Wipe In, 2: Cycle Up, 3: SparkTip Ignition, 4: Center Out, 5: Center In
Power Up Effect Options: Default (0): Disabled, 1: Unstable Power Up, 2: Bright Power Up , 3: AudioFlicker Power Up
Retraction Effect Options: Default (0): Standard Retraction, 1: Run Up, 2: Cycle Down, 3: SparkTip Retraction 4: Split Retraction, 5: Center In
Cool Down Effect Options: Default (0): Disabled, 1: Unstable Cool Down, 2: Bright Cool Down, 3: AudioFlicker Cool Down
Preon Effect Options: Default(0): Disabled, 1: Faulty Ignition V1, 2: Faulty Ignition V2, 3: Overload, 4: Erratic, 5: Pulsing
Swing Effect: Default (0): Disabled, 1: Enhanced Bright Swing, 2: Bright Swing, 3: Force Boost Enhanced Bright Swing, 4: Force Boost Bright Swing
Lockup Effect: Intensity Lockup
Lightning Block Effect: Responsive Lightning Block
Drag Effect: Standard Drag
Melt Effect: Intensity Melt
Blast Effect: Multi-Blast (Seqeunce)
Clash Effect: Real Clash
Battery Level: % Blade - Red to Green
*/
StylePtr<Layers<...>(),

StylePtr<CrystalFallenOrderCalKestisRed>(), 

"Green preset"

},

In the above, the “StylePtr()” is the using code for the Crystal chamber style, this will now use the same crystal code (which contains 16 unique combinations with the “options”) for each preset but the main blade has it’s own style code in each preset.

You can pick and choose how you want to mix and match traditional style code and using functions in each preset as well. If you have some styles that you repeat in different presets it will simplify things with the using function, if you have styles that are unique to a preset you can just use the traditional style code (although the using function will work as well).

Just note, the using function is really just to simplify your presets it doesn’t really affect memory used in any relevant way. The actual style code either traditional or using function is the same. The memory savings from OS6 for reusing styles comes from the use of options and adding the same exact style code to multiple presets and then using Edit Mode or ProffieOSWorkbench to edit colors, settings etc in each preset versus creating copies of the same style in different colors for each preset.

The using function is a way to simplify your config and presets for “management” but it won’t impact memory used.

This feature will be launching with Phase 4 of the library - coming soon!

2 Likes

Thanks for the update. Looking forward to Phase 4. Can you help me understand how this is advantageous to just having a single Preset/Style combo in the config and replicating the Preset using Edit Mode/Workbench to make the second Preset, then adjusting font, track, effects, colors, options?

MTFBWY

I’ll be doing a live demo and will explain further when it’s ready for release.

Looking forward to it. Thanks.

I’ll be discussing this on my live show tonight, 9pm EST = Let's Talk Saber Effects - PHASE 4 OS6 Style Library - YouTube

I’ve updated first post with more information to better explain for when PHASE 4 is completed.