DayTime, Level & PlayerSkin improvements

* Changed the DayTime enum name to DayTimes for consistency with other enums like Seasons
* Changing the EnvironmentType or WeatherType will now not reset back to the default when Reloading a map with the R key (Warping or loading a different map normally does reset those properties)
* @level.setdaytime(int) is now @environment.setdaytime(int), which sets the DayTime permanently across maps. Setting the daytime to any other value than 1 2 3 or 4 will reset the daytime to the default one
* Added command @player.setskin(name) which will permanently change the player's skin, unlike @player.wearskin(name) which only changes the skin temporarily.
This commit is contained in:
JappaWakka 2022-02-17 13:46:15 +01:00
parent 0c7600e4f4
commit 2c7fbf8364
11 changed files with 138 additions and 115 deletions

View File

@ -427,7 +427,7 @@
r = New ReactionContainer("<name> is looking~up at the sky.", MessageBulb.NotifcationTypes.Waiting) r = New ReactionContainer("<name> is looking~up at the sky.", MessageBulb.NotifcationTypes.Waiting)
End If End If
Case 27 Case 27
If IsOutside() = True And World.GetTime() = World.DayTime.Night And World.GetCurrentRegionWeather() = World.Weathers.Clear Then If IsOutside() = True And World.GetTime() = World.DayTimes.Night And World.GetCurrentRegionWeather() = World.Weathers.Clear Then
r = New ReactionContainer("Your Pokémon is happily~gazing at the beautiful,~starry sky!", MessageBulb.NotifcationTypes.Waiting) r = New ReactionContainer("Your Pokémon is happily~gazing at the beautiful,~starry sky!", MessageBulb.NotifcationTypes.Waiting)
End If End If
Case 28 Case 28
@ -437,7 +437,7 @@
r = New ReactionContainer("<name> is looking~up at the ceiling.", MessageBulb.NotifcationTypes.Note) r = New ReactionContainer("<name> is looking~up at the ceiling.", MessageBulb.NotifcationTypes.Note)
End If End If
Case 30 Case 30
If IsOutside() = True And World.GetTime() = World.DayTime.Night Then If IsOutside() = True And World.GetTime() = World.DayTimes.Night Then
r = New ReactionContainer("Your Pokémon is staring~spellbound at the night sky!", MessageBulb.NotifcationTypes.Friendly) r = New ReactionContainer("Your Pokémon is staring~spellbound at the night sky!", MessageBulb.NotifcationTypes.Friendly)
End If End If
Case 31 Case 31

View File

