firebelley / godot-export

Automatically exports your Godot games.
MIT License
461 stars 53 forks source link

Custom editor settings are always overwritten #52

Closed knightofiam closed 2 years ago

knightofiam commented 3 years ago

From the README:

Using custom editor settings
Some Godot configurations are editor-based and not project-based.
This includes things like Android paths. This repository provides a base
editor settings that will be used by default when exporting your games.
However, you can supply a custom editor settings configuration by simply
copying a a custom editor settings file to ~/.config/godot/editor_settings-3.tres
before this action runs. This action will not overwrite an existing editor_settings-3.tres file.

However, I have not found this to be the case. Following the instructions, I create a custom editor settings file as ~/.config/godot/editor_settings-3.tres and I cat the contents before and after godot-export. Before, it has my custom contents. After, it has your contents. I've even tried making the file read-only but it STILL gets overwritten, and in that case an error occurs:

WARNING: create: Could not open config file.
     At: editor/editor_settings.cpp:989.

The default editor settings are unwanted and break the export process, yet there is no way to stop it from happening that I have been able to find.

Relevant yml excerpt:

...

steps:

...

  - name: use custom editor settings
    run: |
      mkdir -p ~/.config/godot
      cp default_env.tres ~/.config/godot/editor_settings-3.tres
      cat ~/.config/godot/editor_settings-3.tres
  - name: create executables
    uses: firebelley/godot-export@v2.6.1

    ...

  - name: show custom editor settings
    run: cat ~/.config/godot/editor_settings-3.tres

...

Seems like the force: false flag from #42 might not be effective.

firebelley commented 3 years ago

Hi, thanks for reporting the issue. Can you confirm that this line is correct?

cp default_env.tres ~/.config/godot/editor_settings-3.tres

As far as I know, default_env.tres is NOT the same as editor settings. It's possible the format is invalid and Godot itself is overwriting it. I'm fairly certain that this file will not be overwritten. See this line: https://github.com/firebelley/godot-export/blob/master/src/godot.ts#L246

The force: false option means that the cp operation will not overwrite a file that exists.

Please double check that you are copying the appropriate file. That would help to confirm the issue.

knightofiam commented 3 years ago

@firebelley You're right about the default_env.tres file. So I created an actual editor_settings-3.tres and put it under source control in the root of the project directory. I then copy it the way that I demonstrated above, and I can confirm that it's being overwritten, not with your editor settings, but Godot itself overwrites it. So I don't think your settings are being used in any case. I can't find my custom settings in the file after Godot overwrites it.

knightofiam commented 3 years ago

Example editor settings after Godot overwrite:

>Run cat ~/.config/godot/editor_settings-3.tres
[gd_resource type="EditorSettings" format=2]

