pub struct LuaSettings;Expand description
Object containing the three different types of mod settings: startup settings, global runtime settings and per-player runtime settings. An instance of LuaSettings is available through the global object named settings.
Implementations§
Source§impl LuaSettings
impl LuaSettings
Sourcepub fn global(&self) -> HashMap<String, ModSetting>
pub fn global(&self) -> HashMap<String, ModSetting>
The current global mod settings, indexed by prototype name.
Even though this attribute is marked as read-only, individual settings can be changed by overwriting their ModSetting table. Mods can only change their own settings. Using the in-game console, all player settings can be changed.
Sourcepub fn object_name(&self) -> &str
pub fn object_name(&self) -> &str
The class name of this object. Available even when valid is false. For LuaStruct objects it may also be suffixed with a dotted path to a member of the struct.
Sourcepub fn player_default(&self) -> HashMap<String, ModSetting>
pub fn player_default(&self) -> HashMap<String, ModSetting>
The default player mod settings for this map, indexed by prototype name. Changing these settings only affects the default settings for future players joining the game.
Individual settings can be changed by overwriting their ModSetting table. Mods can only change their own settings. Using the in-game console, all player settings can be changed.
Sourcepub fn startup(&self) -> HashMap<String, ModSetting>
pub fn startup(&self) -> HashMap<String, ModSetting>
The startup mod settings, indexed by prototype name.
Sourcepub fn get_player_settings(&self, player: LuaAny) -> HashMap<String, ModSetting>
pub fn get_player_settings(&self, player: LuaAny) -> HashMap<String, ModSetting>
Gets the current per-player settings for the given player, indexed by prototype name. Returns the same structure as LuaPlayer::mod_settings. This table becomes invalid if its associated player does.
Even though this attribute is a getter, individual settings can be changed by overwriting their ModSetting table. Mods can only change their own settings. Using the in-game console, all player settings can be changed.
Trait Implementations§
Source§impl Clone for LuaSettings
impl Clone for LuaSettings
Source§fn clone(&self) -> LuaSettings
fn clone(&self) -> LuaSettings
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more