Jump to content

Recommended Posts

  • Active+ Member

Hi,

.gif

By pressing SHIFT + RIGHT CLICK on the items eligible for sale, an interface will appear showing you how much money you will receive and how many items you have selected. The selected items will have a special icon indicating that they have been selected.

More information can be found in the README.

This is the hidden content, please

This is the hidden content, please

 

  • Metin2 Dev 51
  • Good 12
  • Love 21
Link to comment
Share on other sites

Thank you, but I don't understand 

 

Search self.wndItem.RefreshSlot() in def RefreshBagSlotWindow(self):

Add below:

		if app.QUICK_SELL_SYSTEM:
			self.RefreshQuickSell()

Add at the end:

	if app.QUICK_SELL_SYSTEM:
		def RefreshQuickSell(self):
			for k in xrange(player.INVENTORY_PAGE_SIZE * 5):
				slotNumber = self.__InventoryLocalSlotPosToGlobalSlotPos(k)
				if slotNumber in constInfo.QUICK_SELL_ITEMS:
					self.wndItem.SetSlotCoverImage(k, "inventory/selected_icon.tga")
				else:
					self.wndItem.EnableSlotCoverImage(k, False)


while you could've done

 

			if app.QUICK_SELL_SYSTEM:
				if slotNumber in constInfo.QUICK_SELL_ITEMS:
					self.wndItem.SetSlotCoverImage(i, "d:/ymir work/ui/game/inventory/selected_icon.tga")
				else:
					self.wndItem.EnableSlotCoverImage(i, False)

		self.wndItem.RefreshSlot()



Also what can happen if your constInfo.IS_AUTO_POTION effect is active and you'll sell your potion or having growth pet active and selling it. I would suggest this

 

		if app.ENABLE_QUICK_SELL_ITEM:
			itemVnum = player.GetItemIndex(slotIndex)
			blackList = [constInfo.IS_AFFECT_PLUS, constInfo.IS_AUTO_POTION, constInfo.IS_GROWTH_PET_ITEM]

			if app.IsPressed(app.DIK_LCONTROL):
				for func in blackList:
					if func(itemVnum):
						return

				if slotIndex in constInfo.QUICK_SELL_ITEMS:
					self.interface.RemoveSellSlot(slotIndex)
					self.RefreshBagSlotWindow()
					return
				elif not slotIndex in constInfo.QUICK_SELL_ITEMS:
					self.interface.AppendSellSlot(slotIndex)
					self.RefreshBagSlotWindow()
					return

 

Link to comment
Share on other sites

  • Active+ Member
Posted (edited)
1 hour ago, tw1x1 said:

Thank you, but I don't understand 

 

Search self.wndItem.RefreshSlot() in def RefreshBagSlotWindow(self):

Add below:

		if app.QUICK_SELL_SYSTEM:
			self.RefreshQuickSell()

Add at the end:

	if app.QUICK_SELL_SYSTEM:
		def RefreshQuickSell(self):
			for k in xrange(player.INVENTORY_PAGE_SIZE * 5):
				slotNumber = self.__InventoryLocalSlotPosToGlobalSlotPos(k)
				if slotNumber in constInfo.QUICK_SELL_ITEMS:
					self.wndItem.SetSlotCoverImage(k, "inventory/selected_icon.tga")
				else:
					self.wndItem.EnableSlotCoverImage(k, False)


while you could've done

 

			if app.QUICK_SELL_SYSTEM:
				if slotNumber in constInfo.QUICK_SELL_ITEMS:
					self.wndItem.SetSlotCoverImage(i, "d:/ymir work/ui/game/inventory/selected_icon.tga")
				else:
					self.wndItem.EnableSlotCoverImage(i, False)

		self.wndItem.RefreshSlot()



