Init of the game resource viewer
This commit is contained in:
parent
a97d68b0e1
commit
9708d73199
4013
Cargo.lock
generated
4013
Cargo.lock
generated
File diff suppressed because it is too large
Load Diff
@ -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
|
||||||
|
11
resource-viewer/Cargo.toml
Normal file
11
resource-viewer/Cargo.toml
Normal 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
3
resource-viewer/build.rs
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
fn main() {
|
||||||
|
slint_build::compile("ui/appwindow.slint").unwrap();
|
||||||
|
}
|
13
resource-viewer/src/main.rs
Normal file
13
resource-viewer/src/main.rs
Normal 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()
|
||||||
|
}
|
17
resource-viewer/ui/appwindow.slint
Normal file
17
resource-viewer/ui/appwindow.slint
Normal 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();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user