Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // Action script...
- // [Initial MovieClip Action of sprite 91]
- #initclip 2
- class com.rockstargames.gtav.web.WWW_WARSTOCK_D_CACHE_D_AND_D_CARRY_COM extends com.rockstargames.ui.core.BaseWebsite
- {
- var _name, IS_SITE_DYNAMIC, browser, CONTENT, PAGE_NAMES, CAN_STORE_PAGE, defaultButtonOnColour, defaultButtonOffColour, itemLabels, prices, ranks, seats, displayArray, itemNumber, intervalId, mcScope, dataTextScope, dataProviderUI;
- function WWW_WARSTOCK_D_CACHE_D_AND_D_CARRY_COM()
- {
- super();
- _name = "WWW_WARSTOCK_D_CACHE_D_AND_D_CARRY_COM";
- IS_SITE_DYNAMIC = 0;
- browser = _level0.TIMELINE;
- browser.DebugTextContent = true;
- if (browser.player == 1)
- {
- isMP = true;
- }
- else
- {
- isMP = false;
- } // end else if
- CONTENT.localisationTF.autoSize = true;
- PAGE_NAMES = new Array();
- PAGE_NAMES[1] = "PAGE1";
- PAGE_NAMES[2] = "SEARCH";
- PAGE_NAMES[3] = "DETAILS1";
- PAGE_NAMES[4] = "DETAILS2";
- PAGE_NAMES[5] = "DETAILS3";
- PAGE_NAMES[6] = "DETAILS4";
- PAGE_NAMES[7] = "DETAILS5";
- PAGE_NAMES[8] = "DETAILS6";
- PAGE_NAMES[9] = "DETAILS7";
- PAGE_NAMES[10] = "DETAILS8";
- PAGE_NAMES[11] = "DETAILS9";
- PAGE_NAMES[12] = "PURCHASE";
- PAGE_NAMES[13] = "PURCHASE_D_FAILED";
- PAGE_NAMES[14] = "PURCHASE_D_ERROR";
- PAGE_NAMES[15] = "PURCHASE_D_CONFIRM";
- PAGE_NAMES[16] = "INVENTORY";
- PAGE_NAMES[17] = "DETAILS15";
- PAGE_NAMES[18] = "DETAILS16";
- PAGE_NAMES[19] = "DETAILS17";
- PAGE_NAMES[20] = "DETAILS18";
- PAGE_NAMES[21] = "DETAILS19";
- PAGE_NAMES[22] = "DETAILS20";
- PAGE_NAMES[23] = "DETAILS21";
- PAGE_NAMES[24] = "DETAILS22";
- PAGE_NAMES[25] = "DETAILS23";
- PAGE_NAMES[26] = "DETAILS24";
- PAGE_NAMES[27] = "DETAILS25";
- PAGE_NAMES[28] = "DETAILS26";
- CAN_STORE_PAGE = new Array();
- CAN_STORE_PAGE[1] = true;
- CAN_STORE_PAGE[2] = false;
- CAN_STORE_PAGE[3] = true;
- CAN_STORE_PAGE[4] = false;
- CAN_STORE_PAGE[5] = true;
- CAN_STORE_PAGE[6] = false;
- CAN_STORE_PAGE[7] = true;
- CAN_STORE_PAGE[8] = true;
- CAN_STORE_PAGE[9] = false;
- CAN_STORE_PAGE[10] = true;
- CAN_STORE_PAGE[11] = false;
- CAN_STORE_PAGE[12] = false;
- CAN_STORE_PAGE[13] = false;
- CAN_STORE_PAGE[14] = false;
- CAN_STORE_PAGE[15] = false;
- CAN_STORE_PAGE[16] = true;
- CAN_STORE_PAGE[17] = true;
- CAN_STORE_PAGE[18] = true;
- CAN_STORE_PAGE[19] = true;
- CAN_STORE_PAGE[20] = true;
- CAN_STORE_PAGE[21] = true;
- CAN_STORE_PAGE[22] = true;
- CAN_STORE_PAGE[23] = true;
- CAN_STORE_PAGE[24] = true;
- CAN_STORE_PAGE[25] = true;
- CAN_STORE_PAGE[26] = true;
- CAN_STORE_PAGE[27] = true;
- CAN_STORE_PAGE[28] = true;
- defaultButtonOnColour = 16777215;
- defaultButtonOffColour = 16777215;
- itemLabels = new Array();
- itemLabels = ["RHINO", "", "BARRACKS", "", "CARGOBOB", "BUZZARD", "", "CRUSADER", "", "", "", "", "", "", "AIRBUS", "JOURNEY", "FIRETRUK", "COACH", "BUS", "BOXVILLE", "TOURBUS", "MULE", "PBUS", "RIOT", "RENTBUS", "DUMP"];
- prices = new Array();
- prices = [-1, 0, -1, 0, -1, -1, 0, -1, 0, 0, 0, 0, 0, 0, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1];
- ranks = new Array();
- ranks = [-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1];
- seats = new Array();
- seats = ["01", "", "10", "", "10", "02", "", "04", "", "", "", "", "", "", "16", "06", "08", "10", "16", "06", "10", "06", "11", "08", "10", "01"];
- displayArray = new Array();
- if (isMP == false)
- {
- displayArray = [1, 3, 5, 6, 8];
- }
- else
- {
- displayArray = [1, 3, 6, 8, 15, 16, 18, 19, 22, 25, 26];
- } // end else if
- } // End of the function
- function READY()
- {
- } // End of the function
- function SET_PRICES(slotID, price)
- {
- prices[slotID - 3] = price;
- } // End of the function
- function SET_RANKS(slotID, rank, current)
- {
- ranks[slotID - 3] = rank;
- if (current != undefined)
- {
- currentRank = current;
- } // end if
- } // End of the function
- function goToAnchor(AnchorLink)
- {
- var _loc2 = new Array();
- _loc2 = AnchorLink.split("_");
- itemNumber = parseInt(_loc2[1]);
- browser.GO_TO_WEBPAGE("WWW_WARSTOCK_D_CACHE_D_AND_D_CARRY_COM_S_DETAILS" + itemNumber);
- } // End of the function
- function POPULATE_TEXT(pageName, searchArgs, newPage)
- {
- CONTENT._y = 0;
- switch (pageName)
- {
- case "DETAILS2":
- case "DETAILS4":
- case "DETAILS7":
- case "DETAILS9":
- {
- browser.GO_TO_WEBPAGE("PAGE1");
- break;
- }
- case "PAGE1":
- {
- clearInterval(intervalId);
- mcScope = CONTENT.PAGE1;
- dataTextScope = new Array();
- dataTextScope[0] = mcScope.WWW_WARSTOCK_D_CACHE_D_AND_D_CARRY_COM.btnTxt;
- this.set_localised_text(5, mcScope.header, "CANDC_PG1_HEADER");
- this.set_localised_text(6, mcScope.body1, "CANDC_PG1_BODY1");
- this.set_localised_text(7, mcScope.body2, "CANDC_PG1_BODY2");
- this.set_localised_text(8, mcScope.descriptionTF, "CANDC_RHINO");
- var _loc13 = 1185;
- var _loc6 = 258.500000;
- var _loc8 = 364;
- var _loc4 = 9;
- var _loc2;
- var _loc12;
- if (newPage == false)
- {
- for (var _loc5 = 0; _loc5 < displayArray.length; ++_loc5)
- {
- var _loc3 = displayArray[_loc5];
- _loc2 = "item_" + _loc3;
- if (prices[_loc3 - 1] != -1)
- {
- if (mcScope[_loc2] != undefined)
- {
- mcScope[_loc2].removeMovieClip();
- } // end if
- _loc12 = mcScope.attachMovie("car_box", _loc2, mcScope.getNextHighestDepth(), {_x: _loc6, _y: _loc8, _alpha: 0});
- var _loc7 = itemLabels[_loc3 - 1];
- mcScope[_loc2].itemImages.gotoAndStop(_loc7);
- this.set_localised_text(_loc4, mcScope[_loc2].btnTxt, _loc7, true);
- dataTextScope[_loc4] = undefined;
- if (prices[_loc3 - 1] == 0)
- {
- mcScope[_loc2].itemImages.outOfStock._alpha = 100;
- this.set_localised_text(-1, mcScope[_loc2].itemImages.outOfStock.outOfStockTF, "WEB_OUTOFSTOCK", false);
- mcScope[_loc2].priceTF.text = "";
- }
- else if (prices[_loc3 - 1] > 0 || isNaN(prices[_loc3 - 1]))
- {
- mcScope[_loc2].itemImages.outOfStock._alpha = 0;
- this.set_price_text(mcScope[_loc2].priceTF, prices[_loc3 - 1]);
- dataTextScope[_loc4] = mcScope[_loc2].btnTxt;
- } // end else if
- if (isMP == true)
- {
- if (ranks[_loc3 - 1] > currentRank)
- {
- mcScope[_loc2].MPrank.rankTF.text = ranks[_loc3 - 1];
- mcScope[_loc2].MPrank._alpha = 100;
- dataTextScope[_loc4] = undefined;
- }
- else
- {
- mcScope[_loc2].MPrank._alpha = 0;
- } // end else if
- if (seats[_loc3 - 1] != "")
- {
- mcScope[_loc2].MPseats.seatsTF.text = seats[_loc3 - 1];
- mcScope[_loc2].MPseats._alpha = 100;
- }
- else
- {
- mcScope[_loc2].MPseats._alpha = 0;
- } // end if
- } // end else if
- mcScope[_loc2]._alpha = 100;
- ++_loc4;
- _loc13 = _loc8;
- _loc6 = _loc6 + 385;
- if (_loc6 > 643.500000)
- {
- _loc6 = 258.500000;
- _loc8 = _loc8 + 242;
- } // end if
- } // end if
- } // end of for
- if (_loc12._x == 258.500000)
- {
- _loc12._x = 451;
- } // end if
- } // end if
- mcScope.bgBlack._height = _loc13 + 124;
- mcScope.bgWhite._height = mcScope.bgBlack._height - 14;
- var _loc15;
- _loc15 = mcScope.bgBlack._y + mcScope.bgBlack._height + 40;
- CONTENT.BOUNDING_BOX._height = _loc15;
- browser.SET_PAGE_BUTTONS(dataTextScope);
- com.rockstargames.ui.game.GameInterface.call("SET_TEXT_WITH_TRANSLATION", com.rockstargames.ui.game.GameInterface.GENERIC_TYPE, "CANDC_TOOLBAR", CONTENT.localisationTF);
- browser.SET_TITLEBAR_TEXT(CONTENT.localisationTF.text, 14474460);
- break;
- }
- case "SEARCH":
- {
- browser.GO_TO_WEBPAGE("PAGE1");
- break;
- }
- case "DETAILS1":
- case "DETAILS3":
- case "DETAILS5":
- case "DETAILS6":
- case "DETAILS8":
- case "DETAILS9":
- case "DETAILS15":
- case "DETAILS16":
- case "DETAILS17":
- case "DETAILS18":
- case "DETAILS19":
- case "DETAILS20":
- case "DETAILS21":
- case "DETAILS22":
- case "DETAILS23":
- case "DETAILS24":
- case "DETAILS25":
- case "DETAILS26":
- {
- clearInterval(intervalId);
- mcScope = CONTENT.DETAILS;
- var _loc14 = pageName.split("DETAILS");
- itemNumber = parseInt(_loc14[1]);
- dataTextScope = new Array();
- dataTextScope[0] = mcScope.WWW_WARSTOCK_D_CACHE_D_AND_D_CARRY_COM.btnTxt;
- dataTextScope[1] = mcScope.WWW_RIGHTEOUSSLAUGHTER7_COM.btnTxt;
- this.set_localised_text(5, mcScope.body, "CANDC_" + itemLabels[itemNumber - 1]);
- this.set_localised_text(6, mcScope.nameTF, itemLabels[itemNumber - 1]);
- if (prices[itemNumber - 1] > 0)
- {
- this.set_price_text(mcScope.priceTF, prices[itemNumber - 1]);
- }
- else
- {
- mcScope.priceTF.text = "";
- } // end else if
- this.set_localised_text(8, mcScope.WWW_WARSTOCK_D_CACHE_D_AND_D_CARRY_COM_S_PURCHASE.btnTxt, "CANDC_BUYNOW");
- mcScope.itemImages.gotoAndStop(itemNumber);
- if (isMP == true)
- {
- if (seats[itemNumber - 1] != "")
- {
- mcScope.MPseats.seatsTF.text = seats[itemNumber - 1];
- mcScope.MPseats._alpha = 100;
- }
- else
- {
- mcScope.MPseats._alpha = 0;
- } // end if
- } // end else if
- browser.SET_PAGE_BUTTONS(dataTextScope);
- mcScope.priceTF._x = mcScope.nameTF._x + mcScope.nameTF.textWidth + 10;
- CONTENT.BOUNDING_BOX._height = 700;
- break;
- }
- case "PURCHASE":
- {
- clearInterval(intervalId);
- mcScope = CONTENT.PURCHASE;
- mcScope.body1._alpha = 0;
- mcScope.body2._alpha = 0;
- dataTextScope = new Array();
- dataTextScope[0] = mcScope.WWW_WARSTOCK_D_CACHE_D_AND_D_CARRY_COM.btnTxt;
- dataTextScope[1] = mcScope.WWW_RIGHTEOUSSLAUGHTER7_COM.btnTxt;
- this.set_localised_text(5, mcScope.body1, "CANDC_PURCHASED");
- this.set_localised_text(6, mcScope.body2, "CANDC_DISCLAIMER");
- mcScope.itemImages.gotoAndStop(itemNumber);
- if (isMP == true)
- {
- if (seats[itemNumber - 1] != "")
- {
- mcScope.MPseats.seatsTF.text = seats[itemNumber - 1];
- mcScope.MPseats._alpha = 100;
- }
- else
- {
- mcScope.MPseats._alpha = 0;
- } // end if
- } // end else if
- browser.SET_PAGE_BUTTONS(dataTextScope);
- intervalId = setInterval(this, "displayPurchasedText", 1500);
- CONTENT.BOUNDING_BOX._height = 700;
- break;
- }
- case "PURCHASE_D_FAILED":
- {
- clearInterval(intervalId);
- mcScope = CONTENT.PURCHASE_D_FAILED;
- dataTextScope = new Array();
- dataTextScope[0] = mcScope.WWW_WARSTOCK_D_CACHE_D_AND_D_CARRY_COM.btnTxt;
- dataTextScope[1] = mcScope.WWW_RIGHTEOUSSLAUGHTER7_COM.btnTxt;
- this.set_localised_text(5, mcScope.body1, "CANDC_FAILED");
- mcScope.body1.autoSize = "center";
- mcScope.itemImages.gotoAndStop(itemNumber);
- if (isMP == true)
- {
- if (seats[itemNumber - 1] != "")
- {
- mcScope.MPseats.seatsTF.text = seats[itemNumber - 1];
- mcScope.MPseats._alpha = 100;
- }
- else
- {
- mcScope.MPseats._alpha = 0;
- } // end if
- } // end else if
- browser.SET_PAGE_BUTTONS(dataTextScope);
- CONTENT.BOUNDING_BOX._height = 700;
- break;
- }
- case "PURCHASE_D_ERROR":
- {
- mcScope = CONTENT.PURCHASE_D_ERROR;
- dataTextScope = new Array();
- dataTextScope[0] = mcScope.WWW_WARSTOCK_D_CACHE_D_AND_D_CARRY_COM.btnTxt;
- dataTextScope[1] = mcScope.soldTF;
- if (dataProviderUI[1][0] != undefined)
- {
- dataTextScope[1].text = dataProviderUI[1][0];
- } // end if
- mcScope.soldTF.autoSize = "center";
- mcScope.body.multiline = true;
- dataTextScope[2] = mcScope.body1;
- if (dataProviderUI[2][0] != undefined)
- {
- dataTextScope[2].text = dataProviderUI[2][0];
- } // end if
- mcScope.body1.autoSize = "center";
- dataTextScope[1] = mcScope.WWW_RIGHTEOUSSLAUGHTER7_COM.btnTxt;
- mcScope.itemImages.gotoAndStop(itemNumber);
- if (isMP == true)
- {
- if (seats[itemNumber - 1] != "")
- {
- mcScope.MPseats.seatsTF.text = seats[itemNumber - 1];
- mcScope.MPseats._alpha = 100;
- }
- else
- {
- mcScope.MPseats._alpha = 0;
- } // end if
- } // end else if
- browser.SET_PAGE_BUTTONS(dataTextScope);
- CONTENT.BOUNDING_BOX._height = 700;
- break;
- }
- case "PURCHASE_D_CONFIRM":
- {
- mcScope = CONTENT.PURCHASE_D_CONFIRM;
- dataTextScope = new Array();
- dataTextScope[0] = mcScope.WWW_WARSTOCK_D_CACHE_D_AND_D_CARRY_COM.btnTxt;
- mcScope.body.multiline = true;
- mcScope.body.wordWrap = true;
- if (dataProviderUI[1] != undefined)
- {
- mcScope.body.htmlText = dataProviderUI[1];
- } // end if
- dataTextScope[2] = mcScope.WWW_WARSTOCK_D_CACHE_D_AND_D_CARRY_COM_S_PURCHASE.btnTxt;
- if (dataProviderUI[2] != undefined)
- {
- dataTextScope[2].htmlText = dataProviderUI[2];
- } // end if
- dataTextScope[3] = mcScope.WWW_WARSTOCK_D_CACHE_D_AND_D_CARRY_COM_S_PURCHASE_D_FAILED.btnTxt;
- if (dataProviderUI[3] != undefined)
- {
- dataTextScope[3].htmlText = dataProviderUI[3];
- } // end if
- dataTextScope[1] = mcScope.WWW_RIGHTEOUSSLAUGHTER7_COM.btnTxt;
- browser.SET_PAGE_BUTTONS(dataTextScope);
- CONTENT.BOUNDING_BOX._height = 700;
- break;
- }
- } // End of switch
- browser.SET_DATA_SLOT_EMPTY();
- } // End of the function
- function displayPurchasedText()
- {
- clearInterval(intervalId);
- mcScope.body1._alpha = 100;
- mcScope.body2._alpha = 100;
- } // End of the function
- function set_localised_text(slotID, TF, TextLabel, setDataSlot)
- {
- dataTextScope[slotID] = TF;
- com.rockstargames.ui.game.GameInterface.call("SET_TEXT_WITH_TRANSLATION", com.rockstargames.ui.game.GameInterface.GENERIC_TYPE, TextLabel, CONTENT.localisationTF);
- var _loc2 = CONTENT.localisationTF.htmlText;
- TF.htmlText = _loc2;
- if (setDataSlot)
- {
- browser.SET_DATA_SLOT(slotID, _loc2);
- } // end if
- } // End of the function
- function set_price_text(TF, price)
- {
- if (isNaN(price))
- {
- TF.htmlText = price;
- }
- else
- {
- var _loc3;
- var _loc2 = price.toString();
- var _loc5 = _loc2.length;
- if (_loc5 > 3)
- {
- var _loc4 = "";
- var _loc1 = _loc2.slice(0, -3);
- var _loc7 = "," + _loc2.slice(-3);
- if (_loc1.length > 3)
- {
- _loc4 = _loc1.slice(0, -3) + ",";
- _loc1 = _loc1.slice(-3);
- } // end if
- _loc3 = _loc4 + _loc1 + _loc7;
- }
- else
- {
- _loc3 = _loc2;
- } // end else if
- TF.text = "$" + _loc3;
- } // end else if
- } // End of the function
- var currentRank = 0;
- var isMP = false;
- } // End of Class
- #endinitclip
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement