// Oleg Petruny staff

#include "Settings.h"

/*		OTHER		*/
void USettings::SettingsSave() {
	GetMutableDefault<USettings>()->SaveConfig();
	GetMutableDefault<USettings>()->LoadConfig();
}

void USettings::SettingsGetReinit(bool &reinitialize) {
	reinitialize = GetDefault<USettings>()->reinit;
}
void USettings::SettingsSetReinit(bool reinitialize) {
	GetMutableDefault<USettings>()->reinit = reinitialize;
}

/*		VIDEO		*/
void USettings::SettingsGetMonitorId(int &monitorId) {
	monitorId = GetDefault<USettings>()->monitor;
}
void USettings::SettingsSetMonitorId(int monitorId) {
	GetMutableDefault<USettings>()->monitor = monitorId;
}

void USettings::SettingsGetScreenResolution(FIntPoint &resolution) {
	resolution.X = GetDefault<USettings>()->width;
	resolution.Y = GetDefault<USettings>()->height;
}
void USettings::SettingsSetScreenResolution(FIntPoint resolution) {
	GetMutableDefault<USettings>()->width = resolution.X;
	GetMutableDefault<USettings>()->height = resolution.Y;
}

void USettings::SettingsGetWindowMode(int &displayMode) {
	displayMode = GetDefault<USettings>()->mode;
}
void USettings::SettingsSetWindowMode(int displayMode) {
	GetMutableDefault<USettings>()->mode = displayMode;
}

void USettings::SettingsGetResolutionScale(float &resolutionScale) {
	resolutionScale = GetDefault<USettings>()->scale;
}
void USettings::SettingsSetResolutionScale(float resolutionScale) {
	GetMutableDefault<USettings>()->scale = resolutionScale;
}

void USettings::SettingsGetBrightnessIntensity(float &brightnessIntensity) {
	brightnessIntensity = GetDefault<USettings>()->brightness;
}
void USettings::SettingsSetBrightnessIntensity(float brightnessIntensity) {
	GetMutableDefault<USettings>()->brightness = brightnessIntensity;
}

void USettings::SettingsGetMotionBlur(float &motionBlur) {
	motionBlur = GetDefault<USettings>()->blur;
}
void USettings::SettingsSetMotionBlur(float motionBlur) {
	GetMutableDefault<USettings>()->blur = motionBlur;
}

void USettings::SettingsGetShowFps(bool &showFps) {
	showFps = GetDefault<USettings>()->fps;
}
void USettings::SettingsSetShowFps(bool showFps) {
	GetMutableDefault<USettings>()->fps = showFps;
}

void USettings::SettingsGetDefaultMonitorId(int &monitorId) {
	monitorId = GetDefault<USettings>()->dmonitor;
}
void USettings::SettingsSetDefaultMonitorId(int monitorId) {
	GetMutableDefault<USettings>()->dmonitor = monitorId;
}

void USettings::SettingsGetDefaultScreenResolution(FIntPoint &resolution) {
	resolution.X = GetDefault<USettings>()->dwidth;
	resolution.Y = GetDefault<USettings>()->dheight;
}
void USettings::SettingsSetDefaultScreenResolution(FIntPoint resolution) {
	GetMutableDefault<USettings>()->dwidth = resolution.X;
	GetMutableDefault<USettings>()->dheight = resolution.Y;
}

void USettings::SettingsGetDefaultWindowMode(int &displayMode) {
	displayMode = GetDefault<USettings>()->dmode;
}
void USettings::SettingsSetDefaultWindowMode(int displayMode) {
	GetMutableDefault<USettings>()->dmode = displayMode;
}

void USettings::SettingsGetDefaultResolutionScale(float &resolutionScale) {
	resolutionScale = GetDefault<USettings>()->dscale;
}
void USettings::SettingsGetDefaultBrightnessIntensity(float &brightnessIntensity) {
	brightnessIntensity = GetDefault<USettings>()->dbrightness;
}
void USettings::SettingsGetDefaultMotionBlur(float &motionBlur) {
	motionBlur = GetDefault<USettings>()->dblur;
}
void USettings::SettingsGetDefaultShowFps(bool &showFps) {
	showFps = GetDefault<USettings>()->dfps;
}

/*		AUDIO		*/
void USettings::SettingsGetMasterVolume(float &masterVolume) {
	masterVolume = GetDefault<USettings>()->master;
}
void USettings::SettingsSetMasterVolume(float masterVolume) {
	GetMutableDefault<USettings>()->master = masterVolume;
}

void USettings::SettingsGetMusicVolume(float &musicVolume) {
	musicVolume = GetDefault<USettings>()->music;
}
void USettings::SettingsSetMusicVolume(float musicVolume) {
	GetMutableDefault<USettings>()->music = musicVolume;
}

void USettings::SettingsGetEffectsVolume(float &effectsVolume) {
	effectsVolume = GetDefault<USettings>()->effects;
}
void USettings::SettingsSetEffectsVolume(float effectsVolume) {
	GetMutableDefault<USettings>()->effects = effectsVolume;
}

