Introduction :
With the new plugin manager the possibilities to do configurations is incredible! It's can pretty much remove the use of JSON configurations! (wich is not always user friendly for people who doesn't know how to program) and can even do more (with File and MV integrate system)
ALTHOUGH it's lacks one features who are from the JSON.
"The Object with key signature"
if I explain a Object with key is pretty much and object with key.
They can work pretty much the same than an List but instead of using an index wich is an number it's use the name or the key.
It's possible to use "List" and struct for simulate this effect but you can see here it's...kinda look hard to read.
and for fetch it I need to use some kind array looping for get them by their name.
so I am suggesting a new type who would act as an List but with name.
The KeyStruct
Description of the Feature:
Code for Implementation:
I don't have access to the editor code.
Mockups:
Why is this feature good?
This feature is great because of the following:
Issues that might arise from this feature:
With the new plugin manager the possibilities to do configurations is incredible! It's can pretty much remove the use of JSON configurations! (wich is not always user friendly for people who doesn't know how to program) and can even do more (with File and MV integrate system)
ALTHOUGH it's lacks one features who are from the JSON.
"The Object with key signature"
if I explain a Object with key is pretty much and object with key.
Code:
{
"interaction": {
"normal": {
"someOtherVariable": 10
},
"angry": {
"someOtherVariable": 3
}
}
}
// you can then access the code like interaction["key"].someOtherVariable;
They can work pretty much the same than an List but instead of using an index wich is an number it's use the name or the key.
It's possible to use "List" and struct for simulate this effect but you can see here it's...kinda look hard to read.
so I am suggesting a new type who would act as an List but with name.
The KeyStruct
Description of the Feature:
The keystruct would work almost the same than a list and a struct but it's would work quite differently in same time. It's will be explain better in the mockup.
The Keystruct can't be loop with a regular loop and shouldn't since this not their whole point.
- Permit to get elements by their name
- better visibility
- Organisation
- not dependant on their index
- useful for complex structure
- Allow the same function than an struct and List
- can use the struct and list and can be use by them.
The Keystruct can't be loop with a regular loop and shouldn't since this not their whole point.
Code for Implementation:
I don't have access to the editor code.
Mockups:
Pretty much they will work almost the same than and struct list before showing how it's show in the editor I will show it's actually work in script.
Then after it's would look like this :
As you can see it's pretty much look like List and struct!
Although it's when you add a new item to the keystruct it's almost the same than adding a new element BUT!
It's change a little that's possible to set a key for it! Making that the output in JS file will be :
Code:
/**
* @param interactions // <- it's the main key it's act like an namespaces
* @type KeyStruct<anything>
*
*/
As you can see it's pretty much look like List and struct!
Although it's when you add a new item to the keystruct it's almost the same than adding a new element BUT!
It's change a little that's possible to set a key for it! Making that the output in JS file will be :
Code:
// Obviously inside the variable $plugin where the parameters are.
"interactions" : {
"someKey" : {
"someValue" : "string"
}
}
// can be obtained by doing a JSON.parse
// would be accessible like :
var parameters = parameters("myPlugin")["parameters"];
var newValue = JSON.parse(parameters);
newvalue.someKey.someValue = "newString";
Why is this feature good?
This feature is great because of the following:
- More clean options for the PluginManager
- less hassle to loop through an list for gets elements
- non dependant of the index
- Allow more flexibility
Issues that might arise from this feature:
- More complex to implement than the List and Struct
- can be confuse with the list and struct (wich can be clarified with a good tutorial or doc!)
- can get messy if used inside an list (it's can create quite weird struct
Code:
{
"core": {
"messageSystem": "MV",
"voices": {
"enable": false,
"useCustomDir": true
},
"AI": [
{
"interactions": [
{
"name": "buy",
"earlyMethodCall": "none",
"spriteEffect": "none",
"messageContent": "Thanks for your buy!",
"emotion": "happy",
"lateMethodCall": "none"
}
]
}
]
}
}