@ -209,13 +209,13 @@
Core.SpriteBatch.Draw(TextureManager.GetTexture("GUI\Menus\pokegear"), New Rectangle(CInt(startPos.X + 34 + FontManager.MiniFont.MeasureString(t2).X), CInt(startPos.Y + 8), 16, 16), New Rectangle(112, 112, 16, 16), Color.White) Core.SpriteBatch.Draw(TextureManager.GetTexture("GUI\Menus\pokegear"), New Rectangle(CInt(startPos.X + 34 + FontManager.MiniFont.MeasureString(t2).X), CInt(startPos.Y + 8), 16, 16), New Rectangle(112, 112, 16, 16), Color.White)
End If End If
Select Case World.GetTime Select Case World.GetTime
Case World.DayTime.Night Case World.DayTimes.Night
Core.SpriteBatch.Draw(TextureManager.GetTexture("GUI\Menus\pokegear"), New Rectangle(CInt(startPos.X + width - FontManager.MiniFont.MeasureString(t).X - 34), CInt(startPos.Y + 6), 16, 16), New Rectangle(64, 112, 8, 8), Color.White) Core.SpriteBatch.Draw(TextureManager.GetTexture("GUI\Menus\pokegear"), New Rectangle(CInt(startPos.X + width - FontManager.MiniFont.MeasureString(t).X - 34), CInt(startPos.Y + 6), 16, 16), New Rectangle(64, 112, 8, 8), Color.White)
Case World.DayTime.Morning Case World.DayTimes.Morning
Core.SpriteBatch.Draw(TextureManager.GetTexture("GUI\Menus\pokegear"), New Rectangle(CInt(startPos.X + width - FontManager.MiniFont.MeasureString(t).X - 34), CInt(startPos.Y + 6), 16, 16), New Rectangle(72, 112, 8, 8), Color.White) Core.SpriteBatch.Draw(TextureManager.GetTexture("GUI\Menus\pokegear"), New Rectangle(CInt(startPos.X + width - FontManager.MiniFont.MeasureString(t).X - 34), CInt(startPos.Y + 6), 16, 16), New Rectangle(72, 112, 8, 8), Color.White)
Case World.DayTime.Day Case World.DayTimes.Day
Core.SpriteBatch.Draw(TextureManager.GetTexture("GUI\Menus\pokegear"), New Rectangle(CInt(startPos.X + width - FontManager.MiniFont.MeasureString(t).X - 34), CInt(startPos.Y + 6), 16, 16), New Rectangle(64, 120, 8, 8), Color.White) Core.SpriteBatch.Draw(TextureManager.GetTexture("GUI\Menus\pokegear"), New Rectangle(CInt(startPos.X + width - FontManager.MiniFont.MeasureString(t).X - 34), CInt(startPos.Y + 6), 16, 16), New Rectangle(64, 120, 8, 8), Color.White)
Case World.DayTime.Evening Case World.DayTimes.Evening
Core.SpriteBatch.Draw(TextureManager.GetTexture("GUI\Menus\pokegear"), New Rectangle(CInt(startPos.X + width - FontManager.MiniFont.MeasureString(t).X - 34), CInt(startPos.Y + 6), 16, 16), New Rectangle(72, 120, 8, 8), Color.White) Core.SpriteBatch.Draw(TextureManager.GetTexture("GUI\Menus\pokegear"), New Rectangle(CInt(startPos.X + width - FontManager.MiniFont.MeasureString(t).X - 34), CInt(startPos.Y + 6), 16, 16), New Rectangle(72, 120, 8, 8), Color.White)
End Select End Select
End Sub End Sub
@ -1541,7 +1541,7 @@
Public OverwriteMax As Decimal Public OverwriteMax As Decimal
Public Name As String = "" Public Name As String = ""
Public Region As String = "" Public Region As String = ""
Public DayTimes As New List(Of World.DayTime) Public DayTimes As New List(Of World.DayTimes)
Public Expansions As New List(Of String) Public Expansions As New List(Of String)
Public Music As String = "" Public Music As String = ""
Public Content As String = "" Public Content As String = ""
@ -1576,7 +1576,7 @@
Dim lDayTimes() As String = data(4).Split(CChar(",")) Dim lDayTimes() As String = data(4).Split(CChar(","))
For Each daytime As String In lDayTimes For Each daytime As String In lDayTimes
If StringHelper.IsNumeric(daytime) = True Then If StringHelper.IsNumeric(daytime) = True Then
DayTimes.Add(CType(CInt(daytime), World.DayTime)) DayTimes.Add(CType(CInt(daytime), World.DayTimes))
End If End If
Next Next

View File

@ -72,25 +72,25 @@ Public Class PressStartScreen
Dim dayTime = World.GetTime Dim dayTime = World.GetTime
Select Case dayTime Select Case dayTime
Case World.DayTime.Morning Case World.DayTimes.Morning
_fromColor = New Color(246, 170, 109) _fromColor = New Color(246, 170, 109)
_toColor = New Color(248, 248, 248) _toColor = New Color(248, 248, 248)
_textColor = Color.Black _textColor = Color.Black
Case World.DayTime.Day Case World.DayTimes.Day
_fromColor = New Color(120, 160, 248) _fromColor = New Color(120, 160, 248)
_toColor = New Color(248, 248, 248) _toColor = New Color(248, 248, 248)
_textColor = Color.Black _textColor = Color.Black
Case World.DayTime.Evening Case World.DayTimes.Evening
_fromColor = New Color(32, 64, 168) _fromColor = New Color(32, 64, 168)
_toColor = New Color(40, 80, 88) _toColor = New Color(40, 80, 88)
_textColor = Color.White _textColor = Color.White
Case World.DayTime.Night Case World.DayTimes.Night
_fromColor = New Color(32, 64, 168) _fromColor = New Color(32, 64, 168)
_toColor = New Color(0, 0, 0) _toColor = New Color(0, 0, 0)
_textColor = Color.White _textColor = Color.White
End Select End Select
If dayTime = World.DayTime.Day OrElse dayTime = World.DayTime.Morning Then If dayTime = World.DayTimes.Day OrElse dayTime = World.DayTimes.Morning Then
Dim clouds = New Scene.Clouds() Dim clouds = New Scene.Clouds()
clouds.LoadContent() clouds.LoadContent()
_entities.Add(clouds) _entities.Add(clouds)
@ -787,7 +787,7 @@ Public Class NewMainMenuScreen
Dim fontColor As Color = Color.White Dim fontColor As Color = Color.White
Dim dayTime = World.GetTime Dim dayTime = World.GetTime
If dayTime = World.DayTime.Day OrElse dayTime = World.DayTime.Morning Then If dayTime = World.DayTimes.Day OrElse dayTime = World.DayTimes.Morning Then
fontColor = Color.Black fontColor = Color.Black
End If End If