void USettings::SettingsGetVoicesVolume(float &voicesVolume) {
	voicesVolume = GetDefault<USettings>()->voices;
}
void USettings::SettingsSetVoicesVolume(float voicesVolume) {
	GetMutableDefault<USettings>()->voices = voicesVolume;
}

void USettings::SettingsGetMenuVolume(float &menuVolume) {
	menuVolume = GetDefault<USettings>()->menu;
}
void USettings::SettingsSetMenuVolume(float menuVolume) {
	GetMutableDefault<USettings>()->menu = menuVolume;
}

void USettings::SettingsGetDefaultMasterVolume(float &masterVolume) {
	masterVolume = GetDefault<USettings>()->dmaster;
}
void USettings::SettingsGetDefaultMusicVolume(float &musicVolume) {
	musicVolume = GetDefault<USettings>()->dmusic;
}
void USettings::SettingsGetDefaultEffectsVolume(float &effectsVolume) {
	effectsVolume = GetDefault<USettings>()->deffects;
}
void USettings::SettingsGetDefaultVoicesVolume(float &voicesVolume) {
	voicesVolume = GetDefault<USettings>()->dvoices;
}
void USettings::SettingsGetDefaultMenuVolume(float &menuVolume) {
	menuVolume = GetDefault<USettings>()->dmenu;
}

/*		CONTROLS		*/
void USettings::SettingsGetSensetivity(float &speed) {
	speed = GetDefault<USettings>()->sensetivity;
}
void USettings::SettingsSetSensetivity(float speed) {
	GetMutableDefault<USettings>()->sensetivity = speed;
}

void USettings::SettingsGetInvertEnabled(bool &enabled) {
	enabled = GetDefault<USettings>()->invert;
}
void USettings::SettingsSetInvertEnabled(bool enabled) {
	GetMutableDefault<USettings>()->invert = enabled;
}

void USettings::SettingsGetDefaultSensetivity(float &speed) {
	speed = GetDefault<USettings>()->dsensetivity;
}
void USettings::SettingsGetDefaultInvertEnabled(bool &enabled) {
	enabled = GetDefault<USettings>()->dinvert;
}
void USettings::SettingsGetDefaultMoveForwardsKey(FKey &key) {
	key = GetDefault<USettings>()->dmoveforwkey;
}
void USettings::SettingsGetDefaultMoveBackwardsKey(FKey &key) {
	key = GetDefault<USettings>()->dmovebackkey;
}
void USettings::SettingsGetDefaultMoveLeftKey(FKey &key) {
	key = GetDefault<USettings>()->dmoveleftkey;
}
void USettings::SettingsGetDefaultMoveRightKey(FKey &key) {
	key = GetDefault<USettings>()->dmoverightkey;
}
void USettings::SettingsGetDefaultRunKey(FKey &key) {
	key = GetDefault<USettings>()->drunkey;
}
void USettings::SettingsGetDefaultJumpKey(FKey &key) {
	key = GetDefault<USettings>()->djumpkey;
}
void USettings::SettingsGetDefaultCrouchKey(FKey &key) {
	key = GetDefault<USettings>()->dcrouchkey;
}
void USettings::SettingsGetDefaultInteractKey(FKey &key) {
	key = GetDefault<USettings>()->dinteractkey;
}
void USettings::SettingsGetDefaultCutsceneSkipKey(FKey &key) {
	const USettings *settings = GetDefault<USettings>();
	key = GetDefault<USettings>()->dcutskipkey;
}
void USettings::SettingsGetDefaultDialogueSkipKey(FKey &key) {
	key = GetDefault<USettings>()->ddiaskipkey;
}
void USettings::SettingsGetDefaultCameraModeKey(FKey &key) {
	key = GetDefault<USettings>()->dcammodekey;
}
void USettings::SettingsGetDefaultPauseKey(FKey &key) {
	key = GetDefault<USettings>()->dpausekey;
}

/*		GAMEPLAY		*/
void USettings::SettingsGetUIEnabled(bool &enabled) {
	enabled = GetDefault<USettings>()->ui;
}
void USettings::SettingsSetUIEnabled(bool enabled) {
	GetMutableDefault<USettings>()->ui = enabled;
}

void USettings::SettingsGetLanguage(FString &code) {
	code = GetDefault<USettings>()->language;
}
void USettings::SettingsSetLanguage(FString code) {
	GetMutableDefault<USettings>()->language = code;
}

void USettings::SettingsGetSubtitlesEnabled(bool &enabled) {
	enabled = GetDefault<USettings>()->subtitles;
}
void USettings::SettingsSetSubtitlesEnabled(bool enabled) {
	GetMutableDefault<USettings>()->subtitles = enabled;
}

void USettings::SettingsGetDefaultUIEnabled(bool &enabled) {
	enabled = GetDefault<USettings>()->dui;
}
void USettings::SettingsGetDefaultLanguage(FString &code) {
	code = GetDefault<USettings>()->dlanguage;
}
void USettings::SettingsGetDefaultSubtitlesEnabled(bool &enabled) {
	enabled = GetDefault<USettings>()->dsubtitles;
}