A framework for the Godot engine to create TTRPG games for Advanced 5th Edition, Pathfinder 2nd Edition, and more

Adding tutorial

authored by cass.cityboundforest.com and committed by tangled.org fc2a828f 8054cc7d

+54
+5
.gitignore
··· 18 18 *.pdb 19 19 20 20 # End of https://www.toptal.com/developers/gitignore/api/rust 21 + 22 + 23 + # Added by cargo 24 + 25 + /target
+26
Cargo.toml
··· 1 + [package] 2 + name = "dice-wire" 3 + version = "0.1.0" 4 + edition = "2024" 5 + 6 + [lib] 7 + crate-type = ["cdylib", "rlib"] 8 + 9 + [features] 10 + default = ["console_error_panic_hook"] 11 + 12 + [dependencies] 13 + wasm-bindgen = "0.2.84" 14 + 15 + # The `console_error_panic_hook` crate provides better debugging of panics by 16 + # logging them with `console.error`. This is great for development, but requires 17 + # all the `std::fmt` and `std::panicking` infrastructure, so isn't great for 18 + # code size when deploying. 19 + console_error_panic_hook = { version = "0.1.7", optional = true } 20 + 21 + [dev-dependencies] 22 + wasm-bindgen-test = "0.3.34" 23 + 24 + [profile.release] 25 + # Tell `rustc` to optimize for small code size. 26 + opt-level = "s"
+13
src/lib.rs
··· 1 + mod utils; 2 + 3 + use wasm_bindgen::prelude::*; 4 + 5 + #[wasm_bindgen] 6 + extern "C" { 7 + fn alert(s: &str); 8 + } 9 + 10 + #[wasm_bindgen] 11 + pub fn greet() { 12 + alert("Hello, dice-wire!"); 13 + }
+10
src/utils.rs
··· 1 + pub fn set_panic_hook() { 2 + // When the `console_error_panic_hook` feature is enabled, we can call the 3 + // `set_panic_hook` function at least once during initialization, and then 4 + // we will get better error messages if our code ever panics. 5 + // 6 + // For more details see 7 + // https://github.com/rustwasm/console_error_panic_hook#readme 8 + #[cfg(feature = "console_error_panic_hook")] 9 + console_error_panic_hook::set_once(); 10 + }