hedgewars/uStore.pas
changeset 7186 013deb83086b
parent 7138 f8248bcba8f1
parent 7170 84ac6c6d2d8e
child 7188 580cd247511e
equal deleted inserted replaced
7138:f8248bcba8f1 7186:013deb83086b
   959 begin
   959 begin
   960 // make sure there is a caption as well as a sub caption - description is optional
   960 // make sure there is a caption as well as a sub caption - description is optional
   961 if caption = '' then
   961 if caption = '' then
   962     caption:= '???';
   962     caption:= '???';
   963 if subcaption = '' then
   963 if subcaption = '' then
   964     subcaption:= ' ';
   964     subcaption:= _S' ';
   965 
   965 
   966 font:= CheckCJKFont(caption,fnt16);
   966 font:= CheckCJKFont(caption,fnt16);
   967 font:= CheckCJKFont(subcaption,font);
   967 font:= CheckCJKFont(subcaption,font);
   968 font:= CheckCJKFont(description,font);
   968 font:= CheckCJKFont(description,font);
   969 font:= CheckCJKFont(extra,font);
   969 font:= CheckCJKFont(extra,font);
  1043     if tmpline <> '' then
  1043     if tmpline <> '' then
  1044         begin
  1044         begin
  1045         r:= WriteInRect(tmpsurf, cFontBorder + 2, r.y + r.h, $ff707070, font, tmpline);
  1045         r:= WriteInRect(tmpsurf, cFontBorder + 2, r.y + r.h, $ff707070, font, tmpline);
  1046 
  1046 
  1047         // render highlighted caption (if there is a ':')
  1047         // render highlighted caption (if there is a ':')
  1048         tmpline2:= '';
  1048         tmpline2:= _S'';
  1049         SplitByChar(tmpline, tmpline2, ':');
  1049         SplitByChar(tmpline, tmpline2, ':');
  1050         if tmpline2 <> '' then
  1050         if tmpline2 <> _S'' then
  1051             WriteInRect(tmpsurf, cFontBorder + 2, r2.y + r2.h, $ffc7c7c7, font, tmpline + ':');
  1051             WriteInRect(tmpsurf, cFontBorder + 2, r2.y + r2.h, $ffc7c7c7, font, tmpline + ':');
  1052         end
  1052         end
  1053     end;
  1053     end;
  1054 
  1054 
  1055 if extra <> '' then
  1055 if extra <> '' then
  1088 r.y:= (i mod 16) * 32;
  1088 r.y:= (i mod 16) * 32;
  1089 r.w:= 32;
  1089 r.w:= 32;
  1090 r.h:= 32;
  1090 r.h:= 32;
  1091 
  1091 
  1092 // default (no extra text)
  1092 // default (no extra text)
  1093 extra:= '';
  1093 extra:= _S'';
  1094 extracolor:= 0;
  1094 extracolor:= 0;
  1095 
  1095 
  1096 if (CurrentTeam <> nil) and (Ammoz[atype].SkipTurns >= CurrentTeam^.Clan^.TurnNumber) then // weapon or utility is not yet available
  1096 if (CurrentTeam <> nil) and (Ammoz[atype].SkipTurns >= CurrentTeam^.Clan^.TurnNumber) then // weapon or utility is not yet available
  1097     begin
  1097     begin
  1098     extra:= trmsg[sidNotYetAvailable];
  1098     extra:= trmsg[sidNotYetAvailable];
  1103     extra:= trmsg[sidNoEndTurn];
  1103     extra:= trmsg[sidNoEndTurn];
  1104     extracolor:= LongInt($ff70c770);
  1104     extracolor:= LongInt($ff70c770);
  1105     end
  1105     end
  1106 else
  1106 else
  1107     begin
  1107     begin
  1108     extra:= '';
  1108     extra:= _S'';
  1109     extracolor:= 0;
  1109     extracolor:= 0;
  1110     end;
  1110     end;
  1111 
  1111 
  1112 // render window and return the texture
  1112 // render window and return the texture
  1113 WeaponTooltipTex:= RenderHelpWindow(trammo[Ammoz[atype].NameId], trammoc[Ammoz[atype].NameId], trammod[Ammoz[atype].NameId], extra, extracolor, SpritesData[sprAMAmmos].Surface, @r)
  1113 WeaponTooltipTex:= RenderHelpWindow(trammo[Ammoz[atype].NameId], trammoc[Ammoz[atype].NameId], trammod[Ammoz[atype].NameId], extra, extracolor, SpritesData[sprAMAmmos].Surface, @r)
  1144 {$ELSE}
  1144 {$ELSE}
  1145     if SDLPrimSurface = nil then
  1145     if SDLPrimSurface = nil then
  1146 {$ENDIF}
  1146 {$ENDIF}
  1147         begin
  1147         begin
  1148         // set window title
  1148         // set window title
  1149         {$IFNDEF SDL13}SDL_WM_SetCaption('Hedgewars', nil);{$ENDIF}
  1149         {$IFNDEF SDL13}SDL_WM_SetCaption(_P'Hedgewars', nil);{$ENDIF}
  1150         WriteToConsole('Init SDL_image... ');
  1150         WriteToConsole('Init SDL_image... ');
  1151         SDLTry(IMG_Init(IMG_INIT_PNG) <> 0, true);
  1151         SDLTry(IMG_Init(IMG_INIT_PNG) <> 0, true);
  1152         WriteLnToConsole(msgOK);
  1152         WriteLnToConsole(msgOK);
  1153         // load engine icon
  1153         // load engine icon
  1154     {$IFNDEF DARWIN}
  1154     {$IFNDEF DARWIN}
  1248         // reload everything we had before
  1248         // reload everything we had before
  1249         ReloadCaptions(false);
  1249         ReloadCaptions(false);
  1250         ReloadLines;
  1250         ReloadLines;
  1251         StoreLoad(true);
  1251         StoreLoad(true);
  1252         // redraw all land
  1252         // redraw all land
  1253         UpdateLandTexture(0, LAND_WIDTH, 0, LAND_HEIGHT);
  1253         UpdateLandTexture(0, LAND_WIDTH, 0, LAND_HEIGHT, false);
  1254         end;
  1254         end;
  1255 end;
  1255 end;
  1256 
  1256 
  1257 procedure initModule;
  1257 procedure initModule;
  1258 var ai: TAmmoType;
  1258 var ai: TAmmoType;