Jump to content

TIEMPO DE REUTILIZACIÓN INVERSE PARA LAS RANURAS


ALEXANDER2020

Mensajes recomendados


0fbdd28f7d.gif


Los siguientes archivos se le trabajando en: 

- eterPythonLib / PythonWindowManagerModule.cpp 
- eterPythonLib / PythonSlotWindow.cpp 
- eterPythonLib / PythonSlotWindow.h 
- eterPythonLib / PythonGraphic.cpp 
- eterPythonLib / PythonGraphic.h 
- root / ui.py 

PythonWindowManagerModule.cpp

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

 


Acerca de la función nula inserción siguiente initwndMgr ():

PyObject * wndMgrSetSlotCoolTimeInverse ( PyObject * poSelf , PyObject * poArgs ) { 
	UI :: CWindow * Pwin ; si (! PyTuple_GetWindow ( poArgs , 0 , y Pwin )) { volver Py_BuildException (); } Int iSlotIndex ; si (! PyTuple_GetInteger ( poArgs , 1 ,y iSlotIndex )) 

	   
	
		 
	
	
	   
	{ Volver Py_BuildException (); } Flotar fCoolTime ; si (! PyTuple_GetFloat ( poArgs , 2 , y fCoolTime )) { retorno Py_BuildException (); } Flotar fElapisodioFecha = 0.0f ; PyTuple_GetFloat ( poArgs , 3 , y fElapisodio ); si (! Pwin -> IsType ( UI ::CSlotWindow :: Tipo
		 
	
	
	   
	
		 
	
	 
	  
	 ())) { Volver Py_BuildException (); } 
	UI :: CSlotWindow * pSlotWin = ( UI :: CSlotWindow *) Pwin ; 
	pSlotWin -> SetSlotCoolTimeInverse ( iSlotIndex , fCoolTime , fElapsedTime ); volver Py_BuildNone (); }
	
		 
	 
	 


Bajo el siguiente

{ "UnlockSlot" , 					wndMgrUnlockSlot , 					METH_VARARGS }, 

el inserto aquí:

{ "SetSlotCoolTimeInverse" , 		wndMgrSetSlotCoolTimeInverse , 		METH_VARARGS }, 

 


PythonSlotWindow.cpp

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

En algún lugar agregar la función al final del archivo:

vacío CSlotWindow :: SetSlotCoolTimeInverse ( DWORD dwIndex , flotar fCoolTime , flotar fElappsedTime ) { tslot * pSlot ; si (! GetSlotPointer ( dwIndex , y pSlot )) { devolver ; }   

	
	  
	
		
	

	pSlot -> fCoolTime = fCoolTime ; 
	pSlot -> fStartCoolTime = ctimer :: Instancia (). GetCurrentSecond () - fElappsedTime ; 
	pSlot -> bIsInverseCoolTime = verdadero ; }   


Luego, en la función void CSlotWindow :: ranura Claro (tslot * pSlot) en:

pSlot -> bRenderBaseSlotImage = verdadero ; 

Agregue el siguiente:

pSlot -> bIsInverseCoolTime = falso ; 


reemplazado el siguiente (en la función void CSlotWindow :: OnRender ahora):

if ( rSlot . fCoolTime ! = 0.0f ) { float fcurTime = CTimer :: Instance (). GetCurrentSecond (); float fPercentage = ( fcurTime - rSlot . fStartCoolTime ) / rSlot . fCoolTime ; CPythonGraphic :: Instance (). RenderCoolTimeBox ( m_rect . Abandonó + rSlot . IxPosition + 16.0f  

	 
	  
	 , M_rect . top + rSlot . iyPosition + 16.0f , 16.0f , fPercentage );  

	si ( fcurTime - rSlot . fStartCoolTime > = rSlot . fCoolTime ) { // ÄðŸÀÓÀÌ ³¡³Áö 1AE Àó³ »¶ó¸é ... si (( fcurTime - rSlot . fStartCoolTime ) - rSlot . fCoolTime < 1.0f ) 
 		__CreateFinishCoolTimeEffect ( y rSlot ); 
	
    	
		   

    	rSlot . fCoolTime = 0.0f ; 
   		rSlot . fStartCoolTime = 0.0f ; } }  
  	

