equal
deleted
inserted
replaced
448 |
448 |
449 // name of weapons in ammo menu |
449 // name of weapons in ammo menu |
450 for ai:= Low(TAmmoType) to High(TAmmoType) do |
450 for ai:= Low(TAmmoType) to High(TAmmoType) do |
451 with Ammoz[ai] do |
451 with Ammoz[ai] do |
452 begin |
452 begin |
453 TryDo(trAmmo[NameId] <> '','No default text/translation found for ammo type #' + intToStr(ord(ai)) + '!',true); |
453 TryDo(length(trAmmo[NameId]) > 0,'No default text/translation found for ammo type #' + intToStr(ord(ai)) + '!',true); |
454 tmpsurf:= TTF_RenderUTF8_Blended(Fontz[CheckCJKFont(trAmmo[NameId],fnt16)].Handle, Str2PChar(trAmmo[NameId]), cWhiteColorChannels); |
454 tmpsurf:= TTF_RenderUTF8_Blended(Fontz[CheckCJKFont(trAmmo[NameId],fnt16)].Handle, Str2PChar(trAmmo[NameId]), cWhiteColorChannels); |
455 TryDo(tmpsurf <> nil,'Name-texture creation for ammo type #' + intToStr(ord(ai)) + ' failed!',true); |
455 TryDo(tmpsurf <> nil,'Name-texture creation for ammo type #' + intToStr(ord(ai)) + ' failed!',true); |
456 tmpsurf:= doSurfaceConversion(tmpsurf); |
456 tmpsurf:= doSurfaceConversion(tmpsurf); |
457 FreeTexture(NameTex); |
457 FreeTexture(NameTex); |
458 NameTex:= Surface2Tex(tmpsurf, false); |
458 NameTex:= Surface2Tex(tmpsurf, false); |
1236 r, r2: TSDL_Rect; |
1236 r, r2: TSDL_Rect; |
1237 wa, ha: LongInt; |
1237 wa, ha: LongInt; |
1238 tmpline, tmpline2, tmpdesc: ansistring; |
1238 tmpline, tmpline2, tmpdesc: ansistring; |
1239 begin |
1239 begin |
1240 // make sure there is a caption as well as a sub caption - description is optional |
1240 // make sure there is a caption as well as a sub caption - description is optional |
1241 if caption = '' then |
1241 if length(caption) = 0 then |
1242 caption:= '???'; |
1242 caption:= ansistring('???'); |
1243 if subcaption = '' then |
1243 if length(caption) = 0 then |
1244 subcaption:= _S' '; |
1244 subcaption:= ansistring(_S' '); |
1245 |
1245 |
1246 font:= CheckCJKFont(caption,fnt16); |
1246 font:= CheckCJKFont(caption,fnt16); |
1247 font:= CheckCJKFont(subcaption,font); |
1247 font:= CheckCJKFont(subcaption,font); |
1248 font:= CheckCJKFont(description,font); |
1248 font:= CheckCJKFont(description,font); |
1249 font:= CheckCJKFont(extra,font); |
1249 font:= CheckCJKFont(extra,font); |
1283 w:= i + wa; |
1283 w:= i + wa; |
1284 inc(h, j + ha) |
1284 inc(h, j + ha) |
1285 end |
1285 end |
1286 end; |
1286 end; |
1287 |
1287 |
1288 if extra <> '' then |
1288 if length(extra) > 0 then |
1289 begin |
1289 begin |
1290 // get extra label's dimensions |
1290 // get extra label's dimensions |
1291 TTF_SizeUTF8(Fontz[font].Handle, PChar(extra), @i, @j); |
1291 TTF_SizeUTF8(Fontz[font].Handle, PChar(extra), @i, @j); |
1292 if w < (i + wa) then |
1292 if w < (i + wa) then |
1293 w:= i + wa; |
1293 w:= i + wa; |
1330 if length(tmpline2) > 0 then |
1330 if length(tmpline2) > 0 then |
1331 WriteInRect(tmpsurf, cFontBorder + 2, r2.y + r2.h, $ffc7c7c7, font, PChar(tmpline + ':')); |
1331 WriteInRect(tmpsurf, cFontBorder + 2, r2.y + r2.h, $ffc7c7c7, font, PChar(tmpline + ':')); |
1332 end |
1332 end |
1333 end; |
1333 end; |
1334 |
1334 |
1335 if extra <> '' then |
1335 if length(extra) > 0 then |
1336 r:= WriteInRect(tmpsurf, cFontBorder + 2, r.y + r.h, extracolor, font, PChar(extra)); |
1336 r:= WriteInRect(tmpsurf, cFontBorder + 2, r.y + r.h, extracolor, font, PChar(extra)); |
1337 |
1337 |
1338 r.x:= cFontBorder + 6; |
1338 r.x:= cFontBorder + 6; |
1339 r.y:= cFontBorder + 4; |
1339 r.y:= cFontBorder + 4; |
1340 r.w:= 32; |
1340 r.w:= 32; |