View File

@ -50,6 +50,16 @@
End Select End Select
Case "toggledarkness" Case "toggledarkness"
Screen.Level.IsDark = Not Screen.Level.IsDark Screen.Level.IsDark = Not Screen.Level.IsDark
Case "setdaytime"
Dim daytime As Integer = int(argument)
If daytime > 0 AndAlso daytime <= 4 Then
World.setDaytime = CType(daytime, World.DayTimes)
Screen.Level.DayTime = daytime
Else
World.setDaytime = Nothing
Screen.Level.DayTime = World.GetTime
End If
IsReady = True
End Select End Select
Screen.Level.World.Initialize(Screen.Level.EnvironmentType, Screen.Level.WeatherType) Screen.Level.World.Initialize(Screen.Level.EnvironmentType, Screen.Level.WeatherType)

View File

@ -69,9 +69,6 @@
Case "setsafari" Case "setsafari"
Screen.Level.IsSafariZone = CBool(argument) Screen.Level.IsSafariZone = CBool(argument)
IsReady = True IsReady = True
Case "setdaytime"
Screen.Level.DayTime = CInt(argument)
IsReady = True
End Select End Select
End Sub End Sub

View File

@ -41,6 +41,15 @@
.UpdateEntity() .UpdateEntity()
End With End With
IsReady = True IsReady = True
Case "setskin"
Core.Player.Skin = argument
With Screen.Level.OwnPlayer
Dim TextureID As String = argument
.SetTexture(TextureID, False)
.UpdateEntity()
End With
IsReady = True
Case "move" Case "move"
If Started = False Then If Started = False Then
Screen.Camera.Move(sng(argument)) Screen.Camera.Move(sng(argument))

View File

