-- -- 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.backButton, 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 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) .. " pts", 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("g_driverNames[" .. UserLevel + 1 .. "][" .. _pos .. "]") local auxText if _pos == 1 then auxText = ComposeSNSSUserName(12, "YOU") else auxText = g_driverNames[CupSelected][UserLevel + 1][_pos] end --log(auxname .. _pos) return { scale = 0.08, name = auxname .. _pos, font = fontStr, overlap = g_TextOverlap, text = auxText, 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 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 = g_trackInfo[CupSelected][TrackSelected].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 .. " 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 initFirstRaceMenu() 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/first_race_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 SetEffectParamColor( "name1", "blanco", "g_matDiffuse", {0.87,0.57,0.0,1.0} ) SetEffectParamColor( "pts1", "blanco", "g_matDiffuse", {0.87,0.57,0.0,1.0} ) --entrada SetActorAnim("Menu", { anim = "menu/first_race_start.anm", loop = false, velocity = 1.5, }) DollStates.destroy() --EnqueueExecuteScript("Menu", "DollStates.destroy()") end destroyGarage() if(currentMenuScreen ~= nil) then currentMenuScreen:postFreeScreenResources() end currentMenuScreen = TPreRaceMenuScreen:new() currentMenuScreen:resetScreen() initFirstRaceMenu()