Mercurial > mm7
comparison UI/UIHouses.cpp @ 2355:a574a80e7012
Moving more functions out of unsorted_subs
author | Grumpy7 |
---|---|
date | Wed, 09 Apr 2014 22:58:22 +0200 |
parents | 7c10dfb6d802 |
children | bddcaf5d5db2 |
comparison
equal
deleted
inserted
replaced
2354:7f2e111bbafb | 2355:a574a80e7012 |
---|---|
3071 jail_dialogue_window.uFrameWidth = 148; | 3071 jail_dialogue_window.uFrameWidth = 148; |
3072 jail_dialogue_window.uFrameZ = 334; | 3072 jail_dialogue_window.uFrameZ = 334; |
3073 jail_dialogue_window.DrawTitleText(pFontArrus, 0, (310 - pFontArrus->CalcTextHeight(pGlobalTXT_LocalizationStrings[672], &jail_dialogue_window, 0, 0)) / 2 + 18, | 3073 jail_dialogue_window.DrawTitleText(pFontArrus, 0, (310 - pFontArrus->CalcTextHeight(pGlobalTXT_LocalizationStrings[672], &jail_dialogue_window, 0, 0)) / 2 + 18, |
3074 Color16(0xFFu, 0xFFu, 0x9Bu), pGlobalTXT_LocalizationStrings[672], 3);//"За многочисленные преступления и злодеяния вы были приговорены к одному году заключения." | 3074 Color16(0xFFu, 0xFFu, 0x9Bu), pGlobalTXT_LocalizationStrings[672], 3);//"За многочисленные преступления и злодеяния вы были приговорены к одному году заключения." |
3075 } | 3075 } |
3076 | |
3077 | |
3078 //----- (00443801) -------------------------------------------------------- | |
3079 void InitializeBuildingResidents() | |
3080 { | |
3081 | |
3082 int i; | |
3083 char* test_string; | |
3084 unsigned char c; | |
3085 bool break_loop; | |
3086 unsigned int temp_str_len; | |
3087 char* tmp_pos; | |
3088 int decode_step; | |
3089 | |
3090 if ( p2DEventsTXT_Raw ) | |
3091 free(p2DEventsTXT_Raw); | |
3092 p2DEventsTXT_Raw = NULL; | |
3093 p2DEventsTXT_Raw = (char *)pEvents_LOD->LoadRaw("2dEvents.txt", 0); | |
3094 strtok(p2DEventsTXT_Raw, "\r"); | |
3095 strtok(NULL, "\r"); | |
3096 | |
3097 for (i=0;i<525;++i) | |
3098 { | |
3099 test_string = strtok(NULL, "\r") + 1; | |
3100 break_loop = false; | |
3101 decode_step=0; | |
3102 do | |
3103 { | |
3104 c = *(unsigned char*)test_string; | |
3105 temp_str_len = 0; | |
3106 while((c!='\t')&&(c>0)) | |
3107 { | |
3108 ++temp_str_len; | |
3109 c=test_string[temp_str_len]; | |
3110 } | |
3111 tmp_pos=test_string+temp_str_len; | |
3112 if (*tmp_pos == 0) | |
3113 break_loop = true; | |
3114 *tmp_pos = 0; | |
3115 if (temp_str_len) | |
3116 { | |
3117 switch (decode_step) | |
3118 { | |
3119 case 2: | |
3120 { | |
3121 if ( !_strnicmp(test_string, "wea", 3) ) | |
3122 { | |
3123 p2DEvents[i].uType = BuildingType_WeaponShop; | |
3124 break; | |
3125 } | |
3126 if ( !_strnicmp(test_string, "arm", 3) ) | |
3127 { | |
3128 p2DEvents[i].uType = BuildingType_ArmorShop; | |
3129 break; | |
3130 } | |
3131 if ( !_strnicmp(test_string, "mag", 3) ) | |
3132 { | |
3133 p2DEvents[i].uType = BuildingType_MagicShop; | |
3134 break; | |
3135 } | |
3136 if ( !_strnicmp(test_string, "alc", 3) ) | |
3137 { | |
3138 p2DEvents[i].uType = BuildingType_AlchemistShop; | |
3139 break; | |
3140 } | |
3141 if ( !_strnicmp(test_string, "sta", 3) ) | |
3142 { | |
3143 p2DEvents[i].uType = BuildingType_Stables; | |
3144 break; | |
3145 } | |
3146 if ( !_strnicmp(test_string, "boa", 3) ) | |
3147 { | |
3148 p2DEvents[i].uType = BuildingType_Boats; | |
3149 break; | |
3150 } | |
3151 if ( !_strnicmp(test_string, "tem", 3) ) | |
3152 { | |
3153 p2DEvents[i].uType = BuildingType_Temple; | |
3154 break; | |
3155 } | |
3156 if ( !_strnicmp(test_string, "tra", 3) ) | |
3157 { | |
3158 p2DEvents[i].uType = BuildingType_Training; | |
3159 break; | |
3160 } | |
3161 if ( !_strnicmp(test_string, "tow", 3) ) | |
3162 { | |
3163 p2DEvents[i].uType = BuildingType_TownHall; | |
3164 break; | |
3165 } | |
3166 | |
3167 if ( !_strnicmp(test_string, "tav", 3) ) | |
3168 { | |
3169 p2DEvents[i].uType = BuildingType_Tavern; | |
3170 break; | |
3171 } | |
3172 if ( !_strnicmp(test_string, "ban", 3) ) | |
3173 { | |
3174 p2DEvents[i].uType = BuildingType_Bank; | |
3175 break; | |
3176 } | |
3177 if ( !_strnicmp(test_string, "fir", 3) ) | |
3178 { | |
3179 p2DEvents[i].uType = BuildingType_FireGuild; | |
3180 break; | |
3181 } | |
3182 if ( !_strnicmp(test_string, "air", 3) ) | |
3183 { | |
3184 p2DEvents[i].uType = BuildingType_AirGuild; | |
3185 break; | |
3186 } | |
3187 if ( !_strnicmp(test_string, "wat", 3) ) | |
3188 { | |
3189 p2DEvents[i].uType = BuildingType_WaterGuild; | |
3190 break; | |
3191 } | |
3192 if ( !_strnicmp(test_string, "ear", 3) ) | |
3193 { | |
3194 p2DEvents[i].uType = BuildingType_EarthGuild; | |
3195 break; | |
3196 } | |
3197 if ( !_strnicmp(test_string, "spi", 3) ) | |
3198 { | |
3199 p2DEvents[i].uType = BuildingType_SpiritGuild; | |
3200 break; | |
3201 } | |
3202 if ( !_strnicmp(test_string, "min", 3) ) | |
3203 { | |
3204 p2DEvents[i].uType = BuildingType_MindGuild; | |
3205 break; | |
3206 } | |
3207 if ( !_strnicmp(test_string, "bod", 3) ) | |
3208 { | |
3209 p2DEvents[i].uType = BuildingType_BodyGuild; | |
3210 break; | |
3211 } | |
3212 if ( !_strnicmp(test_string, "lig", 3) ) | |
3213 { | |
3214 p2DEvents[i].uType = BuildingType_LightGuild; | |
3215 break; | |
3216 } | |
3217 if ( !_strnicmp(test_string, "dar", 3) ) | |
3218 { | |
3219 p2DEvents[i].uType = BuildingType_DarkGuild; | |
3220 break; | |
3221 } | |
3222 if ( !_strnicmp(test_string, "ele", 3) ) // "Element Guild" from mm6 | |
3223 { | |
3224 p2DEvents[i].uType = BuildingType_ElementalGuild; | |
3225 break; | |
3226 } | |
3227 if ( !_strnicmp(test_string, "sel", 3) ) | |
3228 { | |
3229 p2DEvents[i].uType = BuildingType_SelfGuild; | |
3230 break; | |
3231 } | |
3232 if ( !_strnicmp(test_string, "mir", 3) ) | |
3233 { | |
3234 p2DEvents[i].uType = BuildingType_16; | |
3235 break; | |
3236 } | |
3237 if ( !_strnicmp(test_string, "mer", 3) ) // "Merc Guild" from mm6 | |
3238 { | |
3239 p2DEvents[i].uType = BuildingType_TownHall; | |
3240 break; | |
3241 } | |
3242 p2DEvents[i].uType = BuildingType_18; | |
3243 } | |
3244 break; | |
3245 | |
3246 case 4: | |
3247 p2DEvents[i].uAnimationID = atoi(test_string); | |
3248 break; | |
3249 case 5: | |
3250 p2DEvents[i].pName = RemoveQuotes(test_string); | |
3251 break; | |
3252 case 6: | |
3253 p2DEvents[i].pProprieterName = RemoveQuotes(test_string); | |
3254 break; | |
3255 case 7: | |
3256 p2DEvents[i].pProprieterTitle = RemoveQuotes(test_string); | |
3257 break; | |
3258 case 8: | |
3259 p2DEvents[i].field_14 = atoi(test_string); | |
3260 break; | |
3261 case 9: | |
3262 p2DEvents[i]._state = atoi(test_string); | |
3263 break; | |
3264 case 10: | |
3265 p2DEvents[i]._rep = atoi(test_string); | |
3266 break; | |
3267 case 11: | |
3268 p2DEvents[i]._per = atoi(test_string); | |
3269 break; | |
3270 case 12: | |
3271 p2DEvents[i].fPriceMultiplier = atof(test_string); | |
3272 break; | |
3273 case 13: | |
3274 p2DEvents[i].flt_24 = atof(test_string); | |
3275 break; | |
3276 case 15: | |
3277 p2DEvents[i].field_1C = atoi(test_string); | |
3278 break; | |
3279 case 18: | |
3280 p2DEvents[i].uOpenTime = atoi(test_string); | |
3281 break; | |
3282 case 19: | |
3283 p2DEvents[i].uCloseTime = atoi(test_string); | |
3284 break; | |
3285 case 20: | |
3286 p2DEvents[i].uExitPicID = atoi(test_string); | |
3287 break; | |
3288 case 21: | |
3289 p2DEvents[i].uExitMapID = atoi(test_string); | |
3290 break; | |
3291 case 22: | |
3292 p2DEvents[i]._quest_related = atoi(test_string); | |
3293 break; | |
3294 case 23: | |
3295 p2DEvents[i].pEnterText = RemoveQuotes(test_string); | |
3296 break; | |
3297 } | |
3298 } | |
3299 ++decode_step; | |
3300 test_string=tmp_pos+1; | |
3301 } while ((decode_step<24)&&!break_loop); | |
3302 } | |
3303 | |
3304 } |