summaryrefslogtreecommitdiff
path: root/editor/editor_asset_installer.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'editor/editor_asset_installer.cpp')
-rw-r--r--editor/editor_asset_installer.cpp38
1 files changed, 19 insertions, 19 deletions
diff --git a/editor/editor_asset_installer.cpp b/editor/editor_asset_installer.cpp
index 73c70f422d..74c4102003 100644
--- a/editor/editor_asset_installer.cpp
+++ b/editor/editor_asset_installer.cpp
@@ -85,7 +85,7 @@ void EditorAssetInstaller::open(const String &p_path, int p_depth) {
package_path = p_path;
Set<String> files_sorted;
- FileAccess *src_f = NULL;
+ FileAccess *src_f = nullptr;
zlib_filefunc_def io = zipio_create_io_from_file(&src_f);
unzFile pkg = unzOpen2(p_path.utf8().get_data(), &io);
@@ -102,7 +102,7 @@ void EditorAssetInstaller::open(const String &p_path, int p_depth) {
//get filename
unz_file_info info;
char fname[16384];
- unzGetCurrentFileInfo(pkg, &info, fname, 16384, NULL, 0, NULL, 0);
+ unzGetCurrentFileInfo(pkg, &info, fname, 16384, nullptr, 0, nullptr, 0);
String name = fname;
files_sorted.insert(name);
@@ -110,19 +110,19 @@ void EditorAssetInstaller::open(const String &p_path, int p_depth) {
ret = unzGoToNextFile(pkg);
}
- Map<String, Ref<Texture2D> > extension_guess;
+ Map<String, Ref<Texture2D>> extension_guess;
{
- extension_guess["png"] = get_icon("ImageTexture", "EditorIcons");
- extension_guess["jpg"] = get_icon("ImageTexture", "EditorIcons");
- extension_guess["atlastex"] = get_icon("AtlasTexture", "EditorIcons");
- extension_guess["scn"] = get_icon("PackedScene", "EditorIcons");
- extension_guess["tscn"] = get_icon("PackedScene", "EditorIcons");
- extension_guess["shader"] = get_icon("Shader", "EditorIcons");
- extension_guess["gd"] = get_icon("GDScript", "EditorIcons");
- extension_guess["vs"] = get_icon("VisualScript", "EditorIcons");
+ extension_guess["png"] = tree->get_theme_icon("ImageTexture", "EditorIcons");
+ extension_guess["jpg"] = tree->get_theme_icon("ImageTexture", "EditorIcons");
+ extension_guess["atlastex"] = tree->get_theme_icon("AtlasTexture", "EditorIcons");
+ extension_guess["scn"] = tree->get_theme_icon("PackedScene", "EditorIcons");
+ extension_guess["tscn"] = tree->get_theme_icon("PackedScene", "EditorIcons");
+ extension_guess["shader"] = tree->get_theme_icon("Shader", "EditorIcons");
+ extension_guess["gd"] = tree->get_theme_icon("GDScript", "EditorIcons");
+ extension_guess["vs"] = tree->get_theme_icon("VisualScript", "EditorIcons");
}
- Ref<Texture2D> generic_extension = get_icon("Object", "EditorIcons");
+ Ref<Texture2D> generic_extension = tree->get_theme_icon("Object", "EditorIcons");
unzClose(pkg);
@@ -131,7 +131,7 @@ void EditorAssetInstaller::open(const String &p_path, int p_depth) {
TreeItem *root = tree->create_item();
root->set_cell_mode(0, TreeItem::CELL_MODE_CHECK);
root->set_checked(0, true);
- root->set_icon(0, get_icon("folder", "FileDialog"));
+ root->set_icon(0, tree->get_theme_icon("folder", "FileDialog"));
root->set_text(0, "res://");
root->set_editable(0, true);
Map<String, TreeItem *> dir_map;
@@ -180,7 +180,7 @@ void EditorAssetInstaller::open(const String &p_path, int p_depth) {
if (isdir) {
dir_map[path] = ti;
ti->set_text(0, path.get_file() + "/");
- ti->set_icon(0, get_icon("folder", "FileDialog"));
+ ti->set_icon(0, tree->get_theme_icon("folder", "FileDialog"));
ti->set_metadata(0, String());
} else {
String file = path.get_file();
@@ -194,7 +194,7 @@ void EditorAssetInstaller::open(const String &p_path, int p_depth) {
String res_path = "res://" + path;
if (FileAccess::exists(res_path)) {
- ti->set_custom_color(0, get_color("error_color", "Editor"));
+ ti->set_custom_color(0, tree->get_theme_color("error_color", "Editor"));
ti->set_tooltip(0, vformat(TTR("%s (Already Exists)"), res_path));
ti->set_checked(0, false);
} else {
@@ -212,7 +212,7 @@ void EditorAssetInstaller::open(const String &p_path, int p_depth) {
void EditorAssetInstaller::ok_pressed() {
- FileAccess *src_f = NULL;
+ FileAccess *src_f = nullptr;
zlib_filefunc_def io = zipio_create_io_from_file(&src_f);
unzFile pkg = unzOpen2(package_path.utf8().get_data(), &io);
@@ -234,7 +234,7 @@ void EditorAssetInstaller::ok_pressed() {
//get filename
unz_file_info info;
char fname[16384];
- ret = unzGetCurrentFileInfo(pkg, &info, fname, 16384, NULL, 0, NULL, 0);
+ ret = unzGetCurrentFileInfo(pkg, &info, fname, 16384, nullptr, 0, nullptr, 0);
String name = fname;
@@ -297,10 +297,10 @@ void EditorAssetInstaller::ok_pressed() {
}
msg += failed_files[i];
}
- if (EditorNode::get_singleton() != NULL)
+ if (EditorNode::get_singleton() != nullptr)
EditorNode::get_singleton()->show_warning(msg);
} else {
- if (EditorNode::get_singleton() != NULL)
+ if (EditorNode::get_singleton() != nullptr)
EditorNode::get_singleton()->show_warning(TTR("Package installed successfully!"), TTR("Success!"));
}
EditorFileSystem::get_singleton()->scan_changes();