@ -204,7 +204,6 @@ Namespace ScriptVersion2
r(New ScriptCommand("level", "waitforsave", "Makes the level idle until the current saving of an GameJolt save is done.")) r(New ScriptCommand("level", "waitforsave", "Makes the level idle until the current saving of an GameJolt save is done."))
r(New ScriptCommand("level", "reload", "Reloads the current map.")) r(New ScriptCommand("level", "reload", "Reloads the current map."))
r(New ScriptCommand("level", "setsafari", {New ScriptArgument("safari", ScriptArgument.ArgumentTypes.Bool)}.ToList(), "Sets if the current map is a Safari Zone (influences battle style).")) r(New ScriptCommand("level", "setsafari", {New ScriptArgument("safari", ScriptArgument.ArgumentTypes.Bool)}.ToList(), "Sets if the current map is a Safari Zone (influences battle style)."))
r(New ScriptCommand("level", "setdaytime", {New ScriptArgument("daytime", ScriptArgument.ArgumentTypes.Int)}.ToList(), "Sets the daytime of the current map."))
' Constructs: ' Constructs:
r(New ScriptCommand("level", "mapfile", "str", "Returns the mapfile of the currently loaded map.", ",", True)) r(New ScriptCommand("level", "mapfile", "str", "Returns the mapfile of the currently loaded map.", ",", True))
r(New ScriptCommand("level", "levelfile", "str", "Returns the mapfile of the currently loaded map.", ",", True)) r(New ScriptCommand("level", "levelfile", "str", "Returns the mapfile of the currently loaded map.", ",", True))
@ -406,7 +405,7 @@ Namespace ScriptVersion2
r(New ScriptCommand("environment", "setisdark", {New ScriptArgument("isDark", ScriptArgument.ArgumentTypes.Bool)}.ToList(), "Sets the ""IsDark"" parameter of the current map.")) r(New ScriptCommand("environment", "setisdark", {New ScriptArgument("isDark", ScriptArgument.ArgumentTypes.Bool)}.ToList(), "Sets the ""IsDark"" parameter of the current map."))
r(New ScriptCommand("environment", "setrenderdistance", {New ScriptArgument("distance", ScriptArgument.ArgumentTypes.Str, {"0-4", "tiny", "small", "normal", "far", "extreme"})}.ToList(), "Sets the render distance.")) r(New ScriptCommand("environment", "setrenderdistance", {New ScriptArgument("distance", ScriptArgument.ArgumentTypes.Str, {"0-4", "tiny", "small", "normal", "far", "extreme"})}.ToList(), "Sets the render distance."))
r(New ScriptCommand("environment", "toggledarkness", "Toggles the ""IsDark"" parameter of the current map.")) r(New ScriptCommand("environment", "toggledarkness", "Toggles the ""IsDark"" parameter of the current map."))
r(New ScriptCommand("environment", "setdaytime", {New ScriptArgument("daytime", ScriptArgument.ArgumentTypes.Int)}.ToList(), "Sets the daytime to use for the Outside EnvironmentType (0). Can be 1-4, any other number resets to the default daytime."))
' Constructs: ' Constructs:
r(New ScriptCommand("environment", "daytime", "str", "Returns the current DayTime of the game.", ",", True)) r(New ScriptCommand("environment", "daytime", "str", "Returns the current DayTime of the game.", ",", True))
r(New ScriptCommand("environment", "daytimeID", "int", "Returns the current DayTimeID of the game.", ",", True)) r(New ScriptCommand("environment", "daytimeID", "int", "Returns the current DayTimeID of the game.", ",", True))
@ -440,7 +439,8 @@ Namespace ScriptVersion2
r(New ScriptCommand("player", "receivepokedex", "Makes the Pokédex accessible for the player.")) r(New ScriptCommand("player", "receivepokedex", "Makes the Pokédex accessible for the player."))
r(New ScriptCommand("player", "receivepokegear", "Makes the Pokégear accessible for the player.")) r(New ScriptCommand("player", "receivepokegear", "Makes the Pokégear accessible for the player."))
r(New ScriptCommand("player", "renamerival", "Opens the rival rename screen.")) r(New ScriptCommand("player", "renamerival", "Opens the rival rename screen."))
r(New ScriptCommand("player", "wearskin", {New ScriptArgument("skin", ScriptArgument.ArgumentTypes.Str)}.ToList(), "Changes the player skin.")) r(New ScriptCommand("player", "wearskin", {New ScriptArgument("skin", ScriptArgument.ArgumentTypes.Str)}.ToList(), "Changes the player skin temporarily."))
r(New ScriptCommand("player", "setskin", {New ScriptArgument("skin", ScriptArgument.ArgumentTypes.Str)}.ToList(), "Changes the player skin permanently."))
r(New ScriptCommand("player", "setonlineskin", {New ScriptArgument("gamejoltID", ScriptArgument.ArgumentTypes.Str)}.ToList(), "Changes the player skin to a skin downloaded for the GameJoltID.")) r(New ScriptCommand("player", "setonlineskin", {New ScriptArgument("gamejoltID", ScriptArgument.ArgumentTypes.Str)}.ToList(), "Changes the player skin to a skin downloaded for the GameJoltID."))
r(New ScriptCommand("player", "move", {New ScriptArgument("steps", ScriptArgument.ArgumentTypes.Sng)}.ToList(), "Starts the player movement.")) r(New ScriptCommand("player", "move", {New ScriptArgument("steps", ScriptArgument.ArgumentTypes.Sng)}.ToList(), "Starts the player movement."))
r(New ScriptCommand("player", "moveasync", {New ScriptArgument("steps", ScriptArgument.ArgumentTypes.Str)}.ToList(), "Starts the async player movement.")) r(New ScriptCommand("player", "moveasync", {New ScriptArgument("steps", ScriptArgument.ArgumentTypes.Str)}.ToList(), "Starts the async player movement."))

