Skip to main content

yog_event/
game.rs

1//! The game: the host's actions.
2
3use yog_ids as ids;
4
5actions! {
6    /// The game's directory.
7    Dir {  } -> Option<String> = ids::service_game::DIR, "YogGameActions.gameDir";
8    /// The current world's directory.
9    WorldDir {  } -> Option<String> = ids::service_game::WORLD_DIR, "YogGameActions.worldDir";
10    /// The game's text for translation `key` in the current language.
11    Translate { key: String } -> Option<String> = ids::service_game::TRANSLATE, "YogGameActions.translate";
12    /// The loader's own (Java) mods.
13    PlatformMods {  } -> Vec<ModInfo> = ids::service_game::PLATFORM_MODS, "YogMods.platformMods";
14}
15
16/// Every installed mod: Yog's and the loader's (the runtime answers).
17#[derive(Debug, Clone, yog_data::Schema)]
18pub struct Mods {}
19
20/// An installed mod.
21#[derive(Debug, Clone, PartialEq, yog_data::Schema)]
22pub struct ModInfo {
23    /// Which list it's on (`yog_ids::mod_source`).
24    pub source: String,
25    pub id: String,
26    pub name: String,
27    pub version: String,
28    /// Comma-separated.
29    pub authors: String,
30    pub description: String,
31}
32
33/// Whether mod `id` is loaded — a Yog mod or a Java one (the runtime answers).
34#[derive(Debug, Clone, yog_data::Schema)]
35pub struct ModLoaded {
36    pub id: String,
37}