con aquí:

si ( rSlot . fCoolTime ! = 0.0f ) { float fcurTime = ctimer :: Instancia (). GetCurrentSecond (); flotar fPercentage = ( fcurTime - rSlot . fStartCoolTime ) / rSlot . fCoolTime ;  

  	 
  	  

  	int iCellY = rSlot . iyCellSize ; int iCellX = rSlot . ixCellSize ;
  	

  	iCellX = min ( iCellX , İçelim );

  	flotante fRadius = iCellX * 0.5f ; flotar fxCenter = m_rect . izquierda + rSlot . ixPosition + iCellX * 0.5f ; flotar fyCenter = m_rect . top + rSlot . iyPosition + iCellY * 0.5f ; 
  	 
 	 

  	si (! rSlot . bIsInverseCoolTime ) { CPythonGraphic :: Instancia (). RenderCoolTimeBox ( fxCenter , fyCenter , fRadius , fPercentage ); } Demás { CPythonGraphic :: Instancia (). RenderCoolTimeBoxInverse ( fxCenter , fyCenter , fRadius , fPercentage ); } 
 	
      	
  	
  	
  	
    	
  	

  	si ( fcurTime - rSlot . fStartCoolTime > = rSlot . fCoolTime && ! rSlot . bIsInverseCoolTime ) { si (( fcurTime - rSlot . fStartCoolTime ) - rSlot . fCoolTime < 1.0f ) { 
      		__CreateFinishCoolTimeEffect (y rSlot ); }  
  	
    	   
   	 	
    	

    	rSlot . fCoolTime = 0.0f ; 
    	rSlot . fStartCoolTime = 0.0f ; } }  
  	

 


PythonSlotWindow.h
 

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

Buscando:

flotar 	fStartCoolTime ;

Incluyendo añadir:

bool bIsInverseCoolTime ;


Buscando:

void SetSlotCoolTime ( DWORD dwIndex , flotar fCoolTime , flotar fElapsonTime = 0.0f );    

Incluyendo añadir:

vacío SetSlotCoolTimeInverse ( DWORD dwIndex , flotar fCoolTime , flotar fElapsoned Tiempo );   

 


PythonGraphic.cpp
 

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

Bajo el vacío función se añadió CPythonGraphic :: RenderCoolTimeBox lo siguiente:
 