View File

@ -39,7 +39,7 @@ Public Class Level
Private _canFly As Boolean = False Private _canFly As Boolean = False
Private _rideType As Integer = 0 Private _rideType As Integer = 0
Private _weatherType As Integer = 0 Private _weatherType As Integer = 0
Public _DayTime As World.DayTime = World.GetTime Public _DayTime As World.DayTimes = World.GetTime
Private _environmentType As Integer = 0 Private _environmentType As Integer = 0
Private _wildPokemonGrass As Boolean = True Private _wildPokemonGrass As Boolean = True
Private _wildPokemonFloor As Boolean = False Private _wildPokemonFloor As Boolean = False
@ -351,13 +351,13 @@ Public Class Level
Public Property DayTime As Integer Public Property DayTime As Integer
Get Get
Select Case Me._DayTime Select Case Me._DayTime
Case World.DayTime.Day Case World.DayTimes.Day
Return 1 Return 1
Case World.DayTime.Night Case World.DayTimes.Night
Return 2 Return 2
Case World.DayTime.Morning Case World.DayTimes.Morning
Return 3 Return 3
Case World.DayTime.Evening Case World.DayTimes.Evening
Return 4 Return 4
Case Else Case Else
Return World.GetTime Return World.GetTime
@ -366,13 +366,13 @@ Public Class Level
Set(value As Integer) Set(value As Integer)
Select Case value Select Case value
Case 1 Case 1
Me._DayTime = World.DayTime.Day Me._DayTime = World.DayTimes.Day
Case 2 Case 2
Me._DayTime = World.DayTime.Night Me._DayTime = World.DayTimes.Night
Case 3 Case 3
Me._DayTime = World.DayTime.Morning Me._DayTime = World.DayTimes.Morning
Case 4 Case 4
Me._DayTime = World.DayTime.Evening Me._DayTime = World.DayTimes.Evening
Case Else Case Else
Me._DayTime = World.GetTime Me._DayTime = World.GetTime
End Select End Select
@ -733,7 +733,7 @@ Public Class Level
''' Loads a level from a levelfile. ''' Loads a level from a levelfile.
''' </summary> ''' </summary>
''' <param name="Levelpath">The path to load the level from. Start with "|" to prevent loading a levelfile.</param> ''' <param name="Levelpath">The path to load the level from. Start with "|" to prevent loading a levelfile.</param>
Public Sub Load(ByVal Levelpath As String) Public Sub Load(ByVal Levelpath As String, Optional Reload As Boolean = False)
' copy all changed files ' copy all changed files
If GameController.IS_DEBUG_ACTIVE Then If GameController.IS_DEBUG_ACTIVE Then
@ -750,7 +750,7 @@ Public Class Level
If Levelpath.StartsWith("|") = False Then If Levelpath.StartsWith("|") = False Then
Me.StopOffsetMapUpdate() Me.StopOffsetMapUpdate()
Dim levelLoader As New LevelLoader() Dim levelLoader As New LevelLoader()
levelLoader.LoadLevel(params.ToArray()) levelLoader.LoadLevel(params.ToArray(), Reload)
Else Else
Logger.Debug("Don't attempt to load a levelfile.") Logger.Debug("Don't attempt to load a levelfile.")
End If End If
@ -829,7 +829,7 @@ Public Class Level
If KeyBoardHandler.KeyPressed(Keys.R) = True And Core.CurrentScreen.Identification = Screen.Identifications.OverworldScreen Then If KeyBoardHandler.KeyPressed(Keys.R) = True And Core.CurrentScreen.Identification = Screen.Identifications.OverworldScreen Then
Core.OffsetMaps.Clear() Core.OffsetMaps.Clear()
Logger.Debug(String.Format("Reload map file: {0}", Me._levelFile)) Logger.Debug(String.Format("Reload map file: {0}", Me._levelFile))
Me.Load(LevelFile) Me.Load(LevelFile, True)
End If End If
End If End If

