Jump to content

Failed to move inventorywindowex.py item to costumewindow.py


Recommended Posts

  • Premium

Hi, guys!

I've spent lot of hours but i'm out of ideas, any help will be appreciated.

What I try to achieve? I try to add PET_SLOT on CostumeWindow. It works like a charm if i try to add it on InventoryWindowEx.py but isn't visible if when I try to apply it on CostumeWindow.py.

Very important: For debugging purposes I've moved other costume items to "x":115, "y":158 and I can confirm coords are correct (I have an extended window, not classical new_costume_bg.jpg). It's also important to mention that I've mixed item.EQUIPMENT_PET with item.EQUIPMENT_BELT and I had pet item on belt slot but belt dissapeared somewhere on costume window.

ItemData.h

		enum EItemType
		{
			ITEM_TYPE_NONE,					//0
			ITEM_TYPE_WEAPON,				//1//¹«±â
			ITEM_TYPE_ARMOR,				//2//°©¿Ê
			ITEM_TYPE_USE,					//3//¾ÆÀÌÅÛ »ç¿ë
			ITEM_TYPE_AUTOUSE,				//4
			ITEM_TYPE_MATERIAL,				//5
			ITEM_TYPE_SPECIAL,				//6 //½ºÆä¼È ¾ÆÀÌÅÛ
			ITEM_TYPE_TOOL,					//7
			ITEM_TYPE_LOTTERY,				//8//º¹±Ç
			ITEM_TYPE_ELK,					//9//µ·
			ITEM_TYPE_METIN,				//10
			ITEM_TYPE_CONTAINER,			//11
			ITEM_TYPE_FISH,					//12//³¬½Ã
			ITEM_TYPE_ROD,					//13
			ITEM_TYPE_RESOURCE,				//14
			ITEM_TYPE_CAMPFIRE,				//15
			ITEM_TYPE_UNIQUE,				//16
			ITEM_TYPE_SKILLBOOK,			//17
			ITEM_TYPE_QUEST,				//18
			ITEM_TYPE_POLYMORPH,			//19
			ITEM_TYPE_TREASURE_BOX,			//20//º¸¹°»óÀÚ
			ITEM_TYPE_TREASURE_KEY,			//21//º¸¹°»óÀÚ ¿­¼è
			ITEM_TYPE_SKILLFORGET,			//22
			ITEM_TYPE_GIFTBOX,				//23
			ITEM_TYPE_PICK,					//24
			ITEM_TYPE_HAIR,					//25//¸Ó¸®
			ITEM_TYPE_TOTEM,				//26//ÅäÅÛ
			ITEM_TYPE_BLEND,				//27//»ý¼ºµÉ¶§ ·£´ýÇÏ°Ô ¼Ó¼ºÀÌ ºÙ´Â ¾à¹°
			ITEM_TYPE_COSTUME,				//28//ÄÚ½ºÃõ ¾ÆÀÌÅÛ (2011³â 8¿ù Ãß°¡µÈ ÄÚ½ºÃõ ½Ã½ºÅÛ¿ë ¾ÆÀÌÅÛ)
			ITEM_TYPE_DS,					//29 //¿ëÈ¥¼®
			ITEM_TYPE_SPECIAL_DS,			//30 // Ư¼öÇÑ ¿ëÈ¥¼® (DS_SLOT¿¡ Âø¿ëÇÏ´Â UNIQUE ¾ÆÀÌÅÛÀ̶ó »ý°¢ÇÏ¸é µÊ)
			ITEM_TYPE_EXTRACT,					//31 ÃßÃâµµ±¸.
			ITEM_TYPE_SECONDARY_COIN,			//32 ¸íµµÀü.
			ITEM_TYPE_RING,						//33 ¹ÝÁö (À¯´ÏÅ© ½½·ÔÀÌ ¾Æ´Ñ ¼ø¼ö ¹ÝÁö ½½·Ô)
			ITEM_TYPE_BELT,						//34 º§Æ®
#ifdef ENABLE_ATTR_TRANSFER_SYSTEM
			ITEM_TYPE_TRANSFER_SCROLL,		//35
#endif
#ifdef ENABLE_GROWTH_PET_SYSTEM
			ITEM_TYPE_PET,					//36
#endif
#ifdef __UNIMPLEMENTED__
			ITEM_TYPE_MEDIUM,				//37
			ITEM_TYPE_GACHA					//38 Florin
#endif
#ifdef ENABLE_PET_SLOT
			ITEM_TYPE_NORMAL_PET,			//39
#endif
			ITEM_TYPE_MAX_NUM,
		};

		enum EWearPositions
		{
			WEAR_BODY,          // 0
			WEAR_HEAD,          // 1
			WEAR_FOOTS,         // 2
			WEAR_WRIST,         // 3
			WEAR_WEAPON,        // 4
			WEAR_NECK,          // 5
			WEAR_EAR,           // 6
			WEAR_UNIQUE1,       // 7
			WEAR_UNIQUE2,       // 8
			WEAR_ARROW,         // 9
			WEAR_SHIELD,        // 10

			WEAR_ABILITY1,  // 11
			WEAR_ABILITY2,  // 12
			WEAR_ABILITY3,  // 13
			WEAR_ABILITY4,  // 14
			WEAR_ABILITY5,  // 15
			WEAR_ABILITY6,  // 16
			WEAR_ABILITY7,  // 17
			WEAR_ABILITY8,  // 18
			WEAR_COSTUME_BODY,	// 19
			WEAR_COSTUME_HAIR,	// 20

#ifdef ENABLE_MOUNT_COSTUME_SYSTEM
			WEAR_COSTUME_MOUNT,	// 21
#endif

#ifdef ENABLE_SASH_SYSTEM
			WEAR_COSTUME_SASH,	// 22
#endif

#ifdef ENABLE_WEAPON_COSTUME_SYSTEM
			WEAR_COSTUME_WEAPON,	//23
#endif

			WEAR_RING1,			// 24	: ½Å±Ô ¹ÝÁö½½·Ô1 (¿ÞÂÊ)
			WEAR_RING2,			// 25	: ½Å±Ô ¹ÝÁö½½·Ô2 (¿À¸¥ÂÊ)

			WEAR_BELT,			// 26	: ½Å±Ô º§Æ®½½·Ô

#ifdef ENABLE_PET_SLOT
			WEAR_NORMAL_PET,	// 27
#endif

			WEAR_MAX_NUM = 32,
		};

