MCPcopy Create free account
hub / github.com/crossuo/crossuo / ValueInt

Method ValueInt

src/CrossUO.cpp:2064–3009  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2062}
2063
2064int CGame::ValueInt(const VALUE_KEY_INT &key, int value)
2065{
2066 switch (key)
2067 {
2068 case VKI_SOUND:
2069 {
2070 if (value == -1)
2071 {
2072 value = static_cast<int>(g_ConfigManager.GetSound());
2073 }
2074 else
2075 {
2076 g_ConfigManager.SetSound(value != 0);
2077 }
2078
2079 break;
2080 }
2081 case VKI_SOUND_VALUE:
2082 {
2083 if (value == -1)
2084 {
2085 value = g_ConfigManager.GetSoundVolume();
2086 }
2087 else
2088 {
2089 if (value < 0)
2090 {
2091 value = 0;
2092 }
2093 else if (value > 255)
2094 {
2095 value = 255;
2096 }
2097
2098 g_ConfigManager.SetSoundVolume(value);
2099 }
2100
2101 break;
2102 }
2103 case VKI_MUSIC:
2104 {
2105 if (value == -1)
2106 {
2107 value = static_cast<int>(g_ConfigManager.GetMusic());
2108 }
2109 else
2110 {
2111 g_ConfigManager.SetMusic(value != 0);
2112 }
2113
2114 break;
2115 }
2116 case VKI_MUSIC_VALUE:
2117 {
2118 if (value == -1)
2119 {
2120 value = g_ConfigManager.GetMusicVolume();
2121 }

Callers 2

FUNCBODY_GetValueIntFunction · 0.80
FUNCBODY_SetValueIntFunction · 0.80

Calls 15

GetSoundMethod · 0.80
SetSoundMethod · 0.80
GetSoundVolumeMethod · 0.80
SetSoundVolumeMethod · 0.80
GetMusicMethod · 0.80
SetMusicMethod · 0.80
GetMusicVolumeMethod · 0.80
GetClientFPSMethod · 0.80
SetClientFPSMethod · 0.80
GetUseScalingMethod · 0.80
SetUseScalingMethod · 0.80
GetDrawStatusStateMethod · 0.80

Tested by

no test coverage detected