home *** CD-ROM | disk | FTP | other *** search
- class NickHS
- {
- var bHSAvailable;
- var G_TestHighScore;
- var bSubmitHS;
- var bGetHS;
- var G_GameID;
- var mcHSZone;
- var G_NoTxtField;
- var G_NameTxtField;
- var G_ScoreTxtField;
- static var oNickHS;
- function NickHS(_sGameID, _bHSAvailable, _bTestHighScore)
- {
- this.bHSAvailable = _bHSAvailable;
- this.G_TestHighScore = _bTestHighScore;
- this.bSubmitHS = false;
- this.bGetHS = false;
- this.G_GameID = _sGameID;
- this.mcHSZone = undefined;
- this.initHiScores();
- if(this.G_TestHighScore == true)
- {
- _global.gProxyObj.setServer("www.nick.com");
- _global.gProxyObj.setScreenName("SbkRR");
- _global.gProxyObj.setIsLoggedIn(true);
- }
- NickHS.oNickHS = this;
- }
- function doHSInit()
- {
- this.initHiScores();
- }
- function doSubmitHS()
- {
- this.bSubmitHS = true;
- }
- function doViewHS()
- {
- this.bGetHS = true;
- }
- function setHSBoard(_mcRef)
- {
- this.mcHSZone = _mcRef;
- this.G_NoTxtField = this.mcHSZone.txtHSNumber;
- this.G_NameTxtField = this.mcHSZone.txtHSName;
- this.G_ScoreTxtField = this.mcHSZone.txtHSScore;
- }
- static function get Instance()
- {
- return NickHS.oNickHS;
- }
- function getIsLoggedIn()
- {
- var _loc2_ = true;
- if(_global.gProxyObj != undefined)
- {
- _loc2_ = _global.gProxyObj.getIsLoggedIn();
- }
- return _loc2_;
- }
- function getScores()
- {
- if(_global.gProxyObj == undefined)
- {
- this.listScores();
- }
- else
- {
- _global.gProxyObj.getScores(this.cbFunc2);
- }
- }
- function submitScore(theScore)
- {
- this.G_NoTxtField.text = "";
- this.G_NameTxtField.text = "The high score list is updating!";
- this.G_ScoreTxtField.text = "";
- _global.gProxyObj.submitScore(theScore,this.cbFunc);
- _global.ipbSend();
- }
- function initHiScores()
- {
- _global.gProxyObj.setGame_Id(this.G_GameID);
- }
- function getScoreString()
- {
- var _loc11_ = "Oops! The high score list is not available right now!";
- if(_global.gProxyObj != undefined)
- {
- var _loc10_ = _global.gProxyObj.getScoreCount();
- if(_loc10_ > 0)
- {
- var _loc3_ = undefined;
- var _loc4_ = undefined;
- var _loc9_ = undefined;
- var _loc8_ = undefined;
- _loc11_ = "";
- var _loc5_ = "";
- var _loc6_ = "";
- var _loc7_ = "";
- _loc3_ = 0;
- while(_loc3_ < _loc10_)
- {
- _loc4_ = _global.gProxyObj.getScoreItem(_loc3_);
- _loc9_ = _loc4_[0];
- _loc8_ = Library.Utils.Tools.returnFormatedNumber(_loc4_[1]);
- _loc5_ += _loc3_ + 1 + "\n";
- _loc6_ += _loc9_ + "\n";
- _loc7_ += _loc8_ + " pts" + "\n";
- _loc3_ = _loc3_ + 1;
- }
- this.G_NoTxtField.text = _loc5_;
- this.G_NameTxtField.text = _loc6_;
- this.G_ScoreTxtField.text = _loc7_;
- }
- else
- {
- this.G_NameTxtField.text = "Oops! The high score list is not available right now!";
- }
- }
- else
- {
- this.G_NameTxtField.text = "Oops! The high score list is not available right now!";
- }
- return _loc11_;
- }
- function listScores()
- {
- this.getScoreString();
- }
- function cbFunc(thisBool)
- {
- if(thisBool)
- {
- NickHS.Instance.listScores();
- }
- else
- {
- NickHS.Instance.G_NameTxtField.text = "Oops! The high score list is not available right now!";
- }
- }
- function cbFunc2(thisBool)
- {
- if(thisBool)
- {
- NickHS.Instance.listScores();
- }
- else
- {
- NickHS.Instance.G_NameTxtField.text = "Oops! The high score list is not available right now!";
- }
- }
- }
-