10 public override float extFixY
19 public override void RefreshItem()
22 bool flag = item !=
null;
23 this.instantClick = !this.widget.hotbar.IsUserHotbar;
24 base.onClick.RemoveAllListeners();
25 this.dragParent = ((flag && this.widget.CanRegisterItem) ? this.widget :
null);
26 this.icon.enabled = flag;
27 base.interactable = (flag || this.widget.CanRegisterItem || !this.widget.IsSealed);
28 if (flag && item.Hidden)
30 this.icon.enabled =
false;
31 base.interactable =
false;
33 this.mainText.SetActive(this.widget.extra.showShortcut);
34 base.image.sprite = Core.Instance.refs.spritesHighlight[0];
36 base.transition = ((item2 !=
null) ? item2.Transition : Selectable.Transition.SpriteSwap);
40 item.hotbar = this.widget.hotbar;
41 base.onClick.AddListener(delegate()
50 this.RegisterHotbar();
53 if (!this.widget.Visible)
55 this.widget.ToggleVisible();
57 UIButton.buttonPos = this.transform.position;
58 item.OnClick(
this, this.widget.hotbar);
61 this.onRightClick = delegate()
63 item.OnRightClick(
this);
65 this.tooltip.enable = !item.TextTip.IsEmpty();
66 this.tooltip.offset =
new Vector3(0f, (
float)((this.widget.transform.position.y < 200f) ? 70 : -20), 0f);
67 this.tooltip.onShowTooltip = delegate(UITooltip t)
69 string textTip = item.TextTip;
70 t.textMain.text = textTip;
72 this.icon.material = (item.UseUIObjMaterial ? EClass.core.refs.matUIObj :
null);
73 item.SetImage(this.icon);
77 this.subText.SetActive(
false);
78 this.tooltip.enable =
false;
79 base.onClick.AddListener(delegate()
88 this.RegisterHotbar();
91 this.widget.OnClickEmptyItem(
this);
93 this.onRightClick =
null;
99 if (this.item ==
null)
104 hotItem.SetSubText(this.subText);
105 if (hotItem.Thing !=
null)
107 this.card = hotItem.Thing;
112 public void RegisterHotbar()
115 this.widget.SetItem(
this,
WidgetHotbar.registeringItem);
120 public override void OnHover()
131 public new int index;