From 59e45c45caa1fb90e65022ab38429edab4c15dac Mon Sep 17 00:00:00 2001 From: AJ Kelly Date: Fri, 3 Jun 2011 00:37:04 -0500 Subject: [PATCH] add Profile(PlayerNumber) binding to productivity helpers --- .../Scripts/03 ProductivityHelpers.lua | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/Themes/_fallback/Scripts/03 ProductivityHelpers.lua b/Themes/_fallback/Scripts/03 ProductivityHelpers.lua index efe523ddfa..eb2d64bb9d 100644 --- a/Themes/_fallback/Scripts/03 ProductivityHelpers.lua +++ b/Themes/_fallback/Scripts/03 ProductivityHelpers.lua @@ -223,6 +223,23 @@ end; --[[ ----------------------------------------------------------------------- ]] +--[[ profile stuff ]] +-- Profile(pn) +-- This returns a profile, preferably a player one. +-- If there isn't one, we fall back on the machine profile. +function Profile(pn) + if PROFILEMAN:IsPersistentProfile(pn) then + -- player profile + return PROFILEMAN:GetProfile(pn); + else + -- machine profile + return PROFILEMAN:GetMachineProfile(); + end; +end; +--[[ end profile stuff]] + +--[[ ----------------------------------------------------------------------- ]] + --[[ helper functions ]] function tobool(v) if type(v) == "string" then