Added storage for settings
This commit is contained in:
parent
9501954587
commit
4942012da1
|
@ -91,9 +91,11 @@ impl MainTab {
|
||||||
image: vram_image.image,
|
image: vram_image.image,
|
||||||
},
|
},
|
||||||
info: VRAMInfo {
|
info: VRAMInfo {
|
||||||
x: vram_image.x as i32,
|
x: vram_image.x as i32,
|
||||||
y: vram_image.y as i32,
|
y: vram_image.y as i32,
|
||||||
encoding_str: SharedString::from(encoding_str),
|
encoding_str: SharedString::from(encoding_str),
|
||||||
|
use_compression: false,
|
||||||
|
trans_setting: 0,
|
||||||
palette_count,
|
palette_count,
|
||||||
is_palette,
|
is_palette,
|
||||||
}
|
}
|
||||||
|
|
|
@ -7,11 +7,13 @@ struct VRAMImgData {
|
||||||
}
|
}
|
||||||
|
|
||||||
struct VRAMInfo {
|
struct VRAMInfo {
|
||||||
x: int,
|
x: int,
|
||||||
y: int,
|
y: int,
|
||||||
encoding_str: string,
|
encoding_str: string,
|
||||||
palette_count: int,
|
use_compression: bool,
|
||||||
is_palette: bool, // < Can we combine the palette into this, instead of having it separate?
|
trans_setting: int,
|
||||||
|
palette_count: int,
|
||||||
|
is_palette: bool, // < Can we combine the palette into this, instead of having it separate?
|
||||||
}
|
}
|
||||||
|
|
||||||
struct VRAMData {
|
struct VRAMData {
|
||||||
|
@ -313,8 +315,14 @@ export component MainTab inherits Rectangle {
|
||||||
VerticalLayout {
|
VerticalLayout {
|
||||||
alignment: start;
|
alignment: start;
|
||||||
lz4_check_box := CheckBox {
|
lz4_check_box := CheckBox {
|
||||||
text: "Compress (lz4)";
|
text: "Compress (lz4)";
|
||||||
enabled: file_settings_box.enabled;
|
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 {
|
GroupBox {
|
||||||
|
@ -325,13 +333,21 @@ export component MainTab inherits Rectangle {
|
||||||
trans_combo_box := ComboBox {
|
trans_combo_box := ComboBox {
|
||||||
model: ["No transparency", "First color transparent", "PSX semi-transparency", "Both"];
|
model: ["No transparency", "First color transparent", "PSX semi-transparency", "Both"];
|
||||||
enabled: file_settings_box.enabled;
|
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) {
|
||||||
self.enabled = true;
|
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() {
|
public function set_inactive() {
|
||||||
|
|
Loading…
Reference in New Issue