GameType.h

#ifdef ENABLE_NEW_EQUIPMENT_SYSTEM
	const DWORD c_New_Equipment_Start = c_Equipment_Start + 24;	// 21
	const DWORD c_New_Equipment_Count = 3
#ifdef ENABLE_PET_SLOT
	+ 1
#endif
	;
	const DWORD c_Equipment_Ring1 = c_New_Equipment_Start + 0;
	const DWORD c_Equipment_Ring2 = c_New_Equipment_Start + 1;
	const DWORD c_Equipment_Belt  = c_New_Equipment_Start + 2;
#endif
#ifdef ENABLE_PET_SLOT
	const DWORD c_Equipment_Pet   = c_New_Equipment_Start + 3;
#endif

PythonItemModule.cpp


#ifdef ENABLE_PET_SLOT
	PyModule_AddIntConstant(poModule, "EQUIPMENT_PET",				c_Equipment_Pet);
#endif

 

Thank you!

Link to comment
Share on other sites

  • Contributor

uiinventory.py (It's a default code, you may have modified)

	def RefreshCostumeSlot(self):
		getItemVNum=player.GetItemIndex
		
		for i in xrange(item.COSTUME_SLOT_COUNT):
			slotNumber = item.COSTUME_SLOT_START + i
			self.wndEquip.SetItemSlot(slotNumber, getItemVNum(slotNumber), 0)

		self.wndEquip.RefreshSlot()

As you see the default code only works if it's in order like 19..20..21..22..23.
While your costum item stuffs ends on 23, you have pets on 27 so it's not working.

Plus I'm not sure if your pet slot are calculated in COSTUME_SLOT_COUNT but you did not show it so idk. (GameType.h look for #ifdef ENABLE_COSTUME_SYSTEM it should have only 1 search result)

You may can do something like this:

Spoiler
	def RefreshCostumeSlot(self):
		getItemVNum=player.GetItemIndex
		
		for i in xrange(item.COSTUME_SLOT_COUNT):
			slotNumber = item.COSTUME_SLOT_START + i
			self.wndEquip.SetItemSlot(slotNumber, getItemVNum(slotNumber), 0)

		self.wndEquip.SetItemSlot(27, getItemVNum(27), 0)

		self.wndEquip.RefreshSlot()

 

Not sure if it's works, it would be better to have them in order and have it calculated in COSTUME_SLOT_COUNT.

Edited by TMP4
  • Love 2
Link to comment
Share on other sites

  • Premium
48 minutes ago, TMP4 said:

uiinventory.py (It's a default code, you may have modified)

	def RefreshCostumeSlot(self):
		getItemVNum=player.GetItemIndex
		
		for i in xrange(item.COSTUME_SLOT_COUNT):
			slotNumber = item.COSTUME_SLOT_START + i
			self.wndEquip.SetItemSlot(slotNumber, getItemVNum(slotNumber), 0)

		self.wndEquip.RefreshSlot()

As you see the default code only works if it's in order like 19..20..21..22..23.
While your costum item stuffs ends on 23, you have pets on 27 so it's not working.

Plus I'm not sure if your pet slot are calculated in COSTUME_SLOT_COUNT but you did not show it so idk. (GameType.h look for #ifdef ENABLE_COSTUME_SYSTEM it should have only 1 search result)

You may can do something like this:

  Hide contents
	def RefreshCostumeSlot(self):
		getItemVNum=player.GetItemIndex
		
		for i in xrange(item.COSTUME_SLOT_COUNT):
			slotNumber = item.COSTUME_SLOT_START + i
			self.wndEquip.SetItemSlot(slotNumber, getItemVNum(slotNumber), 0)

		self.wndEquip.SetItemSlot(27, getItemVNum(27), 0)

		self.wndEquip.RefreshSlot()

 

Not sure if it's works, it would be better to have them in order and have it calculated in COSTUME_SLOT_COUNT.

That did the trick.

It wasn't really 27 as slot number but setting correct slot number solved my problem.

Thank you !

#CloseRequest

Link to comment
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now

Announcements



  • Similar Content

  • Activity

    1. 24

      Experimental Renderer

    2. 11

      Multi Language System

    3. 0

      [FREE DESIGN] Interface + Logo + Discord Banner and Avatar

    4. 4

      Feeding game source to LLM

    5. 0

      Quest 6/7 Problem

    6. 5

      Effect weapons

    7. 0

      [C++] Fix Core Downer Using Negative Number in GM Codes

  • Recently Browsing

    • No registered users viewing this page.
×
×
  • Create New...

Important Information

Terms of Use / Privacy Policy / Guidelines / We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.