void Start() { tooltip_handler = new ToolTipHandler(TooltipBGTexture, TooltipFont, TooltipFontSizes, colors); // Create Initial Icons here Icon main_hand = new Icon(IconType.Item, IconBase, (Texture2D)Resources.Load("ObjectDetails/Items/staffoflight"), new Rect(300, 260, 32, 32), "Staff of Light"); Icon off_hand = new Icon(IconType.Item, IconBase, (Texture2D)Resources.Load("ObjectDetails/Items/swordoftruth"), new Rect(300, 300, 32, 32), "Sword of Truth"); Icon chest_piece = new Icon(IconType.Item, IconBase, (Texture2D)Resources.Load("ObjectDetails/Items/robeofpower"), new Rect(300, 340, 32, 32), "Robe of Power"); Icon skill_one = new Icon(IconType.Skill, IconBase, (Texture2D)Resources.Load("ObjectDetails/Skills/healoflight"), new Rect(300, 380, 32, 32), "Heal of Light"); // Only need one Icon with IconType.GameObject Icon objecthandler_tooltip = new Icon(IconType.GameObject, null, new Rect(), ""); // Add icons to the icons list icons.Add(main_hand); icons.Add(off_hand); icons.Add(chest_piece); icons.Add(skill_one); icons.Add(objecthandler_tooltip); }
public PrivateMessageControl CreatePrivateMessageControl(string userName) { var pmControl = new PrivateMessageControl(userName) { Dock = DockStyle.Fill }; var isFriend = Program.FriendManager.Friends.Contains(userName); User user; var isOffline = !Program.TasClient.ExistingUsers.TryGetValue(userName, out user); var icon = isOffline ? ZklResources.grayuser : TextImage.GetUserImage(userName); var contextMenu = new ContextMenu(); if (!isFriend) { var closeButton = new MenuItem(); closeButton.Click += (s, e) => toolTabs.RemovePrivateTab(userName); contextMenu.MenuItems.Add(closeButton); } toolTabs.AddTab(userName, userName, pmControl, icon, ToolTipHandler.GetUserToolTipString(userName), 0); pmControl.ChatLine += (s, e) => { if (Program.TasClient.IsLoggedIn) { Program.TasClient.Say(SayPlace.User, userName, e.Data, false); } }; return(pmControl); }
private void Start() { Get = this; focusHeight = transform.position.z; provinceSelector = TimedSelectorWithMaterial.AddTo(gameObject, LinksManager.Get.ProvinceSelecionMaterial, 0); fogOfWar = TimedSelectorWithMaterial.AddTo(gameObject, LinksManager.Get.FogOfWarMaterial, 0); // //var window = Instantiate(LinksManager.Get.MapOptionsPrefab, LinksManager.Get.CameraLayerCanvas.transform); //window.GetComponent<RectTransform>().anchoredPosition = new Vector2(150f, 150f); tooltip = GetComponent <ToolTipHandler>(); }
private void Awake() { if (_instance != null && _instance != this) { Destroy(this.gameObject); } else { _instance = this; } }
/* ----------------------------------------------------------------- */ /// /// UpdateToolTip /// /// <summary> /// マウスオーバ時に表示されるツールチップ表示に関する設定を /// 更新します。 /// </summary> /// /* ----------------------------------------------------------------- */ private void UpdateToolTip(RegistryKey key, bool enabled) { var guid = TooTipKey.ToString("B").ToUpperInvariant(); var name = $@"shellex\{guid}"; if (enabled) { var s = ToolTipHandler.ToString("B"); using (var k = key.CreateSubKey(name)) k.SetValue("", s); } else { key.DeleteSubKeyTree(name, false); } }
public Home(FileStoreManager fileStore, IController controller) { _fileStore = fileStore; _controller = controller; InitializeComponent(); _highlightedMonth = DateTime.Today; _plotter = new GraphHandler(monthPlot, controller); viewer.Controller = controller; _toolTipHandler = new ToolTipHandler(); controller.AddView(this); }
public MonthlyAllowanceChanger(IController controller, DateTime date) { this.controller = controller; controller.AddView(this); InitializeComponent(); toolTipHandler = new ToolTipHandler(); month.Value = date; month.MaxDate = DateTime.Today; updateBudget(date); }
private void GenerateShop() { for (int i = 0; i < shopItems.Length; i++) { GameObject newButton = Instantiate(buttonTemplate) as GameObject; newButton.SetActive(true); ShopButton shopButton = newButton.GetComponent <ShopButton>(); shopButton.SetIcon(shopItems[i].itemIcon); shopButton.SetName(shopItems[i].itemName); shopButton.SetPrice(shopItems[i].itemPrice); shopButton.SetPrefab(shopItems[i].itemPrefab); shopButton.CreditManager = creditManager.GetComponent <CreditManager>(); shopButton.ShopHandler = this; shopButton.Item = shopItems[i]; newButton.transform.SetParent(buttonTemplate.transform.parent, false); } if (toolTip != null) { toolTipHandler = toolTip.GetComponent <ToolTipHandler>(); } }
/// <summary> /// 设置评阅到界面。 /// </summary> /// <param name="cbb"></param> /// <param name="evaluate"></param> public static void SetEvaluateToWin(ComboBox cbb, Evaluate evaluate, ToolTipHandler toolTipHandler) { if (cbb != null && evaluate != null) { if (evaluate.Type == EnumEvaluateType.Score) { if (toolTipHandler != null) { toolTipHandler(cbb, "分数制"); } cbb.BeginUpdate(); cbb.DropDownStyle = ComboBoxStyle.DropDown; cbb.Text = string.Format("{0}", evaluate.MinValue + 1); cbb.TextChanged += new EventHandler(delegate(object o, EventArgs args) { ComboBox box = o as ComboBox; if (box != null) { try { int result = 0; if (int.TryParse(box.Text.Trim(), out result)) { if (result < evaluate.MinValue || result > evaluate.MaxValue) { MessageBox.Show(string.Format("评阅分数无效,须在[{0}-{1}]之间!", evaluate.MinValue, evaluate.MaxValue)); box.Text = string.Format("{0}", evaluate.MinValue); } } else { MessageBox.Show("评阅分数不能转化为数字!"); } } catch (Exception) { } } }); cbb.EndUpdate(); } else { if (toolTipHandler != null) { toolTipHandler(cbb, "等级制"); } cbb.BeginUpdate(); cbb.DropDownStyle = ComboBoxStyle.DropDownList; cbb.DataSource = evaluate.Items; cbb.DisplayMember = "ItemName"; cbb.ValueMember = "ItemValue"; cbb.SelectedIndex = -1; cbb.EndUpdate(); } } }