Support File Settings #26

Merged
cody merged 7 commits from topic/jb/tim-tool_additional-settings into main 2025-04-08 19:19:33 +00:00
2 changed files with 29 additions and 11 deletions
Showing only changes of commit f72f92d4c2 - Show all commits

View File

@ -94,6 +94,8 @@ impl MainTab {
x: vram_image.x as i32,
y: vram_image.y as i32,
encoding_str: SharedString::from(encoding_str),
use_compression: false,
trans_setting: 0,
palette_count,
is_palette,
}

View File

@ -10,6 +10,8 @@ struct VRAMInfo {
x: int,
y: int,
encoding_str: string,
use_compression: bool,
trans_setting: int,
palette_count: int,
is_palette: bool, // < Can we combine the palette into this, instead of having it separate?
}
@ -304,6 +306,12 @@ export component MainTab inherits Rectangle {
lz4_check_box := CheckBox {
text: "Compress (lz4)";
enabled: file_settings_box.enabled;
toggled => {
if(vram_files_list.current-item != -1) {
root.vram_data[vram_files_list.current-item].info.use_compression = self.checked;
}
}
}
GroupBox {
@ -314,12 +322,20 @@ export component MainTab inherits Rectangle {
trans_combo_box := ComboBox {
model: ["No transparency", "First color transparent", "PSX semi-transparency", "Both"];
enabled: file_settings_box.enabled;
selected(current-value) => {
if(vram_files_list.current-item != -1) {
root.vram_data[vram_files_list.current-item].info.trans_setting = self.current-index;
}
}
}
}
}
}
public function set_active(item: int) {
public function set_active(current-item: int) {
lz4_check_box.checked = root.vram_data[current-item].info.use_compression;
trans_combo_box.current-index = root.vram_data[current-item].info.trans_setting;
self.enabled = true;
}