Crates.io | livemod-gui |
lib.rs | livemod-gui |
version | 0.5.0 |
source | src |
created_at | 2021-06-24 02:49:56.166884 |
updated_at | 2021-10-02 05:28:03.575945 |
description | Graphical user interface for livemod |
homepage | |
repository | https://github.com/TheOnlyMrCat/LiveMod |
max_upload_size | |
id | 414229 |
size | 76,111 |
Livemod is my attempt to make Unity-style runtime parameter modification possible in Rust, in a way that is simple and easy to turn off if necessary.
Livemod requires the library, livemod
, and a locally-installed viewer, such as livemod-gui
.
livemod-gui
can be installed through cargo
:
cargo install livemod-gui
And can be used from your code by:
let livemod = LiveModHandle::new_gui();
let tracked_variable = livemod.create_variable("My variable", 0_u32);
#[derive]
The LiveMod
trait can be #[derive]
d if the feature derive
is enabled. The behaviour of the derive macro can be modified with the #[livemod]
field attribute, the behaviour of which is documented below:
#[livemod(skip)]
: Skip representing a fieldThe field will not be modifiable by livemod
, and will not be required to implement the LiveMod
trait.
#[livemod(rename = "New name")]
Rename a fieldThe field will be labelled with the new name. By default, a field's label is generated by capitalising the first letter of its name and replacing underscores with spaces.
#[livemod(repr = Trait(args))]
Change the representation of a fieldInstead of calling LiveMod::data_type()
on the field's type to determine its representation, use its definition of the
supplied trait instead.
For example, integers and floats implement the Slider
trait, and can be used as follows:
#[livemod(repr = Slider(0..=100))]
field: u32