Esempio n. 1
0
func (i *inventoryScreen) click(down bool, x, y float64, w, h int) {
	if down {
		if i.activeSlot != -1 {
			item := Client.activeInventory.Items[i.activeSlot]
			Client.activeInventory.Items[i.activeSlot] = i.cursorItem
			Client.network.Write(&protocol.ClickWindow{
				ID:           byte(Client.activeInventory.ID),
				Slot:         int16(i.activeSlot),
				Button:       0,
				Mode:         0,
				ActionNumber: 42,
				ClickedItem:  ItemStackToProtocol(item),
			})
			i.setCursor(item)
		} else if !i.inWindow {
			Client.network.Write(&protocol.ClickWindow{
				ID:           byte(Client.activeInventory.ID),
				Slot:         int16(-999),
				Button:       0,
				Mode:         0,
				ActionNumber: 42,
				ClickedItem:  ItemStackToProtocol(nil),
			})
			i.setCursor(nil)
		}
		return
	}
	ui.Click(x, y, w, h)
}
Esempio n. 2
0
func (om *optionMenu) click(down bool, x, y float64, w, h int) {
	om.fov.click(down, x, y, w, h)
	om.mouseS.click(down, x, y, w, h)
	if down {
		return
	}
	ui.Click(x, y, w, h)
}
Esempio n. 3
0
func (vm *volumeMenu) click(down bool, x, y float64, w, h int) {
	for _, s := range vm.sliders {
		s.click(down, x, y, w, h)
	}
	if down {
		return
	}
	ui.Click(x, y, w, h)
}
Esempio n. 4
0
File: ui.go Progetto: num5/steven
func (b *baseUI) click(down bool, x, y float64, w, h int) {
	if down {
		return
	}
	ui.Click(x, y, w, h)
}