-- -- Autor: Catalin Marcu -- Date: 20-09-2009 -- -- Main loading script -- local userStats --=============================================================================== function getStatisticsText(index) if (index == 1) then return { scale = 0.095, font = "font4.fnt", overlap = -3, color = {255, 255, 255, 255}, layer = LF_PANELS, vertical = E_VALIGN_CENTER, text = txtStatistics } elseif (index == 2) then return { scale = 0.08, font = "font4.fnt", overlap = -3, color = {0, 0, 0, 255}, layer = LF_PANELS, vertical = E_VALIGN_CENTER, text = txtPlayerPoints .. ": " .. userStats[1] } elseif (index == 3) then return { scale = 0.08, font = "font4.fnt", overlap = -3, color = {0, 0, 0, 255}, layer = LF_PANELS, align = E_ALIGN_RIGHT, vertical = E_VALIGN_CENTER, text = txtTournamentsWon } elseif (index == 4) then return { scale = 0.08, font = "font4.fnt", overlap = -3, color = {0, 0, 0, 255}, layer = LF_PANELS, align = E_ALIGN_RIGHT, vertical = E_VALIGN_CENTER, text = txtRoundsWon } elseif (index == 5) then return { scale = 0.08, font = "font4.fnt", overlap = -3, color = {0, 0, 0, 255}, layer = LF_PANELS, align = E_ALIGN_RIGHT, vertical = E_VALIGN_CENTER, text = txtGoalsScored } elseif (index == 6) then return { scale = 0.08, font = "font4.fnt", overlap = -3, color = {0, 0, 0, 255}, layer = LF_PANELS, align = E_ALIGN_RIGHT, vertical = E_VALIGN_CENTER, text = txtGoalsInRow } elseif (index == 7) then return { scale = 0.08, font = "font4.fnt", overlap = -3, color = {0, 0, 0, 255}, layer = LF_PANELS, align = E_ALIGN_RIGHT, vertical = E_VALIGN_CENTER, text = txtSaves } elseif (index == 8) then return { scale = 0.08, font = "font4.fnt", overlap = -3, color = {0, 0, 0, 255}, layer = LF_PANELS, align = E_ALIGN_RIGHT, vertical = E_VALIGN_CENTER, text = txtSavesInRow } elseif (index < 15) then return { scale = 0.08, font = "font4.fnt", overlap = -3, color = {0, 0, 0, 255}, layer = LF_PANELS, vertical = E_VALIGN_CENTER, text = "" .. userStats[index - 7] } elseif (index < 18) then return { scale = 0.08, font = "font4.fnt", overlap = -3, color = {0, 0, 0, 255}, layer = LF_PANELS, vertical = E_VALIGN_CENTER, text = "" .. userStats[index - 7] .. "%%" } elseif (index == 19) then return { scale = 0.08, font = "font4.fnt", overlap = -3, color = {0, 0, 0, 255}, layer = LF_PANELS, vertical = E_VALIGN_CENTER, text = "" .. (userStats[index - 8]) .. "%%" } end end --=============================================================================== function exitUserStats(functionName) SetActorAnimPenalty("MenuUser", { anim = "Main_menu_userbutton_down.anm", loop = false }) Sound.PlaySound(MenuSounds.Fx.panelOut, false) if (LITE_VERSION == true) then SetActorAnimPenalty("UserStats", { anim = "Screen_statistics_out_lite.anm", loop = false }) else SetActorAnimPenalty("UserStats", { anim = "Screen_statistics_out.anm", loop = false }) end SetActorAnimPenalty("StatsOpenFeint", { anim = "Screen_openfeinttouch_out.anm", loop = false }) EnqueueExecuteScript("UserStats", "destroyUserStats()") EnqueueExecuteScript("UserStats", functionName) currentScreen = SCREEN_MAIN_MENU end --=============================================================================== function destroyUserStats() DestroyActor("UserStats") DestroyActor("StatsOpenFeint") end --=============================================================================== function goToUserStats() userStats = GetUserStats() currentScreen = SCREEN_STATISTICS if (LITE_VERSION == true) then CreateActor("ActorGeom", {name = "UserStats", model = "Screen_statistics_lite.mesh", touchable = true, camera = "backgroundCamera", layer = LF_PANELS}) SetActorAnimPenalty("UserStats", { anim = "Screen_statistics_in_lite.anm", loop = false }) else CreateActor("ActorGeom", {name = "UserStats", model = "Screen_statistics.mesh", touchable = true, camera = "backgroundCamera", layer = LF_PANELS}) SetActorAnimPenalty("UserStats", { anim = "Screen_statistics_in.anm", loop = false }) end Sound.PlaySound(MenuSounds.Fx.panelIn, false) CreateActor("ActorGeom", {name = "StatsOpenFeint", model = "Screen_openfeinttouch.mesh", touchable = true, camera = "backgroundCamera", layer = LF_PANELS}) SetActorAnimPenalty("StatsOpenFeint", { anim = "Screen_openfeinttouch_in.anm", loop = false }) SetActorAnimPenalty("MenuUser", { anim = "Main_menu_userbutton_up.anm", loop = false }) allowBackButton = true end