add sm-ssc Mouse Test theme

This commit is contained in:
AJ Kelly
2011-02-23 21:23:51 -06:00
parent a89f5a61a6
commit 3e135d8519
8 changed files with 153 additions and 0 deletions
@@ -0,0 +1,3 @@
return Def.Quad{
InitCommand=cmd(Center;FullScreen;diffuse,HSV(192,1,0.8);diffusebottomedge,HSV(192,0.625,0.25));
};
@@ -0,0 +1,51 @@
local t = Def.ActorFrame{
LoadActor(THEME:GetPathG("_click","target"))..{
InitCommand=cmd(diffusealpha,0;Real);
LeftClickMessageCommand=function(self)
MESSAGEMAN:Broadcast("MouseInput", { Input = "Left" });
end;
RightClickMessageCommand=function(self)
MESSAGEMAN:Broadcast("MouseInput", { Input = "Right" });
end;
MiddleClickMessageCommand=function(self)
MESSAGEMAN:Broadcast("MouseInput", { Input = "Middle" });
end;
MouseWheelUpMessageCommand=function(self)
MESSAGEMAN:Broadcast("MouseInput", { Input = "WheelUp" });
end;
MouseWheelDownMessageCommand=function(self)
MESSAGEMAN:Broadcast("MouseInput", { Input = "WheelDown" });
end;
MouseInputMessageCommand=function(self,param)
local cX = INPUTFILTER:GetMouseX()
local cY = INPUTFILTER:GetMouseY()
if param.Input == "Left" then
self:stoptweening()
self:x(cX)
self:y(cY)
self:diffusealpha(1)
self:sleep(1)
self:diffusealpha(0)
end
end
};
LoadFont("common normal")..{
Name="Coords";
InitCommand=cmd(shadowlength,1;zoom,0.5;align,0,1);
MouseInputMessageCommand=function(self,param)
local cX = INPUTFILTER:GetMouseX()
local cY = INPUTFILTER:GetMouseY()
if param.Input == "Left" then
self:stoptweening()
self:x(cX + 8)
self:y(cY + 16)
self:settext("(".. string.format("%i",cX) ..",".. string.format("%i",cY) ..")")
self:diffusealpha(1)
self:sleep(1)
self:diffusealpha(0)
end
end
};
};
return t;
@@ -0,0 +1,32 @@
local t = Def.ActorFrame{};
local mou = Def.ActorFrame{
LoadFont("common normal")..{
Name="Coords";
InitCommand=cmd(align,0,0;x,SCREEN_LEFT+8;y,SCREEN_BOTTOM-48);
};
};
local function UpdateMouse(self)
local coords = self:GetChild("Coords")
local mouseX = INPUTFILTER:GetMouseX()
local mouseY = INPUTFILTER:GetMouseY()
local text = "[Mouse] X: ".. mouseX .." Y: ".. mouseY;
coords:settext(text)
end
mou.InitCommand=cmd(SetUpdateFunction,UpdateMouse);
t[#t+1] = mou;
t[#t+1] = Def.ActorFrame{
LoadFont("Common normal")..{
Name="Title";
Text=THEME:GetString("MouseTest","Title");
InitCommand=cmd(CenterX;y,SCREEN_TOP+28;diffuse,color("#333333"));
};
LoadFont("Common normal")..{
Name="Instructions";
Text=THEME:GetString("MouseTest","Instructions");
InitCommand=cmd(x,SCREEN_LEFT+12;align,0,0;y,SCREEN_TOP+42;diffuse,color("#333333");zoom,16/24;wrapwidthpixels,SCREEN_WIDTH*1.5);
};
};
return t;
@@ -0,0 +1,43 @@
local gc = Var("GameCommand");
local index = gc:GetIndex();
local name = gc:GetName();
local text = gc:GetText();
local itemColors = {
HSV(128, 0.6, 0.85), -- play
HSV(192, 0.6, 0.85), -- options
HSV(160, 0.6, 0.85), -- customization
HSV( 64, 0.6, 0.85), -- edit
HSV( 0, 0.6, 0.85), -- exit
};
local t = Def.ActorFrame{
--[[
Def.Actor{
Name="TitleMenuController";
GainFocusCommand=function(self)
MESSAGEMAN:Broadcast("TitleChange",{NewColor=itemColors[index+1]});
end;
};
]]
LoadFont("Common Normal")..{
Text=Screen.String(text);
InitCommand=cmd(diffuse,color("1,1,1,1"));
DisabledCommand=cmd(diffuse,color("0.5,0.5,0.5,0.85"));
--GainFocusCommand=cmd(stoptweening;linear,0.25;diffuse,itemColors[index+1]);
GainFocusCommand=cmd(stoptweening;linear,0.25;diffuse,color("1,0.2,0.2,1"));
LoseFocusCommand=cmd(stoptweening;linear,0.25;diffuse,color("1,1,1,1"));
};
--[[ begin triangle ]]
Def.Quad{
InitCommand=cmd(x,-SCREEN_WIDTH*0.105;zoomto,8,24;zwrite,true;blend,'BlendMode_NoEffect');
};
Def.Quad{
InitCommand=cmd(x,-SCREEN_WIDTH*0.1;zoomto,12,12;rotationz,45;diffuselowerleft,color("0,0,0,0");ztest,true);
GainFocusCommand=cmd(stoptweening;visible,true);
LoseFocusCommand=cmd(stoptweening;visible,false);
};
--[[ end triangle ]]
};
return t;
Binary file not shown.

After

Width:  |  Height:  |  Size: 341 B

+6
View File
@@ -0,0 +1,6 @@
[Common]
WindowTitle=sm-ssc Mouse Test
[MouseTest]
Title=sm-ssc Mouse Test
Instructions=Move around with the mouse. You'll see some coordinates in the bottom right, and when you click, a target appears.
+3
View File
@@ -0,0 +1,3 @@
[ThemeInfo]
DisplayName=sm-ssc Mouse Test
Author=sm-ssc Developers
+15
View File
@@ -0,0 +1,15 @@
# sm-ssc Mouse Test theme
[Common]
InitialScreen="ScreenTitleMenu"
[ScreenTitleMenu]
IdleTimeoutSeconds=-1
IdleTimeoutScreen="ScreenTitleMenu"
ChoiceNames="1,2"
Choice1="screen,ScreenOptionsService;text,Options"
Choice2="screen,ScreenExit;text,Exit"
[ScreenOptionsService]
PrevScreen="ScreenTitleMenu"
NextScreen="ScreenTitleMenu"