Load screen: Move “LOADING” from image into text box
So this message can be properly translated
--- a/hedgewars/hwengine.pas Fri Apr 07 05:03:30 2017 +0200
+++ b/hedgewars/hwengine.pas Sat Apr 08 05:04:18 2017 +0200
@@ -373,7 +373,6 @@
ControllerInit(); // has to happen before InitKbdKeyTable to map keys
InitKbdKeyTable();
- AddProgress();
if not allOK then exit;
LoadLocale(cPathz[ptLocale] + '/en.txt'); // Do an initial load with english
@@ -391,6 +390,9 @@
if not allOK then exit;
WriteLnToConsole(msgGettingConfig);
+ LoadFonts();
+ AddProgress();
+
if cTestLua then
begin
ParseCommand('script ' + cScriptName, true);
--- a/hedgewars/uStore.pas Fri Apr 07 05:03:30 2017 +0200
+++ b/hedgewars/uStore.pas Sat Apr 08 05:04:18 2017 +0200
@@ -26,6 +26,7 @@
procedure initModule;
procedure freeModule;
+procedure LoadFonts();
procedure StoreLoad(reload: boolean);
procedure StoreRelease(reload: boolean);
procedure RenderHealth(var Hedgehog: THedgehog);
@@ -72,6 +73,7 @@
squaresize : LongInt;
numsquares : LongInt;
ProgrTex: PTexture;
+ LoadingText: PTexture;
prevHat: shortstring;
tmpHatSurf: PSDL_Surface;
@@ -348,17 +350,13 @@
end
end;
-procedure StoreLoad(reload: boolean);
+procedure LoadFonts();
var s: shortstring;
- ii: TSprite;
fi: THWFont;
- ai: TAmmoType;
- tmpsurf: PSDL_Surface;
- i, imflags: LongInt;
begin
-AddFileLog('StoreLoad()');
+AddFileLog('LoadFonts();');
-if (not reload) and (not cOnlyStats) then
+if (not cOnlyStats) then
for fi:= Low(THWFont) to High(THWFont) do
with Fontz[fi] do
begin
@@ -369,6 +367,17 @@
TTF_SetFontStyle(Handle, style);
WriteLnToConsole(msgOK)
end;
+end;
+
+procedure StoreLoad(reload: boolean);
+var s: shortstring;
+ ii: TSprite;
+ fi: THWFont;
+ ai: TAmmoType;
+ tmpsurf: PSDL_Surface;
+ i, imflags: LongInt;
+begin
+AddFileLog('StoreLoad()');
if not cOnlyStats then
begin
@@ -774,9 +783,12 @@
ProgrTex:= Surface2Tex(texsurf, false);
+ LoadingText:= RenderStringTex(trmsg[sidLoading], $FFF39EE8, fntBig);
+
squaresize:= texsurf^.w shr 1;
numsquares:= texsurf^.h div squaresize;
SDL_FreeSurface(texsurf);
+
{$IFNDEF PAS2C}
with mobileRecord do
if GameLoading <> nil then
@@ -797,6 +809,7 @@
r.h:= squaresize;
DrawTextureFromRect( -squaresize div 2, (cScreenHeight - squaresize) shr 1, @r, ProgrTex);
+ DrawTexture( -LoadingText^.w div 2, (cScreenHeight - LoadingText^.h) shr 1 - (squaresize div 2) - (LoadingText^.h div 2) - 8, LoadingText);
SwapBuffers;
@@ -810,8 +823,9 @@
if GameLoaded <> nil then
GameLoaded();
{$ENDIF}
- WriteLnToConsole('Freeing progress surface... ');
+ WriteLnToConsole('Freeing progress textures... ');
FreeAndNilTexture(ProgrTex);
+ FreeAndNilTexture(LoadingText);
Step:= 0
end;
--- a/hedgewars/uTypes.pas Fri Apr 07 05:03:30 2017 +0200
+++ b/hedgewars/uTypes.pas Sat Apr 08 05:04:18 2017 +0200
@@ -456,8 +456,7 @@
sidDrillStrike, sidSnowball, sidNothing, sidTardis,
{sidStructure,} sidLandGun, sidIceGun, sidKnife, sidRubber, sidAirMine);
- // sidStartFight is unused and free to be replaced
- TMsgStrId = (sidStartFight, sidDraw, sidWinner, sidVolume, sidPaused,
+ TMsgStrId = (sidLoading, sidDraw, sidWinner, sidVolume, sidPaused,
sidConfirm, sidSuddenDeath, sidRemaining, sidFuel, sidSync,
sidNoEndTurn, sidNotYetAvailable, sidRoundSD, sidRoundsSD, sidReady,
sidBounce1, sidBounce2, sidBounce3, sidBounce4, sidBounce5, sidBounce,
Binary file share/hedgewars/Data/Graphics/Progress.png has changed
--- a/share/hedgewars/Data/Locale/en.txt Fri Apr 07 05:03:30 2017 +0200
+++ b/share/hedgewars/Data/Locale/en.txt Sat Apr 08 05:04:18 2017 +0200
@@ -61,7 +61,7 @@
00:57=Rubber
00:58=Air Mine
-01:00=UNUSED
+01:00=Loading …
01:01=Round draw
01:02=%1 wins!
01:03=Volume %1%