Added storage for settings
This commit is contained in:
parent
07a7149abc
commit
f72f92d4c2
|
@ -91,9 +91,11 @@ impl MainTab {
|
|||
image: vram_image.image,
|
||||
},
|
||||
info: VRAMInfo {
|
||||
x: vram_image.x as i32,
|
||||
y: vram_image.y as i32,
|
||||
encoding_str: SharedString::from(encoding_str),
|
||||
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,
|
||||
}
|
||||
|
|
|
@ -7,11 +7,13 @@ struct VRAMImgData {
|
|||
}
|
||||
|
||||
struct VRAMInfo {
|
||||
x: int,
|
||||
y: int,
|
||||
encoding_str: string,
|
||||
palette_count: int,
|
||||
is_palette: bool, // < Can we combine the palette into this, instead of having it separate?
|
||||
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?
|
||||
}
|
||||
|
||||
struct VRAMData {
|
||||
|
@ -302,8 +304,14 @@ export component MainTab inherits Rectangle {
|
|||
VerticalLayout {
|
||||
alignment: start;
|
||||
lz4_check_box := CheckBox {
|
||||
text: "Compress (lz4)";
|
||||
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,13 +322,21 @@ 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) {
|
||||
self.enabled = true;
|
||||
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;
|
||||
}
|
||||
|
||||
public function set_inactive() {
|
||||
|
|
Loading…
Reference in New Issue