mirror of
https://github.com/OpenDiablo2/OpenDiablo2
synced 2024-11-02 09:17:19 -04:00
commit
719480e95b
@ -69,6 +69,8 @@ func (ui *UIManager) NewTooltip(font,
|
||||
boxEnabled: true,
|
||||
}
|
||||
res.manager = ui
|
||||
// cannot use ui.addWidget, because
|
||||
// some tooltips could be covered by another widgets
|
||||
ui.addTooltip(res)
|
||||
|
||||
return res
|
||||
|
@ -188,14 +188,25 @@ func (h *HUD) Load() {
|
||||
h.loadCustomWidgets()
|
||||
h.loadUIButtons()
|
||||
|
||||
// nolint:gomnd // dividing by 2 (const)
|
||||
h.addStatsButton = h.uiManager.NewButton(d2ui.ButtonTypeAddSkill, "")
|
||||
h.addStatsButton.SetPosition(addStatsButtonX, addStatsButtonY)
|
||||
h.addStatsButton.SetVisible(false)
|
||||
bw, bh := h.addStatsButton.GetSize()
|
||||
statsTooltip := h.uiManager.NewTooltip(d2resource.Font16, d2resource.PaletteSky, d2ui.TooltipXCenter, d2ui.TooltipYTop)
|
||||
statsTooltip.SetPosition(addStatsButtonX+bw/2, addStatsButtonY-bh/2)
|
||||
statsTooltip.SetText(h.asset.TranslateString("strlvlup"))
|
||||
h.addStatsButton.SetTooltip(statsTooltip)
|
||||
h.panelGroup.AddWidget(h.addStatsButton)
|
||||
|
||||
h.addSkillButton = h.uiManager.NewButton(d2ui.ButtonTypeAddSkill, "")
|
||||
h.addSkillButton.SetPosition(addSkillButtonX, addSkillButtonY)
|
||||
h.addSkillButton.SetVisible(false)
|
||||
bw, bh = h.addSkillButton.GetSize()
|
||||
skillTooltip := h.uiManager.NewTooltip(d2resource.Font16, d2resource.PaletteSky, d2ui.TooltipXCenter, d2ui.TooltipYTop)
|
||||
skillTooltip.SetPosition(addSkillButtonX+bw/2, addSkillButtonY-bh/2)
|
||||
skillTooltip.SetText(h.asset.TranslateString("strnewskl"))
|
||||
h.addSkillButton.SetTooltip(skillTooltip)
|
||||
h.panelGroup.AddWidget(h.addSkillButton)
|
||||
|
||||
h.panelGroup.SetVisible(true)
|
||||
|
Loading…
Reference in New Issue
Block a user