2011-04-29 14:58:59 -04:00
|
|
|
local function PlayerName(player)
|
|
|
|
|
local puns = {
|
|
|
|
|
--TODO: add moar...
|
|
|
|
|
["asd"] = "qwe";
|
|
|
|
|
["qwe"] = "asd";
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
return LoadFont("_arial black 20px")..{
|
|
|
|
|
--Text="PlaceHolder";
|
2013-07-03 18:38:57 -04:00
|
|
|
InitCommand=function(self)
|
|
|
|
|
self:zoomx(1);
|
|
|
|
|
end;
|
2011-04-29 14:58:59 -04:00
|
|
|
SetCommand=function(self)
|
|
|
|
|
self:settext("");
|
|
|
|
|
if PROFILEMAN:IsPersistentProfile(player) then
|
|
|
|
|
local profile = PROFILEMAN:GetProfile(player)
|
|
|
|
|
local name = profile:GetDisplayName()
|
|
|
|
|
|
|
|
|
|
if name == "" then
|
|
|
|
|
name = string.gsub(player,"Number_P"," ")
|
|
|
|
|
end
|
|
|
|
|
--max 20 chars ºvº
|
|
|
|
|
name = string.sub(name,1,20)
|
|
|
|
|
--name = puns[name] or name
|
|
|
|
|
|
|
|
|
|
self:settext(name)
|
|
|
|
|
end
|
|
|
|
|
end;
|
2013-07-03 18:38:57 -04:00
|
|
|
PlayerJoinedMessageCommand=function(self)
|
|
|
|
|
self:playcommand("Set");
|
|
|
|
|
end;
|
|
|
|
|
CoinInsertedMessageCommand=function(self)
|
|
|
|
|
self:playcommand("Set");
|
|
|
|
|
end;
|
|
|
|
|
CoinModeChangedMessageCommand=function(self)
|
|
|
|
|
self:playcommand("Set");
|
|
|
|
|
end;
|
|
|
|
|
ScreenChangedMessageCommand=function(self)
|
|
|
|
|
self:playcommand("Set");
|
|
|
|
|
end;
|
|
|
|
|
StorageDevicesChangedMessageCommand=function(self)
|
|
|
|
|
self:playcommand("Set");
|
|
|
|
|
end;
|
2011-04-29 14:58:59 -04:00
|
|
|
};
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
return Def.ActorFrame {
|
|
|
|
|
LoadFont("_fixedsys")..{
|
2013-07-03 18:38:57 -04:00
|
|
|
InitCommand=function(self)
|
|
|
|
|
self:blend('BlendMode_Add');
|
|
|
|
|
self:xy(10, 5);
|
|
|
|
|
self:shadowlength(0);
|
|
|
|
|
self:Stroke(0, 0, 0, 1);
|
|
|
|
|
self:wrapwidthpixels(SCREEN_WIDTH * 0.45);
|
|
|
|
|
self:maxwidth(SCREEN_WIDTH * 0.45);
|
|
|
|
|
self:horizalign(left);
|
|
|
|
|
self:SetTextureFiltering(false);
|
|
|
|
|
self:vertalign(top);
|
|
|
|
|
self:zoom(1.5);
|
|
|
|
|
end;
|
2011-04-29 14:58:59 -04:00
|
|
|
SystemMessageMessageCommand=function(self,params)
|
|
|
|
|
self:settext(params.Message);
|
|
|
|
|
self:finishtweening();
|
|
|
|
|
self:diffusealpha(1);
|
|
|
|
|
self:sleep(3);
|
|
|
|
|
self:diffusealpha(0);
|
|
|
|
|
end;
|
2013-07-03 18:38:57 -04:00
|
|
|
HideSystemMessageMessageCommand=function(self)
|
|
|
|
|
self:finishtweening();
|
|
|
|
|
end;
|
2011-04-29 14:58:59 -04:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
LoadFont("_arial black 20px")..{
|
2013-07-03 18:38:57 -04:00
|
|
|
InitCommand=function(self)
|
|
|
|
|
self:xy(SCREEN_CENTER_X, SCREEN_HEIGHT - 20);
|
|
|
|
|
self:zoom(1);
|
|
|
|
|
self:shadowlength(0);
|
|
|
|
|
self:playcommand("Text");
|
|
|
|
|
end;
|
2011-04-29 14:58:59 -04:00
|
|
|
TextCommand=function(self)
|
2013-06-08 17:28:54 -04:00
|
|
|
if GAMESTATE:GetCoinMode() == 'CoinMode_Home' then
|
2011-04-29 14:58:59 -04:00
|
|
|
self:settext("Home Mode");
|
2013-06-08 17:28:54 -04:00
|
|
|
else
|
|
|
|
|
self:settext("Free Play")
|
2011-04-29 14:58:59 -04:00
|
|
|
end
|
|
|
|
|
end;
|
2013-07-03 18:38:57 -04:00
|
|
|
PlayerJoinedMessageCommand=function(self)
|
|
|
|
|
self:playcommand("Text");
|
|
|
|
|
end;
|
|
|
|
|
CoinInsertedMessageCommand=function(self)
|
|
|
|
|
self:playcommand("Text");
|
|
|
|
|
end;
|
|
|
|
|
CoinModeChangedMessageCommand=function(self)
|
|
|
|
|
self:playcommand("Text");
|
|
|
|
|
end;
|
|
|
|
|
ScreenChangedMessageCommand=function(self)
|
|
|
|
|
self:playcommand("Text");
|
|
|
|
|
end;
|
2011-04-29 14:58:59 -04:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
ScreenChangedMessageCommand=function(self)
|
|
|
|
|
self:visible(THEME:GetMetric(SCREENMAN:GetTopScreen():GetName(),"ShowCreditDisplay"));
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
PlayerName(PLAYER_1)..{
|
2013-07-03 18:38:57 -04:00
|
|
|
InitCommand=function(self)
|
|
|
|
|
self:xy(20, SCREEN_HEIGHT - 20);
|
|
|
|
|
self:horizalign(left);
|
|
|
|
|
end;
|
2011-04-29 14:58:59 -04:00
|
|
|
};
|
|
|
|
|
PlayerName(PLAYER_2)..{
|
2013-07-03 18:38:57 -04:00
|
|
|
InitCommand=function(self)
|
|
|
|
|
self:xy(SCREEN_WIDTH - 20, SCREEN_HEIGHT - 20);
|
|
|
|
|
self:horizalign(right);
|
|
|
|
|
end;
|
2011-04-29 14:58:59 -04:00
|
|
|
};
|
|
|
|
|
}
|