anulará CPythonGraphic :: RenderCoolTimeBoxInverse ( flotar fxCenter , flotar fyCenter , flotar fRadius , flotar FTIME ) { si ( FTIME > = 1.0f ) { devolver ; }    

	  
	
		
	

	FTIME = max ( 0.0f , FTIME );

	color D3DXCOLOR estático = D3DXCOLOR ( 0.0f , 0.0f , 0.0f , 0.5f );   

	estática D3DXVECTOR2 s_v2BoxPos [ 8 ] = { 
		D3DXVECTOR2 (+ 1.0f , - 1.0f ), 
		D3DXVECTOR2 (+ 1.0f , 0.0f ), 
		D3DXVECTOR2 (+ 1.0f , + 1.0f ), 
		D3DXVECTOR2 ( 0.0f , + 1.0f ), 
		D3DXVECTOR2 (- 1.0f , + 1.0f ), 
		D3DXVECTOR2 (- 1.0f , 0.0f ),
		D3DXVECTOR2 (- 
	        1.0f , - 1.0f ), 
		D3DXVECTOR2 ( 0.0f , - 1.0f ), };  
	

	int iTriCount = int ( 8.0f * FTIME ); flotar fLastPercentage = ( 8.0f * FTIME ) - iTriCount ;  
	   

	std :: vector < TPDTVertex > vértices ; TPDTVertex vértice ; 
	Vértice . posición . x = fxCenter ; 
	Vértice . posición . y = fyCenter ; 
	Vértice . posición . z = 0.0f ; 
	Vértice . difundir = de color ; 
	Vértice . TexCoord . x =0.0f ; 
	vértice
	  . texCoord . x = 0.0f ; 
	vértices . push_back ( vértice ); 

	vértice . posición . x = fxCenter ; 
	vértice . posición . y = fyCenter - fRadius ; 
	vértice . posición . z = 0.0f ; 
	vértice . difuso = color ; 
	vértice . texCoord . x = 0.0f ; 
	vértice . texCoord . x = 0.0f ; 
	vértices . push_back   ( vértice );

	for ( int j = 0 ; j < iTriCount ; ++ j ) { 
		vertex . posición . x = s_v2BoxPos [ j ]. x * fRadius + fxCenter ; 
		vértice . posición . y = s_v2BoxPos [ j ]. y * fRadius + fyCenter ; 
		vértices . push_back ( vértice   
	); }
	

	si ( fLastPercentage > 0.0f ) { 
		D3DXVECTOR2 * pv2Pos ; 
		D3DXVECTOR2 * pv2LastPos ;  
	

		afirmar (( iTriCount - 1 + 8 ) % 8 > = 0 && ( iTriCount - 1 + 8 ) % 8 < 8 ); 
		afirmar (( iTriCount + 8 ) % 8 > = 0 && ( iTriCount + 8 ) % 8 < 8 ); 
		pv2LastPos = y s_v2BoxPos [(iTriCount - 1                               + 8 ) % 8 ]; 
		pv2Pos = y s_v2BoxPos [( iTriCount + 8 ) % 8 ];       

		Vértice . posición . x = (( pv2Pos -> x - pv2LastPos -> x ) * fLastPercentage + pv2LastPos -> x ) * fRadius + fxCenter ; 
		Vértice . posición . Y = (( pv2Pos -> Y - pv2LastPos -> Y ) * fLastPercentage + pv2LastPos -> Y) *      fRadius + fyCenter ;

		vértices . push_back ( vértice ); ++ iTriCount ; }
		
	

	if ( vértices . empty ()) { return ; } 
	
		
	

	if ( SetPDTStream ( vertices . data (), vertices . size ())) { 
		STATEMANAGER . SaveTextureStageState ( 0 , D3DTSS_COLORARG1 , D3DTA_DIFFUSE ); 
		STATEMANAGER . SaveTextureStageState ( 0 , D3DTSS_COLOROP , D3DTOP_SELECTARG1 ); 
		STATEMANAGER . SaveTextureStageState ( 0 , D3DTSS_ALPHAARG1 , D3DTA_DIFFUSE ); 
	
		StateManager . SaveTextureStageState ( 0 , D3DTSS_ALPHAOP , D3DTOP_SELECTARG1 ); 
		StateManager . SetTexture ( 0 , NULL ); 
		StateManager . SetTexture ( 1 , NULL ); 
		StateManager . SetVertexShader ( D3DFVF_XYZ | D3DFVF_DIFFUSE | D3DFVF_TEX1 ); 
		CullMode DWORD ; 
		StateManager . GetRenderState (D3DRS_CULLMODE , D3DTSS_ALPHAARG1 ); 
		StateManager . RestoreTextureStageState ( 0 , D3DTSS_ALPHAOP ); 
		StateManager . SetRenderState ( D3DRS_CULLMODE , cullMode ); } } & cullMode ); 
		STATEMANAGER . SetRenderState ( D3DRS_CULLMODE , D3DCULL_CCW ); 
		STATEMANAGER . DrawPrimitive ( D3DPT_TRIANGLEFAN , 0 , iTriCount ); 
		STATEMANAGER . RestoreTextureStageState ( 0 , D3DTSS_COLORARG1 ); 
		STATEMANAGER . RestoreTextureStageState ( 0 , D3DTSS_COLOROP ); 
		STATEMANAGER . RestoreTextureStageState ( 0 , 
	

 


PythonGraphic.h
 

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


UI.py
 

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

Buscando:
 

def SetSlotCoolTime ( auto , slotIndex , CoolTime , elapsedTime = 0,0 ):  

Incluyendo su agrega la clave aquí:

 

def SetSlotCoolTimeInverse ( automático , slotIndex , CoolTime , elapsedTime = 0,0 ): 
	wndMgr . SetSlotCoolTimeInverse ( automático . Cvent , slotIndex , CoolTime , elapsedTime )  

 


¿Ahora puedes Artículos revés Cooldown'nen dejar ... 
Aquí NEN ejemplo de mí (no irá contigo porque itemTypes incorrectas):
 

Debes iniciar sesión para ver el contenido del enlace en esta publicación.
 ocultar el contenido
def __SetCooldownForTimedItemSlot ( auto , SlotNumber , itemVnum ): si itemVnum == 0 : retorno
     
		

    artículo . SelectItem ( itemVnum ) 
    tipoElemento = artículo . GetItemType () 
    itemSubType = artículo . GetItemSubType ()

    Si tipoElemento ! = elemento . ITEM_TYPE_MOUNT o itemSubType ! = Elemento . MOUNT_SUB_SUMMON : retorno
        

    ( LimitType , limitValue ) = elemento . GetLimit ( 0 ) 
    sock_time     = jugador . GetItemMetinSocket ( SlotNumber , 0 ) 
    remain_time = max ( 0 , sock_time )   

    Si SlotNumber > = jugador . INVENTORY_PAGE_SIZE : 
        SlotNumber - = jugador . INVENTORY_PAGE_SIZE

    uno mismo . wndItem . SetSlotCoolTimeInverse ( número de ranura , valor límite , valor límite - remain_time )

La función está conmigo en el uiInventory.py y ejecutado en el mismo archivo de la función RefreshBagSlotWindow:
 

def RefreshBagSlotWindow ( auto ): 
		getItemVNum = jugador . GetItemIndex 
		getItemCount = jugador . GetItemCount 
		setItemVNum = auto . wndItem . SetItemSlot para i en xrange ( reproductor . INVENTORY_PAGE_SIZE ): 
			SlotNumber = auto . __InventoryLocalSlotPosToGlobalSlotPos ( i ) 
			objetoCuenta =getItemCount ( SlotNumber 
		) Si objetoCuenta <= 1 : 
				objetoCuenta = 0
			  
				
			itemVnum = getItemVNum ( número de ranura ) 
			setItemVNum ( i , itemVnum , cuenta de artículos )
			
			## Poción Auto (# 72723, # 72724) Tratamiento Especial - A Pesar De Que Trabaja Para El Elemento para Activar / Desactivar la ranura Pantalla Lim - [Hyo] del SI 72723 == itemVnum o 72.724 == itemVnum : # metinSocket - [ 0]: Habilitado? [1]: la cantidad utilizada, [2]: la capacidad máxima 
				metinSocket = [ jugador . GetItemMetinSocket ( SlotNumber , j ) para j en xrange ( jugador . METIN_SOCKET_MAX_NUM )]
			    
				  	
				
				Si 0 =! int ( metinSocket [ 0 ]): . wndItem . ActivateSlot ( SlotNumber ) otra cosa : 
					uno mismo . wndItem . DeactivateSlot ( SlotNumber )  
							

			uno mismo . __SetCooldownForTimedItemSlot ( SlotNumber , itemVnum ) 
		auto . wndItem . RefreshSlot ()
Enlace para comentar
Compartir en otros sitios

  • Dilong locked y unlocked this tema

Unirse a la conversación

Puedes publicar ahora y registrarte más tarde. Si tienes una cuenta, regístrate para publicar con su cuenta.

Guest
Responder a este tema...

×   Has pegado contenido con formato .   Eliminar formato

  Only 75 emoji are allowed.

×   Tu enlace se ha incorporado automáticamente.   Mostrar un enlace en su lugar

×   Se ha restaurado el contenido anterior. .   Borrar editor

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

  • Recientemente navegando por este tema   0 miembros

    • No hay usuarios registrados visitando esta página.
×
×
  • Crear nuevo...