-
Notifications
You must be signed in to change notification settings - Fork 27
Endless Dream custom skin properties #138
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
|
I appreciate the effort but I think it's not going to be this simple. This suggested check method doesn't meet our requirements. A skin that attempts to call Instead, I would like to suggest this kind of approach: The second issue is that inserting lua functions that recover a value from the runtime, while clever, isn't going to work with dynamically changing values; I believe this implementation will only set them once during skin load. Instead, we will need to provide a function that recovers a numeric property id, the value of which will be dynamically assigned by us at skin load time - this will allow us to maintain full compatibility even with possible future upstream updates, because we won't ever have to worry about id collisions. Along with this feature I think we should also add a skin configuration toggle to force compatibility mode - ie. allow loading a skin in "legacy" mode, with endless dream variables and properties disabled, to make it possible for skin authors to test both versions without having to juggle separate runtimes. |
Thanks for pointing out, I completely forgot the field existence check. Example and code have been updated
I have a quick test and can confirm this is true, I'll update the pr implementation in near future. We might have some trouble at finding the unused id. Maybe writing a simple function to collect used id from
I agree on this. Currently the only idea I can think of is to add a parameter to main function. I'll update the code later and see if we can find any clever solution or not. |
|
Updated the dynamic id allocation draft and example. Also added some explanation in the first pr comment. We still need some time to investigate what they're used for. |
72c4a58 to
35d1e36
Compare
|
Changed the base from |
ff1a802 to
924a828
Compare
See the first pr message for todos!!!Update:
Dynamic id allocation vs mystery raja code:
|
Motivation
This pr is a draft to implement the endless dream's only skin properties without introducing the conflicts with upstream. The original idea was proposed by @Arctice
Drop-in compatibility
This pr implements a "dynamic id system" to avoid producing any conflicts with the old skin system and not giving pressure to skin producers. To use it, skin writer needs to call the function exposed on
main_stateto get the id anduse it as usual. For example, to use the
rivalname in a text, we need to write something liketable.insert(skin.text, { id = "rival", ref = 2 })at old skin system. In endless dream's new skin system we only need to change the magic number 2 to a function call astable.insert(skin.text, {id = "rival", ref = main_state.rival() }).(Note: This is only an example, we didn't expose the existed skin properties as a function to user)
Also this pr implements a "legacy mode" to allow skin makers to test their skins are working in vanilla raja or not.
Example
Currently, this pr contains an example for exposing the current bgm/sound directory, which isn't being exposed in skin properties and requested by #137. Here's a demo:

The skin used in the demo picture is Project-Shoko, code changes are:
and
TODOs
EventProperty,TimerPropertyImageIndexPropertyinsideIntegerPropertyFactory, code. Currently I have no idea what this property is used for.