make time object more editor friendly

master
Maikel de Vries 2018-03-13 22:32:03 +01:00
parent e084947bcd
commit 3808c22df4
5 changed files with 22 additions and 1 deletions

View File

@ -3,3 +3,6 @@ id=Time
Version=8,0
Category=C4D_StaticBack|C4D_Environment
Picture=0,0,128,128
Width=32
Height=32
Offset=-16,-16

View File

Before

Width:  |  Height:  |  Size: 17 KiB

After

Width:  |  Height:  |  Size: 17 KiB

View File

@ -220,13 +220,26 @@ protected func Initialize()
daycolour_global = [255, 255, 255];
// Set the time to midday (12:00).
SetTime(12*60);
SetTime(12 * 60);
// Add effect that controls time cycle.
SetCycleSpeed(30);
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.
protected func FxIntTimeCycleTimer(object target, proplist effect)
{
@ -411,3 +424,6 @@ public func Definition(def)
/*-- Properties --*/
local Name = "Time";
local Description = "$Description$";
local Visibility = VIS_Editor;
local EditorPlacementLimit = 1;

View File

@ -1,4 +1,5 @@
Time=Zeit
Description=Controls the time of the day and corresponding night time effects.
TimeHelp=Aktuelle Tageszeit in Minuten seit Mitternacht.
CycleSpeed=Tagesgeschwindigkeit
CycleSpeedHelp=Geschwindigkeit des Tag-/Nachtrhythmus in Sekunden pro Tick. Standard 30.

View File

@ -1,4 +1,5 @@
Time=Time
Description=Controls the time of the day and corresponding night time effects.
TimeHelp=Current time of the day in minutes since midnight.
CycleSpeed=Daily cycle speed
CycleSpeedHelp=Speed of the day/night cycle in seconds per tick. Default 30.