forked from Mirrors/openclonk
make time object more editor friendly
parent
a935a9d4ac
commit
0aba4f88fc
|
@ -3,3 +3,6 @@ id=Time
|
||||||
Version=8,0
|
Version=8,0
|
||||||
Category=C4D_StaticBack|C4D_Environment
|
Category=C4D_StaticBack|C4D_Environment
|
||||||
Picture=0,0,128,128
|
Picture=0,0,128,128
|
||||||
|
Width=32
|
||||||
|
Height=32
|
||||||
|
Offset=-16,-16
|
Before Width: | Height: | Size: 17 KiB After Width: | Height: | Size: 17 KiB |
|
@ -220,13 +220,26 @@ protected func Initialize()
|
||||||
daycolour_global = [255, 255, 255];
|
daycolour_global = [255, 255, 255];
|
||||||
|
|
||||||
// Set the time to midday (12:00).
|
// Set the time to midday (12:00).
|
||||||
SetTime(12*60);
|
SetTime(12 * 60);
|
||||||
|
|
||||||
// Add effect that controls time cycle.
|
// Add effect that controls time cycle.
|
||||||
SetCycleSpeed(30);
|
SetCycleSpeed(30);
|
||||||
AddEffect("IntTimeCycle", this, 100, 10, this);
|
AddEffect("IntTimeCycle", this, 100, 10, this);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public func Destruction()
|
||||||
|
{
|
||||||
|
// Only if last object.
|
||||||
|
if (ObjectCount(Find_ID(Time)) > 1)
|
||||||
|
return;
|
||||||
|
// Remove celestial objects.
|
||||||
|
RemoveAll(Find_Func("IsCelestial"));
|
||||||
|
// Reset sky shading and ambience.
|
||||||
|
SetTime(12 * 60);
|
||||||
|
DoSkyShade();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
// Cycles through day and night.
|
// Cycles through day and night.
|
||||||
protected func FxIntTimeCycleTimer(object target, proplist effect)
|
protected func FxIntTimeCycleTimer(object target, proplist effect)
|
||||||
{
|
{
|
||||||
|
@ -411,3 +424,6 @@ public func Definition(def)
|
||||||
/*-- Properties --*/
|
/*-- Properties --*/
|
||||||
|
|
||||||
local Name = "Time";
|
local Name = "Time";
|
||||||
|
local Description = "$Description$";
|
||||||
|
local Visibility = VIS_Editor;
|
||||||
|
local EditorPlacementLimit = 1;
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
Time=Zeit
|
Time=Zeit
|
||||||
|
Description=Controls the time of the day and corresponding night time effects.
|
||||||
TimeHelp=Aktuelle Tageszeit in Minuten seit Mitternacht.
|
TimeHelp=Aktuelle Tageszeit in Minuten seit Mitternacht.
|
||||||
CycleSpeed=Tagesgeschwindigkeit
|
CycleSpeed=Tagesgeschwindigkeit
|
||||||
CycleSpeedHelp=Geschwindigkeit des Tag-/Nachtrhythmus in Sekunden pro Tick. Standard 30.
|
CycleSpeedHelp=Geschwindigkeit des Tag-/Nachtrhythmus in Sekunden pro Tick. Standard 30.
|
|
@ -1,4 +1,5 @@
|
||||||
Time=Time
|
Time=Time
|
||||||
|
Description=Controls the time of the day and corresponding night time effects.
|
||||||
TimeHelp=Current time of the day in minutes since midnight.
|
TimeHelp=Current time of the day in minutes since midnight.
|
||||||
CycleSpeed=Daily cycle speed
|
CycleSpeed=Daily cycle speed
|
||||||
CycleSpeedHelp=Speed of the day/night cycle in seconds per tick. Default 30.
|
CycleSpeedHelp=Speed of the day/night cycle in seconds per tick. Default 30.
|
Loading…
Reference in New Issue