Add "flip" EditorAction to structures

ipv6
Sven Eberhardt 2016-12-27 09:14:45 -04:00
parent eee156b5ac
commit 16988e76f0
3 changed files with 25 additions and 0 deletions

View File

@ -421,3 +421,22 @@ public func OnRepairMenuHover(id symbol, string action, desc_menu_target, menu_i
GuiUpdateText(text, menu_id, 1, desc_menu_target);
}
public func Flip()
{
// Mirror structure
if (this->~NoConstructionFlip()) return false;
return SetDir(1-GetDir());
}
public func Definition(def, ...)
{
if (!def.EditorProps) def.EditorProps = {};
if (!def->~NoConstructionFlip())
{
if (!def.EditorActions) def.EditorActions = {};
def.EditorActions.flip = { Name="$Flip$", EditorHelp="$FlipHelp$", Command="Flip()" };
}
return _inherited(def, ...);
}

View File

@ -14,3 +14,6 @@ YouNeedAHammer=Es wird ein Hammer benötigt.
YouNeedMaterials=Es werden Materialien benötigt.
MsgNotFullyConstructed=%s ist noch nicht fertig gebaut.|Im Moment sind keine Interaktionen möglich.
Flip=Umdrehen
FlipHelp=Spiegelt das Gebaeude.

View File

@ -14,3 +14,6 @@ YouNeedAHammer=You need a hammer.
YouNeedMaterials=You need some of the required materials to repair this structure.
MsgNotFullyConstructed=%s is not fully constructed yet.|There are no interactions possible at this point.
Flip=Flip
FlipHelp=Mirrors the structure.