From e311d7b37805162868a3346b68abaa5e31c7d421 Mon Sep 17 00:00:00 2001 From: jianmingyong Date: Mon, 13 Feb 2017 20:59:11 +0800 Subject: [PATCH] Testing some v0.54.1 features --- 2.5DHero/2.5DHero/2.5DHero.vbproj | 2 +- .../{UpdateHash.dat => CurrentVersion.dat} | 0 .../Screens/MainMenu/MainMenuScreen.vb | 24 ++++++++++++++++--- .../2.5DHero/Screens/MainMenu/SplashScreen.vb | 5 ++-- 4 files changed, 25 insertions(+), 6 deletions(-) rename 2.5DHero/2.5DHero/{UpdateHash.dat => CurrentVersion.dat} (100%) diff --git a/2.5DHero/2.5DHero/2.5DHero.vbproj b/2.5DHero/2.5DHero/2.5DHero.vbproj index d3a8d43a1..5e2db585b 100644 --- a/2.5DHero/2.5DHero/2.5DHero.vbproj +++ b/2.5DHero/2.5DHero/2.5DHero.vbproj @@ -42,7 +42,7 @@ - + $(MSBuildProgramFiles32)\MonoGame\v3.0\Assemblies\DesktopGL\OpenTK.dll diff --git a/2.5DHero/2.5DHero/UpdateHash.dat b/2.5DHero/2.5DHero/CurrentVersion.dat similarity index 100% rename from 2.5DHero/2.5DHero/UpdateHash.dat rename to 2.5DHero/2.5DHero/CurrentVersion.dat diff --git a/2.5DHero/2.5DHero/Screens/MainMenu/MainMenuScreen.vb b/2.5DHero/2.5DHero/Screens/MainMenu/MainMenuScreen.vb index aee09f7d6..774a7d09d 100644 --- a/2.5DHero/2.5DHero/Screens/MainMenu/MainMenuScreen.vb +++ b/2.5DHero/2.5DHero/Screens/MainMenu/MainMenuScreen.vb @@ -1,4 +1,7 @@ -Public Class MainMenuScreen +Imports System.Net +Imports System.Net.Cache + +Public Class MainMenuScreen Inherits Screen @@ -78,6 +81,21 @@ GameJolt.Emblem.ClearOnlineSpriteCache() Screen.Level.World.Initialize(Screen.Level.EnvironmentType, Screen.Level.WeatherType) + + Try + Logger.Debug("---Check Version---") + + Dim client As New WebClient + client.CachePolicy = New RequestCachePolicy(RequestCacheLevel.BypassCache) + Dim version As String = client.DownloadString("https://raw.githubusercontent.com/P3D-Legacy/P3D-Legacy/master/2.5DHero/2.5DHero/CurrentVersion.dat") + If version <> "0.54.2" Then + If MsgBox("New version detected." & vbNewLine & "Current Version: Indev 0.54.1" & vbNewLine & "Newest Version: Indev " & version & vbNewLine & vbNewLine & "Would you like to update the game?", MsgBoxStyle.YesNo, "Game Update") = MsgBoxResult.Yes Then + Process.Start("https://p3d-legacy.github.io/P3D-Legacy-Launcher/latestRelease") + Core.GameInstance.Exit() + End If + End If + Catch ex As Exception + End Try End Sub Private Sub GetPacks(Optional ByVal reload As Boolean = False) @@ -703,7 +721,7 @@ If MouseHandler.ButtonPressed(MouseHandler.MouseButtons.LeftButton) = True Then Select Case loadMenuIndex(1) Case 0 - Core.Player.IsGamejoltSave = False + Core.Player.IsGameJoltSave = False Core.Player.LoadGame(System.IO.Path.GetFileName(Saves(loadMenuIndex(0)))) Core.SetScreen(New JoinServerScreen(Me)) @@ -743,7 +761,7 @@ If Controls.Accept(False, True) = True Then Select Case loadMenuIndex(1) Case 0 - Core.Player.IsGamejoltSave = False + Core.Player.IsGameJoltSave = False Core.Player.LoadGame(System.IO.Path.GetFileName(Saves(loadMenuIndex(0)))) Core.SetScreen(New JoinServerScreen(Me)) diff --git a/2.5DHero/2.5DHero/Screens/MainMenu/SplashScreen.vb b/2.5DHero/2.5DHero/Screens/MainMenu/SplashScreen.vb index 81a2636c8..dc216317f 100644 --- a/2.5DHero/2.5DHero/Screens/MainMenu/SplashScreen.vb +++ b/2.5DHero/2.5DHero/Screens/MainMenu/SplashScreen.vb @@ -1,4 +1,6 @@ -Imports System.Threading +Imports System.Net +Imports System.Net.Cache +Imports System.Threading Friend Class SplashScreen @@ -72,7 +74,6 @@ Friend Class SplashScreen Private Sub LoadContent() Logger.Debug("---Start loading content---") - Core.LoadContent() End Sub