// // CPT operator / SondeerGame // This source file is (c) by Deltares. // - October 2014 // //============================================================================= // GeoHUD // Started using MyFirstHUD (FROM UDN) // // IMPORTANT: FOR LOADING SCREEN WHEN STARTING FROM THE MENU HANDLE GeoHUDMenu.uc // FOR LOADING SCREEN WHEN SWITCHING LEVELS HANDLE HERE // //============================================================================= // Date Id Modification // 2006-09-13 gui Corrected problem of having several markers close by // 2006-09-18 bas Added ability to show a WarningMessage // 2006-09-22 bas Changed text for a WarningMessage // 2006-09-25 bas Added Blue Color for WarningMessage // 2006-10-06 bas Added arne's beloved timer function for debugging purposes // 2006-10-06 bas Added 'press leftmousebutton' image in bottom right corner // 2006-10-06 gui Added tips in game start also here so you can see on restart // 2006-10-09 gui initial call shows // 2006-12-08 zmr When bGameOver the wmsg won't be displayed // 2006-12-12 gui Informations in Complete exercise // 2006-12-13 gui Corrected thing in Complete exercise and new tips // 2007-02-07 gui Image for single exercise // 2007-05-31 wsl removed left mouse button image from End-of-Game HUD // 2007-06-07 wsl Images are square and centred on screen // 2007-06-08 wsl Images accompanying tip 0 are centred // 2007-07-25 mcb Modified the level loading tips // 2007-09-19 wsl Changed all occurrences of 'afstands-' to 'meet-' // 2008-02-12 wsl Corrected English texts //============================================================================= class GeoHUD extends HUD; #exec OBJ LOAD FILE=InGameMenuImagesT.utx #exec OBJ LOAD FILE=GeoGamePlayTextures.utx #exec OBJ LOAD FILE=HumanLandscapeSM.usx var Texture MouseCursorTexture; var Material TitleMaterial; // test var vector MapCenter; var() float OnslaughtMapCenterX, OnslaughtMapCenterY, OnslaughtMapRadius; var float RadarScale, RadarTrans, IconScale, RadarPosX, RadarPosY; var float RadarMaxRange, RadarRangeX, RadarRangeY; var() Material BorderMat; var float RadarWidth, RadarHeight, CenterRadarPosX, CenterRadarPosY; /// Render camera? var bool ShowCamera; /// A couple of language strings: var string LANG_TooFarAway, LANG_TooClose, LANG_SlowDown, LANG_ReadySondeer, LANG_ReadyPrepare; struct radarinfo { var int width; var int height; var float rangex; var float rangey; var float alpha; }; /// Hud background picture. var Material BackPicture; var bool bShowMessage; var string sMessage; var int iShowTime; var int iAlpha; var int iStartTime; var int iMessageType; var Material maptexture, nomaptexture; simulated event PostBeginPlay() { local GeoPlayercontroller GeoPC; //local TerrainInfo T, PrimaryTerrain; local string map; super.PostBeginPlay(); GeoPC = GeoPlayerController(PlayerOwner); // Determine primary terrain RadarRangeX = int(Localize("Radar", "RangeX", GeoPC.GetScenarioFile())); RadarRangeY = int(Localize("Radar", "RangeY", GeoPC.GetScenarioFile())); MapCenter.x = int(Localize("Radar", "CenterX", GeoPC.GetScenarioFile())); MapCenter.y = int(Localize("Radar", "CenterY", GeoPC.GetScenarioFile())); MapCenter.z = int(Localize("Radar", "CenterZ", GeoPC.GetScenarioFile())); /// Set map texutre: map = "IngameMenuImagesT.Maps.Map" $ GeoPC.GetScenarioNumber(); maptexture = Material(DynamicLoadObject(map, class'Material')); /// jln - 03-12-2008 /// Also load empty texture for when the player has not gotten the map: nomaptexture = Material'IngameMenuImagesT.Maps.Map0'; /// Update language strings: UpdateLanguage(); } simulated event PostRender(Canvas C) { local GeoPlayercontroller GeoPC; local GUIPage dialog; local KVehicle DrivenVehicle; local SVehicle DrivenSVehicle; local float CurrentDist; local float DistUnrealUnit; local color _color; local font _font; // local Material BackPicture; // local float ImageX, ImageY; local TimerActor ta; Super.PostRender(C); GeoPC = GeoPlayerController(PlayerOwner); GeoPC.LastHUDSizeX = C.SizeX; GeoPC.LastHUDSizeY = C.SizeY; /* C.SetPos(100, 200); T = "Touching "; ForEach GeoPC.Pawn.TouchingActors(class'Actor', A) T = T$GetItemName(string(A))$" "; if ( T == "Touching ") T = "Touching nothing"; C.DrawText(T, false); */ if (PlayerOwner.IsInState('PlayerDriving')) { if (ShowCamera) DrawBottomCamera(C); } if(Level.Pauser == None) { if (PlayerOwner.PlayerReplicationInfo.PlayerVolume != None && PlayerOwner.PlayerReplicationInfo.PlayerVolume.IsA('MapLimitVolume')) { SetMessage( GeoPC.IL8N( MapLimitVolume(PlayerOwner.PlayerReplicationInfo.PlayerVolume).MessageNotLeave, "ingame" ), 1, 0); } // only draw HUD if the game is not paused if (bShowMessage == true) { ShowMessage(C); /// Process time: if (Level.TimeSeconds > (iStartTime + iShowTime)) { /// The visible time has elapsed, start reducing alpha: iAlpha--; if (iAlpha < 1) bShowMessage = false; } } if (PlayerOwner.IsInState('PlayerMousing')) DrawMouseCursor(C); if (PlayerOwner.IsInState('PlayerDriving')) { _color = C.DrawColor; _font = C.Font; if (ShowCamera == false) { /// Display mouse menu indication: C.SetDrawColor(255, 255, 255); C.Font = MedFont; C.SetPos(0.9*C.SizeX, 0.78*C.SizeY); if (C.SizeX <= 1024) C.DrawTileScaled(Texture'InGameMenuImagesT.ImageButtons.MouseRight', 0.2, 0.2 ); else if (C.SizeX <= 1152) C.DrawTileScaled(Texture'InGameMenuImagesT.ImageButtons.MouseRight', 0.24, 0.24 ); else if (C.SizeX <= 1280) C.DrawTileScaled(Texture'InGameMenuImagesT.ImageButtons.MouseRight', 0.26, 0.26 ); else C.DrawTileScaled(Texture'InGameMenuImagesT.ImageButtons.MouseRight', 0.3,0.3 ); C.SetPos(0.925*C.SizeX, 0.94*C.SizeY); C.DrawTextClipped("Menu"); /// Return state: C.DrawColor = _color; C.Font = _font; } if (GeoPC.RaceMode == true) { /// jln, we are in race mode, display elapsed time: RenderTime(C); } /// Render driving hud: //Log("is driving"); RenderMiniMap(C); // DrawBottomCamera(C); /// jln - 30-09-2008 Make sure we actually have a sondeerlocation and that is is not the one we are skipping until we pass it again. if (GeoPC.CurrentSondeerLocation != None && GeoPC.SondeerLocationToSkip != GeoPC.CurrentSondeerLocation) { if (GeoPC.RaceMode == true) { /// Find timer and stop: ForEach DynamicActors ( class'TimerActor', ta ) { break; } if (ta != None) { ta.isRunning = false; //Level.Game.bGameEnded = true; dialog = GUIController(GeoPC.Player.GUIController).FindMenu("dialogEndEnterName"); if (dialog == None) { GeoPC.ClientOpenMenu("GeoInterface.dialogEndEnterName"); } } } // C.SetPos(0.8*C.SizeX, 0.4*C.SizeY); // C.DrawTextClipped("At sondeer location: " $ GeoPC.CurrentSondeerLocation.LocationName); /// Calculate distance. DistUnrealUnit=Abs(VSize(GeoPC.Pawn.Location - GeoPC.CurrentSondeerLocation.Location)); CurrentDist=DistUnrealUnit * (100.0 / 128.0); // Convert to cm /// Player did not perform any preparations yet. if (GeoPC.playeractions.FinishedPreparations == true) { /// Yes if (CurrentDist > 96) { SetMessage( LANG_TooFarAway, 1, 0); ShowCamera = true; } else { ShowCamera = true; if (GeoPC.GetVelocity() <= 1) { SetMessage(LANG_ReadySondeer, 1, 0); dialog = GUIController(GeoPC.Player.GUIController).FindMenu("dialogStartSondering"); if (dialog == None) { GeoPC.ClientOpenMenu("GeoInterface.dialogStartSondering", false); } } else { SetMessage(LANG_Slowdown, 1, 0); } } } else { ShowCamera = false; /// No, no preparations yet. if (CurrentDist > 300 && CurrentDist < 1000) { SetMessage(LANG_ReadyPrepare, 1, 0); dialog = GUIController(GeoPC.Player.GUIController).FindMenu("dialogPreparation"); if (dialog == None && GeoPC.GetVelocity() <= 2 && CurrentDist < 1000) { DrivenVehicle = KVehicle(GeoPC.Pawn); GeoPC.Pawn.Velocity = vect(0,0,0); GeoPC.Velocity = vect(0,0,0); if(DrivenVehicle != None) { DrivenVehicle.Throttle=0; DrivenVehicle.Steering=0; } DrivenSVehicle = SVehicle(GeoPC.Pawn); if(DrivenSVehicle != None) { DrivenSVehicle.Throttle=0; DrivenSVehicle.Steering=0; DrivenSVehicle.Rise=0; SCar(GeoPC.Pawn).OutputBrake=1; SCar(GeoPC.Pawn).OutputHandbrake=true; } GeoPC.ClientOpenMenu("GeoInterface.dialogPreparation"); } } else { /// Too close if (GeoPC.GetVelocity() <= 1) { SetMessage(LANG_TooClose, 1, 0); GeoPC.FindAndHide("dialogPreparation"); } } } } } } return; } function RenderTime(Canvas C) { local TimerActor ta; /// Find time actor ForEach DynamicActors ( class'TimerActor', ta ) { break; } if (ta != None) { C.SetPos(0.8*C.SizeX, 0.7*C.SizeY); C.DrawTextClipped( (ta.totaltime) $ " sec"); } } function UpdateLanguage() { local GeoPlayerController GeoPC; local string section; GeoPC = GeoPlayerController(PlayerOwner); section = "Ingame"; LANG_TooFarAway = GeoPC.IL8n("LANG_TooFarAway", section, false); LANG_TooClose = GeoPC.IL8n("LANG_TooClose", section, false); LANG_SlowDown = GeoPC.IL8n("LANG_SlowDown", section, false); LANG_ReadySondeer = GeoPC.IL8n("LANG_ReadySondeer", section, false); LANG_ReadyPrepare = GeoPC.IL8n("LANG_ReadyPrepare", section, false); } simulated function DrawMouseCursor(Canvas C) { local float XPos, YPos; local GeoPlayerController GeoPC; C.SetDrawColor(255, 255, 255); C.Style = ERenderStyle.STY_Alpha; GeoPC = GeoPlayerController(PlayerOwner); // find position of cursor, and clamp it to screen XPos = GeoPC.PlayerMouse.X + C.SizeX / 2.0; if (XPos < 0) { GeoPC.PlayerMouse.X -= XPos; XPos = 0; } else if (XPos >= C.SizeX) { GeoPC.PlayerMouse.X -= (XPos - C.SizeX); XPos = C.SizeX - 1; } YPos = GeoPC.PlayerMouse.Y + C.SizeY / 2.0; if (YPos < 0) { GeoPC.PlayerMouse.Y -= YPos; YPos = 0; } else if (YPos >= C.SizeY) { GeoPC.PlayerMouse.Y -= (YPos - C.SizeY); YPos = C.SizeY - 1; } // render mouse cursor C.SetPos(XPos, YPos); C.DrawIcon(MouseCursorTexture, 1); C.Style = ERenderStyle.STY_Normal; return; } /// jln - 06-08-2008 Render mini map. function RenderMiniMap(Canvas C) { DrawMap(C); } function bool DrawMap(Canvas C) { local Color HoldColor; /// Save and restore color: HoldColor = C.DrawColor; RadarWidth = 0.5 * RadarScale * HUDCanvasScale * C.ClipX; RadarHeight = RadarWidth * 2; CenterRadarPosX = (RadarPosX * C.ClipX);// - RadarWidth; CenterRadarPosY = (RadarPosY * C.ClipY);// + RadarHeight; DrawRadarMap(C, CenterRadarPosX, CenterRadarPosY, RadarWidth, false); C.DrawColor = HoldColor; return true; } function DrawBottomCamera(Canvas C) { local rotator RearMirrorRot; local float width; /// jln - 29-09-2008 // If you want a rear mirror, uncomment the following: RearMirrorRot = PlayerOwner.Pawn.Rotation; RearMirrorRot.Pitch -= 15192; width = RadarScale * HUDCanvasScale * C.ClipX; C.DrawPortal( CenterRadarPosX - (width /2), CenterRadarPosY + (width * 1.05), width, width, PlayerOwner.Pawn , PlayerOwner.Pawn.Location + (vect(10, 1, 100) >> RearMirrorRot), RearMirrorRot, 90, true); C.DrawColor = C.MakeColor(200,200,200,255); C.SetPos( CenterRadarPosX - (width /2), CenterRadarPosY + (width * 1.05) - 4); C.DrawTile(Texture'SondeerMeester.Icon.MapBorderTex', (width) , (width + 4) , 0, 0, 256, 256); } simulated function DrawRadarMap(Canvas C, float CenterPosX, float CenterPosY, float RadarWidth, bool bShowDisabledNodes) { local float PawnIconSize, PlayerIconSize, CoreIconSize, MapScaleX, MapScaleY, MapRadarWidth; local vector HUDLocation; local Material PlayerIcon; local Actor A; // local int i; // local plane SavedModulation; local GeoPlayerController GeoPC; local radarinfo radari; /// Sondeerlocations: local SondeerLocation SL; local vector ScreenLocation, DrawLocation; GeoPC = GeoPlayerController(PlayerOwner); MapRadarWidth = RadarWidth; // MapCenter = vect(150,-24500,0); radari.width = RadarWidth; radari.height = RadarHeight; radari.rangex = RadarRangeX; radari.rangey = RadarRangeY; radari.alpha = RadarTrans; /// jln - 03-12-2008 Use real map or empty map: if (GeoPC.PlayerActions.HasMap) DrawMapImage( C, MapTexture, CenterPosX, CenterPosY, 0, 0, radari ); else DrawMapImage( C, NoMapTexture, CenterPosX, CenterPosY, 0, 0, radari ); CoreIconSize = IconScale * 16 * C.ClipX * HUDCanvasScale/1600; PawnIconSize = CoreIconSize * 0.5; PlayerIconSize = CoreIconSize * 2.5; MapScaleX = RadarWidth / RadarRangeX; MapScaleY = RadarHeight / RadarRangeY; C.Font = GetConsoleFont(C); /// Draw sondeerlocations: /// jln - 03-12-2008 only when player has map! if (GeoPC.PlayerActions.HasMap) { ForEach AllActors ( class'SondeerLocation', SL ) { /// We found an item. ScreenLocation = SL.Location - MapCenter; ScreenLocation.Z = 0; //Dist = VSize(ScreenLocation); //if ( (Dist < (Range * 0.95)) ) //{ DrawLocation.X = CenterPosX + ScreenLocation.X * (RadarWidth/RadarRangeX); DrawLocation.Y = CenterPosY + ScreenLocation.Y * (RadarHeight/RadarRangeY); if (SL == GeoPC.CurrentSondeerLocation) { /// This is the current location ,render it red. DrawIcon( C, DrawLocation, true, IconScale * 1.5, HUDCanvasScale, 1.0 ); } else { DrawIcon( C, DrawLocation, false, IconScale * 1.5, HUDCanvasScale, 1.0 ); } } } /* // VERY SLOW DEBUGGING CODE for showing all the dynamic actors that exist in the level in real-time ForEach DynamicActors(class'Actor', A) { if (A.IsA('Projectile')) //(A.IsA('Projector') || A.IsA('Emitter') || A.IsA('xEmitter')) { HUDLocation = A.Location - MapCenter; HUDLocation.Z = 0; C.SetPos(CenterPosX + HUDLocation.X * MapScale - PlayerIconSize * 0.5 * 0.25, CenterPosY + HUDLocation.Y * MapScale - PlayerIconSize * 0.5 * 0.25); C.DrawColor = C.MakeColor(255,255,0); C.DrawTile(Material'NewHUDIcons', PlayerIconSize * 0.25, PlayerIconSize * 0.25, 0, 0, 32, 32); } if (A.IsA('Pawn')) { if (Pawn(A).PlayerReplicationInfo != None && Pawn(A).PlayerReplicationInfo.Team != None) { if (Pawn(A).PlayerReplicationInfo.Team.TeamIndex == 0) C.DrawColor = C.MakeColor(255,0,0); else if (Pawn(A).PlayerReplicationInfo.Team.TeamIndex == 1) C.DrawColor = C.MakeColor(0,0,255); else C.DrawColor = C.MakeColor(255,0,255); } else C.DrawColor = C.MakeColor(255,255,255); HUDLocation = A.Location - MapCenter; HUDLocation.Z = 0; if (A.IsA('Vehicle')) { C.SetPos(CenterPosX + HUDLocation.X * MapScale - PlayerIconSize * 0.5 * 0.5, CenterPosY + HUDLocation.Y * MapScale - PlayerIconSize * 0.5 * 0.5); C.DrawTile(Material'NewHUDIcons', PlayerIconSize * 0.5, PlayerIconSize * 0.5, 0, 0, 32, 32); } else { C.SetPos(CenterPosX + HUDLocation.X * MapScale - PlayerIconSize * 0.5 * 0.25, CenterPosY + HUDLocation.Y * MapScale - PlayerIconSize * 0.5 * 0.25); C.DrawTile(Material'NewHUDIcons', PlayerIconSize * 0.25, PlayerIconSize * 0.25, 0, 0, 32, 32); } } } */ // Draw PlayerIcon if (PlayerOwner.Pawn != None) A = PlayerOwner.Pawn; if (A != None) { PlayerIcon = Material'SondeerMeester.Icon.Icon_Truck_Rotator'; TexRotator(PlayerIcon).Rotation.Yaw = -A.Rotation.Yaw; // - 16384; HUDLocation = A.Location - MapCenter; HUDLocation.Z = 0; if (HUDLocation.X < (RadarRangeX * 0.95) && HUDLocation.Y < (RadarRangeY * 0.95)) { C.SetPos( (CenterPosX + HUDLocation.X * MapScaleX - PlayerIconSize * 0.5) , (CenterPosY + HUDLocation.Y * MapScaleY - PlayerIconSize * 0.5) ); C.DrawColor = C.MakeColor(255,255,255); C.DrawTile(PlayerIcon, PlayerIconSize , PlayerIconSize , 0, 0, 64, 64); } } // Draw Border C.DrawColor = C.MakeColor(200,200,200,255); C.SetPos(CenterPosX - RadarWidth, CenterPosY - RadarHeight); C.DrawTile(Texture'SondeerMeester.Icon.MapBorderTex', (RadarWidth * 2) , (RadarHeight * 2) , 0, 0, 256, 256); // C.ColorModulate = SavedModulation; } simulated static function DrawIcon( Canvas C, vector HUDLocation, bool bAttackable, float IconScaling, float HUDScaling, float ColorPercentage ) { local float CoreIconSize; local color HoldColor; if ( C == None ) return; /// Store and return color later on: HoldColor = C.DrawColor; CoreIconSize = IconScaling * 16 * C.ClipX * HUDScaling/1600; C.SetPos(HUDLocation.X - CoreIconSize * 1.75 * 0.5, HUDLocation.Y - CoreIconSize * 1.75 * 0.5); if (bAttackable == true) { C.DrawColor = C.MakeColor(255,0,0,200); } else { C.DrawColor = C.MakeColor(255,255,255,200); } C.DrawTile(Material'SondeerMeester.Icon.Icon_Marker', CoreIconSize * 1.75, CoreIconSize * 1.75, 0, 0, 64, 64); C.DrawColor = HoldColor; } //// Draws the level map simulated static function DrawMapImage( Canvas C, Material Image, float MapX, float MapY, float PlayerX, float PlayerY, radarinfo radari ) { local float MapScaleX, MapSizeX; local float MapScaleY, MapSizeY; local byte SavedAlpha; /* Dimensions.X = Width Dimensions.Y = Range Dimensions.Z = Alpha */ if ( Image == None || C == None ) return; MapSizeX = 512; //Image.MaterialUSize(); MapScaleX = MapSizeX / (radari.rangex * 2); MapSizeY = 1024; //Image.MaterialUSize(); MapScaleY = MapSizeY / (radari.rangey * 2); /// Save alpha SavedAlpha = C.DrawColor.A; C.DrawColor = C.MakeColor(255,255,255); C.DrawColor.A = radari.alpha; C.SetPos( (MapX - radari.width) , MapY - radari.height ); C.DrawTile( Image, (radari.width * 2.0) , (radari.height * 2.0) , ((PlayerX - radari.rangex) * MapScaleX + MapSizeX / 2.0) , ((PlayerY - radari.rangey) * MapScaleY + MapSizeY / 2.0) , (radari.rangex * 2 * MapScaleX) , (radari.rangey * 2 * MapScaleY) ); /// Return alpha C.DrawColor.A = SavedAlpha; } /******************************************************************************** * Converts a given directional vector to canvas coordinates. * * X and Y values of the returned vector contain absolute coordinates. * * The function returns, whether the target direction is visible for the player. * * Created by Wormbo * ********************************************************************************/ simulated function bool MapToHUD(out vector Result, rotator ViewRotation, float FOV, vector TargetDir, Canvas Canvas) { local float TanFOVx, TanFOVy; local float TanX, TanY; local float dx, dy; local vector X, Y, Dir, XY; TanFOVx = Tan(FOV * Pi / 360); TanFOVy = (Canvas.ClipY / Canvas.ClipX) * TanFOVx; GetAxes(ViewRotation, Dir, X, Y); Dir *= TargetDir dot Dir; XY = TargetDir - Dir; dx = XY dot X; dy = XY dot Y; TanX = dx / VSize(dir); TanY = dy / VSize(dir); Result.X = Canvas.ClipX * 0.5 * (1 + TanX / TanFOVx); Result.Y = Canvas.ClipY * 0.5 * (1 - TanY / TanFOVy); return Dir dot vector(ViewRotation) > 0 && Result.X == FClamp(Result.X, Canvas.OrgX, Canvas.ClipX) && Result.Y == FClamp(Result.Y, Canvas.OrgY, Canvas.ClipY); } simulated static function bool WorldToScreen(Vector WorldLocation, GeoPlayerController ThePlayer, float ScreenWidth, float ScreenHeight, out float X, out float Y) { local vector EyePos, RelativeToPlayer; local float Scale; local actor camactor; local vector CamPos; local rotator CamRot; ThePlayer.PlayerCalcView(camactor,CamPos,CamRot); // GetAxes(CamRot, X, Y, Z); EyePos = CamPos; //EyePos.Z += ThePlayer.Pawn.BaseEyeHeight; // Maybe ThePlayer.EyeHeight instead? RelativeToPlayer = (WorldLocation - EyePos) << CamRot; if (RelativeToPlayer.X < 0.01) return false; Scale = (ScreenWidth / 2) / Tan(ThePlayer.FovAngle/2/180*Pi); X = RelativeToPlayer.Y / RelativeToPlayer.X * Scale + ScreenWidth / 2; Y = - RelativeToPlayer.Z / RelativeToPlayer.X * Scale + ScreenHeight / 2; return true; } function ShowMessage(canvas Canvas) { local float YL; local float TitleXL; local color WhiteColor; local color RedColor; local color YellowColor; local color BlueColor; local color PurpleColor; local color GreenColor; BlueColor = class'Canvas'.static.MakeColor(0,191,255, iAlpha); WhiteColor = class'Canvas'.static.MakeColor(255,255,225); RedColor = class'Canvas'.static.MakeColor(255,0,0, iAlpha); YellowColor = class'Canvas'.static.MakeColor(255,255,0); PurpleColor = class'Canvas'.static.MakeColor(160,32,240); GreenColor = class'Canvas'.static.MakeColor(0,255,0); Canvas.Font = BigFont; switch (iMessageType) { case 1: Canvas.DrawColor = BlueColor; break; case 2: Canvas.DrawColor = RedColor; break; } Canvas.StrLen(sMessage,TitleXL,YL); Canvas.Style = ERenderStyle.STY_Alpha; Canvas.SetPos(0, 0.25*YL); Canvas.DrawTileStretched( TitleMaterial, Canvas.ClipX, YL*1.5); Canvas.SetPos(0.5*(Canvas.ClipX-TitleXL), 0.5*YL); Canvas.DrawText(sMessage,true); } function SetMessage(string Message, int iType, int time) { bShowMessage = true; sMessage = Message; iShowTime = time; iAlpha = 255; iMessageType = iType; /// jln - 07-08-2008 Set start time. iStartTime = Level.TimeSeconds; } // ************************************** // Date Id Modification // 2006-10-06 gui Redo Draw the Level Action for both languages // 2006-12-12 gui New information for loading in complete exercise // ************************************** function bool DrawLevelAction( canvas C ) { local string BigMessage; local color WhiteColor, RedColor, PurpleColor; local float ImageX, ImageY; local Material matImage; local float CX,CY, LeveLImageScale; local string TipMsg; local int irand; local string tex; local GeoPlayerController GeoPC; GeoPC = GeoPlayerController(Owner); WhiteColor = class'Canvas'.static.MakeColor(255,255,255); RedColor = class'Canvas'.static.MakeColor(110,66,66); PurpleColor = class'Canvas'.static.MakeColor(160,32,240); if (Level.LevelAction == LEVACT_None ) { if ( (Level.Pauser != None) && (Level.TimeSeconds > Level.PauseDelay + 0.2) ) { //BigMessage = IL8N("PausedMessage"); // Add pauser name? //BigMessage = ""; } else { BigMessage = ""; return false; } } // BACKGROUND ON LOADING SCREEN C.DrawColor = WhiteColor; C.SetPos(0.0, 0.0); ImageX=C.ClipX / 1024.0; ImageY=C.ClipY / 1024.0; if (BackPicture != None) { C.DrawTileScaled( BackPicture, ImageX, ImageY); } // *************************************************************************** // THIS WILL LOAD ONLY FOR RESTART GAME OR TRAVELING BETWEEN LEVELS // FOR SCENARIO GEN, TRAINING, AND FIRST LEVE USE GEOHUDMENU // *************************************************************************** if ( Level.LevelAction == LEVACT_Loading ) { /// Draw background image: irand = (Rand(6) + 1); tex = "sondeermeester.Screenshots.screenshot0" $ irand; if (irand == 5) { if (GeoPC.GetCompany() ~= "geomil") { /// If 5, and geomil, show different image: tex = "sondeermeester.Screenshots.screenshot_geomil"; } } matImage = Material(DynamicLoadObject(tex, class'Material')); LevelImageScale = C.ClipY / 1024.0 / 2.5; CX = (C.ClipX / 2) - (LevelImageScale * 1024.0 / 2); CY = 0.3 * C.ClipY; C.SetPos(CX, CY); C.DrawTileScaled( matImage, LevelImageScale, LevelImageScale); /// Loading tip: // TIPS TipMsg = IL8N("text" $ ((Rand(6)) + 1), "loading"); C.SetPos(0.0, 0.0); if (C.ClipX < 1024) UseSmallFont(C); else UseMediumFont(C); C.DrawTextJustified(TipMsg, 1, 0, 0.45 * C.ClipY, C.ClipX, C.ClipY); BigMessage = IL8N("LoadingMessage"); } if ( Level.LevelAction == LEVACT_Saving ) BigMessage = IL8N("SavingMessage"); else if ( Level.LevelAction == LEVACT_Connecting ) BigMessage = IL8N("ConnectingMessage"); else if ( Level.LevelAction == LEVACT_Precaching ) BigMessage = IL8N("PrecachingMessage"); if ( BigMessage != "" ) { C.DrawColor = PurpleColor; C.Style = ERenderStyle.STY_Normal; UseLargeFont(C); PrintActionMessage(C, BigMessage); return true; } return false; } /// jln - 08-08-2008 Internationalize an item (IL8N); function string IL8N(string item, optional string section) { local string Language; local GeoPlayercontroller GeoPC; GeoPC = GeoPlayerController(Owner); Language = "Language_" $ GeoPC.PlayerLanguage; if (Len(section) > 0) { return Localize( section, item , Language); } else { return Localize(String(self.Class), item , Language); } } // BackPicture=Material'GeoDelft.Backgrounds.Background_cabine4' defaultproperties { MouseCursorTexture=material'GUIContent.MouseCursor' TitleMaterial=Material'GUIContent.SquareBoxA' SmallFont=Font'GeoFonts.SmallFontTex2' MedFont=Font'GeoFonts.NormalFontTex2' BigFont=Font'GeoFonts.LargeFontTex2' LargeFont=Font'GeoFonts.HeaderFontTex1' FontArrayNames(0)="GeoFonts.LargeFontTex3" FontArrayNames(1)="GeoFonts.LargeFontTex2" FontArrayNames(2)="GeoFonts.LargeFontTex2" FontArrayNames(3)="GeoFonts.LargeFontTex1" FontArrayNames(4)="GeoFonts.NormalFontTex2" FontArrayNames(5)="GeoFonts.NormalFontTex1" FontArrayNames(6)="GeoFonts.SmallFontTex3" FontArrayNames(7)="GeoFonts.SmallFontTex2" FontArrayNames(8)="GeoFonts.SmallFontTex1" FontScreenWidthMedium(0)=1600 FontScreenWidthMedium(1)=1600 FontScreenWidthMedium(2)=1600 FontScreenWidthMedium(3)=1600 FontScreenWidthMedium(4)=1280 FontScreenWidthMedium(5)=1024 FontScreenWidthMedium(6)=800 FontScreenWidthMedium(7)=640 FontScreenWidthMedium(8)=0 OnslaughtMapCenterX=0.650000 OnslaughtMapCenterY=0.400000 OnslaughtMapRadius=0.300000 RadarScale=0.200000 RadarTrans=255.000000 IconScale=1.000000 RadarPosX=0.900000 RadarPosY=0.300000 RadarMaxRange=500000.000000 }