public void InitSettings() { SettingsDb db = SettingsDb.Init(); masterVolume = Util.ToFloat(db.SelectSetting("master_volume")); sfxVolume = Util.ToFloat(db.SelectSetting("sfx_volume")); musicVolume = Util.ToFloat(db.SelectSetting("music_volume")); userName = db.SelectSetting("username"); mouseSensitivityX = Util.ToFloat(db.SelectSetting("mouse_sensitivity_x")); mouseSensitivityY = Util.ToFloat(db.SelectSetting("mouse_sensitivity_y")); db.Close(); Sound.RefreshVolume(); }
public static void SaveSettings() { SettingsDb db = SettingsDb.Init(); db.StoreSetting("master_volume", "" + Session.session.masterVolume); db.StoreSetting("sfx_volume", "" + Session.session.sfxVolume); db.StoreSetting("music_volume", "" + Session.session.musicVolume); db.StoreSetting("mouse_sensitivity_x", "" + Session.session.mouseSensitivityX); db.StoreSetting("mouse_sensitivity_y", "" + Session.session.mouseSensitivityY); db.StoreSetting("username", Session.session.userName); db.Close(); Sound.RefreshVolume(); }