public UserInterface init(StatusScreen statusScreen, StarSystem starSystem, PlayerShip ship) { this.statusScreen = statusScreen; this.ship = ship; if (ship != null) { updateShip(); } textColor = messengerStyle.normal.textColor; GetComponent <Messenger>().init(this); minimap = GetComponent <Minimap>(); if (starSystem != null) { galaxyMap = GameObject.Find("Galaxy Map").GetComponent <GalaxyMap>().init(ship.jumpController); minimap.init(starSystem, galaxyMap, ship.transform, ship.radarRange); planetDescriptor = GetComponent <StarSystemPlanetDescriptor>().init(starSystem); } else { minimap.enabled = false; GetComponent <StarSystemPlanetDescriptor>().enabled = false; } showBars = starSystem != null; gameObject.SetActive(true); showInterface = true; return(this); }
public BarAir(Data data, StatusScreen parant) : base(data, parant) { SetBar( StandardRect(parant).X + 12, StandardRect(parant).Bottom + 8, 500, 16); SetColor(Color.Black, Color.Aqua); }
public BarMental(Data data, StatusScreen parant) : base(data, parant) { SetBar( StandardRect(parant).X, StandardRect(parant).Bottom + 8, 500, 16); SetColor(Color.Black, Color.LawnGreen); }
public ScanningScreen init(ExploreScreen exploreScreen, StatusScreen statusScreen, ItemDescriptor itemDescriptor) { this.exploreScreen = exploreScreen; fightScreen = GameObject.Find("Fight Screen").GetComponent <FightScreen>().init(this, statusScreen, itemDescriptor); scanningDetails = transform.Find("Scanning Details").GetComponent <ScanningDetails>().init(this); statusScreen.cabin.scanningScreen = this; cursor = transform.Find("Cursor").transform; cursor.gameObject.SetActive(true); closeBtn = transform.Find("Close Button").GetComponent <Button>().init(); transform.Find("Background").gameObject.SetActive(true); markersHolder = transform.Find("Markers Holder"); holderCenter = markersHolder.localPosition; Transform barsHolder = transform.Find("Bars Holder"); barBlocks = new GameObject[barsHolder.childCount]; char[] separ = new char[] { ' ' }; int pos; for (int i = 0; i < barsHolder.childCount; i++) { pos = int.Parse(barsHolder.GetChild(i).name.Split(separ, int.MaxValue)[2]); barBlocks[i] = barsHolder.GetChild(i).gameObject; } barsHolder.gameObject.SetActive(true); // Transform blockHolder = transform.Find("Enemy Blocks"); // enemyBlocks = new EnemyBlock[blockHolder.childCount]; // EnemyBlock block; // for (int i = 0; i < blockHolder.childCount; i++) { // block = blockHolder.GetChild(i).GetComponent<EnemyBlock>().init(this); // enemyBlocks[block.index] = block; // } // blockHolder.gameObject.SetActive(true); markersHolder.gameObject.SetActive(true); foreach (EnemyType eType in Enum.GetValues(typeof(EnemyType))) { if (eType.planet() == Vars.planetType) { enemyTypes.Add(eType); } } isActive = true; close(); return(this); }
public void UpdateAllBackgrounds() { MainScreen.UpdateBackground(); ItemScreen.UpdateBackground(); //MagicScreen.UpdateBackground(); MateriaScreen.UpdateBackground(); EquipScreen.UpdateBackground(); StatusScreen.UpdateBackground(); ConfigScreen.UpdateBackground(); PhsScreen.UpdateBackground(); SaveScreen.UpdateBackground(); }
/// <summary> /// Main update running the game /// /// Manages all animations /// </summary> public void Update() { //Quits Application if (Input.GetKeyDown(KeyCode.Escape)) { Application.Quit(); } //If we have an animation in the list, call its update, if it returns true, it's finished and wants to be dequeued and remove from the currently updating list if (m_Animations.Count > 0) { if (m_Animations.Peek().RunUpdate() == true) { m_Animations.Dequeue(); if (m_Animations.Count > 0) { //If there's another animation, prep it to run m_Animations.Peek().RunStart(); } } } else //If we dont have anymore animations, attempt to move to the next player { //Keep a reference of the next player Player m_CurrentPlayer = m_Players[NextPlayer()]; //If he doesn't have any jail-time, load up the dice roll animation for him if (m_CurrentPlayer.m_DaysLeftInJail <= 0) { AddToAnimationQueue(new RollManager(m_CurrentPlayer)); m_Animations.Peek().RunStart(); } else //If he does have jail time, post a message displaying the jail time and deincrement his jailtime by a day { CustomAnimation m_TempCustomAnimation = new StatusScreen("Spent the Day in Jail - Wait " + m_CurrentPlayer.m_DaysLeftInJail + " Days For Release", 2.0f); m_TempCustomAnimation.RunStart(); AddToAnimationQueue(m_TempCustomAnimation); WriteToLog("Player: " + m_CurrentPlayer.name + " Spent the day in Jail"); m_CurrentPlayer.m_DaysLeftInJail--; //If the player has moved out of jail, move him to visiting if (m_CurrentPlayer.m_DaysLeftInJail <= 0) { m_TempCustomAnimation = new PlayerMovementToNode(m_CurrentPlayer, transform.FindChild("Just Visiting").GetComponent <Node>(), 1.0f); m_TempCustomAnimation.RunStart(); AddToAnimationQueue(m_TempCustomAnimation); } } } }
public FightScreen init(ScanningScreen scanningScreen, StatusScreen statusScreen, ItemDescriptor itemDescriptor) { this.scanningScreen = scanningScreen; this.playerData = statusScreen.playerData; this.itemDescriptor = itemDescriptor; this.chambersHolder = statusScreen.cabin.chambersHolder; fightProcessor = GetComponent <FightProcessor>(); itemDescriptor.fightScreen = this; elementsHolder = transform.Find("Elements Holder").GetComponent <ElementsHolder> ().init(this);; iconsHolderRender = elementsHolder.GetComponent <SpriteRenderer>(); fightEffectPlayer = transform.Find("Fight Effect Player").GetComponent <FightEffectPlayer>().init(); elementEffectPlayer = transform.Find("ElementEffectPlayer").GetComponent <ElementEffectPlayer>(); fightInterface = transform.Find("Fight Interface").GetComponent <FightInterface>().init(this); enemy = transform.Find("Enemy").GetComponent <Enemy>(); resultScreen = transform.Find("Fight Result Screen").GetComponent <FightResultScreen>().init(this, statusScreen.cabin.chambersHolder, enemy); enemyDeadAnimator = transform.Find("EnemyDeadAnim").GetComponent <Animator>(); deadStone = enemyDeadAnimator.transform.Find("DeadStone"); enemyPos = enemy.transform.localPosition; // elementsHolder.init(); enemy.init(this); elementEffectPlayer.init(this, enemy); fightProcessor.init(this, elementsHolder, enemy); elementsHolder.gameObject.SetActive(true); enemyDeadAnimator.gameObject.SetActive(false); gameObject.SetActive(false); Transform actionsHolder = transform.Find("Actions Holder"); actionsHolder.Find("Delimiter").GetComponent <StrokeText>().init("default", 5); playerActionsText = actionsHolder.Find("Player Actions").GetComponent <StrokeText>().init("default", 5); enemyActionsText = actionsHolder.Find("Enemy Actions").GetComponent <StrokeText>().init("default", 5); actionsHolder.gameObject.SetActive(true); Transform supplyHolder = transform.Find("Supply Holder"); SupplySlot slot; for (int i = 0; i < supplyHolder.childCount; i++) { slot = supplyHolder.GetChild(i).GetComponent <SupplySlot>(); slot.init(); supplySlots.Add(slot); } supplyHolder.gameObject.SetActive(true); captureBtn = transform.Find("Capture Button").GetComponent <Button> ().init(); releaseBtn = transform.Find("Release Button").GetComponent <Button> ().init(); Player.fightScreen = this; return(this); }
public Cabin init(StatusScreen statusScreen) { this.statusScreen = statusScreen; terminalBtn = transform.Find("Terminal Button").GetComponent <Button>().init(); restBtn = transform.Find("Rest Button").GetComponent <Button>().init(); stasisBtn = transform.Find("Stasis Button").GetComponent <Button>().init(); terminal = transform.Find("Player Terminal").GetComponent <PlayerTerminal>().init(this); chambersHolder = transform.Find("Chambers").GetComponent <StasisChambersHolder>().init(this); return(this); }
private void init() { Vars.initVars(); Vars.inSpace = true; ItemFactory.itemPrefab = itemPrefab; mainCamera = Camera.main.transform; Imager.initialize(); Player.init(); GameObject.Find("Images Provider").GetComponent <ImagesProvider>().init(); starField = GameObject.Find("StarField").GetComponent <StarField>().init(); star = transform.Find("Star").GetComponent <SpriteRenderer>(); star.gameObject.SetActive(true); ItemDescriptor descriptor = GameObject.Find("Item Descriptor").GetComponent <ItemDescriptor>().init(); statusScreen = GameObject.Find("Status Screen").GetComponent <StatusScreen>().init(this, descriptor); descriptor.playerData = statusScreen.playerData; if (Vars.shipCurrentHealth == -1) { statusScreen.shipData.initializeRandomShip(HullType.ARMAGEDDON); statusScreen.inventory.setCapacity(statusScreen.shipData.hullType.getStorageCapacity()); } else { statusScreen.initFromVars(); } initPlayerShip(); statusScreen.cameraController = cameraController; Vars.userInterface = GameObject.FindGameObjectWithTag("UserInterface").GetComponent <UserInterface>().init(statusScreen, this, playerShip); shieldsPool = GameObject.Find("ShieldsPool").GetComponent <ShieldsPool>(); explosionsManager = GameObject.Find("Explosions Manager").GetComponent <ExplosionsManager>().init(); lootDropper = GameObject.Find("Loot Dropper").GetComponent <LootDropper>().init(statusScreen.inventory, descriptor); spawner = GetComponent <EnemySpawner>().init(Vars.userInterface.minimap, playerShip.transform); loadStarSystem(); gamePaused = false; }
private void HasToShowHeader(StatusScreen statusScreen) { switch (statusScreen) { case StatusScreen.Login: case StatusScreen.UmEx: case StatusScreen.ShMenu: HeaderVisibility = Visibility.Collapsed; CloseFlyouts(); return; } HeaderVisibility = Visibility.Visible; }
public ExploreScreen init(PlanetSurface planetSurface, StatusScreen statusScreen, ItemDescriptor itemDescriptor) { this.planetSurface = planetSurface; enemyImage = transform.Find("Enemy Image").GetComponent <SpriteRenderer>(); exploreBtn = transform.Find("Explore Button").GetComponent <Button>().init(); leaveBtn = transform.Find("Leave Button").GetComponent <Button>().init(); scanningScreen = GameObject.Find("Scanning Screen").GetComponent <ScanningScreen>().init(this, statusScreen, itemDescriptor); gameObject.SetActive(false); return(this); }
// private AnnouncementScreen announcementScreen; void Awake() { Vars.initVars(); Vars.inSpace = false; ItemFactory.itemPrefab = itemPrefab; Imager.initialize(); Player.init(); GameObject.Find("Images Provider").GetComponent <ImagesProvider>().init(); background = transform.Find("Background").GetComponent <Background>().init(); // announcementsBtn = transform.Find("Announcements Button").GetComponent<Button>().init(); marketBtn = transform.Find("Market Button").GetComponent <Button>().init(); hangarBtn = transform.Find("Hangar Button").GetComponent <Button>().init(); // industrialBtn = transform.Find("Industrial Button").GetComponent<Button>().init(); leaveBtn = transform.Find("Leave Button").GetComponent <Button>().init(); btns = new Button[] { marketBtn, hangarBtn, leaveBtn }; //announcementsBtn, industrialBtn, PlanetSurface.topHideable = this; ItemDescriptor descriptor = GameObject.Find("Item Descriptor").GetComponent <ItemDescriptor>().init(); statusScreen = GameObject.Find("Status Screen").GetComponent <StatusScreen>().init(null, descriptor); descriptor.playerData = statusScreen.playerData; Vars.userInterface = GameObject.FindGameObjectWithTag("UserInterface").GetComponent <UserInterface>().init(statusScreen); // messageBox = GameObject.Find("Message Box").GetComponent<MessageBox>(); story = GameObject.Find("Story Teller").GetComponent <Story>().init(this); // announcementScreen = GameObject.Find("Announcement Screen").GetComponent<AnnouncementScreen>().init(this, statusScreen.cabin); exploreScreen = GameObject.Find("Explore Screen").GetComponent <ExploreScreen>().init(this, statusScreen, descriptor); market = GameObject.Find("Equipments Market").GetComponent <EquipmentsMarket> ().init(this, statusScreen.inventory, descriptor); hangarScreen = GameObject.Find("Hangar Screen").GetComponent <HangarScreen>().init(this, statusScreen.inventory, statusScreen.shipData); // industrialScreen = GameObject.Find("Industrial Screen").GetComponent<IndustrialScreen>().init(this); // messageBox.init(this); if (Vars.shipCurrentHealth == -1) { startNewGame(); } landPlanet(); }
public void ChangeCurrentView(StatusScreen statusScreen, bool bHasToInit, bool bForzeToInit = false, string parameters = null) { if (_lastView != null) { CurrentView = _lastView; _lastView = null; } else { CurrentView = DictionaryViews[statusScreen]; } HasToShowHeader(statusScreen); if (bHasToInit) { CurrentView.Initialize(bForzeToInit, parameters); } }
public void PrintResult(string asset, StatusScreen status) { switch (status) { case StatusScreen.Success: new LineColorLine().Green("[Processed] - "); new LineColorLine().White(asset + "\n"); break; case StatusScreen.Warning: new LineColorLine().Yellow("[Warning] - "); new LineColorLine().White(asset + "\n"); break; case StatusScreen.Error: new LineColorLine().Red("[Error] - "); new LineColorLine().White(asset + "\n"); break; } }
public UserInterface init(StatusScreen statusScreen) { return(init(statusScreen, null, null)); }
private static Rectangle StandardRect(StatusScreen parant) { return(parant.AirBar.Bounds); }
public GuiInterface(Game game) { statusScreen = new StatusScreen(game); game.Components.Add(statusScreen); hudScreen = new HudScreen(game); game.Components.Add(hudScreen); }
public BarExp(Data data, StatusScreen parant) : base(data, parant) { SetBar(610, 1020, 700, 30); SetColor(Color.Black, Color.Yellow); }
public BarHp(Data data, StatusScreen parant) : base(data, parant) { SetBar(25, 25, 700, 35); SetColor(Color.Black, Color.DarkRed); }