Jump to content
Sign in to follow this  
Rusef

[Mini - Release (Python)] Habilitar strickers (!) (?) por botón

Recommended Posts

Buenas, esto vale para cuando dejas presionado CTRL las teclas 1 a 9 haces emociones ahora las teclas ? y ¡ - ejecutaran esas emociones.

1. Descompilamos root y abrimos game.py

2. Hacemos la siguiente guía

#BUSCAMOS
		onPressKeyDict[app.DIK_1]	= lambda : self.__PressNumKey(1)
		onPressKeyDict[app.DIK_2]	= lambda : self.__PressNumKey(2)
		onPressKeyDict[app.DIK_3]	= lambda : self.__PressNumKey(3)
		onPressKeyDict[app.DIK_4]	= lambda : self.__PressNumKey(4)
		onPressKeyDict[app.DIK_5]	= lambda : self.__PressNumKey(5)
		onPressKeyDict[app.DIK_6]	= lambda : self.__PressNumKey(6)
		onPressKeyDict[app.DIK_7]	= lambda : self.__PressNumKey(7)
		onPressKeyDict[app.DIK_8]	= lambda : self.__PressNumKey(8)
		onPressKeyDict[app.DIK_9]	= lambda : self.__PressNumKey(9)
		onPressKeyDict[app.DIK_F1]	= lambda : self.__PressQuickSlot(4)
		onPressKeyDict[app.DIK_F2]	= lambda : self.__PressQuickSlot(5)
		onPressKeyDict[app.DIK_F3]	= lambda : self.__PressQuickSlot(6)
		onPressKeyDict[app.DIK_F4]	= lambda : self.__PressQuickSlot(7)
#DETRAS DE
		onPressKeyDict[app.DIK_9]	= lambda : self.__PressNumKey(9)

#DAMOS ENTER Y PEGAMOS
		onPressKeyDict[app.DIK_EQUALS]	= lambda : self.__PressNumKey(10)
		onPressKeyDict[app.DIK_MINUS]	= lambda : self.__PressNumKey(11)
#BUSCAMOS
	def __PressNumKey(self,num):
		MapName = str(background.GetCurrentMapName())
		if MapName == "mapa_guerra":
			if constInfo.ataque_guerra == 1:
				return
		if app.IsPressed(app.DIK_LCONTROL) or app.IsPressed(app.DIK_RCONTROL):
			
			if num >= 1 and num <= 9:
				if(chrmgr.IsPossibleEmoticon(-1)):				
					chrmgr.SetEmoticon(-1,int(num)-1)
					net.SendEmoticon(int(num)-1)
		else:
			if num >= 1 and num <= 4:
				self.pressNumber(num-1)
#DETRAS DE
					net.SendEmoticon(int(num)-1)

#DAMOS ENTER Y PEGAMOS
			if num >= 10 and 11:
				if(chrmgr.IsPossibleEmoticon(-1)):				
					chrmgr.SetEmoticon(-1,int(num)-1)
					net.SendEmoticon(int(num)-1)

3. Compilamos root

 

Respuestas básicas:

Debes iniciar sesión para ver el contenido del enlace en esta publicación.

 

Otros:

#Dejo un regalo para el que lo entienda

		onPressKeyDict[app.DIK_F5]	= lambda : self.__PressQuickSlot(19)
		onPressKeyDict[app.DIK_F6]	= lambda : self.__PressQuickSlot(20)
		onPressKeyDict[app.DIK_F7]	= lambda : self.__PressQuickSlot(21)
		onPressKeyDict[app.DIK_F8]	= lambda : self.__PressQuickSlot(22)

	def __PressQuickSlot(self, localSlotIndex):

		MapName = str(background.GetCurrentMapName())
		if MapName == "mapa_guerra":
			if constInfo.ataque_guerra == 1:
				return
		if app.IsPressed(app.DIK_LCONTROL) or app.IsPressed(app.DIK_RCONTROL):

			if localSlotIndex >= 19 and 20 and 21 and 22:
				if(chrmgr.IsPossibleEmoticon(-1)):				
					chrmgr.SetEmoticon(-1,int(localSlotIndex)-1)
					net.SendEmoticon(int(localSlotIndex)-1)

			if localSlotIndex >= 4 and 5 and 6 and 7:
				if(chrmgr.IsPossibleEmoticon(-1)):				
					chrmgr.SetEmoticon(-1,int(localSlotIndex)+10)
					net.SendEmoticon(int(localSlotIndex)-1)
		else:
			player.RequestUseLocalQuickSlot(localSlotIndex)

 

Un saludo, espero que a alguien le valga.

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...