Overview | Package | Class | Source | Class tree | Glossary | UnrealScript Documentation
previous class next class | frames no frames

# TribesGUI.TribesPatchCheck

00001 00002 00003 00004 00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039
00040
00041
00042
00043
00044
00045
00046
00047
00048
00049
00050
00051
00052
00053
00054
00055
00056
00057
00058
00059
00060
00061
00062
00063
00064
00065
00066
00067
00068
00069
00070
00071
00072
00073
00074
00075
00076
00077
00078
00079
00080
00081
00082
00083
00084
00085
00086
00087
00088
00089
00090
00091
00092
00093
00094
00095
00096
00097
00098
00099
00100
00101

    class TribesPatchCheck extends TribesGUIPage
    	native;

    var(TribesGui) protected EditInline Config GUIButton YesButton;
    var(TribesGui) protected EditInline Config GUIButton NoButton;
    var(TribesGui) protected EditInline Config GUIButton OKButton;
    var(TribesGui) protected EditInline Config GUILabel StatusLabel;
    var(TribesGui) protected EditInline Config GUILabel URLLabel;

    var(TribesGui) protected EditInline GlobalConfig localized string PatchCheckingText;
    var(TribesGui) protected EditInline GlobalConfig localized string NewVersionText;
    var(TribesGui) protected EditInline GlobalConfig localized string UpToDateText;
    var(TribesGui) protected EditInline GlobalConfig localized string URLFailedText;

    var(TribesGui) protected EditInline GlobalConfig int CheckTimeout		"Gamespy timeout";

    var TribesGameSpyManager	gm;

    function InitComponent(GUIComponent MyOwner)
    {
    	Super.InitComponent(MyOwner);

    	OnShow=InternalOnShow;
    }

    function InternalOnShow()
    {
    	gm = TribesGameSpyManager(PlayerOwner().Level.GetGameSpyManager());

    	if (gm == None)
    	{
    		log("Failed patch check: no gamespy manager");
    		Controller.CloseMenu();
    		return;
    	}

    	YesButton.OnClick = OnYes;
    	NoButton.OnClick = OnNo;
    	OKButton.OnClick = OnNo;
    	YesButton.bCanBeShown = false;
    	YesButton.Hide();
    	NoButton.bCanBeShown = false;
    	NoButton.Hide();
    	OKButton.bCanBeShown = false;
    	OKButton.Hide();
    	URLLabel.Caption = "";
    	StatusLabel.Caption = PatchCheckingText;

    	gm.OnQueryPatchResult = OnQueryPatchResult;
    	gm.QueryPatch();
    	SetTimer(CheckTimeout, false);
    }

    function Timer()
    {
    	log("Failed patch check: gamespy timeout");
    	Controller.CloseMenu();
    }

    function OnQueryPatchResult(bool bNeeded, bool bMandatory, string versionName, string URL)
    {
    	SetTimer(0);

    	if (!bNeeded)
    	{
    		StatusLabel.Caption = UpToDateText;
    		OKButton.bCanBeShown = true;
    		OKButton.Show();
    	}
    	else
    	{
    		YesButton.bCanBeShown = true;
    		YesButton.Show();
    		NoButton.bCanBeShown = true;
    		NoButton.Show();
    		StatusLabel.Caption = NewVersionText;
    		URLLabel.Caption = URL;
    	}
    }

    native function OnYes(GUIComponent Sender);

    event OnURLFailed(string Error)
    {
    	OpenDlg(replaceStr(URLFailedText, Error), QBTN_Ok, "1");
    }

    function OnNo(GUIComponent Sender)
    {
    	Controller.CloseMenu();
    }

    defaultproperties
    {
    	PatchCheckingText="Checking for an updated version of Tribes: Vengeance..."
    	UpToDateText="You already have the latest version of Tribes: Vengeance."
    	NewVersionText="An updated version of Tribes: Vengeance has been released. You must install an update in order to play online. Would you like to download the update now at the location below?"
    	URLFailedText="An error occurred while browsing to the URL: %1"
    	CheckTimeout=10
    }

Overview | Package | Class | Source | Class tree | Glossary | UnrealScript Documentation
previous class next class | frames no frames

Class file time: st 16.4.2014 10:20:44.000 - Creation time: st 23.5.2018 00:10:48.758 - Created with UnCodeX