5 releases (breaking)

0.5.0 Oct 2, 2021
0.4.0 Jul 13, 2021
0.3.0 Jul 3, 2021
0.2.0 Jun 27, 2021
0.1.0 Jun 24, 2021
Download history 15/week @ 2022-08-04 10/week @ 2022-08-11 5/week @ 2022-08-18 13/week @ 2022-08-25 7/week @ 2022-09-01 22/week @ 2022-09-08 5/week @ 2022-09-15 6/week @ 2022-09-22 12/week @ 2022-09-29 13/week @ 2022-10-06 2/week @ 2022-10-13 5/week @ 2022-10-20 10/week @ 2022-10-27 15/week @ 2022-11-03 16/week @ 2022-11-10 12/week @ 2022-11-17

55 downloads per month
Used in livemod-gui

MIT/Apache

56KB
1.5K SLoC

LiveMod - Runtime modification of program values

livemod-test livemod-gui crates.io dependency status

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.

Usage

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);

Using #[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 field

The field will not be modifiable by livemod, and will not be required to implement the LiveMod trait.

#[livemod(rename = "New name")] Rename a field

The 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 field

Instead 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

Dependencies

~1.5MB
~28K SLoC