mirror of
https://github.com/infinitefusion/infinitefusion-e18.git
synced 2025-12-09 06:04:59 +00:00
Refactoring, documenting deprecated methods
This commit is contained in:
@@ -38,45 +38,45 @@ module PBDayNight
|
||||
@dayNightToneLastUpdate = nil
|
||||
@oneOverSixty = 1/60.0
|
||||
|
||||
# Returns true if it's day.
|
||||
# Returns true if it's day.
|
||||
def self.isDay?(time=nil)
|
||||
time = pbGetTimeNow if !time
|
||||
return (time.hour>=5 && time.hour<20)
|
||||
end
|
||||
|
||||
# Returns true if it's night.
|
||||
# Returns true if it's night.
|
||||
def self.isNight?(time=nil)
|
||||
time = pbGetTimeNow if !time
|
||||
return (time.hour>=20 || time.hour<5)
|
||||
end
|
||||
|
||||
# Returns true if it's morning.
|
||||
# Returns true if it's morning.
|
||||
def self.isMorning?(time=nil)
|
||||
time = pbGetTimeNow if !time
|
||||
return (time.hour>=5 && time.hour<10)
|
||||
end
|
||||
|
||||
# Returns true if it's the afternoon.
|
||||
# Returns true if it's the afternoon.
|
||||
def self.isAfternoon?(time=nil)
|
||||
time = pbGetTimeNow if !time
|
||||
return (time.hour>=14 && time.hour<17)
|
||||
end
|
||||
|
||||
# Returns true if it's the evening.
|
||||
# Returns true if it's the evening.
|
||||
def self.isEvening?(time=nil)
|
||||
time = pbGetTimeNow if !time
|
||||
return (time.hour>=17 && time.hour<20)
|
||||
end
|
||||
|
||||
# Gets a number representing the amount of daylight (0=full night, 255=full day).
|
||||
# Gets a number representing the amount of daylight (0=full night, 255=full day).
|
||||
def self.getShade
|
||||
time = pbGetDayNightMinutes
|
||||
time = (24*60)-time if time>(12*60)
|
||||
return 255*time/(12*60)
|
||||
end
|
||||
|
||||
# Gets a Tone object representing a suggested shading
|
||||
# tone for the current time of day.
|
||||
# Gets a Tone object representing a suggested shading
|
||||
# tone for the current time of day.
|
||||
def self.getTone
|
||||
@cachedTone = Tone.new(0,0,0) if !@cachedTone
|
||||
return @cachedTone if !Settings::TIME_SHADING
|
||||
@@ -95,8 +95,6 @@ module PBDayNight
|
||||
|
||||
private
|
||||
|
||||
# Internal function
|
||||
|
||||
def self.getToneInternal
|
||||
# Calculates the tone for the current frame, used for day/night effects
|
||||
realMinutes = pbGetDayNightMinutes
|
||||
|
||||
Reference in New Issue
Block a user