From c43f983b4efc24b9bb96b0dd400dc3835ad9bc7c Mon Sep 17 00:00:00 2001 From: Colby Klein Date: Sat, 31 Dec 2011 18:52:36 -0800 Subject: [PATCH 1/5] Add 32log to global scripts dir. This will be useful. --- Scripts/32log.lua | 39 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) create mode 100644 Scripts/32log.lua diff --git a/Scripts/32log.lua b/Scripts/32log.lua new file mode 100644 index 0000000000..340bc39df1 --- /dev/null +++ b/Scripts/32log.lua @@ -0,0 +1,39 @@ +--[[ +-- 32 lines of goodness. +-- Links to original source of code and usage documentation: +-- http://love2d.org/wiki/32_lines_of_goodness +-- http://love2d.org/forums/viewtopic.php?f=5&t=3344 +--]] + +local mt_class = {} + +function mt_class:extends(parent) + self.super = parent + setmetatable(mt_class, {__index = parent}) + parent.__members__ = parent.__members__ or {} + return self +end + +local function define(class, members) + class.__members__ = class.__members__ or {} + for k, v in pairs(members) do + class.__members__[k] = v + end + function class:new(...) + local newvalue = {} + for k, v in pairs(class.__members__) do + newvalue[k] = v + end + setmetatable(newvalue, {__index = class}) + if newvalue.__init then + newvalue:__init(...) + end + return newvalue + end +end + +function class(name) + local newclass = {} + _G[name] = newclass + return setmetatable(newclass, {__index = mt_class, __call = define}) +end From d844e539543455dce5c769d3fd719f1cbd6c72e7 Mon Sep 17 00:00:00 2001 From: Colby Klein Date: Sat, 31 Dec 2011 18:53:24 -0800 Subject: [PATCH 2/5] argh --- Xcode/stepmania.xcodeproj/project.pbxproj | 2 -- 1 file changed, 2 deletions(-) diff --git a/Xcode/stepmania.xcodeproj/project.pbxproj b/Xcode/stepmania.xcodeproj/project.pbxproj index 85789e1c2a..d482cfbef8 100644 --- a/Xcode/stepmania.xcodeproj/project.pbxproj +++ b/Xcode/stepmania.xcodeproj/project.pbxproj @@ -1986,7 +1986,6 @@ 2BD6E14013D78FAD008443DB /* uncompr.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = uncompr.c; sourceTree = ""; }; 2BD6E14113D78FAD008443DB /* zutil.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = zutil.c; sourceTree = ""; }; 2BD6E14213D78FAD008443DB /* zutil.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = zutil.h; sourceTree = ""; }; - 2BD91A791470DE4C008812C5 /* libjpeg.8.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = libjpeg.8.dylib; path = usr/local/lib/libjpeg.8.dylib; sourceTree = SDKROOT; }; 2BDB88B2137201F700E6FD3A /* lapi.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = lapi.c; path = "../extern/lua-5.1/src/lapi.c"; sourceTree = SOURCE_ROOT; }; 2BDB88B3137201F700E6FD3A /* lapi.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = lapi.h; path = "../extern/lua-5.1/src/lapi.h"; sourceTree = SOURCE_ROOT; }; 2BDB88B4137201F700E6FD3A /* lauxlib.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = lauxlib.c; path = "../extern/lua-5.1/src/lauxlib.c"; sourceTree = SOURCE_ROOT; }; @@ -5117,7 +5116,6 @@ AA21E4770A9826CD00684CEA /* libtheora_link.a */, AA21E4780A9826CD00684CEA /* libvorbis_link.a */, AA059E2A0B8F0C66006F8139 /* libz_link.a */, - 2BD91A791470DE4C008812C5 /* libjpeg.8.dylib */, ); path = Libraries; sourceTree = ""; From 7a7c72f2872855a7d8ee72cbd7b6d031bf3659c9 Mon Sep 17 00:00:00 2001 From: Flameshadowxeroshin Date: Mon, 2 Jan 2012 05:42:08 +0000 Subject: [PATCH 3/5] make juke'm box work? --- Themes/_fallback/metrics.ini | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Themes/_fallback/metrics.ini b/Themes/_fallback/metrics.ini index 1760cba4f1..a6bd8bac64 100644 --- a/Themes/_fallback/metrics.ini +++ b/Themes/_fallback/metrics.ini @@ -1675,7 +1675,7 @@ UpdateOnMessage="" # NumChoicesOnPage1=100 DefaultChoice="GameStart" -ChoiceNames="GameStart,Options,Edit,Exit" +ChoiceNames="GameStart,Options,Edit,Jukebox,Exit" ChoiceGameStart="applydefaultoptions;text,Game Start;screen,"..Branch.StartGame() #ChoiceQuickPlay="applydefaultoptions;text,Quick Play;" ChoiceOptions="screen,ScreenOptionsService;text,Options" From b2c345442865e66bb0cf9243fa92547d75049c78 Mon Sep 17 00:00:00 2001 From: Flameshadowxeroshin Date: Mon, 2 Jan 2012 06:07:24 +0000 Subject: [PATCH 4/5] add GameState:GetEnabledPlayers --- src/GameState.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/GameState.cpp b/src/GameState.cpp index 3b27cd9f11..34e8337c99 100644 --- a/src/GameState.cpp +++ b/src/GameState.cpp @@ -2401,6 +2401,14 @@ public: LuaHelpers::CreateTableFromArray( vHP, L ); return 1; } + static int GetEnabledPlayers(T* p, lua_State *L ) + { + vector vEP; + FOREACH_EnabledPlayer( pn ) + vEP.push_back( pn ); + LuaHelpers::CreateTableFromArray( vEP, L ); + return 1; + } static int GetCurrentStyle( T* p, lua_State *L ) { Style *pStyle = const_cast