Combo Property to Cordova plugin reference.

0 favourites
  • 3 posts
From the Asset Store
Combo
$10 USD
Button Combinations like in fightings, supports both keyboard and gamepads
  • Hi Nepeo, is it possible for us to reference different Cordova plugins depending on the combo property selection?

    Like this:

    			// Setting Property References
    			const mode = new SDK.PluginProperty("combo", "mode", { "items": ["first-plugin", "second-plugin"], "initialValue": "first-plugin"})
    
     SDK.Lang.PushContext(".properties");
    
     this._info.SetProperties([
     mode
     ]);
    
     const pluginMode = (mode === "first-plugin" ? "cordova-plugin-first" : "cordova-plugin-second");
    
     // Cordova Plugin Reference
    			this._info.AddCordovaPluginReference(
    				{
    					id: pluginMode,
    					plugin: this
    				}
    			);

    Thanks.

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • I'm afraid not, the whole plugin definition is treated as a static type object. After it has been created it doesn't do much other than hold information. Trying to read back the value of a plugin property is also pretty hard, as the definition of the property is decoupled from the actual value. Took a fair bit of gymnastics to get dynamic variables to work.

    We could probably add something like this, but it could add weird side effects ( plugin list becomes non-deterministic ), and I'm not sure what the advantage is?

  • I see, I understand. Thanks for explaining.

    We could probably add something like this, but it could add weird side effects ( plugin list becomes non-deterministic ), and I'm not sure what the advantage is?

    I was planning to load different Cordova plugins that can have the same ACEs, just different platforms and each plugin having their own exclusive features. Although, I understand if it can't be done, cause it might be a lot of work.

    Thanks for explaining.

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)