Skip to content

Commit

Permalink
xrGame/ui/UIActorMenu.h: returned deleted fields (#382 and #392)
Browse files Browse the repository at this point in the history
  • Loading branch information
Xottab-DUTY committed May 23, 2019
1 parent 1be7cfa commit 7cc1183
Show file tree
Hide file tree
Showing 4 changed files with 31 additions and 21 deletions.
8 changes: 5 additions & 3 deletions src/xrGame/ui/UIActorMenu.h
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,7 @@ class CUIActorMenu : public CUIDialogWnd, public CUIWndCallback
{
e_af_count = 5
};

CUIStatic* m_belt_list_over[e_af_count];
CUIStatic* m_HelmetOver;

Expand Down Expand Up @@ -161,23 +162,24 @@ class CUIActorMenu : public CUIDialogWnd, public CUIWndCallback

// delimiter ------------------------------
CUIStatic* m_LeftDelimiter;
// CUITextWnd* m_PartnerTradeCaption;
CUITextWnd* m_PartnerTradeCaption;
CUITextWnd* m_PartnerTradePrice;
CUITextWnd* m_PartnerTradeWeightMax;

CUIStatic* m_RightDelimiter;
// CUITextWnd* m_ActorTradeCaption;
CUITextWnd* m_ActorTradeCaption;
CUITextWnd* m_ActorTradePrice;
CUITextWnd* m_ActorTradeWeightMax;

CTrade* m_actor_trade;
CTrade* m_partner_trade;

CUI3tButton* m_trade_button;
CUI3tButton* m_trade_buy_button;
CUI3tButton* m_trade_sell_button;
CUI3tButton* m_takeall_button;
CUI3tButton* m_exit_button;
// CUIStatic* m_clock_value;
CUIStatic* m_clock_value;

u32 m_last_time;
bool m_repair_mode;
Expand Down
20 changes: 9 additions & 11 deletions src/xrGame/ui/UIActorMenuInitialize.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -50,10 +50,7 @@ void CUIActorMenu::Construct()
CUIXmlInit::InitWindow(uiXml, "main", 0, this);
m_hint_wnd = UIHelper::CreateHint(uiXml, "hint_wnd");

m_LeftBackground = new CUIStatic();
m_LeftBackground->SetAutoDelete(true);
AttachChild(m_LeftBackground);
CUIXmlInit::InitStatic(uiXml, "left_background", 0, m_LeftBackground);
m_LeftBackground = UIHelper::CreateStatic(uiXml, "left_background", this);

m_pUpgradeWnd = new CUIInventoryUpgradeWnd();
AttachChild(m_pUpgradeWnd);
Expand All @@ -71,16 +68,16 @@ void CUIActorMenu::Construct()
m_PartnerCharacterInfo->InitCharacterInfo(&uiXml, "partner_ch_info");

m_RightDelimiter = UIHelper::CreateStatic(uiXml, "right_delimiter", this);
// m_ActorTradeCaption = UIHelper::CreateTextWnd(uiXml, "right_delimiter:trade_caption", m_RightDelimiter);
if ((m_ActorTradeCaption = UIHelper::CreateTextWnd(uiXml, "right_delimiter:trade_caption", m_RightDelimiter, false)))

This comment has been minimized.

Copy link
@FreeZoneMods

FreeZoneMods May 25, 2019

Contributor

Could you please avoid such style of writing code?

This comment has been minimized.

Copy link
@Xottab-DUTY

Xottab-DUTY May 25, 2019

Author Member

Yes, I will =)

m_ActorTradeCaption->AdjustWidthToText();
m_ActorTradePrice = UIHelper::CreateTextWnd(uiXml, "right_delimiter:trade_price", m_RightDelimiter);
m_ActorTradeWeightMax = UIHelper::CreateTextWnd(uiXml, "right_delimiter:trade_weight_max", m_RightDelimiter);
// m_ActorTradeCaption->AdjustWidthToText();

