Add inscription property to guideposts

Now you can set a guidepost message in the editor!
console-destruction
Sven Eberhardt 2016-08-23 02:06:49 -04:00
parent 4ce96cb892
commit 83a5034f63
6 changed files with 60 additions and 3 deletions

View File

@ -1,8 +1,45 @@
/**
@author Dustin Neß (dness.de)
@author Graphics Dustin Neß (dness.de), Script Sven2
*/
protected func Construction()
local Name="$Name$";
local Description="$Description$";
local inscription = "";
// Players can read the sign via the interaction bar.
public func IsInteractable() { return inscription != ""; }
// Adapt appearance in the interaction bar.
public func GetInteractionMetaInfo(object clonk)
{
return { Description = "$MsgRead$", IconName = nil, IconID = GetID(), Selected = false };
}
// Called on player interaction.
public func Interact(object clonk)
{
if (!clonk) return false;
Dialogue->MessageBox(inscription, clonk, this, clonk->GetController(), true);
return true;
}
public func SetInscription(to_text)
{
inscription = to_text ?? "";
return true;
}
// Color for messages
public func GetColor() { return 0xffcf9c1a; }
public func Construction()
{
SetProperty("MeshTransformation", Trans_Mul(Trans_Rotate(RandomX(-180,180),0,10), Trans_Scale(360)));
}
}
public func Definition(def)
{
if (!def.EditorProps) def.EditorProps = {};
def.EditorProps.inscription = { Name="$Inscription$", Type="string", EditorHelp="$InscriptionHelp$", Set="SetInscription", Save="Inscription" };
}

View File

@ -0,0 +1,5 @@
Name=Wegweiser
Description=Kann den richtigen Weg weisen.
MsgRead=Lesen
Inscription=Beschriftung
InscriptionHelp=Text der beim Lesen des Wegweisers angezeigt wird.

View File

@ -0,0 +1,6 @@
Name=Signpost
Description=Can show the right way.
MsgRead=Read
Inscription=Inscription
InscriptionHelp=Text that can be read by interacting with the signpost.

View File

@ -2,6 +2,11 @@
@author Nachtfalter
*/
#include EnvPack_Guidepost
local Name="$Name$";
local Description="$Description$";
protected func Construction()
{
SetProperty("MeshTransformation", Trans_Mul(Trans_Rotate(RandomX(-180,180),0,10), Trans_Scale(130)));

View File

@ -0,0 +1,2 @@
Name=Wegweiser
Description=Kann den richtigen Weg weisen.

View File

@ -0,0 +1,2 @@
Name=Signpost
Description=Can show the right way.