Example #1
0
	public void onManageContract() {
		// They've missed out the tutorial if any of these are not 2 by this point. Pre-emptively set these to two so tutorials no longer appear

		DialogueLua.SetVariable("HintArrowOfferContract",2);
		DialogueLua.SetVariable("HintArrowHireADriver",2);
		DialogueLua.SetVariable("HintArrowOfferContract",2);
		GameObject g = NGUITools.AddChild(GameObject.Find("UI Root").gameObject,this.prefabContractScreen.gameObject);
		ContractOfferScreen contract = g.GetComponent<ContractOfferScreen>();
		screenManageContract = contract;
		this.gameObject.SetActive(false);
		gameObject.SetActive(false); 
		screenManageContract.initDriver(this.driverRef,null);
		screenManageContract.onCloseContractScreenF += onClosedManageContractScreen;
		screenManageContract.onContractAccepted += onContractManageAccepted;
	}
Example #2
0
	public void hireThisDriver() {
		

		GameObject g = NGUITools.AddChild(GameObject.Find("UI Root").gameObject,this.prefabContractScreen.gameObject);
		ContractOfferScreen contract = g.GetComponent<ContractOfferScreen>();
		contractScreen = contract;
		this.gameObject.SetActive(false);
		myDriverPanel.gameObject.SetActive(false); 
		contractScreen.initDriver(this.driverRef,this.myDriverPanel.driverRef);
		contractScreen.onCloseContractScreenF += onClosedContractScreen;
		contractScreen.onContractAccepted += onContractAccepted;
		// This is now accept contract stuff
		/*
		GarageManager.REF.doConversation("OpenHireDriversScreen");
		GTTeam team = ChampionshipSeason.ACTIVE_SEASON.getUsersTeam();
		GTCar car = team.getGTCarFromDriver(myDriverPanel.driverRef);
		int indexForMyDriver = team.indexForDriver(this.myDriverPanel.driverRef);
		
		GTDriver oldDriver = this.myDriverPanel.driverRef;
		GTDriver newDriver = driverList[currentIndex];
		GTTeam oldTeam = ChampionshipSeason.ACTIVE_SEASON.getTeamFromDriver(newDriver);
		int indexForOldDriver = oldTeam.indexForDriver(newDriver);
		oldTeam.drivers[indexForOldDriver] = myDriverPanel.driverRef;
		team.drivers[indexForMyDriver] = newDriver;
		this.myDriverPanel.initDriver(driverList[currentIndex]);
		this.myDriverPanel.showButtons();
		Destroy(this.gameObject);*/
	
	}