View File

@ -4,6 +4,7 @@
Public Shared LoadedOffsetMapOffsets As New List(Of Vector3) Public Shared LoadedOffsetMapOffsets As New List(Of Vector3)
Public Shared LoadedOffsetMapNames As New List(Of String) Public Shared LoadedOffsetMapNames As New List(Of String)
Private _reload As Boolean = False
Private Enum TagTypes Private Enum TagTypes
Entity Entity
@ -46,10 +47,10 @@
''' Loads the level. ''' Loads the level.
''' </summary> ''' </summary>
''' <param name="Params">Params contruction: String LevelFile, bool IsOffsetMap, Vector3 Offset, int Offsetmaplevel, Str() InstanceLoadedOffsetMaps</param> ''' <param name="Params">Params contruction: String LevelFile, bool IsOffsetMap, Vector3 Offset, int Offsetmaplevel, Str() InstanceLoadedOffsetMaps</param>
Public Sub LoadLevel(ByVal Params As Object()) Public Sub LoadLevel(ByVal Params As Object(), Optional Reload As Boolean = False)
Busy += 1 Busy += 1
TempParams = Params TempParams = Params
_reload = Reload
If MULTITHREAD = True Then If MULTITHREAD = True Then
Dim t As New Threading.Thread(AddressOf InternalLoad) Dim t As New Threading.Thread(AddressOf InternalLoad)
t.IsBackground = True t.IsBackground = True
@ -992,7 +993,7 @@
Else Else
Screen.Level.RideType = 0 Screen.Level.RideType = 0
End If End If
If _reload = False Then
If TagExists(Tags, "EnvironmentType") = True Then If TagExists(Tags, "EnvironmentType") = True Then
Screen.Level.EnvironmentType = CInt(GetTag(Tags, "EnvironmentType")) Screen.Level.EnvironmentType = CInt(GetTag(Tags, "EnvironmentType"))
Else Else
@ -1010,6 +1011,7 @@
Else Else
Screen.Level.DayTime = 0 Screen.Level.DayTime = 0
End If End If
End If
If TagExists(Tags, "Lighting") = True Then If TagExists(Tags, "Lighting") = True Then
Screen.Level.LightingType = CInt(GetTag(Tags, "Lighting")) Screen.Level.LightingType = CInt(GetTag(Tags, "Lighting"))
@ -1023,7 +1025,7 @@
Screen.Level.IsDark = False Screen.Level.IsDark = False
End If End If
If Screen.Level.DayTime = World.DayTime.Night Then If Screen.Level.DayTime = World.DayTimes.Night Then
If World.IsAurora = False Then If World.IsAurora = False Then
Dim chance = Random.Next(0, 250) Dim chance = Random.Next(0, 250)
If chance = 0 Then If chance = 0 Then

View File

