GDevelopApp / GDevelop-extensions

Repository of behaviors, actions, conditions and expressions to be used in GDevelop for creating games
https://gdevelop.io
MIT License
131 stars 52 forks source link

Interact for Battery,Language and OnLine #22

Closed MauryDev closed 3 years ago

MauryDev commented 5 years ago

Battery API for GDevelop: Description:

Extension to access battery properties.

Methods: API Start (Action) API Done (Condition) Level (String Expression) Charging (Condition) Charging Time (String Expression) Discharging Time (String Expression)

Events: onchargingtimechange (Condition) onlevelchange (Condition) ondischargingtimechange (Condition) onchargingchange (Condition)

JSON file: https://gitlab.com/maurygta2/interact-for-gdevelop/blob/master/src/Battery.json

Language API for GDevelop:

Description: Information about the user's language.

Methods: Language (String Expression)

JSON file: https://gitlab.com/maurygta2/interact-for-gdevelop/blob/master/src/language.json

OnLine API for GDevelop:

Description: Extension to check if it is online.

Methods: OnLine (String Expression)

JSON file: https://gitlab.com/maurygta2/interact-for-gdevelop/blob/master/src/online.json

4ian commented 5 years ago

Thanks for these! Unfortunately I can't your json files, seems that the repository is private. Can you make it public? :)

MauryDev commented 5 years ago

Yes it was private. Sorry!

JSON files: https://gitlab.com/maurygta2/interact-for-gdevelop/blob/master/src

4ian commented 5 years ago

Great! Are these working the browser only or also in Cordova? I guess it's browser only for now :)

MauryDev commented 5 years ago

Browser and Electron is work.

4ian commented 5 years ago

Ok :) I'll review these and will publish them then!

Bouh commented 4 years ago

The battery API is depreciated.

arthuro555 commented 3 years ago

As Bouh said, the Battery API is deprecated so we should probably not use it. The language extension is in my opinion a bit too barebones, I would rather wait for a more complete i18n extension to be made. The online extension is OK I think, though navigator.onLine isn't reliably testing for connection as it only checks the network adapter status, which will be always true (always "online") if it is a virtual one like when using virtual box or some VPNs. I am unsure whether we should not publish it as well or just add a warning in the description.

4ian commented 3 years ago

Looks too error prone, and I think we already have an extension checking if we're online now? I would not publish this for now then.

Bouh commented 3 years ago

Yes and on the same model, so the current extension may not work everywhere.

image