Also what can happen if your constInfo.IS_AUTO_POTION effect is active and you'll sell your potion or having growth pet active and selling it. I would suggest this

 

		if app.ENABLE_QUICK_SELL_ITEM:
			itemVnum = player.GetItemIndex(slotIndex)
			blackList = [constInfo.IS_AFFECT_PLUS, constInfo.IS_AUTO_POTION, constInfo.IS_GROWTH_PET_ITEM]

			if app.IsPressed(app.DIK_LCONTROL):
				for func in blackList:
					if func(itemVnum):
						return

				if slotIndex in constInfo.QUICK_SELL_ITEMS:
					self.interface.RemoveSellSlot(slotIndex)
					self.RefreshBagSlotWindow()
					return
				elif not slotIndex in constInfo.QUICK_SELL_ITEMS:
					self.interface.AppendSellSlot(slotIndex)
					self.RefreshBagSlotWindow()
					return

 

Thank you for coming back and sharing your opinion. I developed this system based on the server I have, as on the official server, elixirs cannot be sold and I did not take this probability into account. Additionally, the pet system is not available on my server. Depending on the systems you have, this system will need to be adapted to your needs. I simply shared with you what I needed on my end.

 

Thank you for coming with an update for those in need.

.png

Edited by Chitra
  • Love 1
Link to comment
Share on other sites

Thank you for your share. Actually, I'm looking for something similar to Rubinum. Specifically, I'm interested in a tool that displays shortcut keys in the item tooltip when the market window is open. It should allow for quick actions like Shift + Right Click to rapidly sell items in the market. Is anyone know something like that ? It might have changed. It's been years since I played Rubinum.

Edited by AltanOzkan
Link to comment
Share on other sites

sysser

 


0308 20:29:15244 ::   File "uiQuickSell.py", line 75, in BoardInterface

0308 20:29:15244 :: AttributeError
0308 20:29:15244 :: :
0308 20:29:15244 :: 'module' object has no attribute 'MakeBoardWithTitleBar'

 

    def BoardInterface(self):

        self.Board = ui.MakeBoardWithTitleBar(self, "not_pick", localeInfo.QUICK_SELL_TITLE_NAME,ui.__mem_func__(self.Close), 170, 100)

On 3/5/2024 at 12:56 AM, tw1x1 said:

 

 

Edited by NvL
Link to comment
Share on other sites

  • Active+ Member
Posted (edited)
1 hour ago, NvL said:

sysser

 


0308 20:29:15244 ::   File "uiQuickSell.py", line 75, in BoardInterface

0308 20:29:15244 :: AttributeError
0308 20:29:15244 :: :
0308 20:29:15244 :: 'module' object has no attribute 'MakeBoardWithTitleBar'

 

    def BoardInterface(self):

        self.Board = ui.MakeBoardWithTitleBar(self, "not_pick", localeInfo.QUICK_SELL_TITLE_NAME,ui.__mem_func__(self.Close), 170, 100)

 

Add in your ui.py before def MakeImageBox

def MakeBoardWithTitleBar(parent, flag, title, closeEvent, width, height):
	board = BoardWithTitleBar()
	board.SetParent(parent)
	board.SetSize(width, height)
	board.AddFlag(flag)
	board.SetTitleName(title)
	board.SetCloseEvent(closeEvent)
	board.Show()
	return board

 

Edited by Chitra
Link to comment
Share on other sites


0308 21:55:14716 ::   File "uiInventory.py", line 2129, in RefreshQuickSell

0308 21:55:14716 :: AttributeError
0308 21:55:14716 :: :
0308 21:55:14716 :: 'GridSlotWindow' object has no attribute 'EnableSlotCoverImage'

uiinventory.py

    if app.QUICK_SELL_SYSTEM:
        def RefreshQuickSell(self):
            for k in xrange(player.INVENTORY_PAGE_SIZE * 5):
                slotNumber = self.__InventoryLocalSlotPosToGlobalSlotPos(k)
                if slotNumber in constInfo.QUICK_SELL_ITEMS:
                    self.wndItem.SetSlotCoverImage(k, "inventory/selected_icon.tga")
                else:
                    self.wndItem.EnableSlotCoverImage(k, False)

Edited by NvL
Link to comment
Share on other sites

18 minutes ago, NvL said:


0308 21:55:14716 ::   File "uiInventory.py", line 2129, in RefreshQuickSell

0308 21:55:14716 :: AttributeError
0308 21:55:14716 :: :
0308 21:55:14716 :: 'GridSlotWindow' object has no attribute 'EnableSlotCoverImage'

uiinventory.py

    if app.QUICK_SELL_SYSTEM:
        def RefreshQuickSell(self):
            for k in xrange(player.INVENTORY_PAGE_SIZE * 5):
                slotNumber = self.__InventoryLocalSlotPosToGlobalSlotPos(k)
                if slotNumber in constInfo.QUICK_SELL_ITEMS:
                    self.wndItem.SetSlotCoverImage(k, "inventory/selected_icon.tga")
                else:
                    self.wndItem.EnableSlotCoverImage(k, False)


In EterPythonLib\PythonSlotWindow.cpp look for
 

void CSlotWindow::SetSlotCoolTimeInverse(DWORD dwIndex, float fCoolTime, float fRemainingTime)


add above or after whole function
 

void CSlotWindow::SetSlotCoverImage(const DWORD dwIndex, const char* FileName)
{
	TSlot* pSlot;
	if (!GetSlotPointer(dwIndex, &pSlot))
		return;

	auto& CoverImage = pSlot->pCoverImage;
	if (CoverImage == nullptr)
		CoverImage = std::make_shared<CImageBox>(nullptr);

	CoverImage->LoadImage(FileName);
	CoverImage->Show();
}

void CSlotWindow::EnableSlotCoverImage(const DWORD dwIndex, const bool bEnable)
{
	TSlot* pSlot;
	if (!GetSlotPointer(dwIndex, &pSlot))
		return;

	const auto& CoverImage = pSlot->pCoverImage;
	if (CoverImage == nullptr)
		return;

	if (bEnable)
		CoverImage->Show();
	else
		CoverImage->Hide();
}

 


In EterPythonLib\PythonSlotWindow.cpp look for
 

void RefreshSlot();



Add after
 

			void SetSlotCoverImage(const DWORD dwIndex, const char* FileName);
			void EnableSlotCoverImage(const DWORD dwIndex, const bool bEnable);



Now go in PythonWindowManagerModule.cpp and add before void initwndMgr()

 

PyObject *wndMgrSetSlotCoverImage(PyObject *poSelf, PyObject *poArgs)
{
	UI::CWindow *pWin;
	if (!PyTuple_GetWindow(poArgs, 0, &pWin))
		return Py_BuildException();

	DWORD dwSlotIndex;
	if (!PyTuple_GetUnsignedLong(poArgs, 1, &dwSlotIndex))
		return Py_BuildException();

	char *szFileName;
	if (!PyTuple_GetString(poArgs, 2, &szFileName))
		return Py_BuildException();

	if (!pWin->IsType(UI::CSlotWindow::Type()))
		return Py_BuildException();

	dynamic_cast<UI::CSlotWindow*>(pWin)->SetSlotCoverImage(dwSlotIndex, szFileName);

	return Py_BuildNone();
}

PyObject *wndMgrEnableSlotCoverImage(PyObject *poSelf, PyObject *poArgs)
{
	UI::CWindow *pWin;
	if (!PyTuple_GetWindow(poArgs, 0, &pWin))
		return Py_BuildException();

	DWORD dwSlotIndex;
	if (!PyTuple_GetUnsignedLong(poArgs, 1, &dwSlotIndex))
		return Py_BuildException();

	bool bOnOff;
	if (!PyTuple_GetBoolean(poArgs, 2, &bOnOff))
		return Py_BuildException();

	if (!pWin->IsType(UI::CSlotWindow::Type()))
		return Py_BuildException();

	dynamic_cast<UI::CSlotWindow*>(pWin)->EnableSlotCoverImage(dwSlotIndex, bOnOff);

	return Py_BuildNone();
}



And look for
 

{ "ShowOverInWindowName",		wndMgrShowOverInWindowName,			METH_VARARGS },

 


