Jump to content

Slot Effect


tierrilopes
 Share

Recommended Posts

Tutorial não estruturado, será necessário comparar os ficheiros.

Caso alguém queira fazer o tutorial, todos agradecemos.

https://www.youtube.com/watch?v=KVxa9yvi20c

Informações:

 

CRC32: 3844CD0E

MD5: CD814BE967A1145508610B7607FBAC75

SHA-1: D18111E8CEBB36D24E5427D63F641E0A4E3F2CFC

Password: m2dev.net

 

Slot Effect System.7z

  • Thanks 1
Link to comment
Share on other sites

  • 2 months later...
  • 5 months later...

Solução encontrada e um tutorial da parte do arquivo uiinventory.py feito por mim com as novas alterações, favor adicionar ao tópico ou ao winrar com os arquivos.

Disponibilização do arquivo uiinventory.py pelo Claudio Almeida ( Teknos ) e estruturação do tutorial por mim

Spoiler
Buscar:

class InventoryWindow(ui.ScriptWindow):

adicionar abaixo:
	liHighlightedItems = []
	
Buscar:

setItemVNum(i, itemVnum, itemCount)

Adicionar Abaixo

			if itemVnum == 0 and slotNumber in self.liHighlightedItems:
				self.liHightlightedItems.remove(slotNumber)
				
Buscar:

self.wndItem.DeactivateSlot(slotNumber)

Adicionar Abaixo:

	self.wndItem.ActivateSlot(slotNumber)					
		self.__RefreshHighlights()
		
Buscar:

def OverInItem(self, overSlotPos):
		overSlotPos = self.__InventoryLocalSlotPosToGlobalSlotPos(overSlotPos)
		self.wndItem.SetUsableItem(False)

		if mouseModule.mouseController.isAttached():
			attachedItemType = mouseModule.mouseController.GetAttachedType()
			if player.SLOT_TYPE_INVENTORY == attachedItemType:

				attachedSlotPos = mouseModule.mouseController.GetAttachedSlotNumber()
				attachedItemVNum = mouseModule.mouseController.GetAttachedItemIndex()
				
				if self.__CanUseSrcItemToDstItem(attachedItemVNum, attachedSlotPos, overSlotPos):
					self.wndItem.SetUsableItem(True)
					self.ShowToolTip(overSlotPos)
					return
				
		self.ShowToolTip(overSlotPos)
		
Substituir por 

def OverInItem(self, overSlotPos):
		overSlotPosGlobal = self.__InventoryLocalSlotPosToGlobalSlotPos(overSlotPos)
		self.wndItem.SetUsableItem(False)
		if overSlotPosGlobal in self.liHighlightedItems:
			self.liHighlightedItems.remove(overSlotPosGlobal)
			self.wndItem.DeactivateSlot(overSlotPos)

		if mouseModule.mouseController.isAttached():
			attachedItemType = mouseModule.mouseController.GetAttachedType()
			if player.SLOT_TYPE_INVENTORY == attachedItemType:

				attachedSlotPos = mouseModule.mouseController.GetAttachedSlotNumber()
				attachedItemVNum = mouseModule.mouseController.GetAttachedItemIndex()
				
				if self.__CanUseSrcItemToDstItem(attachedItemVNum, attachedSlotPos, overSlotPosGlobal):
					self.wndItem.SetUsableItem(True)
					self.ShowToolTip(overSlotPosGlobal)
					return
		
		self.ShowToolTip(overSlotPosGlobal)
		
		
Buscar:

def OnMoveWindow(self, x, y):
#		print "Inventory Global Pos : ", self.GetGlobalPosition()
		if self.wndBelt:
#			print "Belt Global Pos : ", self.wndBelt.GetGlobalPosition()
			self.wndBelt.AdjustPositionAndSize()
			
Adicionar Abaixo:

def HighlightSlot(self, slot):
		if not slot in self.liHighlightedItems:
			self.liHighlightedItems.append(slot)
	
	def __RefreshHighlights(self):
		for i in xrange(player.INVENTORY_PAGE_SIZE*4):
			slotNumber = self.__InventoryLocalSlotPosToGlobalSlotPos(i)
			if slotNumber in self.liHighlightedItems:
				self.wndItem.ActivateSlot(i)
			
			

 

 

Link to comment
Share on other sites

  • 8 months later...

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...