void Awake() { hud = GetComponent<Hud>(); //TODO find is only quick n dirty agentName = transform.FindChild("Container").FindChild("TopImage").GetComponentInChildren<Text>(); agentPortrait = transform.FindChild("Container").FindChild("BottomImage").GetComponentInChildren<Image>(); }
void Start() { style.normal.textColor = Color.white; style.font = font; style.fontSize = 11; that = this; }
public void Init(GameController game, GameGrid grid, Hud hud) { this.game = game; this.grid = grid; this.hud = hud; SelectGameTool(GameTools.TILE); }
// Use this for initialization void Start() { anim = GetComponent <Animation>(); oldCamera = Camera.main; myCamera = GetComponentInChildren <Camera>(); oldCamera.gameObject.active = false; myCamera.gameObject.active = true; Hud.getHud().hudEnabled = false; GameObject audioQuest = GameObject.Find("AudioQuest"); GameObject.Destroy(audioQuest); }
override protected void OnLoseLevel() { if (HealthTutorialCompleted) { base.OnLoseLevel(); } else { Hud.CreateHealthInfoWindow().OnClick += base.OnLoseLevel; HealthTutorialCompleted = true; } }
public void OnLevelWasLoaded() { if (Application.loadedLevelName.ToLower() == "battlefield" && Game.game.currentState == Game.GameStates.InGame && !completed && Game.game.currentQuest.name == "Quest2") { runningTutorial = true; Game.game.currentState = Game.GameStates.InTutorial; Game.game.quickChestEnabled = true; stage = STAGES.WAITING_TO_OPEN_QUICK_CHEST; Hud.getHud().inventoryCanBeOpen = false; } }
// Use this for initialization void Start () { if (hud == null) { hud = Instantiate (hudPrefab).GetComponentInChildren<Hud>(); hud.gameController = this; } if (resultsPanel == null) { resultsPanel = Instantiate (resultsPanelPrefab).GetComponentInChildren<ResultsPanel>(); resultsPanel.gameController = this; } StartRound (); mainCamera.GetComponent<AudioSource> ().enabled = false; }
public void OnEatAll() { GameObject.Find("Player").SendMessage("OnStageClear"); GameObject[] enemys = GameObject.FindGameObjectsWithTag("Enemy"); for (int i = 0; i < enemys.Length; i++) { enemys[i].SendMessage("OnStageClear"); } GameObject.Find("Player").SendMessage("OnStageClear"); Hud.get().DrawStageClear(true); StartCoroutine("StageClear"); }
// Token: 0x06001439 RID: 5177 RVA: 0x00021194 File Offset: 0x00020194 protected internal override void Execute(ActivityExecutionContext context) { for (uint num = 0u; num < base.Event.EventDef.Num_Hud(); num += 1u) { bool enable = (this.flags & EnableHud.HudToggle.Enable) != (EnableHud.HudToggle) 0; Hud.EnableGadget(base.Event.EventDef.Hud(num), enable); if ((this.flags & EnableHud.HudToggle.Dispose) != (EnableHud.HudToggle) 0) { Hud.DisposeGadget(base.Event.EventDef.Hud(num)); } } }
override protected void OnStartLevel() { if (HowToPlayTutorialCompleted) { base.OnStartLevel(); } else { Hud.CreateHowToPlayInfoWindow().OnClick += base.OnStartLevel; HowToPlayTutorialCompleted = true; } }
public void Customize() { Hud.RunOnPlugin <ChestPlugin>(plugin => { // enable DEFAULT plugin.Enabled = true; // normal chest shape plugin.NormalChestDecorator = new WorldDecoratorCollection( // map shape circle new MapShapeDecorator(Hud) { Brush = Hud.Render.CreateBrush(220, 200, 255, 200, 1.8f), ShadowBrush = Hud.Render.CreateBrush(96, 0, 0, 0, 1), Radius = 6.0f, ShapePainter = new CircleShapePainter(Hud), }, // ground shape x new GroundShapeDecorator(Hud) { Brush = Hud.Render.CreateBrush(200, 230, 230, 0, 3), Radius = 0.9f, ShapePainter = WorldStarShapePainter.NewCross(Hud), } ); // resplendent chest shape plugin.ResplendentChestDecorator = new WorldDecoratorCollection( // map shape circle new MapShapeDecorator(Hud) { Brush = Hud.Render.CreateBrush(220, 64, 255, 64, 3.5f), ShadowBrush = Hud.Render.CreateBrush(96, 0, 0, 0, 1), Radius = 6.5f, ShapePainter = new CircleShapePainter(Hud), }, // ground shape x new GroundShapeDecorator(Hud) { Brush = Hud.Render.CreateBrush(200, 230, 230, 0, 3), Radius = 0.9f, ShapePainter = WorldStarShapePainter.NewCross(Hud), } ); }); }
public override void ViewDidLoad() { base.ViewDidLoad(); var vm = (IssueMilestonesViewModel)ViewModel; BindCollection(vm.Milestones, x => { var e = new MilestoneElement(x); e.Tapped += () => { if (vm.SelectedMilestone != null && vm.SelectedMilestone.Number == x.Number) { vm.SelectedMilestone = null; } else { vm.SelectedMilestone = x; } }; if (vm.SelectedMilestone != null && vm.SelectedMilestone.Number == x.Number) { e.Accessory = UITableViewCellAccessory.Checkmark; } return(e); }); vm.Bind(x => x.SelectedMilestone, x => { if (Root.Count == 0) { return; } foreach (var m in Root[0].Elements.Cast <MilestoneElement>()) { m.Accessory = (x != null && m.Milestone.Number == x.Number) ? UITableViewCellAccessory.Checkmark : UITableViewCellAccessory.None; } Root.Reload(Root[0], UITableViewRowAnimation.None); }); var _hud = new Hud(View); vm.Bind(x => x.IsSaving, x => { if (x) { _hud.Show("Saving..."); } else { _hud.Hide(); } }); }
private void CoEReady_Action() { // attack timer bTimer = new System.Timers.Timer { Interval = TimeLeftBeforeAttack * 1000 }; bTimer.Elapsed += CoEAttack; bTimer.AutoReset = false; bTimer.Enabled = true; var msg = string.Empty; if (Speak || TextMsg) { if (Speak) { ReadyToAttack.PlaySync(); if (culture == "ko") { msg = "공격 준비!"; } else { msg = "Ready to attack!"; } Hud.Sound.Speak(msg); } if (TextMsg) { var msgTitle = string.Empty; if (culture == "ko") { msg = ">>> 공격 준비 <<<"; msgTitle = " 준 비 !"; } else { msg = ">>> Ready to attack <<<"; msgTitle = "Preparation!"; } Hud.RunOnPlugin <PopupMsgPlugin>(plugin => { plugin.Show(msg, msgTitle, (TimeLeftBeforeAttack - 1) * 1000, "", PopupMsgPlugin.EnumPopupDecoratorToUse.Default); }); } } }
public override void ViewDidLoad() { base.ViewDidLoad(); var vm = (IssueComponentsViewModel)ViewModel; BindCollection(vm.Components, x => { var e = new ComponentElement(x); e.Tapped += () => { if (vm.SelectedValue != null && string.Equals(vm.SelectedValue, x.Name)) { vm.SelectedValue = null; } else { vm.SelectedValue = x.Name; } }; if (vm.SelectedValue != null && string.Equals(vm.SelectedValue, x.Name)) { e.Accessory = UITableViewCellAccessory.Checkmark; } return(e); }); vm.Bind(x => x.SelectedValue, x => { if (Root.Count == 0) { return; } foreach (var m in Root[0].Elements.Cast <ComponentElement>()) { m.Accessory = (x != null && string.Equals(m.Component.Name, x)) ? UITableViewCellAccessory.Checkmark : UITableViewCellAccessory.None; } Root.Reload(Root[0], UITableViewRowAnimation.None); }); var _hud = new Hud(View); vm.Bind(x => x.IsSaving, x => { if (x) { _hud.Show("Saving..."); } else { _hud.Hide(); } }); }
/// <summary> /// LoadContent will be called once per game and is the place to load /// all of your content. /// </summary> protected override void LoadContent() { // Create a new SpriteBatch, which can be used to draw textures. spriteBatch = new SpriteBatch(GraphicsDevice); font = Content.Load <SpriteFont>("font"); hollowTile = createHollowRectangle(Constants.tileSize, Constants.tileSize, GraphicsDevice); solidTile = createSolidRectangle(Constants.tileSize, Constants.tileSize, GraphicsDevice); grid = new TileGrid(hollowTile, solidTile, Constants.tileSize, Constants.columns, Constants.rows, font); camera = new Camera(new Rectangle(0, 0, Constants.windowWidth / 2, Constants.windowHeight / 2), new Rectangle(0, 0, Constants.windowWidth * 4, Constants.windowHeight * 4)); hud = new Hud(createSolidRectangle(800, Constants.tileSize * 3, GraphicsDevice), font, new Vector2(0, 580 - (Constants.tileSize * 2)), 800, 600); camera.Update(Vector2.Zero); // TODO: use this.Content to load your game content here }
// Use this for initialization void Start() { //m_ColorSection.renderer.material = m_OffMaterial; //gets sound manager m_SFX = SFXManager.Instance; //gets Hud m_Hud = GameObject.FindGameObjectWithTag(Constants.HUD).GetComponent <Hud>(); m_DrawGUI = false; m_WasUsed = false; m_LightsToTurnOn = GetComponentsInChildren <SceneLights> (); }
public void OnLootGenerated(IItem item, bool gambled) { foreach (MyItem myItem in ItemsToWatch) { if (ItemMatchCheck(item, myItem)) { Hud.RunOnPlugin <PopupNotifications>(plugin => { plugin.Show(item.SnoItem.NameLocalized, myItem.Title, myItem.Duration, myItem.Hint, myItem.Decorator); }); } } }
// Use this for initialization void Start() { //m_ColorSection.renderer.material = m_OffMaterial; //gets sound manager m_SFX = SFXManager.Instance; //gets Hud m_Hud = GameObject.FindGameObjectWithTag(Constants.HUD).GetComponent<Hud>(); m_DrawGUI = false; m_WasUsed = false; m_LightsToTurnOn = GetComponentsInChildren<SceneLights> (); }
public static void Postfix(Hud __instance) { playerInitialCrosshairX = __instance.m_crosshair.transform.position.x; playerInitialCrosshairY = __instance.m_crosshair.transform.position.y; playerInitialStealthBarX = __instance.m_stealthBar.transform.position.x; playerInitialStealthBarY = __instance.m_stealthBar.transform.position.y; lastSetCrosshairPos = __instance.m_crosshair.transform.position; lastSetStealthBarPos = __instance.m_stealthBar.transform.position; targetCrosshairPos = __instance.m_crosshair.transform.position; targetStealthBarPos = __instance.m_stealthBar.transform.position; }
public void ShowThumb() { ThumbBlur.SetActive(true); Thumb.SetActive(true); ThumbWhite.SetActive(true); TutorialBtnReact BtnReact = Hud.GetComponent <TutorialBtnReact>(); GameObject victim = BtnReact.getVictim(); //Debug.Log(victim); Parameters Parameters = victim.GetComponent <Parameters>(); Delay = Parameters.Backfill; //backfill in seconds //Debug.Log(Delay); }
private static async void AnimatedProgressButtonOnTouchUpInside(object sender, EventArgs e) { Hud.Create().WithProgressContent() .WithBackgroundDimming(true) .Build() .Show(); await Task.Delay(TimeSpan.FromSeconds(2)); Hud.Create().WithSuccessContent() .Build() .Flash(TimeSpan.FromSeconds(1)); }
public virtual void Draw(int interval) { SizeF res = UIMenu.GetScreenResolutionMaintainRatio(); Point safe = UIMenu.GetSafezoneBounds(); UIResText.Draw(Label, (int)res.Width - safe.X - 180, (int)res.Height - safe.Y - (30 + (4 * interval)), Font.ChaletLondon, 0.3f, Color.White, UIResText.Alignment.Right, false, false, 0); Sprite.Draw("timerbars", "all_black_bg", (int)res.Width - safe.X - 298, (int)res.Height - safe.Y - (40 + (4 * interval)), 300, 37, 0f, Color.FromArgb(180, 255, 255, 255)); Hud.HideComponentThisFrame(HudComponent.AreaName); Hud.HideComponentThisFrame(HudComponent.StreetName); Hud.HideComponentThisFrame(HudComponent.VehicleName); }
public void Hide() { if (mHud != null) { if (!mHud.Lost) { mHud.Enabled = false; mManager.Host.Render.RemoveHud(mHud); } mHud.Dispose(); mHud = null; } }
public void Customize() { Hud.RunOnPlugin <DoorsPlugin>(plugin => plugin.ShowInTown = true); Hud.RunOnPlugin <DangerousAffixMonsterPlugin>(plugin => { plugin.Affixes.Clear(); }); using (var alertListsConfigurator = new AlertListsConfigurator()) { alertListsConfigurator.Configure(Hud); } Enabled = false; }
private void Start() { GameObject hudObj = GameObject.Find("Hud"); if (hudObj) { hud = (Hud)hudObj.GetComponent(typeof(Hud)); } else { Debug.Log("not find hud"); } }
public void Customize() { Hud.RunOnPlugin <PlayerSkillPlugin>(plugin => { // disable DEFAULT plugin.Enabled = false; // DISABLE DH Sentry map deco (DEFAULT theme) /* plugin.SentryDecorator.Enabled = false; * plugin.SentryWithCustomEngineeringDecorator.Enabled = false; */ }); }
public static void Postfix(Hud __instance) { var hotkeyBar = __instance.GetComponentInChildren <HotkeyBar>(); if (EquipmentAndQuickSlots.QuickSlotsEnabled.Value && hotkeyBar.transform.parent.Find("QuickSlotsHotkeyBar") == null) { var quickslotsHotkeyBar = Object.Instantiate(hotkeyBar.gameObject, __instance.m_healthBarRoot, true); quickslotsHotkeyBar.name = "QuickSlotsHotkeyBar"; (quickslotsHotkeyBar.transform as RectTransform).anchoredPosition = new Vector2(55, -120); quickslotsHotkeyBar.transform.localEulerAngles = new Vector3(0.0f, 0.0f, -90f); quickslotsHotkeyBar.GetComponent <HotkeyBar>().m_selected = -1; } }
// Update is called once per frame void Update() { if (!anim || !anim.isPlaying) { oldCamera.gameObject.active = true; myCamera.gameObject.active = false; Hud.getHud().hudEnabled = true; Game game = Game.game; //this little hack is needed due that aurora is already dead so is not in the sEnemies queue foreach (TMonoBehaviour t in game.renderQueue) { if (t is BasicEnemy && !BasicEnemy.sEnemies.Contains(t)) { BasicEnemy.sEnemies.Add(t); } } foreach (BasicEnemy e in BasicEnemy.sEnemies) { if (game.renderQueue.Contains(e)) { game.renderQueue.Remove(e); } Destroy(e.gameObject); } BasicEnemy.sEnemies.Clear(); game.playableCharacter.setFeetPos(new Vector3(0.0f, -0.73f, 0.0f)); game.playableCharacter.currentFacing = SoulAvenger.Character.FACING.RIGHT; GameObject prefab = Resources.Load("Prefabs/Enemies/Demonic_lord1b") as GameObject; BasicEnemy enemy = Game.game.spawnEnemy(prefab); GameObject go = enemy.gameObject; Animation anm = go.AddComponent <Animation>(); enemy.mustNotifyDeath = true; enemy.prefab = prefab; enemy.currentFacing = SoulAvenger.Character.FACING.LEFT; AnimationClip clip = Resources.Load("Cinematics/Quest30/demonic_lord_begin") as AnimationClip; anm.AddClip(clip, "cinematic"); anm.Play("cinematic"); //place me at the end Destroy(gameObject); Game.game.playSound(Game.game.currentQuest.audioQuest, true, "AudioQuest"); } }
public void Customize() { Hud.RunOnPlugin <BloodShardPlugin>(plugin => { // enable BloodShardPlugin (DEFAULT) plugin.Enabled = true; // red deco plugin.RedDecorator = new TopLabelDecorator(Hud) { TextFont = Hud.Render.CreateFont("tahoma", 8, 255, 255, 100, 100, true, false, 255, 0, 0, 0, true), // BackgroundTexture1 = Hud.Texture.ButtonTextureGray, // BackgroundTexture2 = Hud.Texture.BackgroundTextureOrange, BackgroundTexture1 = Hud.Texture.BackgroundTextureOrange, BackgroundTexture2 = Hud.Texture.ButtonTextureGray, BackgroundTextureOpacity1 = 0.8f, BackgroundTextureOpacity2 = 0.8f, TextFunc = () => Hud.Game.Me.Materials.BloodShard.ToString("D", CultureInfo.InvariantCulture), HintFunc = () => "amount of blood shards" }; // yellow deco plugin.YellowDecorator = new TopLabelDecorator(Hud) { TextFont = Hud.Render.CreateFont("tahoma", 8, 255, 200, 205, 50, true, false, 255, 0, 0, 0, true), // BackgroundTexture1 = Hud.Texture.ButtonTextureGray, // BackgroundTexture2 = Hud.Texture.BackgroundTextureOrange, BackgroundTexture1 = Hud.Texture.BackgroundTextureOrange, BackgroundTexture2 = Hud.Texture.ButtonTextureGray, BackgroundTextureOpacity1 = 0.8f, BackgroundTextureOpacity2 = 0.8f, TextFunc = () => Hud.Game.Me.Materials.BloodShard.ToString("D", CultureInfo.InvariantCulture), HintFunc = () => "amount of blood shards" }; // green deco plugin.GreenDecorator = new TopLabelDecorator(Hud) { TextFont = Hud.Render.CreateFont("tahoma", 8, 255, 100, 130, 100, true, false, 255, 0, 0, 0, true), // BackgroundTexture1 = Hud.Texture.ButtonTextureGray, // BackgroundTexture2 = Hud.Texture.BackgroundTextureOrange, BackgroundTexture1 = Hud.Texture.BackgroundTextureOrange, BackgroundTexture2 = Hud.Texture.ButtonTextureGray, BackgroundTextureOpacity1 = 0.8f, BackgroundTextureOpacity2 = 0.8f, TextFunc = () => Hud.Game.Me.Materials.BloodShard.ToString("D", CultureInfo.InvariantCulture), HintFunc = () => "amount of blood shards" }; }); }
protected override void OnFixedUpdate(float timeMult) { base.OnFixedUpdate(timeMult); if (isStillLoading > 0) { isStillLoading--; if (isStillLoading <= 0) { net.Send(new LevelReady { Index = localPlayerIndex }, 2, NetDeliveryMethod.ReliableUnordered, PacketChannels.Main); } } #if DEBUG Hud.ShowDebugText("- Local Player Index: " + localPlayerIndex); Hud.ShowDebugText("- RTT: " + (int)(net.AverageRoundtripTime * 1000) + " ms / Up: " + net.Up + " / Down: " + net.Down); Hud.ShowDebugText("- Last Server Update: " + lastServerUpdateTime); Hud.ShowDebugText("- Remote Objects: " + localRemotableActors.Count + " / " + remoteActors.Count); #endif if (players.Count > 0) { lastUpdate += timeMult; if (lastUpdate < 1.4f) { return; } lastUpdate = 0f; long updateTime = (long)(NetTime.Now * 1000); UpdateSelf updateSelfPacket = players[0].CreateUpdatePacket(); updateSelfPacket.Index = localPlayerIndex; updateSelfPacket.UpdateTime = updateTime; net.Send(updateSelfPacket, 29, NetDeliveryMethod.Unreliable, PacketChannels.Main); foreach (KeyValuePair <int, IRemotableActor> pair in localRemotableActors) { UpdateRemotableActor p = new UpdateRemotableActor(); pair.Value.OnUpdateRemotableActor(ref p); p.Index = pair.Key; p.UpdateTime = updateTime; net.Send(p, 32, NetDeliveryMethod.Unreliable, PacketChannels.Main); } } }
public void Customize() { // ADD buff icons to player's RIGHT buff list // cheat death debuff Hud.RunOnPlugin <PlayerRightBuffListPlugin>(plugin => { /* BuffRules property: * IconIndex = null,0,1,2,3,4,5 / MinimumIconCount = 1 / ShowStacks = true; */ plugin.BuffPainter.ShowTimeLeftNumbers = true; plugin.BuffPainter.Opacity = 0.65f; // plugin.BuffPainter.TimeLeftFont = Hud.Render.CreateFont("tahoma", 5, 160, 255, 255, 255, true, false, 160, 0, 0, 0, true); // plugin.BuffPainter.StackFont = Hud.Render.CreateFont("tahoma", 6, 255, 255, 255, 255, false, false, 255, 0, 0, 0, true); plugin.BuffPainter.ShowTooltips = false; plugin.BuffPainter.HasIconBorder = true; plugin.RuleCalculator.SizeMultiplier = 0.80f; /* --| CHEAT DEATH |-- */ plugin.RuleCalculator.Rules.Add(new BuffRule(156484) { IconIndex = 1, MinimumIconCount = 1 }); // Near Death Experience plugin.RuleCalculator.Rules.Add(new BuffRule(208474) { IconIndex = 1, MinimumIconCount = 1 }); // Unstable Anomaly plugin.RuleCalculator.Rules.Add(new BuffRule(359580) { IconIndex = 1, MinimumIconCount = 1 }); // Firebird's Finery plugin.RuleCalculator.Rules.Add(new BuffRule(324770) { IconIndex = 1, MinimumIconCount = 1 }); // Awareness plugin.RuleCalculator.Rules.Add(new BuffRule(218501) { IconIndex = 1, MinimumIconCount = 1 }); // Spirit Vessel plugin.RuleCalculator.Rules.Add(new BuffRule(309830) { IconIndex = 1, MinimumIconCount = 1 }); // Indestructible plugin.RuleCalculator.Rules.Add(new BuffRule(217819) { IconIndex = 1, MinimumIconCount = 1 }); // Nerves of Steel }); }
// "Customize" methods are automatically executed after every plugin is loaded. // So these methods can use Hud.GetPlugin<class> to access the plugin instances' public properties (like decorators, Enabled flag, parameters, etc) // Make sure you test the return value against null! public void Customize() { // AriadnesThreadPlugin Customization Hud.RunOnPlugin <Resu.AriadnesThreadPlugin>(plugin => { plugin.ThreadBetweenPlayers = false; // Set to false to disable the thread between players. plugin.Pools = true; // Set to true to enable pools of reflection. plugin.BannerTimeSeconds = 3; // Number of seconds you want each player's banner to stay. plugin.MetricSystem = false; // Set to true to use metric system for bounty distance. }); // End of AriadnesThreadPlugin Customization // DeluxeShrineLabelsPlugin Customization Hud.RunOnPlugin <Resu.DeluxeShrineLabelsPlugin>(plugin => { //Enable permanent Healing Well display plugin.ShowHealingWells = false; //Enable permanent Pool of reflection display plugin.ShowPoolOfReflection = true; // Disable displaying Healing Wells & Pools of reflection only when health is under 40% plugin.ShowAllWhenHealthIsUnder40 = false; //Change Pylon Short Name Example plugin.ShrineCustomNamesShort[ShrineType.BanditShrine] = "**BANDIT**"; //Change Pylon Minimap Name Example plugin.ShrineCustomNames[ShrineType.BanditShrine] = "OMG A BANDIT SHRINE"; //Change Pylon Minimap Decorator Example //CreateMapDecorators(Font Size, Saturation(0-255), Red(0-255), Green(0-255), Blue(0-255), Radius Offset) plugin.ShrineDecorators[ShrineType.BanditShrine] = plugin.CreateMapDecorators(8, 255, 255, 0, 0, 5); //Change Pylon Ground Label Decorator Example //CreateGroundLabelDecorators(Font Size, Saturation(0-255), Red(0-255), Green(0-255), Blue(0-255), Bg Saturation(0-255), Bg Red(0-255), Bg Green(0-255), Bg Blue(0-255) ) plugin.ShrineShortDecorators[ShrineType.BanditShrine] = plugin.CreateGroundLabelDecorators(8, 255, 255, 0, 0, 255, 0, 0, 0); }); // End of DeluxeShrineLabelsPlugin Customization // Settings for Paragon Percentage Plugin Hud.RunOnPlugin <Resu.ParagonPercentagePlugin>(plugin => { plugin.ParagonPercentageOnTheRight = true; // set to true to display % on the left plugin.ShowGreaterRiftMaxLevel = true; // set to true to disable GR level display plugin.DisplayParagonPercentage = true; // set to false to disable paragon percentage display }); // End of settings for Paragon Percentage Plugin // Disable Top Experience Statistics Hud.TogglePlugin <TopExperienceStatistics>(true); // End of Disable Top Experience Statistics }
// Use this for initialization public override void TStart() { character = gameObject.GetComponent <SoulAvenger.Character>(); //instantiate the effect effect = Instantiate(Resources.Load("Prefabs/Effects/SoulAvenger")) as GameObject; effect.transform.parent = character.transform.Find("SoulAvengerPos"); if (effect.transform.parent == null) { effect.transform.parent = character.transform; } effect.transform.localPosition = Vector3.zero; character.changeAnimation("forceField"); Hud.getHud().addToBuffStack((Resources.Load("TexturePools/Buffs") as GameObject).GetComponent <TexturePool>().getFromList("soulavenger")); base.TStart(); SoulAvengerBuff buff = Game.game.playableCharacter.GetComponent <SoulAvengerBuff>(); if (buff == null) { buff = Game.game.playableCharacter.gameObject.AddComponent <SoulAvengerBuff>(); } else { buff.TStart(); } Game.game.effectColor[(int)Game.EFFECT_BOARD_COLOR_STACK.SOUL_AVENGER] = originColor; Game.game.effectColorEnabled[(int)Game.EFFECT_BOARD_COLOR_STACK.SOUL_AVENGER] = true; iTween.ValueTo(Game.game.effectBoard.gameObject, iTween.Hash( "from", originColor, "to", destinyColor, "time", changeColorTime, "easetype", iTween.EaseType.linear, "onupdatetarget", this.gameObject, "onupdate", "OnEffectBoardUpdate" )); CameraShake shake = Camera.main.GetComponent <CameraShake>(); if (shake != null) { shake.Shake(changeColorTime * 2.0f, 0.05f); } }
public PlayState(GameStateManager gsm, Handler handler) : base(gsm, handler) { _handler.entitiesList.Add(new Player((Game.WIDTH - 16) / 2, (Game.HEIGHT - 16) / 2, _handler)); _hud = new Hud(); _spawnPoints = new SpawnPoint[3]; _spawnPoints[0] = new SpawnPoint(10, 10); _spawnPoints[1] = new SpawnPoint(Game.WIDTH, Game.HEIGHT); _spawnPoints[2] = new SpawnPoint(Game.WIDTH / 2, Game.HEIGHT); _spawner = new Spawner(_handler, _spawnPoints); }
public void setHud(Hud hud) { for (int i = 0; i < huds.Length; i++) { if (i == (int)hud) { huds[i].SetActive(true); } else { huds[i].SetActive(false); } } }
public void Init() { hud = GetComponent<Hud>(); hud.Init(); grid = GetComponent<GameGrid>(); grid.Init(this); map = GetComponent<GameMap>(); map.Init(this, grid, hud); collectables = new List<Collectable>(); paused = false; }
// Use this for initialization void Start () { var hudGameObject = GameObject.Find("HudCamera"); if (hudGameObject != null) { _hud = hudGameObject.GetComponent<Hud>(); _hud.OnSpawn += OnSpawn; } _Db = GetComponent<Google2u.SampleCharacters>(); _DialogMap = GetComponent<Google2u.SampleDialogMap>(); _Weapons = GetComponent<Google2u.SampleWeapons>(); }
// Use this for initialization void Start () { instance = this; Instruction_cube = GameObject.Find("Instruction_cube"); Panel1 = transform.Find("Panel1"); Panel2 = transform.Find("Panel2"); Panel3 = transform.Find("Panel3"); Panel1.gameObject.SetActive(false); Panel2.gameObject.SetActive(false); Panel3.gameObject.SetActive(true); Continue_text.text = "Start"; instruction_text.text = "GRID WARS"; guicame.backgroundColor = Color.blue; end_turn.onClick.AddListener(() => play_data.instance.next_turn()); option_0.onClick.AddListener(() => play_data.instance.option_0()); option_1.onClick.AddListener(() => play_data.instance.option_1()); option_2.onClick.AddListener(() => play_data.instance.option_2()); Continue.onClick.AddListener(() => play_data.instance.Continue()); }
// The hud must NOT be in Render mode! internal void PaintBackground(Hud hud) { Rectangle r = Region; if (!IsLabelOnly) { hud.Fill(r, BorderColor); r = new Rectangle(r.X + 1, r.Y + 1, r.Width - 2, r.Height - 2); hud.Fill(r, BackgroundColor); } else { hud.Fill(r, Colors.Background); } }
/// <summary> /// Deletes and recreates the window huds, causing this window to be /// the topmost window. <b>Do not use this function if this hud is /// managed by a HudManager</b>. Instead, use /// <see cref="HudManager.RecreateHud(IManagedHud)"/>. /// </summary> public virtual void RecreateHud() { DisposeHudsInternal(); if (Visible) { mHud = Host.Render.CreateHud(new Rectangle(mRegion.Location, MaxSize)); mHud.Enabled = true; mHud.Alpha = AlphaFrame; PaintWindowInternal(); //DrawClientImage(); } }
public virtual void RegisterHandlers(Hud hud, Table t, Player p) { this.OnResetStatisticsButtonPressed += new HudWindow.OnResetStatisticsButtonPressedHandler(p.window_OnResetStatisticsButtonPressed); this.OnResetAllStatisticsButtonPressed += new HudWindow.OnResetAllStatisticsButtonPressedHandler(t.window_OnResetAllStatisticsButtonPressed); this.OnPlayerStatisticsNeedToBeDisplayed += new HudWindow.OnPlayerStatisticsNeedToBeDisplayedHandler(hud.window_OnPlayerStatisticsNeedToBeDisplayed); this.LocationChanged += new EventHandler(hud.window_LocationChanged); }
private void DisposeHudsInternal() { if (mHud != null) { mHud.Enabled = false; Host.Render.RemoveHud(mHud); mHud.Dispose(); mHud = null; } }
public override void RegisterHandlers(Hud hud, Table t, Player p) { base.RegisterHandlers(hud, t, p); this.OnPlayerPreflopPushingRangeNeedToBeDisplayed += new OnPlayerPreflopPushingRangeNeedToBeDisplayedHandler(hud.holdemWindow_OnPlayerPreflopPushingRangeNeedToBeDisplayed); }
public void Show(Point location, string message, DateTime hideTime) { mHideTime = hideTime; if (Visible) { if (mMessage == message) { mHud.Region = new Rectangle(location, mHud.Region.Size); return; } Hide(); } mMessage = message; gBmp.Clear(Clear); SizeF sz = gBmp.MeasureString(message, TextFont); int textWidth = Math.Min(250, (int)Math.Ceiling(sz.Width)); Rectangle outlineRect = new Rectangle(0, 0, textWidth + 2, 20); gBmp.FillRectangle(BackgroundBrush, outlineRect); gBmp.DrawRectangle(BorderPen, outlineRect); gBmp.DrawString(message, TextFont, Brushes.White, new RectangleF(2, 2, textWidth, 16), mFormat); mHud = mManager.Host.Render.CreateHud(new Rectangle(location, new Size(480, 32))); mHud.Clear(); mHud.BeginRender(); mHud.DrawImage(mBmp, new Rectangle(0, 0, mBmp.Width, mBmp.Height)); mHud.EndRender(); mHud.Enabled = true; }
/// <summary> /// Initialise game /// </summary> protected override void Initialize() { base.Initialize(); this.hud_ = new Hud(this, this.spriteBatch_); hud_.GameInfos.Round = 10; score_.Restart(10); this.map_ = new Map(this, this.spriteBatch_, KaboomResources.Level); this.ladder_.AddEntry(KaboomResources.Level.Score.Score1, "King"); this.ladder_.AddEntry(KaboomResources.Level.Score.Score2, "Prince"); this.ladder_.AddEntry(KaboomResources.Level.Score.Score3, "Champion"); this.hud_.GameInfos.Round = KaboomResources.Level.Score.Turn; this.map_.EndGameManager += ManageEndGame; Viewport.Instance.Initialize(GraphicsDevice, this.map_); this.Components.Add(this.map_); this.Components.Add(this.hud_); MediaPlayer.Play(KaboomResources.Musics["InGame"]); MediaPlayer.IsRepeating = true; MediaPlayer.Volume = 0.5f; }
private void PaintSprites(float z) { mNeedsSpriteRepaint = false; if (mSpriteHud == null || mSpriteHud.Lost) { if (mSpriteHud != null) mSpriteHud.Dispose(); mSpriteHud = Host.Render.CreateHud(new Rectangle(ClientLocation, MaxSize)); mSpriteHud.Alpha = AlphaFrame; mSpriteHud.Enabled = ClientVisible; } if (mSpriteHud.Region.Location != ClientLocation) { mSpriteHud.Region = new Rectangle(ClientLocation, mSpriteHud.Region.Size); } mSpriteHud.Clear(); // Paint hotspot rectangle CalcActiveHotspot(MouseLocationClient); if (ActiveHotspot != Hotspot.None) { Rectangle border = ConstrainRectangle(ShrinkRect(ActiveHotspot.rect, -1), 0, 0, ClientSize.Width - 1, ClientSize.Height - 1); Rectangle inner = ConstrainRectangle(ActiveHotspot.rect, 0, 0, ClientSize.Width - 1, ClientSize.Height - 1); if (inner.Width > 0 && inner.Height > 0) { mSpriteHud.Fill(border, Color.Gold); mSpriteHud.Clear(inner); } } // Paint Arrows if (!PlayerInDungeon) { using (Graphics g = Graphics.FromImage(mSpriteBuffer)) { g.SmoothingMode = SmoothingMode.AntiAlias; //Matrix origTransform = g.Transform; float zArrow = z < 1.0f ? (float)Math.Pow(z, 1.0 / 3.0) : 1.0f; // Paint Player Arrow PointF playerPointPix = CoordsToPix(mPlayerCoords, z); g.Clear(Clear); Point hudDrawPoint = new Point( (int)playerPointPix.X - mSpriteBuffer.Width / 2, (int)playerPointPix.Y - mSpriteBuffer.Height / 2); if (hudDrawPoint.X < 0) hudDrawPoint.X = 0; else if (hudDrawPoint.X > ClientSize.Width - mSpriteBuffer.Width) hudDrawPoint.X = ClientSize.Width - mSpriteBuffer.Width; if (hudDrawPoint.Y < 0) hudDrawPoint.Y = 0; else if (hudDrawPoint.Y > ClientSize.Height - mSpriteBuffer.Height) hudDrawPoint.Y = ClientSize.Height - mSpriteBuffer.Height; float offX = playerPointPix.X - hudDrawPoint.X; float offY = playerPointPix.Y - hudDrawPoint.Y; if (offX >= -4 && offX <= mSpriteBuffer.Width + 4 && offY >= -4 && offY <= mSpriteBuffer.Height + 4) { g.TranslateTransform(offX, offY); g.RotateTransform((float)(PlayerHeadingRadians * 180.0 / Math.PI)); g.ScaleTransform(zArrow, zArrow); g.FillPolygon(mPlayerArrowFill, PlayerArrowPolygon); g.DrawPolygon(mPlayerArrowOutline, PlayerArrowPolygon); //g.Transform = origTransform; mSpriteHud.BeginRender(); mSpriteHud.DrawImage(mSpriteBuffer, new Rectangle(hudDrawPoint, mSpriteBuffer.Size)); mSpriteHud.EndRender(); } } } }
// The hud MUST be in Render AND Text mode! internal void PaintForeground(Hud hud) { NeedsRepaint = false; Rectangle r = Region; r.X += Padding; r.Width -= Padding; if (HasIcon && (Owner.Display & ToolbarDisplay.Icons) != 0) { Rectangle iconRect = new Rectangle(r.X, r.Y + (Height - IconSize) / 2, IconSize, IconSize); // Adjust the button's region for when drawing text r.X += IconSize + Padding; r.Width -= IconSize + Padding; if (HasBitmapIcon) { hud.DrawImage(BitmapIcon, iconRect); } else if (HasPortalIcon) { hud.DrawPortalImage(PortalIcon, iconRect); } } if (HasLabel && (Owner.Display & ToolbarDisplay.Text) != 0) { if ((Owner.Display & ToolbarDisplay.Icons) == 0) { r.X += Padding; r.Width -= Padding; } Rectangle textRect = new Rectangle(r.X + Padding, r.Y + (Height - FontSize) / 2, r.Width - 2 * Padding, FontSize); hud.WriteText(Label, TextColor, WriteTextFormats.SingleLine, textRect); } }
private void PaintInternal() { try { mNeedsRepaint = false; if (mHud == null || mHud.Lost) { if (mHud != null) mHud.Dispose(); mHud = Manager.Host.Render.CreateHud( new Rectangle(Location.X, Location.Y, CanvasWidth, CanvasHeight)); mHud.Alpha = Alpha; mHud.Enabled = Visible; } if (!IsHudVisible()) { mHud.Enabled = false; return; } double arrowAngleRadians = PlayerCoords.AngleTo(DestinationCoords) - PlayerHeadingRadians; while (arrowAngleRadians < 0) arrowAngleRadians += 2 * Math.PI; int imageFrame; if (mNeedToCalculateImageRotations) { imageFrame = 1; Graphics g = Graphics.FromImage(mArrowImages[1]); g.Clear(Clear); g.TranslateTransform(mArrowImages[0].Width / 2, mArrowImages[0].Height / 2); g.RotateTransform((float)(arrowAngleRadians * 180.0 / Math.PI)); g.TranslateTransform(-mArrowImages[0].Width / 2, -mArrowImages[0].Height / 2); g.DrawImage(mArrowImages[0], 0, 0, mArrowImages[0].Width, mArrowImages[0].Height); } else { imageFrame = ((int)(arrowAngleRadians / (2 * Math.PI) * mArrowImages.Length)) % mArrowImages.Length; } mArrowRect.Y = 1; mArrowRect.X = (CanvasWidth - mArrowRect.Width) / 2; Rectangle distRect = new Rectangle(1, mArrowRect.Height, CanvasWidth - 2, TextSize + 2); if (ShowDestinationOver) { mArrowRect.Y += 2 * TextSize; distRect.Y += 2 * TextSize; } //mImageFrame = newImageFrame; mHud.Clear(); // Draw move border if (mMouseHovering) { Rectangle r = new Rectangle(mArrowRect.Location, mArrowRect.Size); mHud.Fill(r, Color.Gold); r = new Rectangle(r.X + 1, r.Y + 1, r.Width - 2, r.Height - 2); mHud.Clear(r); } mHud.BeginRender(); // Draw close button if (mMouseHovering && ShowCloseButton) { Bitmap closeBox = Icons.Window.CloseBox; mCloseBoxRect = new Rectangle(mArrowRect.Right - closeBox.Width - 2, mArrowRect.Top + 2, closeBox.Width, closeBox.Height); mHud.DrawImage(Icons.Window.CloseBox, mCloseBoxRect); } else { mCloseBoxRect = Rectangle.Empty; } mRoutePrevRect = mRouteNextRect = new Rectangle(-1, -1, 0, 0); if (ShowDestinationOver || ShowDistanceUnder) { mHud.BeginText(HudFont, TextSize, TextBold ? FontWeight.Bold : FontWeight.Normal, false); if (ShowDestinationOver) { if (HasDestinationLocation) { string locationName = DestinationLocation.Name; if (HasRoute) { // Left and Right arrows on each end if (RouteIndex > 0) { locationName = "\u25C4 " + locationName; } if (RouteIndex < Route.Count - 1) { locationName += " \u25BA"; } SizeF sz = mFontMeasure.MeasureString(locationName, mFont); mRoutePrevRect = mRouteNextRect = new Rectangle(-1, -1, 0, 0); float width = 0.2f * sz.Width; if (RouteIndex > 0) { mRoutePrevRect = Rectangle.Round(new RectangleF( Location.X + (CanvasWidth - 0.9f * sz.Width) / 2.0f, Location.Y - 1, width, TextSize + 2)); } if (RouteIndex < Route.Count - 1) { mRouteNextRect = Rectangle.Round(new RectangleF( Location.X + (CanvasWidth + 0.9f * sz.Width) / 2.0f - width, Location.Y - 1, width, TextSize + 2)); } } WriteText(locationName, WriteTextFormats.Center, new Rectangle(1, 1, CanvasWidth - 2, TextSize + 2)); } else if (HasDestinationObject) { WriteText(DestinationObject.Name + (DestinationObject.IsValid ? "" : " (out of range)"), WriteTextFormats.Center, new Rectangle(1, 1, CanvasWidth - 2, TextSize + 2)); } WriteText(DestinationCoords.ToString(), WriteTextFormats.Center, new Rectangle(1, TextSize, CanvasWidth - 2, TextSize + 2)); } if (ShowDistanceUnder) { double dist = PlayerCoords.DistanceTo(DestinationCoords); WriteText(dist.ToString("0.00"), WriteTextFormats.Center, distRect); } mHud.EndText(); } mHud.DrawImage(mArrowImages[imageFrame], mArrowRect); mHud.EndRender(); mHud.Enabled = true; mLastDisplayedDestinationCoords = DestinationCoords; } catch (Exception ex) { Util.HandleException(ex); } }
void IManagedHud.RecreateHud() { if (mHud != null && !mHud.Lost) { mHud.Enabled = false; Manager.Host.Render.RemoveHud(mHud); mHud.Dispose(); mHud = null; } PaintInternal(); }
public void Dispose() { if (Disposed) return; mDestinationObject = null; asyncLoadImageWorker.DoWork -= asyncLoadImageWorker_DoWork; asyncLoadImageWorker.Dispose(); asyncLoadImageWorker = null; if (mHud != null) { mHud.Enabled = false; mHud.Dispose(); mHud = null; } Manager.UnregisterHud(this); mArrowZipFile.Close(); mDisposed = true; }
// Use this for initialization void Start() { Characters currentCharacter; switch (transform.parent.name) { case Constants.ALEX_STRING: currentCharacter = Characters.Alex; break; case Constants.DEREK_STRING: currentCharacter = Characters.Derek; break; case Constants.ZOE_STRING: currentCharacter = Characters.Zoe; break; default: #if DEBUG || UNITY_EDITOR Debug.LogError("parent is named wrong"); #endif currentCharacter = Characters.Zoe; break; } //Check if player one if (GameData.Instance.PlayerOneCharacter == currentCharacter) { m_Player = 1; } else { m_Player = 2; } //gets reference to sound manager m_SFX = SFXManager.Instance; //Gets reference to hud m_Hud = GameObject.FindGameObjectWithTag(Constants.HUD).GetComponent<Hud>(); //setting initial values for the timers m_HealthRegenTimer = HealthRegenTime; m_InvulnerabilityTimer = InvulnerabilityTimer; //setting the total health m_TotalHealth = m_Health; //Set Health in hud m_Hud.SetHealth (m_TotalHealth, m_Player); m_PlayerRenderer = gameObject.GetComponentInChildren<SkinnedMeshRenderer>(); //Get the players movement for knockback m_Movement = GetComponent<BaseMovementAbility> (); #if DEBUG || UNITY_EDITOR if(i_InvulnerableMaterial == null) { Debug.LogError("put the invulnerable material on this script"); } #endif m_DefaultMaterial = m_PlayerRenderer.materials[0]; //Load player light m_PlayerLight = GetComponent<PlayerLightController>(); }
void Start() { GameObject scoreObject = GameObject.Find("ScoreObject"); hud = (Hud) scoreObject.GetComponent("Hud"); score = (Score) scoreObject.GetComponent("Score"); }
public override void RecreateHud() { base.RecreateHud(); if (mSpriteHud != null) { mSpriteHud.Enabled = false; Host.Render.RemoveHud(mSpriteHud); mSpriteHud.Dispose(); mSpriteHud = null; } PaintSprites(Zoom); }
// Use this for initialization void Start() { hud = GetComponentInChildren<Hud>(); //finds Hud.cs unter Player AddStartResourceLimits(); AddStartResources(); IngameMenu.SetActive(false); // GameObject deaktivieren }
protected HudObject(Hud currentHud) { HudHandler = currentHud; }
void Awake() { hud = GetComponent<Hud>(); }