Allow configuring the script filename casing rule

Defaults to "Auto", which detects the casing based on the
preference of the currently selected language (C# for example
prefers PascalCase whereas GDScript prefers snake_case).
This commit is contained in:
RedMser
2023-06-11 18:23:48 +02:00
committed by Rémi Verschelde
parent a07dd0d6a5
commit 2bd714e34e
15 changed files with 103 additions and 57 deletions

View File

@ -31,6 +31,7 @@
#ifndef EDITOR_NODE_H
#define EDITOR_NODE_H
#include "core/object/script_language.h"
#include "core/templates/safe_refcount.h"
#include "editor/editor_data.h"
#include "editor/editor_folding.h"
@ -135,7 +136,8 @@ public:
enum SceneNameCasing {
SCENE_NAME_CASING_AUTO,
SCENE_NAME_CASING_PASCAL_CASE,
SCENE_NAME_CASING_SNAKE_CASE
SCENE_NAME_CASING_SNAKE_CASE,
SCENE_NAME_CASING_KEBAB_CASE,
};
struct ExecuteThreadArgs {
@ -689,7 +691,8 @@ public:
static VSplitContainer *get_top_split() { return singleton->top_split; }
static EditorBottomPanel *get_bottom_panel() { return singleton->bottom_panel; }
static String adjust_scene_name_casing(const String &root_name);
static String adjust_scene_name_casing(const String &p_root_name);
static String adjust_script_name_casing(const String &p_file_name, ScriptLanguage::ScriptNameCasing p_auto_casing);
static bool has_unsaved_changes() { return singleton->unsaved_cache; }
static void disambiguate_filenames(const Vector<String> p_full_paths, Vector<String> &r_filenames);