[resource]
text_editor/highlighting/symbol_color = Color( 0.67, 0.785, 1, 1 )
text_editor/highlighting/keyword_color = Color( 1, 0.44, 0.52, 1 )
text_editor/highlighting/base_type_color = Color( 0.26, 1, 0.76, 1 )
text_editor/highlighting/engine_type_color = Color( 0.556, 1, 0.856, 1 )
text_editor/highlighting/user_type_color = Color( 0.778, 1, 0.928, 1 )
text_editor/highlighting/comment_color = Color( 0.8, 0.8075, 0.8275, 0.5 )
text_editor/highlighting/string_color = Color( 1, 0.925, 0.63, 1 )
text_editor/highlighting/background_color = Color( 0.125, 0.14375, 0.19375, 1 )
text_editor/highlighting/completion_background_color = Color( 0.2, 0.23, 0.31, 1 )
text_editor/highlighting/completion_selected_color = Color( 1, 1, 1, 0.07 )
text_editor/highlighting/completion_existing_color = Color( 1, 1, 1, 0.14 )
text_editor/highlighting/completion_scroll_color = Color( 1, 1, 1, 0.07 )
text_editor/highlighting/completion_font_color = Color( 0.8, 0.8075, 0.8275, 1 )
text_editor/highlighting/text_color = Color( 0.8, 0.8075, 0.8275, 1 )
text_editor/highlighting/line_number_color = Color( 0.8, 0.8075, 0.8275, 0.5 )
text_editor/highlighting/safe_line_number_color = Color( 0.8, 0.969, 0.8275, 0.75 )
text_editor/highlighting/caret_color = Color( 1, 1, 1, 1 )
text_editor/highlighting/text_selected_color = Color( 0.1, 0.115, 0.155, 1 )
text_editor/highlighting/brace_mismatch_color = Color( 1, 0.47, 0.42, 1 )
text_editor/highlighting/current_line_color = Color( 1, 1, 1, 0.07 )
text_editor/highlighting/line_length_guideline_color = Color( 0.2, 0.23, 0.31, 1 )
text_editor/highlighting/word_highlighted_color = Color( 1, 1, 1, 0.07 )
text_editor/highlighting/number_color = Color( 0.63, 1, 0.88, 1 )
text_editor/highlighting/function_color = Color( 0.34, 0.7, 1, 1 )
text_editor/highlighting/member_variable_color = Color( 0.736, 0.88, 1, 1 )
text_editor/highlighting/mark_color = Color( 1, 0.47, 0.42, 0.3 )
text_editor/highlighting/breakpoint_color = Color( 1, 0.47, 0.42, 1 )
text_editor/highlighting/code_folding_color = Color( 1, 1, 1, 0.7 )
text_editor/highlighting/search_result_color = Color( 1, 1, 1, 0.07 )
export/android/adb = "/usr/bin/adb"
export/android/jarsigner = "/usr/bin/jarsigner"
export/android/custom_build_sdk_path = "/usr/local/lib/android/sdk"
mono/builds/build_tool = 3
export/android/android_sdk_path = ""
export/android/debug_keystore = ""
export/android/debug_keystore_user = "androiddebugkey"
export/android/debug_keystore_pass = "android"
export/android/force_system_user = false
export/android/shutdown_adb_on_exit = true
export/web/http_host = "localhost"
export/web/http_port = 8060
export/windows/rcedit = ""
export/windows/osslsigncode = ""
export/windows/wine = ""
interface/scene_tabs/always_show_close_button = false
interface/editor/show_update_spinner = false
interface/editor/update_continuously = false
interface/scene_tabs/restore_scenes_on_load = false
interface/inspector/capitalize_properties = true
interface/inspector/default_float_step = 0.001
interface/inspector/disable_folding = false
interface/inspector/auto_unfold_foreign_scenes = true
interface/inspector/horizontal_vector2_editing = false
interface/inspector/horizontal_vector_types_editing = true
interface/inspector/open_resources_in_current_inspector = true
interface/inspector/resources_to_open_in_new_inspector = "Script,MeshLibrary,TileSet"
interface/inspector/default_color_picker_mode = 0
_default_feature_profile = ""
interface/editors/show_scene_tree_root_selection = true
interface/editors/derive_script_globals_by_name = true
_use_favorites_root_selection = false
filesystem/file_server/port = 6010
filesystem/file_server/password = ""
editors/3d/manipulator_gizmo_size = 80
editors/3d/manipulator_gizmo_opacity = 0.9
editors/3d/navigation/show_viewport_rotation_gizmo = true
debugger/auto_switch_to_remote_scene_tree = false
debugger/remote_scene_tree_refresh_interval = 1.0
debugger/remote_inspect_refresh_interval = 0.2
debugger/profiler_frame_history_size = 600
debugger/profiler_frame_max_functions = 512
text_editor/files/auto_reload_scripts_on_external_change = true
text_editor/files/auto_reload_and_parse_scripts_on_save = true
text_editor/files/open_dominant_script_on_scene_change = true
text_editor/external/use_external_editor = false
text_editor/external/exec_path = ""
text_editor/script_list/script_temperature_enabled = true
text_editor/script_list/highlight_current_script = true
text_editor/script_list/script_temperature_history_size = 15
text_editor/script_list/current_script_background_color = Color( 1, 1, 1, 0.3 )
text_editor/script_list/group_help_pages = true
text_editor/script_list/sort_scripts_by = 0
text_editor/script_list/list_script_names_as = 0
text_editor/external/exec_flags = "{file}"
asset_library/available_urls = {
"godotengine.org": "https://godotengine.org/asset-library/api",
"localhost": "http://127.0.0.1/asset-library/api"
}
asset_library/use_threads = true
editors/grid_map/preview_size = 64
editors/tile_map/preview_size = 64
editors/tile_map/palette_item_hseparation = 8
editors/tile_map/show_tile_names = true
editors/tile_map/show_tile_ids = false
editors/tile_map/sort_tiles_by_name = true
editors/tile_map/bucket_fill_preview = true
editors/tile_map/editor_side = 1
editors/tile_map/palette_min_width = 80
editors/3d_gizmos/gizmo_colors/path = Color( 0.5, 0.5, 1, 0.8 )
editors/3d_gizmos/gizmo_colors/instanced = Color( 0.7, 0.7, 0.7, 0.6 )
editors/3d_gizmos/gizmo_colors/csg = Color( 0, 0.4, 1, 0.15 )
editors/grid_map/editor_side = 1
editors/grid_map/palette_min_width = 230
network/language_server/remote_port = 6008
network/language_server/enable_smart_resolve = true
network/language_server/show_native_symbols_in_editor = false
network/language_server/use_thread = false
mono/editor/show_info_on_start = true
mono/editor/external_editor = 0
editors/3d_gizmos/gizmo_colors/camera = Color( 0.8, 0.4, 0.8, 1 )
editors/3d_gizmos/gizmo_colors/stream_player_3d = Color( 0.4, 0.8, 1, 1 )
editors/3d_gizmos/gizmo_colors/shape = Color( 0.5, 0.7, 1, 1 )
editors/3d_gizmos/gizmo_colors/skeleton = Color( 1, 0.8, 0.4, 1 )
editors/3d_gizmos/gizmo_colors/visibility_notifier = Color( 0.8, 0.5, 0.7, 1 )
editors/3d_gizmos/gizmo_colors/particles = Color( 0.8, 0.7, 0.4, 1 )
editors/3d_gizmos/gizmo_colors/reflection_probe = Color( 0.6, 1, 0.5, 1 )
editors/3d_gizmos/gizmo_colors/gi_probe = Color( 0.5, 1, 0.6, 1 )
editors/3d_gizmos/gizmo_colors/baked_indirect_light = Color( 0.5, 0.6, 1, 1 )
editors/3d_gizmos/gizmo_colors/navigation_edge = Color( 0.5, 1, 1, 1 )
editors/3d_gizmos/gizmo_colors/navigation_edge_disabled = Color( 0.7, 0.7, 0.7, 1 )
editors/3d_gizmos/gizmo_colors/navigation_solid = Color( 0.5, 1, 1, 0.4 )
editors/3d_gizmos/gizmo_colors/navigation_solid_disabled = Color( 0.7, 0.7, 0.7, 0.4 )
editors/3d_gizmos/gizmo_colors/joint = Color( 0.5, 0.8, 1, 1 )
editors/3d_gizmos/gizmo_colors/joint_body_a = Color( 0.6, 0.8, 1, 1 )
editors/3d_gizmos/gizmo_colors/joint_body_b = Color( 0.6, 0.9, 1, 1 )
mono/assembly_watch_interval_sec = 0.5
knightofiam commented 3 years ago

As per my comment on #51, although Godot overwrites the editor settings, the custom ones are still used before the overwrite occurs. I proved this in #51 by making a change that caused a failing build to pass.

knightofiam commented 3 years ago

@firebelley Maybe we could add a note to the README explaining this to avoid confusion? AFAICT there's really no way using your Action to print the contents of the editor settings that are actually used in the export / build. You can print them beforehand, or after they've been overwritten. That's unfortunate for debugging purposes, but at least it works.

firebelley commented 3 years ago

I suppose it technically is overwriting, but it appears to not be a destructive operation. Godot appears to be adding items. Notice how the android paths and mono build tool are set still.

I don't think it is necessary to add a note about this right now, as long as the user provided settings are still being used. But I am happy to be convinced otherwise if you feel it's necessary!

knightofiam commented 3 years ago

@firebelley Huh. My testing shows that it's destructive. After I used my custom build settings, those settings were not present after the build. I can check again, but I'm fairly certain that was the case on my end.

firebelley commented 2 years ago

Hi, sorry for the delay - I will queue this up for testing for the next release and see if this is still an issue and resolve it if so