@ -246,7 +246,7 @@
End Function End Function
Private Function GetCloudsTexture() As Texture2D Private Function GetCloudsTexture() As Texture2D
Dim time As World.DayTime = World.GetTime Dim time As World.DayTimes = World.GetTime
Select Case Screen.Level.World.CurrentMapWeather Select Case Screen.Level.World.CurrentMapWeather
Case World.Weathers.Rain, World.Weathers.Blizzard, World.Weathers.Thunderstorm, World.Weathers.Snow Case World.Weathers.Rain, World.Weathers.Blizzard, World.Weathers.Thunderstorm, World.Weathers.Snow
@ -262,11 +262,11 @@
Case 4 Case 4
Return TextureManager.GetTexture("SkyDomeResource\Clouds_Evening") Return TextureManager.GetTexture("SkyDomeResource\Clouds_Evening")
End Select End Select
If time = World.DayTime.Morning Then If time = World.DayTimes.Morning Then
Return TextureManager.GetTexture("SkyDomeResource\Clouds_Morning") Return TextureManager.GetTexture("SkyDomeResource\Clouds_Morning")
ElseIf time = World.DayTime.Day Then ElseIf time = World.DayTimes.Day Then
Return TextureManager.GetTexture("SkyDomeResource\Clouds_Day") Return TextureManager.GetTexture("SkyDomeResource\Clouds_Day")
ElseIf time = World.DayTime.Evening Then ElseIf time = World.DayTimes.Evening Then
Return TextureManager.GetTexture("SkyDomeResource\Clouds_Evening") Return TextureManager.GetTexture("SkyDomeResource\Clouds_Evening")
Else Else
Return TextureManager.GetTexture("SkyDomeResource\Clouds_Night") Return TextureManager.GetTexture("SkyDomeResource\Clouds_Night")
@ -288,14 +288,14 @@
Case 4 Case 4
Return TextureManager.GetTexture("SkyDomeResource\Sky_Evening") Return TextureManager.GetTexture("SkyDomeResource\Sky_Evening")
End Select End Select
Dim time As World.DayTime = World.GetTime Dim time As World.DayTimes = World.GetTime
Select Case Screen.Level.World.CurrentMapWeather Select Case Screen.Level.World.CurrentMapWeather
Case World.Weathers.Clear Case World.Weathers.Clear
If time = World.DayTime.Morning Then If time = World.DayTimes.Morning Then
Return TextureManager.GetTexture("SkyDomeResource\Sky_Morning") Return TextureManager.GetTexture("SkyDomeResource\Sky_Morning")
ElseIf time = World.DayTime.Day Then ElseIf time = World.DayTimes.Day Then
Return TextureManager.GetTexture("SkyDomeResource\Sky_Day") Return TextureManager.GetTexture("SkyDomeResource\Sky_Day")
ElseIf time = World.DayTime.Evening Then ElseIf time = World.DayTimes.Evening Then
Return TextureManager.GetTexture("SkyDomeResource\Sky_Evening") Return TextureManager.GetTexture("SkyDomeResource\Sky_Evening")
Else Else
Return TextureManager.GetTexture("SkyDomeResource\Sky_Night") Return TextureManager.GetTexture("SkyDomeResource\Sky_Night")

View File

