/// <summary> /// gibt zurück ob der entsprechende modi angeklickt wurde, bzw was /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void GuiPlayerInfo_OnClick(object sender, Vector e) { Vector position; switch (mode) { case 0: position = new Vector(Size.X - 170, Location.Y + Size.Y / 2); if ((position - e).Length < 25) { InfoClick?.Invoke(this, true); return; } break; case 1: position = new Vector(Size.X - 150 - 80, Location.Y + Size.Y / 2); if ((position - e).Length < 25) { InfoClick?.Invoke(this, true); return; } break; case 2: position = new Vector(Size.X - 150, Location.Y + Size.Y / 2); if ((position - e).Length < 25) { InfoClick?.Invoke(this, false); return; } position = new Vector(Size.X - 150 - 60, Location.Y + Size.Y / 2); if ((position - e).Length < 25) { InfoClick?.Invoke(this, true); return; } break; } if (mode != 2) { InfoClick?.Invoke(this, false); } }
public void ShowPopUp() { var desc = "Unlocks "; if (Achievement.UnlocksClass != "") { desc += "the " + Achievement.UnlocksClass + " class." + System.Environment.NewLine; } else if (Achievement.UnlocksBlessing != LegacySystem.Blessing.NoBlessing) { desc += "the " + Achievement.UnlocksBlessing + " blessing." + System.Environment.NewLine; } else if (Achievement.UnlocksMapSize != MapGenerator.WorldSize.Small) { desc += "a " + Achievement.UnlocksMapSize + " world." + System.Environment.NewLine; } if (Achievement.Unlockable && (Achievement.VisibleUnlockCondition || Achievement.Unlocked)) { desc += "Unlocked by "; switch (Achievement.Condition) { case LegacySystem.UnlockCondition.KillGiant: desc += "killing " + Achievement.AmountToUnlock + " giant."; break; case LegacySystem.UnlockCondition.KillSpider: desc += "killing " + Achievement.AmountToUnlock + " spiders."; break; case LegacySystem.UnlockCondition.KillZombie: desc += "killing " + Achievement.AmountToUnlock + " zombie goblins."; break; case LegacySystem.UnlockCondition.KillHuman: desc += "killing " + Achievement.AmountToUnlock + " man."; break; case LegacySystem.UnlockCondition.KillWolf: desc += "killing " + Achievement.AmountToUnlock + " wolfs."; break; case LegacySystem.UnlockCondition.EquipmentFound: desc += "finding " + Achievement.AmountToUnlock + " equipment."; break; case LegacySystem.UnlockCondition.GoblinSacrifice: desc += "sacrificing " + Achievement.AmountToUnlock + " goblins."; break; case LegacySystem.UnlockCondition.GoblinDeath: desc += "having " + Achievement.AmountToUnlock + " goblins die."; break; case LegacySystem.UnlockCondition.Treasure: desc += "finding " + Achievement.AmountToUnlock + " goblin treasure."; break; case LegacySystem.UnlockCondition.DestroyFarm: desc += "destroying " + Achievement.AmountToUnlock + " man farm."; break; case LegacySystem.UnlockCondition.FindANewHome: desc += "finding a new home"; break; default: throw new ArgumentOutOfRangeException(); } } InfoClick.ShowInfo(AchievementImage.rectTransform, Achievement.Name, desc, Achievement.Image); }
private void InfoToolStripMenuItem_Click(object sender, EventArgs e) { InfoClick?.Invoke(this, EventArgs.Empty); }
/// <summary> /// wird aufgerufen wenn die information gedrückt wird /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void GuiGameInfo_OnClick(object sender, Vector e) { InfoClick?.Invoke(this, false); }
//REct transform is equal the clicked box void Start() { Instance = this; Viewholder.gameObject.SetActive(false); }