Skip to main content

resources

Macro resources 

Source
macro_rules! resources {
    () => { ... };
}
Expand description

Pulls the mod’s .yres resources in as module res — one type per resource set, with an accessor per entry:

ⓘ
// src/lib.rs
yog_api::resources!();

use crate::res::{Icons, Strings};
let title = Strings::screen_title();        // the text in the player's language
let count = Strings::mods_count(58);        // "{count} mods" → "58 mods"
let logo = Icons::logo();                   // an image source, "mymod:images/logo"

yog build, yog check and yog res check generate one .yog-build/generated/resources/<Set>.g.rs per resources/**/<Set>.yres plus .yog-build/generated/resources.g.rs including them all (see Yog-IDLE’s docs/yres.md); never committed, never stale.