From ae57a3f2c2eb1bd6a260af71e7b2cc5b060bf015 Mon Sep 17 00:00:00 2001 From: AJ Kelly Date: Sat, 19 May 2012 00:20:30 -0500 Subject: [PATCH] [Actor] Make the xy command a source-code level command. --- Docs/Changelog_sm5.txt | 4 ++++ Themes/_fallback/Scripts/02 Actor.lua | 24 ++++-------------------- src/Actor.cpp | 2 ++ 3 files changed, 10 insertions(+), 20 deletions(-) diff --git a/Docs/Changelog_sm5.txt b/Docs/Changelog_sm5.txt index c3e1f6ea13..fb75636d41 100644 --- a/Docs/Changelog_sm5.txt +++ b/Docs/Changelog_sm5.txt @@ -4,6 +4,10 @@ The StepMania 5 Changelog covers all post-sm-ssc changes. For a list of changes from StepMania 4 alpha 5 to sm-ssc v1.2.5, see Changelog_sm-ssc.txt. ________________________________________________________________________________ +2012/05/19 +---------- +* [Actor] Made the xy command a source-code level command. + 2012/05/17 ---------- * [LoadingWindow_Gtk] Actually resolve the path to the Splash file. [djpohly] diff --git a/Themes/_fallback/Scripts/02 Actor.lua b/Themes/_fallback/Scripts/02 Actor.lua index a86bf5e864..d13ebf13c0 100644 --- a/Themes/_fallback/Scripts/02 Actor.lua +++ b/Themes/_fallback/Scripts/02 Actor.lua @@ -156,25 +156,9 @@ function Actor:scale_or_crop_background() self:zoomto(SCREEN_HEIGHT*graphicAspect,SCREEN_HEIGHT) end --- xy(actorX,actorY) --- Sets the x and y of an actor in one command. -function Actor:xy(actorX,actorY) - self:x(actorX) - self:y(actorY) -end - -function Actor:CenterX() - self:x(SCREEN_CENTER_X) -end - -function Actor:CenterY() - self:y(SCREEN_CENTER_Y) -end - -function Actor:Center() - self:x(SCREEN_CENTER_X) - self:y(SCREEN_CENTER_Y) -end +function Actor:CenterX() self:x(SCREEN_CENTER_X) end +function Actor:CenterY() self:y(SCREEN_CENTER_Y) end +function Actor:Center() self:xy(SCREEN_CENTER_X,SCREEN_CENTER_Y) end function Actor:bezier(...) local a = {...} @@ -392,7 +376,7 @@ function Actor:hidden(bHide) self:visible(not bHide) end --- (c) 2006-2011 Glenn Maynard, SSC +-- (c) 2006-2012 Glenn Maynard, the Spinal Shark Collective, et al. -- All rights reserved. -- -- Permission is hereby granted, free of charge, to any person obtaining a diff --git a/src/Actor.cpp b/src/Actor.cpp index 917f4cc45f..0d5e3411d6 100644 --- a/src/Actor.cpp +++ b/src/Actor.cpp @@ -1351,6 +1351,7 @@ public: static int x( T* p, lua_State *L ) { p->SetX(FArg(1)); return 0; } static int y( T* p, lua_State *L ) { p->SetY(FArg(1)); return 0; } static int z( T* p, lua_State *L ) { p->SetZ(FArg(1)); return 0; } + static int xy( T* p, lua_State *L ) { p->SetXY(FArg(1),FArg(2)); return 0; } static int addx( T* p, lua_State *L ) { p->AddX(FArg(1)); return 0; } static int addy( T* p, lua_State *L ) { p->AddY(FArg(1)); return 0; } static int addz( T* p, lua_State *L ) { p->AddZ(FArg(1)); return 0; } @@ -1569,6 +1570,7 @@ public: ADD_METHOD( x ); ADD_METHOD( y ); ADD_METHOD( z ); + ADD_METHOD( xy ); ADD_METHOD( addx ); ADD_METHOD( addy ); ADD_METHOD( addz );