=============== Item_Multi_Setting =============== */
| 2996 | =============== |
| 2997 | */ |
| 2998 | const char *Item_Multi_Setting(itemDef_t *item) |
| 2999 | { |
| 3000 | char buff[1024]; |
| 3001 | float value = 0; |
| 3002 | int i; |
| 3003 | multiDef_t *multiPtr = (multiDef_t*)item->typeData; |
| 3004 | if (multiPtr) |
| 3005 | { |
| 3006 | if (multiPtr->strDef) |
| 3007 | { |
| 3008 | if (item->cvar) |
| 3009 | { |
| 3010 | DC->getCVarString(item->cvar, buff, sizeof(buff)); |
| 3011 | } |
| 3012 | else |
| 3013 | { |
| 3014 | |
| 3015 | } |
| 3016 | } |
| 3017 | else |
| 3018 | { |
| 3019 | if (item->cvar) // Was a cvar given? |
| 3020 | { |
| 3021 | value = DC->getCVarValue(item->cvar); |
| 3022 | } |
| 3023 | else |
| 3024 | { |
| 3025 | value = item->value; |
| 3026 | } |
| 3027 | } |
| 3028 | |
| 3029 | for (i = 0; i < multiPtr->count; i++) |
| 3030 | { |
| 3031 | if (multiPtr->strDef) |
| 3032 | { |
| 3033 | if (Q_stricmp(buff, multiPtr->cvarStr[i]) == 0) |
| 3034 | { |
| 3035 | return multiPtr->cvarList[i]; |
| 3036 | } |
| 3037 | } |
| 3038 | else |
| 3039 | { |
| 3040 | if (multiPtr->cvarValue[i] == value) |
| 3041 | { |
| 3042 | return multiPtr->cvarList[i]; |
| 3043 | } |
| 3044 | } |
| 3045 | } |
| 3046 | } |
| 3047 | |
| 3048 | #ifdef JK2_MODE |
| 3049 | return "@MENUS1_CUSTOM"; |
| 3050 | #else |
| 3051 | return "@MENUS_CUSTOM"; |
| 3052 | #endif |
| 3053 | } |
| 3054 | |
| 3055 | //--------------------------------------------------------------------------------------------------------- |
no test coverage detected