@ -5,6 +5,7 @@ Public Class World
Private Shared _regionWeather As Weathers = Weathers.Clear Private Shared _regionWeather As Weathers = Weathers.Clear
Private Shared _regionWeatherSet As Boolean = False Private Shared _regionWeatherSet As Boolean = False
Public Shared setSeason As Seasons = Nothing Public Shared setSeason As Seasons = Nothing
Public Shared setDaytime As DayTimes = Nothing
Public Shared IsMainMenu As Boolean = False Public Shared IsMainMenu As Boolean = False
Public Shared IsAurora As Boolean = False Public Shared IsAurora As Boolean = False
@ -38,7 +39,7 @@ Public Class World
Forest = 5 Forest = 5
End Enum End Enum
Public Enum DayTime As Integer Public Enum DayTimes As Integer
Night = 0 Night = 0
Morning = 1 Morning = 1
Day = 2 Day = 2
@ -78,13 +79,16 @@ Public Class World
End Get End Get
End Property End Property
Public Shared ReadOnly Property GetTime() As DayTime Public Shared ReadOnly Property GetTime() As DayTimes
Get Get
If IsMainMenu Then If IsMainMenu Then
Return DayTime.Day Return DayTimes.Day
End If End If
Dim time As DayTime = DayTime.Day If setDaytime <> Nothing Then
Return setDaytime
Else
Dim time As DayTimes = DayTimes.Day
Dim Hour As Integer = My.Computer.Clock.LocalTime.Hour Dim Hour As Integer = My.Computer.Clock.LocalTime.Hour
If NeedServerObject() = True Then If NeedServerObject() = True Then
@ -95,47 +99,48 @@ Public Class World
Select Case CurrentSeason Select Case CurrentSeason
Case Seasons.Winter Case Seasons.Winter
If Hour > 18 Or Hour < 7 Then If Hour > 18 Or Hour < 7 Then
time = DayTime.Night time = DayTimes.Night
ElseIf Hour > 6 And Hour < 11 Then ElseIf Hour > 6 And Hour < 11 Then
time = DayTime.Morning time = DayTimes.Morning
ElseIf Hour > 10 And Hour < 17 Then ElseIf Hour > 10 And Hour < 17 Then
time = DayTime.Day time = DayTimes.Day
ElseIf Hour > 16 And Hour < 19 Then ElseIf Hour > 16 And Hour < 19 Then
time = DayTime.Evening time = DayTimes.Evening
End If End If
Case Seasons.Spring Case Seasons.Spring
If Hour > 19 Or Hour < 5 Then If Hour > 19 Or Hour < 5 Then
time = DayTime.Night time = DayTimes.Night
ElseIf Hour > 4 And Hour < 10 Then ElseIf Hour > 4 And Hour < 10 Then
time = DayTime.Morning time = DayTimes.Morning
ElseIf Hour > 9 And Hour < 17 Then ElseIf Hour > 9 And Hour < 17 Then
time = DayTime.Day time = DayTimes.Day
ElseIf Hour > 16 And Hour < 20 Then ElseIf Hour > 16 And Hour < 20 Then
time = DayTime.Evening time = DayTimes.Evening
End If End If
Case Seasons.Summer Case Seasons.Summer
If Hour > 20 Or Hour < 4 Then If Hour > 20 Or Hour < 4 Then
time = DayTime.Night time = DayTimes.Night
ElseIf Hour > 3 And Hour < 9 Then ElseIf Hour > 3 And Hour < 9 Then
time = DayTime.Morning time = DayTimes.Morning
ElseIf Hour > 8 And Hour < 19 Then ElseIf Hour > 8 And Hour < 19 Then
time = DayTime.Day time = DayTimes.Day
ElseIf Hour > 18 And Hour < 21 Then ElseIf Hour > 18 And Hour < 21 Then
time = DayTime.Evening time = DayTimes.Evening
End If End If
Case Seasons.Fall Case Seasons.Fall
If Hour > 19 Or Hour < 6 Then If Hour > 19 Or Hour < 6 Then
time = DayTime.Night time = DayTimes.Night
ElseIf Hour > 5 And Hour < 10 Then ElseIf Hour > 5 And Hour < 10 Then
time = DayTime.Morning time = DayTimes.Morning
ElseIf Hour > 9 And Hour < 18 Then ElseIf Hour > 9 And Hour < 18 Then
time = DayTime.Day time = DayTimes.Day
ElseIf Hour > 17 And Hour < 20 Then ElseIf Hour > 17 And Hour < 20 Then
time = DayTime.Evening time = DayTimes.Evening
End If End If
End Select End Select
Return time Return time
End If
End Get End Get
End Property End Property
@ -223,7 +228,7 @@ Public Class World
End Select End Select
Case EnvironmentTypes.Outside Case EnvironmentTypes.Outside
Select Case World.GetTime Select Case World.GetTime
Case DayTime.Night Case DayTimes.Night
Select Case Core.GameOptions.RenderDistance Select Case Core.GameOptions.RenderDistance
Case 0 Case 0
Screen.Effect.FogStart = -2 Screen.Effect.FogStart = -2
@ -251,7 +256,7 @@ Public Class World
Screen.Camera.FarPlane = 100 Screen.Camera.FarPlane = 100
End Select End Select
Case DayTime.Morning Case DayTimes.Morning
Select Case Core.GameOptions.RenderDistance Select Case Core.GameOptions.RenderDistance
Case 0 Case 0
Screen.Effect.FogStart = 16 Screen.Effect.FogStart = 16
@ -279,7 +284,7 @@ Public Class World
Screen.Camera.FarPlane = 100 Screen.Camera.FarPlane = 100
End Select End Select
Case DayTime.Day Case DayTimes.Day
Select Case Core.GameOptions.RenderDistance Select Case Core.GameOptions.RenderDistance
Case 0 Case 0
Screen.Effect.FogStart = 16 Screen.Effect.FogStart = 16
@ -307,7 +312,7 @@ Public Class World
Screen.Camera.FarPlane = 100 Screen.Camera.FarPlane = 100
End Select End Select
Case DayTime.Evening Case DayTimes.Evening
Select Case Core.GameOptions.RenderDistance Select Case Core.GameOptions.RenderDistance
Case 0 Case 0
Screen.Effect.FogStart = 0 Screen.Effect.FogStart = 0