-- -- Autor: BenjamÌn de la Fuente Ranea -- Fecha: 28-11-2008 -- -- Script de carga inicial -- function raceText() return { scale = 0.1, font = "fontTRN_fg.fnt", overlap = g_TextOverlap, text = g_Text.raceButton, align = E_ALIGN_LEFT } end function quitText() return { scale = 0.1, font = "fontTRN_fg.fnt", overlap = g_TextOverlap, text = g_Text.leaveButton, align = E_ALIGN_LEFT } end function racePartialResultText(_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.nextRace, align = E_ALIGN_LEFT, layer = layerFlag } end function ptsletters(_pos, _bForeGround) --local carName = GetCarNameByClasification(_pos) --local playerId = GetPlayerIdByCarName(carName) local fontStr = "fontTRN_bg.fnt" local layerFlag = LF_PANELS local auxname = "ptsletters" 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 = g_Text.pts, align = E_ALIGN_LEFT, layer = layerFlag } end function pts(_pos, _bForeGround) local carName = GetCarNameByClasification(_pos) local playerId = GetPlayerIdByCarName(carName) local fontStr = "fontTRN_bg.fnt" local layerFlag = LF_PANELS local auxname = "pts" 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 = GetAccumPlayerPoints(playerId) .. "", align = E_ALIGN_LEFT, layer = layerFlag } 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 function first() return { scale = 0.1, font = "fontTRN_fg.fnt", overlap = g_TextOverlap, text = g_Text._1st, align = E_ALIGN_LEFT, layer = LF_PANELS+1 } end function second() return { scale = 0.1, font = "fontTRN_fg.fnt", overlap = g_TextOverlap, text = g_Text._2nd, align = E_ALIGN_LEFT, layer = LF_PANELS+1 } end function third() return { scale = 0.1, font = "fontTRN_fg.fnt", overlap = g_TextOverlap, text = g_Text._3rd, align = E_ALIGN_LEFT, layer = LF_PANELS+1 } end function fourth() return { scale = 0.1, font = "fontTRN_fg.fnt", overlap = g_TextOverlap, text = g_Text._4th, align = E_ALIGN_LEFT, layer = LF_PANELS+1 } end function firstpts() return { scale = 0.1, font = "fontTRN_fg.fnt", overlap = g_TextOverlap, text = g_Text.pts, align = E_ALIGN_LEFT, layer = LF_PANELS+1 } end function secondpts() return { scale = 0.1, font = "fontTRN_fg.fnt", overlap = g_TextOverlap, text = g_Text.pts, align = E_ALIGN_LEFT, layer = LF_PANELS+1 } end function thirdpts() return { scale = 0.1, font = "fontTRN_fg.fnt", overlap = g_TextOverlap, text = g_Text.pts, align = E_ALIGN_LEFT, layer = LF_PANELS+1 } end function fourthpts() return { scale = 0.1, font = "fontTRN_fg.fnt", overlap = g_TextOverlap, text = g_Text.pts, align = E_ALIGN_LEFT, layer = LF_PANELS+1 } end function classification(_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.085, font = fontStr, overlap = g_TextOverlap, text = g_Text.classification, align = E_ALIGN_LEFT, layer = layerFlag } end function cup_name() return { scale = 0.09, font = "fontTRN_fg.fnt", overlap = g_TextOverlap, text = g_cupNamesAlias["cup" .. CupSelected], align = E_ALIGN_LEFT, layer = LF_PANELS+1 } end function race_name_tournament() return { scale = 0.065, font = "fontTRN_fg.fnt", overlap = g_TextOverlap, text = TrackSelected + 1 .. "- " .. g_trackInfo[CupSelected][TrackSelected + 1].comercialName, align = E_ALIGN_LEFT, layer = LF_PANELS+1 } end function race_order_number() return { scale = 0.065, font = "fontTRN_fg.fnt", overlap = -20, text = "Race " .. TrackSelected + 1 .. " of 6", align = E_ALIGN_LEFT, layer = LF_PANELS+1 } end function cup_altname() return { scale = 0.065, font = "fontTRN_fg.fnt", overlap = -20, text = string.upper(g_cupNames["cup" .. CupSelected]), align = E_ALIGN_LEFT, layer = LF_PANELS+1 } 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") DestroyActor("Background") CreateActor("ActorGeom", { name = "Background", model = "garage/garage2D_noAlpha.mesh" }) CreateActor("ActorGeom", { name = "Menu", model = "menu/race_partial_results.mesh", layer = LF_PANELS, touchable = true }) --cambio el fondo SetEffectParamTexture("Background","garage_noAlpha","g_diffuseTexture", "cup" .. CupSelected .. "_background.pvr") --cambio el color de la llama if(CupSelected == 1) then SetEffectParamColor( "Menu", "menu_tint", "g_matDiffuse", {0,0,0,1.0}) SetEffectParamColor( "Menu", "menu_tint", "g_ambientColor", {0.514,0.735,0.977,1.0} ) elseif(CupSelected == 2) then SetEffectParamColor( "Menu", "menu_tint", "g_matDiffuse", {0,0,0,1.0}) SetEffectParamColor( "Menu", "menu_tint", "g_ambientColor", {1.0,1.0,0.28,1.0} ) elseif(CupSelected == 3) then SetEffectParamColor( "Menu", "menu_tint", "g_matDiffuse", {0,0,0,1.0}) SetEffectParamColor( "Menu", "menu_tint", "g_ambientColor", {0.769,0.190,0.190,1.0} ) end --coloreo la fila del coche mio de naranja 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} ) SetEffectParamColor( "pts" .. i, "blanco", "g_matDiffuse", {0.87,0.57,0.0,1.0} ) end end --fade_in if(TrackSelected > 1) then if(not ExistsActor("Fade")) then CreateActor("ActorGeom", { name = "Fade", model = "menu/fade_to_black.mesh", camera = "HUD", layer = LF_PANELS+1}) end SetActorAnim("Fade", { anim = "menu/fade_black_from_1_to_0.anm", loop = false, }) end --animo el fondo --SetActorAnim("Background", "menu/scrolling_trn_background.anm", true, "") --entrada SetActorAnim("Menu", { anim = "menu/race_partial_results_start.anm", loop = false, velocity = 1.5, }) end