Add after
 

		{ "SetSlotCoverImage",			wndMgrSetSlotCoverImage,			METH_VARARGS },
		{ "EnableSlotCoverImage",		wndMgrEnableSlotCoverImage,			METH_VARARGS },



Compile your binary and go in root/ui.py and look for
 

	def GetStartIndex(self):
		return 0

 


Below add
 

		def SetSlotCoverImage(self, slotindex, filename):
			wndMgr.SetSlotCoverImage(self.hWnd, slotindex, filename)

		def EnableSlotCoverImage(self, slotindex, onoff):
			wndMgr.EnableSlotCoverImage(self.hWnd, slotindex, onoff)



Or you could take all this from Mali's change look system released on this community.

  • Love 2
Link to comment
Share on other sites

[!] Note that you might have NULL instead of nullptr !

In PythonSlotWindow.cpp look for
 

	Slot.pSignImage = nullptr;

 

Bellow add
 

	Slot.pCoverImage = nullptr;


Look for
 

	if (pSlot->pSignImage)
	{
 		pSlot->pSignImage->Hide();
	}

 

Bellow add
 

	if (pSlot->pCoverImage)
	{
		pSlot->pCoverImage->Hide();
	}

 

Look for
 

		if (rSlot.pNumberLine)
		{
			int ix = rSlot.byxPlacedItemSize*ITEM_WIDTH + rSlot.ixPosition - 4;
			int iy = rSlot.iyPosition + rSlot.byyPlacedItemSize*ITEM_HEIGHT - 12 + 2;
			rSlot.pNumberLine->SetPosition(ix, iy);
			rSlot.pNumberLine->Update();
			rSlot.pNumberLine->Render();
		}

 

Bellow add
 

		if (rSlot.pCoverImage)
		{
			rSlot.pCoverImage->SetPosition(m_rect.left + rSlot.ixPosition, m_rect.top + rSlot.iyPosition);
			rSlot.pCoverImage->Render();
		}

 

Now go in PythonSlotWindow.h and look for
 

CAniImageBox* pFinishCoolTimeEffect;

 

Bellow add
 

				std::shared_ptr< CImageBox > pCoverImage;

 

Edited by tw1x1
  • Love 1
Link to comment
Share on other sites

