-- -- Autor: BenjamÌn de la Fuente Ranea -- Fecha: 28-11-2008 -- -- Script de carga inicial -- function finalResultsText(_bForeGround) local fontStr = "fontTRN_bg.fnt" local layerFlag = LF_PANELS if _bForeGround then fontStr = "fontTRN_fg.fnt" layerFlag = LF_PANELS + 1 end return { scale = 0.1, font = fontStr, overlap = g_TextOverlap, text = g_Text.finalResults, align = E_ALIGN_LEFT, layer = layerFlag } end function nextText() return { scale = 0.1, font = "fontTRN_fg.fnt", overlap = g_TextOverlap, text = g_Text.nextButton, align = E_ALIGN_LEFT } end function leaveText() return { scale = 0.1, font = "fontTRN_fg.fnt", overlap = g_TextOverlap, text = g_Text.leaveButton, align = E_ALIGN_LEFT } end function finalResultsText(_bForeGround) local fontStr = "fontTRN_bg.fnt" local layerFlag = LF_PANELS if _bForeGround then fontStr = "fontTRN_fg.fnt" layerFlag = LF_PANELS + 1 end return { scale = 0.1, font = fontStr, overlap = g_TextOverlap, text = g_Text.finalResults, align = E_ALIGN_LEFT, layer = layerFlag } end -- Creación del menú principal function initMenu() if ExistsActor("Menu") then DestroyActor("Menu") end DeactivateActor("Circuit") DeactivateActor("Car1") if GameMode == E_MODE_TOURNAMENT then DeactivateActor("Car2") DeactivateActor("Car3") DeactivateActor("Car4") end ChangeCamera("default") --CreateActorGeom("Background", "menu/scrolling_trn_background.mesh", "") DestroyActor("Background") CreateActor("ActorGeom", { name = "Background", model = "garage/garage2D_noAlpha.mesh", camera = "default" }) log("CREATING garage2D_noAlpha") CreateActor("ActorGeom", { name = "Menu", model = "menu/final_results.mesh", layer = LF_PANELS, touchable = true, camera = "default"}) SetEffectParamTexture("Background","garage_noAlpha","g_diffuseTexture", "cup" .. CupSelected .. "_background.pvr") for i = 1, 4, 1 do if IsUserCar(GetCarNameByClasification(i)) then SetEffectParamColor( "name" .. i, "blanco", "g_matDiffuse", {0.87,0.57,0.0,1.0} ) end end if(not ExistsActor("Fade")) then CreateActor("ActorGeom", { name = "Fade", model = "menu/fade_to_black.mesh", camera = "HUD", layer = LF_PANELS+4}) end ActivateActor("Fade") SetActorAnim("Fade", { anim = "menu/fade_black_from_1_to_0.anm", loop = false, }) SetActorAnim("Background", { anim = "menu/scrolling_trn_background.anm", loop = true, }) SetActorAnim("Menu", { anim = "menu/final_results_start.anm", loop = false, velocity = 1.5, }) end function pts(_pos) local carName = GetCarNameByClasification(_pos) local playerId = GetPlayerIdByCarName(carName) return { scale = 0.1, font = "fontTRN_fg.fnt", overlap = g_TextOverlap, text = GetAccumPlayerPoints(playerId) .. " pts", align = E_ALIGN_LEFT, layer = LF_PANELS } end function name(_pos, _bForeGround) local fontStr = "fontTRN_bg.fnt" local layerFlag = LF_PANELS local auxname = "name" if _bForeGround then fontStr = "fontTRN_fg.fnt" layerFlag = LF_PANELS + 1 else auxname = auxname .. "bg" end log(auxname .. _pos) return { scale = 0.08, name = auxname .. _pos, font = fontStr, overlap = g_TextOverlap, text = GetPlayerName(GetCarNameByClasification(_pos)), align = E_ALIGN_LEFT, layer = layerFlag } end function winnerText() return { scale = 0.08, font = "fontTRN_fg.fnt", overlap = g_TextOverlap, text = g_Text.winnerCAPS, align = E_ALIGN_LEFT, layer = LF_PANELS } end function secondText() return { scale = 0.08, font = "fontTRN_fg.fnt", overlap = g_TextOverlap, text = g_Text._2nd, align = E_ALIGN_LEFT, layer = LF_PANELS } end function thirdText() return { scale = 0.08, font = "fontTRN_fg.fnt", overlap = g_TextOverlap, text = g_Text._3rd, align = E_ALIGN_LEFT, layer = LF_PANELS } end function fourthText() return { scale = 0.08, font = "fontTRN_fg.fnt", overlap = g_TextOverlap, text = g_Text._4th, align = E_ALIGN_LEFT, layer = LF_PANELS } end