m_LeftDelimiter = UIHelper::CreateStatic(uiXml, "left_delimiter", this);
// m_PartnerTradeCaption = UIHelper::CreateTextWnd(uiXml, "left_delimiter:trade_caption", m_LeftDelimiter);
if ((m_PartnerTradeCaption = UIHelper::CreateTextWnd(uiXml, "left_delimiter:trade_caption", m_LeftDelimiter, false)))
m_PartnerTradeCaption->AdjustWidthToText();
m_PartnerTradePrice = UIHelper::CreateTextWnd(uiXml, "left_delimiter:trade_price", m_LeftDelimiter);
m_PartnerTradeWeightMax = UIHelper::CreateTextWnd(uiXml, "left_delimiter:trade_weight_max", m_LeftDelimiter);
// m_PartnerTradeCaption->AdjustWidthToText();

m_ActorBottomInfo = UIHelper::CreateStatic(uiXml, "actor_weight_caption", this);
m_ActorWeight = UIHelper::CreateTextWnd(uiXml, "actor_weight", this);
Expand Down Expand Up @@ -170,12 +167,13 @@ void CUIActorMenu::Construct()
m_Helmet_progress = UIHelper::CreateProgressBar(uiXml, "progess_bar_helmet", this);
m_Outfit_progress = UIHelper::CreateProgressBar(uiXml, "progess_bar_outfit", this);

m_trade_buy_button = UIHelper::Create3tButton(uiXml, "trade_buy_button", this);
m_trade_sell_button = UIHelper::Create3tButton(uiXml, "trade_sell_button", this);
m_trade_button = UIHelper::Create3tButton(uiXml, "trade_button", this, false);
m_trade_buy_button = UIHelper::Create3tButton(uiXml, "trade_buy_button", this, false);
m_trade_sell_button = UIHelper::Create3tButton(uiXml, "trade_sell_button", this, false);
m_takeall_button = UIHelper::Create3tButton(uiXml, "takeall_button", this);
m_exit_button = UIHelper::Create3tButton(uiXml, "exit_button", this);

// m_clock_value = UIHelper::CreateStatic(uiXml, "clock_value", this);
m_clock_value = UIHelper::CreateStatic(uiXml, "clock_value", this, false);

/*
m_pDeadBodyBagList = new CUIDragDropListEx();
Expand Down
6 changes: 4 additions & 2 deletions src/xrGame/ui/UIActorMenuInventory.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -48,18 +48,20 @@ void CUIActorMenu::InitInventoryMode()
m_pQuickSlot->Show(true);
m_pTrashList->Show(true);
m_RightDelimiter->Show(false);
if (m_clock_value)
m_clock_value->Show(true);

InitInventoryContents(m_pInventoryBagList);

VERIFY(CurrentGameUI());
CurrentGameUI()->UIMainIngameWnd->ShowZoneMap(true);
// m_clock_value->Show (true);
}

void CUIActorMenu::DeInitInventoryMode()
{
m_pTrashList->Show(false);
// m_clock_value->Show (false);
if (m_clock_value)
m_clock_value->Show(false);
}

void CUIActorMenu::SendEvent_ActivateSlot(u16 slot, u16 recipient)
Expand Down
18 changes: 13 additions & 5 deletions src/xrGame/ui/UIActorMenuTrade.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,12 @@ void CUIActorMenu::InitTradeMode()

m_PartnerBottomInfo->Show(true);
m_PartnerWeight->Show(true);
m_trade_buy_button->Show(true);
m_trade_sell_button->Show(true);
if (m_trade_button)
m_trade_button->Show(true);
if (m_trade_buy_button)
m_trade_buy_button->Show(true);
if (m_trade_sell_button)
m_trade_sell_button->Show(true);

VERIFY(m_pPartnerInvOwner);
m_pPartnerInvOwner->StartTrading();
Expand Down Expand Up @@ -139,8 +143,12 @@ void CUIActorMenu::DeInitTradeMode()

m_PartnerBottomInfo->Show(false);
m_PartnerWeight->Show(false);
m_trade_buy_button->Show(false);
m_trade_sell_button->Show(false);
if (m_trade_button)
m_trade_button->Show(false);
if (m_trade_buy_button)
m_trade_buy_button->Show(false);
if (m_trade_sell_button)
m_trade_sell_button->Show(false);

if (!CurrentGameUI())
return;
Expand Down Expand Up @@ -556,4 +564,4 @@ void CUIActorMenu::DonateCurrentItem(CUICellItem* cell_item)
SetCurrentItem(nullptr);
UpdateItemsPlace();
}
//-Alundaio
//-Alundaio

0 comments on commit 7cc1183

Please sign in to comment.