:(((((((

Severity    Code    Description    Project    File    Line    Suppression State    Details
Error    C3861    'PyTuple_GetUnsignedLong': identifier not found    EterPythonLib    D:\project\Client\binary\source\EterPythonLib\PythonWindowManagerModule.cpp    2365        

Link to comment
Share on other sites

PythonUtils.cpp add 
 

bool PyTuple_GetUnsignedLong(PyObject *poArgs, int pos, unsigned long *ret)
{
	if (pos >= PyTuple_Size(poArgs))
		return false;

	PyObject *poItem = PyTuple_GetItem(poArgs, pos);
	
	if (!poItem)
		return false;
	
	*ret = PyLong_AsUnsignedLong(poItem);
	return true;
}

 

and PythonUtils.h
 

bool PyTuple_GetUnsignedLong(PyObject *poArgs, int pos, unsigned long *ret);

 

  • Love 1
Link to comment
Share on other sites

compile resolved

 

0308 23:34:15466 :: Traceback (most recent call last):

0308 23:34:15466 ::   File "networkModule.py", line 247, in SetGamePhase

0308 23:34:15466 ::   File "game.py", line 102, in __init__

0308 23:34:15466 ::   File "interfaceModule.py", line 355, in MakeInterface

0308 23:34:15467 ::   File "interfaceModule.py", line 141, in __MakeQuickSell

0308 23:34:15467 ::   File "uiQuickSell.py", line 24, in __init__

0308 23:34:15467 ::   File "uiQuickSell.py", line 87, in BoardInterface

0308 23:34:15467 :: TypeError
0308 23:34:15467 :: :
0308 23:34:15467 :: MakeTextLine() takes exactly 1 argument (5 given)
0308 23:34:15467 ::

interfacemodule.py

    if app.QUICK_SELL_SYSTEM:
        def __MakeQuickSell(self):
            self.wndQuickSell = uiQuickSell.QuickSell()
            self.wndQuickSell.Hide()

 

X(

Edited by NvL
Link to comment
Share on other sites

In root/ui.py look for
 

def MakeTextLine(parent):

 

Bellow add
 

def MakeTextLineNew(parent, x, y, text):
	textLine = TextLine()
	textLine.SetParent(parent)
	textLine.SetPosition(x, y)
	textLine.SetText(text)
	textLine.Show()
	return textLine

 

Now go in uiqcuicksell.py and change
 

self.sellItemSelectedCount = ui.MakeTextLine

and

self.sellPrice = ui.MakeTextLine

 

with
 

		self.sellItemSelectedCount = ui.MakeTextLineNew(self.sellItemSelectedCountBG, 0, 0, "")
		self.sellItemSelectedCount.SetWindowHorizontalAlignCenter()
		self.sellItemSelectedCount.SetHorizontalAlignCenter()

		self.sellPrice = ui.MakeTextLineNew(self.sellPriceBG, 0, 0, "")
		self.sellPrice.SetWindowHorizontalAlignCenter()
		self.sellPrice.SetHorizontalAlignCenter()

 

You could even remove the "text" argument, you don't use it.

Link to comment
Share on other sites

0309 00:19:18332 :: Traceback (most recent call last):

0309 00:19:18332 ::   File "ui.py", line 1905, in OnUnselectItemSlot

0309 00:19:18332 ::   File "ui.py", line 88, in __call__

0309 00:19:18332 ::   File "ui.py", line 79, in __call__

0309 00:19:18332 ::   File "uiInventory.py", line 2013, in UseItemSlot

0309 00:19:18333 ::   File "interfaceModule.py", line 1859, in AppendSellSlot

0309 00:19:18333 ::   File "interfaceModule.py", line 1849, in UpdateQuickSellPrice

0309 00:19:18333 ::   File "uiQuickSell.py", line 117, in UpdatePrice

0309 00:19:18333 :: AttributeError
0309 00:19:18333 :: :
0309 00:19:18333 :: 'module' object has no attribute 'NumberToDecimalStringQuickSell'

X(

Edited by NvL
Link to comment
Share on other sites

  • Active+ Member
1 hour ago, NvL said:

0309 00:19:18332 :: Traceback (most recent call last):

0309 00:19:18332 ::   File "ui.py", line 1905, in OnUnselectItemSlot

0309 00:19:18332 ::   File "ui.py", line 88, in __call__

0309 00:19:18332 ::   File "ui.py", line 79, in __call__

0309 00:19:18332 ::   File "uiInventory.py", line 2013, in UseItemSlot

0309 00:19:18333 ::   File "interfaceModule.py", line 1859, in AppendSellSlot

0309 00:19:18333 ::   File "interfaceModule.py", line 1849, in UpdateQuickSellPrice

0309 00:19:18333 ::   File "uiQuickSell.py", line 117, in UpdatePrice

0309 00:19:18333 :: AttributeError
0309 00:19:18333 :: :
0309 00:19:18333 :: 'module' object has no attribute 'NumberToDecimalStringQuickSell'

X(

Sorry, I forgot to attach that function.

The github has been updated with the missing file.

 

	def NumberToDecimalStringQuickSell(n):
		return "%s" % ('.'.join([i - 3 < 0 and str(n / 5)[:i] or str(n / 5)[i - 3:i] for i in range(len(str(n / 5)) % 3, len(str(n / 5)) + 1, 3) if i]))

 

Link to comment
Share on other sites

5 hours ago, Chitra said:

Sorry, I forgot to attach that function.

The github has been updated with the missing file.

 

	def NumberToDecimalStringQuickSell(n):
		return "%s" % ('.'.join([i - 3 < 0 and str(n / 5)[:i] or str(n / 5)[i - 3:i] for i in range(len(str(n / 5)) % 3, len(str(n / 5)) + 1, 3) if i]))

 

where does it come from?

  • Good 1
Link to comment
Share on other sites

Announcements



×
×
  • 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.