# HG changeset patch # User Wuzzy # Date 1491620658 -7200 # Node ID 322aaad4a93de702398977f4b9851b513bfe66c5 # Parent cb7d5fd2e515d78c6931fdc68120a2b94350c6ef Load screen: Move “LOADING” from image into text box So this message can be properly translated diff -r cb7d5fd2e515 -r 322aaad4a93d hedgewars/hwengine.pas --- 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); diff -r cb7d5fd2e515 -r 322aaad4a93d hedgewars/uStore.pas --- 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; diff -r cb7d5fd2e515 -r 322aaad4a93d hedgewars/uTypes.pas --- 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, diff -r cb7d5fd2e515 -r 322aaad4a93d share/hedgewars/Data/Graphics/Progress.png Binary file share/hedgewars/Data/Graphics/Progress.png has changed diff -r cb7d5fd2e515 -r 322aaad4a93d share/hedgewars/Data/Locale/en.txt --- 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%