mirror of
https://github.com/exogen/t2-mapper.git
synced 2026-04-20 20:05:37 +00:00
Initial commit
This commit is contained in:
parent
2211ed7650
commit
ebb3dc9cdd
10121 changed files with 801 additions and 4 deletions
47
docs/base/@vl2/scripts.vl2/scripts/gameCanvas.cs
Normal file
47
docs/base/@vl2/scripts.vl2/scripts/gameCanvas.cs
Normal file
|
|
@ -0,0 +1,47 @@
|
|||
function SimSet::removeStable(%this, %object)
|
||||
{
|
||||
if(%this.getCount() < 2)
|
||||
{
|
||||
%this.remove(%object);
|
||||
return;
|
||||
}
|
||||
%last = %this.getObject(%this.getCount() - 1);
|
||||
%this.remove(%object);
|
||||
%this.pushToBack(%last);
|
||||
}
|
||||
|
||||
if(!isObject(GameDialogSet))
|
||||
{
|
||||
new SimSet(GameDialogSet);
|
||||
RootGroup.add(GameDialogSet);
|
||||
}
|
||||
|
||||
function GuiCanvas::setGameMode(%this, %on)
|
||||
{
|
||||
if(%this.gameMode == %on)
|
||||
return;
|
||||
|
||||
%this.gameMode = %on;
|
||||
if(%this.gameMode)
|
||||
{
|
||||
%this.setContent(%this.gameContent);
|
||||
for(%i = 0; %i < GameDialogSet.getCount(); %i++)
|
||||
%this.pushDialog(GameDialogSet.getObject(%i));
|
||||
}
|
||||
else
|
||||
Canvas.setContent(LobbyGui);
|
||||
}
|
||||
|
||||
function GuiCanvas::pushGameDialog(%this, %dialog)
|
||||
{
|
||||
GameDialogSet.add(%dialog);
|
||||
if(%this.gameMode)
|
||||
%this.pushDialog(%dialog);
|
||||
}
|
||||
|
||||
function GuiCanvas::popGameDialog(%this, %dialog)
|
||||
{
|
||||
GameDialogSet.removeStable(%dialog);
|
||||
if(%this.gameMode)
|
||||
%this.popDialog(%dialog);
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue