Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 17 additions & 6 deletions src/Client/WarFare/CountableItemEditDlg.cpp
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
// CountableItemEditDlg.cpp: implementation of the CCountableItemEditDlg class.
// CountableItemEditDlg.cpp: implementation of the CCountableItemEditDlg class.
//
//////////////////////////////////////////////////////////////////////

#include "StdAfx.h"
#include "text_resources.h"
#include "CountableItemEditDlg.h"
#include "N3UIWndBase.h"

#include "GameProcedure.h"
#include "GameProcMain.h"
Expand Down Expand Up @@ -174,6 +175,20 @@ bool CCountableItemEditDlg::ReceiveMessage(CN3UIBase* pSender, uint32_t dwMsg)

void CCountableItemEditDlg::Open(e_UIWND eUW, e_UIWND_DISTRICT eUD, bool bCountGold, bool bWareGold)
{
m_eCallerWnd = eUW;
m_eCallerWndDistrict = eUD;
m_bWareGold = bWareGold;

int iStackSize = -1;
if (!bCountGold && CN3UIWndBase::s_sSelectedIconInfo.pItemSelect != nullptr)
{
bool bToMeOrNotToMe = (eUW == UIWND_TRANSACTION && eUD == UIWND_DISTRICT_TRADE_NPC); // that is the question...
if (!bToMeOrNotToMe)
{
iStackSize = CN3UIWndBase::s_sSelectedIconInfo.pItemSelect->iCount;
}
}

std::string szMsg;
if (bCountGold)
szMsg = fmt::format_text_resource(IDS_EDIT_BOX_GOLD);
Expand All @@ -189,7 +204,7 @@ void CCountableItemEditDlg::Open(e_UIWND eUW, e_UIWND_DISTRICT eUD, bool bCountG
int iCX = 0, iCY = 0;

m_bLocked = true;
SetQuantity(-1);
SetQuantity(iStackSize);

SetVisible(true);

Expand All @@ -198,10 +213,6 @@ void CCountableItemEditDlg::Open(e_UIWND eUW, e_UIWND_DISTRICT eUD, bool bCountG
if (pEdit != nullptr)
pEdit->SetFocus();

m_eCallerWnd = eUW;
m_eCallerWndDistrict = eUD;
m_bWareGold = bWareGold;

switch (eUW)
{
case UIWND_TRANSACTION:
Expand Down
9 changes: 8 additions & 1 deletion src/Client/WarFare/CountableItemEditDlg.h
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// CountableItemEditDlg.h: interface for the CCountableItemEditDlg class.
// CountableItemEditDlg.h: interface for the CCountableItemEditDlg class.
//
//////////////////////////////////////////////////////////////////////

Expand Down Expand Up @@ -41,6 +41,13 @@ class CCountableItemEditDlg : public CN3UIBase
virtual void Open(e_UIWND eUW, e_UIWND_DISTRICT eUD, bool bCountGold, bool bWareGold = false);
virtual void Close();

void SetCallerInfo(e_UIWND eUW, e_UIWND_DISTRICT eUD, bool bWareGold = false)
{
m_eCallerWnd = eUW;
m_eCallerWndDistrict = eUD;
m_bWareGold = bWareGold;
}

bool IsLocked()
{
return m_bLocked;
Expand Down
13 changes: 11 additions & 2 deletions src/Client/WarFare/UIPerTradeDlg.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// UIPerTradeDlg.cpp: implementation of the CUIPerTradeDlg class.
// UIPerTradeDlg.cpp: implementation of the CUIPerTradeDlg class.
//
//////////////////////////////////////////////////////////////////////

Expand Down Expand Up @@ -664,7 +664,16 @@ bool CUIPerTradeDlg::ReceiveIconDrop(__IconItemSkill* spItem, POINT ptCur)

// 활이나 물약등 아이템인 경우..
s_bWaitFromServer = false;
s_pCountableItemEdit->Open(UIWND_PER_TRADE, UIWND_DISTRICT_PER_TRADE_MY, false);
if (s_sSelectedIconInfo.pItemSelect != nullptr && s_sSelectedIconInfo.pItemSelect->iCount == 1)
{
s_pCountableItemEdit->SetCallerInfo(UIWND_PER_TRADE, UIWND_DISTRICT_PER_TRADE_MY, false);
s_pCountableItemEdit->SetQuantity(1);
ItemCountOK();
}
else
{
s_pCountableItemEdit->Open(UIWND_PER_TRADE, UIWND_DISTRICT_PER_TRADE_MY, false);
}

AllHighLightIconFree();
SetState(UI_STATE_COMMON_NONE);
Expand Down
28 changes: 25 additions & 3 deletions src/Client/WarFare/UITransactionDlg.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// UITransactionDlg.cpp: implementation of the CUITransactionDlg class.
// UITransactionDlg.cpp: implementation of the CUITransactionDlg class.
//
//////////////////////////////////////////////////////////////////////

Expand Down Expand Up @@ -998,7 +998,18 @@ bool CUITransactionDlg::ReceiveIconDrop(__IconItemSkill* spItem, POINT ptCur)
s_sRecoveryJobInfo.UIWndSourceEnd.iOrder = iDestInviOrder;
s_bWaitFromServer = false;

s_pCountableItemEdit->Open(UIWND_TRANSACTION, s_sSelectedIconInfo.UIWndSelect.UIWndDistrict, false);
if (s_sSelectedIconInfo.pItemSelect != nullptr && s_sSelectedIconInfo.pItemSelect->iCount == 1
&& s_sSelectedIconInfo.UIWndSelect.UIWndDistrict != UIWND_DISTRICT_TRADE_NPC)
{
auto eDist = s_sSelectedIconInfo.UIWndSelect.UIWndDistrict;
s_pCountableItemEdit->SetCallerInfo(UIWND_TRANSACTION, eDist, false);
s_pCountableItemEdit->SetQuantity(1);
ItemCountOK();
}
else
{
s_pCountableItemEdit->Open(UIWND_TRANSACTION, s_sSelectedIconInfo.UIWndSelect.UIWndDistrict, false);
}
return false;
}

Expand Down Expand Up @@ -1112,7 +1123,18 @@ bool CUITransactionDlg::ReceiveIconDrop(__IconItemSkill* spItem, POINT ptCur)
|| s_sRecoveryJobInfo.pItemSource->pItemBasic->byContable == UIITEM_TYPE_COUNTABLE_SMALL)
{
// 활이나 물약등 아이템인 경우..
s_pCountableItemEdit->Open(UIWND_TRANSACTION, s_sSelectedIconInfo.UIWndSelect.UIWndDistrict, false);
if (s_sSelectedIconInfo.pItemSelect != nullptr && s_sSelectedIconInfo.pItemSelect->iCount == 1
&& s_sSelectedIconInfo.UIWndSelect.UIWndDistrict != UIWND_DISTRICT_TRADE_NPC)
{
auto eDist = s_sSelectedIconInfo.UIWndSelect.UIWndDistrict;
s_pCountableItemEdit->SetCallerInfo(UIWND_TRANSACTION, eDist, false);
s_pCountableItemEdit->SetQuantity(1);
ItemCountOK();
}
else
{
s_pCountableItemEdit->Open(UIWND_TRANSACTION, s_sSelectedIconInfo.UIWndSelect.UIWndDistrict, false);
}
}
else
{
Expand Down
24 changes: 21 additions & 3 deletions src/Client/WarFare/UIWareHouseDlg.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// UIWareHouseDlg.cpp: implementation of the UIWareHouseDlg class.
// UIWareHouseDlg.cpp: implementation of the UIWareHouseDlg class.
//
//////////////////////////////////////////////////////////////////////

Expand Down Expand Up @@ -764,7 +764,16 @@ bool CUIWareHouseDlg::ReceiveIconDrop(__IconItemSkill* spItem, POINT ptCur)
s_sRecoveryJobInfo.UIWndSourceEnd.iOrder = iDestiOrder;
s_bWaitFromServer = false;

s_pCountableItemEdit->Open(UIWND_WARE_HOUSE, s_sSelectedIconInfo.UIWndSelect.UIWndDistrict, false);
if (s_sSelectedIconInfo.pItemSelect != nullptr && s_sSelectedIconInfo.pItemSelect->iCount == 1)
{
s_pCountableItemEdit->SetCallerInfo(UIWND_WARE_HOUSE, s_sSelectedIconInfo.UIWndSelect.UIWndDistrict, false);
s_pCountableItemEdit->SetQuantity(1);
ItemCountOK();
}
else
{
s_pCountableItemEdit->Open(UIWND_WARE_HOUSE, s_sSelectedIconInfo.UIWndSelect.UIWndDistrict, false);
}
}
else
{
Expand Down Expand Up @@ -942,7 +951,16 @@ bool CUIWareHouseDlg::ReceiveIconDrop(__IconItemSkill* spItem, POINT ptCur)

s_bWaitFromServer = false;

s_pCountableItemEdit->Open(UIWND_WARE_HOUSE, s_sSelectedIconInfo.UIWndSelect.UIWndDistrict, false);
if (s_sSelectedIconInfo.pItemSelect != nullptr && s_sSelectedIconInfo.pItemSelect->iCount == 1)
{
s_pCountableItemEdit->SetCallerInfo(UIWND_WARE_HOUSE, s_sSelectedIconInfo.UIWndSelect.UIWndDistrict, false);
s_pCountableItemEdit->SetQuantity(1);
ItemCountOK();
}
else
{
s_pCountableItemEdit->Open(UIWND_WARE_HOUSE, s_sSelectedIconInfo.UIWndSelect.UIWndDistrict, false);
}
return false;
}

Expand Down
4 changes: 3 additions & 1 deletion src/N3Base/N3UIEdit.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// N3UIEdit.cpp: implementation of the CN3UIEdit class.
// N3UIEdit.cpp: implementation of the CN3UIEdit class.
//
//////////////////////////////////////////////////////////////////////

Expand Down Expand Up @@ -293,6 +293,8 @@ bool CN3UIEdit::SetFocus()
else
::SetWindowText(s_hWndEdit, "");
}

::SendMessage(s_hWndEdit, EM_SETSEL, 0, -1);
}

return true;
Expand Down
Loading