Init of the game resource viewer

This commit is contained in:
Valentin Popov 2023-10-27 23:58:12 +04:00
parent a97d68b0e1
commit 9708d73199
Signed by: Valentin Popov
GPG Key ID: AE3CE523DAAA8401
6 changed files with 4054 additions and 12 deletions

4013
Cargo.lock generated

File diff suppressed because it is too large Load Diff

View File

@ -1,6 +1,13 @@
[workspace] [workspace]
resolver = "2" resolver = "2"
members = ["libnres", "nres-cli", "packer", "texture-decoder", "unpacker"] members = [
"libnres",
"nres-cli",
"packer",
"resource-viewer",
"texture-decoder",
"unpacker",
]
[profile.release] [profile.release]
codegen-units = 1 codegen-units = 1

View File

@ -0,0 +1,11 @@
[package]
name = "resource-viewer"
version = "0.1.0"
edition = "2021"
build = "build.rs"
[dependencies]
slint = "1.0"
[build-dependencies]
slint-build = "1.0"

3
resource-viewer/build.rs Normal file
View File

@ -0,0 +1,3 @@
fn main() {
slint_build::compile("ui/appwindow.slint").unwrap();
}

View File

@ -0,0 +1,13 @@
slint::include_modules!();
fn main() -> Result<(), slint::PlatformError> {
let ui = AppWindow::new()?;
let ui_handle = ui.as_weak();
ui.on_request_increase_value(move || {
let ui = ui_handle.unwrap();
ui.set_counter(ui.get_counter() + 1);
});
ui.run()
}

View File

@ -0,0 +1,17 @@
import { Button, VerticalBox } from "std-widgets.slint";
export component AppWindow inherits Window {
in-out property<int> counter: 42;
callback request-increase-value();
VerticalBox {
Text {
text: "Counter: \{root.counter}";
}
Button {
text: "Increase value";
clicked => {
root.request-increase-value();
}
}
}
}