Ark2000 / PankuConsole

Feature-packed real-time debugging toolkit for Godot Engine.
https://k2kra.xyz/PankuConsole/
MIT License
997 stars 38 forks source link

Make the native logger "show if shell visible" setting default. #173

Closed TheContainer closed 4 months ago

TheContainer commented 4 months ago

Is your feature request related to a problem? Please describe. I really want to leave the console in the exported build. But the problem is, the logger is always visible by default. I could just change the settings, but these are stored in the user folder, which means that they don't transfer across devices.

Describe the solution you'd like Make the native logger "show if shell visible" setting default.

Ark2000 commented 4 months ago

I've got a better plan, now a default config file will be added to the plugin's folder, what do you think of it?

TheContainer commented 4 months ago

I've got a better plan, now a default config file will be added to the plugin's folder, what do you think of it?

That is an even better idea and would work perfectly.

worron commented 4 months ago

I've got a better plan, now a default config file will be added to the plugin's folder, what do you think of it?

I'm afraid it might have a negative impact on git submodule routine, which I consider as very valuable feature of panku plugin. User settings should not affect git status of your project, and it works perfectly right now.

Obvious workaround is to make panku config file path customizable in godot project settings. Not sure if is it easy to implement though.

Ark2000 commented 4 months ago

now a rough solution is:

whenever load_module_data is called, such as load_module_data("show_timestamp", true)

  1. find config file in user:// path, if not found, go to step 2
  2. find config file in developer specified res:// path (in project settings), if not found, go to step 3
  3. no config file found or the kv pair does't exist in config file, use the default value provided in function call.

[quit]

save everything to user:// path config file using save_module_data in quit_module.

worron commented 4 months ago

Decent solution overall, but a couple minor inconvenience can be spotted.

[quit]

save everything to user:// path config file using save_module_data in quit_module.

How will user do config changes when file located in res:// then? Manually editing file or coping it from user://?

  1. find config file in user:// path, if not found, go to step 2

That means when you are switching from user:// to res:// you need not only edit project settings but also remove file from user directory. Second action feels a bit non intuitive and unnecessary.


I would consider slightly tweaked workflow like:

Whenever load_module_data is called, such as load_module_data("show_timestamp", true):

  1. Define config file path with some function find_config_path. It will read developer specified path from project settings, if there is no such option or it's empty then use default user://. Go to 2.
  2. Try to read defined file, if not found or other problem, go to step 3.
  3. No config file found or the kv pair does't exist in config file, use the default value provided in function call.

[quit]

Save everything to file defined in step 1 (we can repeat call find_config_path here, or just save result somewhere on first call) using save_module_data in quit_module.