Construct 2: Convert array or key/values to a c2_dictionary json object

Here is a converter I made to convert a one dimensional php array or simple key/values to a c2_dictionary json object to load json data from string into a dictionary object for construct 2 game maker



Add reversed key value to allow for easy lookup by key/value (e.g. beside key:value, value:key)

Keep pebble time watchface backlight on for longer than 3 seconds

The pebble time watchface dims pretty fast and it only lasts 3 seconds, unfortunately there is no option right to increase that. in watchface it is possible to change this behavior programatically here is how i did it.

static int seconds; static void set_backlight(){ light_enable_interaction(); if (seconds<=4)return; app_timer_register(3000,set_backlight, NULL); } static void accel_tap_handler(AccelAxisType axis,int32_t direction) { light_enable_interaction(); seconds = 10; app_timer_register(3000,set_backlight, NULL); } static void main_window_load(Window *window) { ... accel_tap_service_subscribe(&accel_tap_handler); ... } static void tick_handler(struct tm *tick_time, TimeUnits units_changed) { if (seconds>0)seconds--; ... } static void init() { ... tick_timer_service_subscribe(SECOND_UNIT, tick_handler); ... }