mirror of
https://github.com/eried/portapack-mayhem.git
synced 2025-04-18 06:56:03 -04:00
Installing a custom waterfall gradient via fileman
This commit is contained in:
parent
8b7de608a6
commit
d4647b9e0c
@ -419,6 +419,17 @@ void FileManBaseView::reload_current(bool reset_pagination) {
|
||||
refresh_list();
|
||||
}
|
||||
|
||||
void FileManBaseView::copy_waterfall(std::filesystem::path path) {
|
||||
nav_.push<ModalMessageView>(
|
||||
"Install", " Use this gradient file\n for all waterfalls?", YESNO,
|
||||
[this, path](bool choice) {
|
||||
if (choice) {
|
||||
delete_file(default_gradient_file);
|
||||
copy_file(path, default_gradient_file);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
const FileManBaseView::file_assoc_t& FileManBaseView::get_assoc(
|
||||
const fs::path& ext) const {
|
||||
size_t index = 0;
|
||||
@ -685,7 +696,11 @@ bool FileManagerView::handle_file_open() {
|
||||
auto ext = path.extension();
|
||||
|
||||
if (path_iequal(txt_ext, ext)) {
|
||||
nav_.push<TextEditorView>(path);
|
||||
if (path_iequal(current_path, u"/" + waterfalls_dir)) {
|
||||
copy_waterfall(path);
|
||||
} else {
|
||||
nav_.push<TextEditorView>(path);
|
||||
}
|
||||
return true;
|
||||
} else if (is_cxx_capture_file(path) || path_iequal(ppl_ext, ext)) {
|
||||
// TODO: Enough memory to push?
|
||||
|
@ -96,6 +96,7 @@ class FileManBaseView : public View {
|
||||
void load_directory_contents(const std::filesystem::path& dir_path);
|
||||
void load_directory_contents_unordered(const std::filesystem::path& dir_path, size_t file_cnt);
|
||||
const file_assoc_t& get_assoc(const std::filesystem::path& ext) const;
|
||||
void copy_waterfall(std::filesystem::path path);
|
||||
|
||||
NavigationView& nav_;
|
||||
|
||||
|
14
sdcard/WATERFALLS/aurora.txt
Normal file
14
sdcard/WATERFALLS/aurora.txt
Normal file
@ -0,0 +1,14 @@
|
||||
# 0% black
|
||||
0,0,0,0
|
||||
|
||||
# 25% blue
|
||||
64,0,0,255
|
||||
|
||||
# 50% magenta
|
||||
128,255,0,255
|
||||
|
||||
# 75% green
|
||||
192,0,255,0
|
||||
|
||||
# 100% white
|
||||
255,255,255,255
|
11
sdcard/WATERFALLS/flame.txt
Normal file
11
sdcard/WATERFALLS/flame.txt
Normal file
@ -0,0 +1,11 @@
|
||||
# 0% black
|
||||
0,0,0,0
|
||||
|
||||
# 33% red
|
||||
84,255,0,0
|
||||
|
||||
# 66% yellow
|
||||
168,255,255,0
|
||||
|
||||
# 100% white
|
||||
255,255,255,255
|
8
sdcard/WATERFALLS/matrix.txt
Normal file
8
sdcard/WATERFALLS/matrix.txt
Normal file
@ -0,0 +1,8 @@
|
||||
# 0% black
|
||||
0,0,0,0
|
||||
|
||||
# 50% green
|
||||
128,0,255,0
|
||||
|
||||
# 100% white
|
||||
255,255,255,255
|
14
sdcard/WATERFALLS/sunset.txt
Normal file
14
sdcard/WATERFALLS/sunset.txt
Normal file
@ -0,0 +1,14 @@
|
||||
# 0% black
|
||||
0,0,0,0
|
||||
|
||||
# 25% blue
|
||||
64,0,0,255
|
||||
|
||||
# 50% red
|
||||
128,255,0,0
|
||||
|
||||
# 75% yellow
|
||||
192,255,255,0
|
||||
|
||||
# 100% white
|
||||
255,255,255,255
|
Loading…
x
Reference in New Issue
Block a user