Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
18 commits
Select commit Hold shift + click to select a range
5c7e2fd
Add DrawCustomShape
nltp-ashes Feb 15, 2026
3c5c52e
Move from CUIMainIngameWnd to CUIGameCustom
nltp-ashes Feb 15, 2026
ec0b6cc
Port as much code as possible to lua
nltp-ashes Feb 15, 2026
96a1393
Merge branch 'themrdemonized:all-in-one-vs2022-wpo' into all-in-one-v…
nltp-ashes Feb 15, 2026
36e8af7
Removed useless UpdateShaderName
nltp-ashes Feb 16, 2026
247922d
Merge branch 'all-in-one-vs2022-wpo' of https://github.com/nltp-ashes…
nltp-ashes Feb 16, 2026
0de0122
Dummy change to trigger CI
nltp-ashes Feb 16, 2026
55ecc7c
Merge branch 'themrdemonized:all-in-one-vs2022-wpo' into all-in-one-v…
nltp-ashes Feb 22, 2026
34cb537
Made CustomShapes persistant through runtime and added state management
nltp-ashes Mar 1, 2026
ddab4ca
Merge branch 'all-in-one-vs2022-wpo' of https://github.com/nltp-ashes…
nltp-ashes Mar 1, 2026
2e6f318
Merge branch 'themrdemonized:all-in-one-vs2022-wpo' into all-in-one-v…
nltp-ashes Aug 8, 2026
deebabc
Merge branch 'themrdemonized:all-in-one-vs2022-wpo' into all-in-one-v…
nltp-ashes Aug 13, 2026
e1eb73d
Merge branch 'themrdemonized:all-in-one-vs2022-wpo' into all-in-one-v…
nltp-ashes Aug 29, 2026
e63cac5
feature(find-child): expose find-child to lua
nltp-ashes Aug 29, 2026
8d8a655
feature(find-child): add macro to cast ui classes
nltp-ashes Aug 29, 2026
c35b225
feature(find-child): rewrite macro
nltp-ashes Aug 29, 2026
9bd8aeb
feature(find-child): remove custom shape code
nltp-ashes Aug 29, 2026
0cfd395
feature(find-child): update lua help
nltp-ashes Aug 30, 2026
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
54 changes: 48 additions & 6 deletions gamedata/scripts/lua_help_ex.script
Original file line number Diff line number Diff line change
Expand Up @@ -185,12 +185,6 @@
bool dltx_is_override(string sec, string line)
}

// UI hud
// get_hud():GetWindow()
get_hud() {
CUIWindow GetWindow()
}

// Player hud
// get_player_hud():set_hands("actor_hud_cs_exo")
get_player_hud() {
Expand All @@ -213,6 +207,54 @@
property dest_position // Fvector
}

class CUIWindow {
CUIWindow FindChild()

CUI3tButton cast_3tButton()
CUIActorMenu cast_ActorMenu()
CUIButton cast_Button()
CUICheckButton cast_CheckButton()
CUIComboBox cast_ComboBox()
CUICustomEdit cast_CustomEdit()
CUICustomSpin cast_CustomSpin()
CUIDialogWnd cast_DialogWnd()
CUIEditBox cast_EditBox()
CUIFrameLineWnd cast_FrameLineWnd()
CUIFrameWindow cast_FrameWindow()
UIHint cast_Hint()
CUIHudStatesWnd cast_HudStatesWnd()
CUIListBox cast_ListBox()
CUIListBoxItem cast_ListBoxItem()
CUIListBoxItemMsgChain cast_ListBoxItemMsgChain()
CUIMMShniaga cast_MMShniaga()
CUIMainIngameWnd cast_MainIngameWnd()
CUIMapInfo cast_MapInfo()
CUIMapList cast_MapList()
CUIMessageBox cast_MessageBox()
CUIMessageBoxEx cast_MessageBoxEx()
CUIMessagesWindow cast_MessagesWindow()
CUIMotionIcon cast_MotionIcon()
CUIPdaWnd cast_PdaWnd()
CUIProgressBar cast_ProgressBar()
CUIPropertiesBox cast_PropertiesBox()
CUIDialogWndEx cast_ScriptWnd()
CUIScrollView cast_ScrollView()
CServerList cast_ServerList()
CUISleepStatic cast_SleepStatic()
CUISpinFlt cast_SpinFlt()
CUISpinNum cast_SpinNum()
CUISpinText cast_SpinText()
CUIStatic cast_Static()
CUITabButton cast_TabButton()
CUITabControl cast_TabControl()
CUITextWnd cast_TextWnd()
CUITrackBar cast_TrackBar()
}

class CUIGameCustom {
CUIWindow GetWindow() // get_hud():GetWindow()
}

class CUIProgressBar {
CUIStatic GetProgressStatic()
bool GetSnapNoDelay() Get the status of "SnapNoDelay"
Expand Down
1 change: 0 additions & 1 deletion src/xrGame/ui/UIMainIngameWnd.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -315,7 +315,6 @@ void CUIMainIngameWnd::Draw()
RenderQuickInfos();
}


void CUIMainIngameWnd::SetMPChatLog(CUIWindow* pChat, CUIWindow* pLog)
{
m_pMPChatWnd = pChat;
Expand Down
1 change: 0 additions & 1 deletion src/xrGame/ui/UIMainIngameWnd.h
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,6 @@ class CUIMainIngameWnd : public CUIWindow
CUITextWnd* m_QuickSlotText2;
CUITextWnd* m_QuickSlotText3;
CUITextWnd* m_QuickSlotText4;

protected:
// 5 статиков для отображения иконок:
// - сломанного оружия(only mp)
Expand Down
2 changes: 1 addition & 1 deletion src/xrGame/ui/UIWindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -612,7 +612,7 @@ bool CUIWindow::IsChild(CUIWindow* pPossibleChild) const
}


CUIWindow* CUIWindow::FindChild(const shared_str name)
CUIWindow* CUIWindow::FindChild(const LPCSTR name)
{
if (WindowName() == name)
return this;
Expand Down
2 changes: 1 addition & 1 deletion src/xrGame/ui/UIWindow.h
Original file line number Diff line number Diff line change
Expand Up @@ -240,7 +240,7 @@ class CUIWindow : public CUISimpleWindow
const shared_str WindowName() const { return m_windowName; }
void SetWindowName(LPCSTR wn) { m_windowName = wn; }
LPCSTR WindowName_script() { return m_windowName.c_str(); }
CUIWindow* FindChild(const shared_str name);
CUIWindow* FindChild(const LPCSTR name);

IC bool CursorOverWindow() const { return m_bCursorOverWindow; }
IC u32 FocusReceiveTime() const { return m_dwFocusReceiveTime; }
Expand Down
109 changes: 89 additions & 20 deletions src/xrGame/ui/UIWindow_script.cpp
Original file line number Diff line number Diff line change
@@ -1,17 +1,47 @@
#include "pch_script.h"
#include "UIWindow.h"
#include "UIFrameWindow.h"
#include "UIFrameLineWnd.h"
#include "UIDialogWnd.h"
#include "UIDialogHolder.h"
#include "../GamePersistent.h"
//#include "UILabel.h"
#include "UIMMShniaga.h"
#include "UITextureMaster.h"
#include "UIScrollView.h"
#include "UIHint.h"
#include "../GamePersistent.h"
#include "../ScriptXMLInit.h"
#include "../UICursor.h"
#include "ServerList.h"
#include "UI3tButton.h"
#include "UIActorMenu.h"
#include "UIAnimatedStatic.h"
#include "UIButton.h"
#include "UICheckButton.h"
#include "UIComboBox.h"
#include "UICustomEdit.h"
#include "UICustomSpin.h"
#include "UIDialogWnd.h"
#include "UIEditBox.h"
#include "UIFrameLineWnd.h"
#include "UIFrameWindow.h"
#include "UIHint.h"
#include "UIHudStatesWnd.h"
#include "UIListBox.h"
#include "UIListBoxItem.h"
#include "UIListBoxItemMsgChain.h"
#include "UIMainIngameWnd.h"
#include "UIMapInfo.h"
#include "UIMapList.h"
#include "UIMessageBox.h"
#include "UIMessageBoxEx.h"
#include "UIMessagesWindow.h"
#include "UIMMShniaga.h"
#include "UIMotionIcon.h"
#include "UIPdaWnd.h"
#include "UIProgressBar.h"
#include "UIPropertiesBox.h"
#include "UIScriptWnd.h"
#include "UIScrollView.h"
#include "UISpinNum.h"
#include "UISpinText.h"
#include "UIStatic.h"
#include "UITabButton.h"
#include "UITabControl.h"
#include "UITrackBar.h"

CFontManager& mngr()
{
Expand Down Expand Up @@ -131,6 +161,14 @@ void SetCursorPosition_script(Fvector2& pos)
GetUICursor().SetUICursorPosition(pos);
}

template <typename T>
T* ui_window_cast(CUIWindow* window)
{
return smart_cast<T*>(window);
}

#define UI_WINDOW_CAST(class_name) &ui_window_cast<class_name>

using namespace luabind;
#pragma optimize("s",on)
void CUIWindow::script_register(lua_State* L)
Expand Down Expand Up @@ -166,25 +204,14 @@ void CUIWindow::script_register(lua_State* L)
.def("AttachChild", &CUIWindow::AttachChild, adopt<2>())
.def("AttachChildKeepOwner", &CUIWindow::AttachChild)
.def("DetachChild", &CUIWindow::DetachChild)
.def("FindChild", &CUIWindow::FindChild)
.def("SetAutoDelete", &CUIWindow::SetAutoDelete)
.def("IsAutoDelete", &CUIWindow::IsAutoDelete)

.def("IsCursorOverWindow", &CUIWindow::CursorOverWindow)
.def("FocusReceiveTime", &CUIWindow::FocusReceiveTime)
.def("GetAbsoluteRect", &CUIWindow::GetAbsoluteRect)

/*
.def("DisableHint", &CUIWindow::DisableHint)
.def("EnableHint", &CUIWindow::EnableHint)
.def("SetHintDelay", &CUIWindow::SetHintDelay)
.def("GetHintDelay", &CUIWindow::GetHintDelay)
.def("RemoveHint", &CUIWindow::RemoveHint)
.def("SetHintWnd", &CUIWindow::SetHintWnd)
.def("GetHintWnd", &CUIWindow::GetHintWnd)
.def("SetHintText", &CUIWindow::SetHintText)
.def("GetHintText", &CUIWindow::GetHintText)
*/

.def("SetWndRect", (void (CUIWindow::*)(Frect))&CUIWindow::SetWndRect_script)
.def("SetWndPos", (void (CUIWindow::*)(Fvector2))&CUIWindow::SetWndPos_script)
.def("SetWndSize", (void (CUIWindow::*)(Fvector2))&CUIWindow::SetWndSize_script)
Expand All @@ -201,6 +228,46 @@ void CUIWindow::script_register(lua_State* L)
.def("SetWindowName", &CUIWindow::SetWindowName)
.def("SetPPMode", &CUIWindow::SetPPMode)
.def("ResetPPMode", &CUIWindow::ResetPPMode)

.def("cast_3tButton", UI_WINDOW_CAST(CUI3tButton))
.def("cast_ActorMenu", UI_WINDOW_CAST(CUIActorMenu))
.def("cast_Button", UI_WINDOW_CAST(CUIButton))
.def("cast_CheckButton", UI_WINDOW_CAST(CUICheckButton))
.def("cast_ComboBox", UI_WINDOW_CAST(CUIComboBox))
.def("cast_CustomEdit", UI_WINDOW_CAST(CUICustomEdit))
.def("cast_CustomSpin", UI_WINDOW_CAST(CUICustomSpin))
.def("cast_DialogWnd", UI_WINDOW_CAST(CUIDialogWnd))
.def("cast_EditBox", UI_WINDOW_CAST(CUIEditBox))
.def("cast_FrameLineWnd", UI_WINDOW_CAST(CUIFrameLineWnd))
.def("cast_FrameWindow", UI_WINDOW_CAST(CUIFrameWindow))
.def("cast_Hint", UI_WINDOW_CAST(UIHint))
.def("cast_HudStatesWnd", UI_WINDOW_CAST(CUIHudStatesWnd))
.def("cast_ListBox", UI_WINDOW_CAST(CUIListBox))
.def("cast_ListBoxItem", UI_WINDOW_CAST(CUIListBoxItem))
.def("cast_ListBoxItemMsgChain", UI_WINDOW_CAST(CUIListBoxItemMsgChain))
.def("cast_MMShniaga", UI_WINDOW_CAST(CUIMMShniaga))
.def("cast_MainIngameWnd", UI_WINDOW_CAST(CUIMainIngameWnd))
.def("cast_MapInfo", UI_WINDOW_CAST(CUIMapInfo))
.def("cast_MapList", UI_WINDOW_CAST(CUIMapList))
.def("cast_MessageBox", UI_WINDOW_CAST(CUIMessageBox))
.def("cast_MessageBoxEx", UI_WINDOW_CAST(CUIMessageBoxEx))
.def("cast_MessagesWindow", UI_WINDOW_CAST(CUIMessagesWindow))
.def("cast_MotionIcon", UI_WINDOW_CAST(CUIMotionIcon))
.def("cast_PdaWnd", UI_WINDOW_CAST(CUIPdaWnd))
.def("cast_ProgressBar", UI_WINDOW_CAST(CUIProgressBar))
.def("cast_PropertiesBox", UI_WINDOW_CAST(CUIPropertiesBox))
.def("cast_ScriptWnd", UI_WINDOW_CAST(CUIDialogWndEx))
.def("cast_ScrollView", UI_WINDOW_CAST(CUIScrollView))
.def("cast_ServerList", UI_WINDOW_CAST(CServerList))
.def("cast_SleepStatic", UI_WINDOW_CAST(CUISleepStatic))
.def("cast_SpinFlt", UI_WINDOW_CAST(CUISpinFlt))
.def("cast_SpinNum", UI_WINDOW_CAST(CUISpinNum))
.def("cast_SpinText", UI_WINDOW_CAST(CUISpinText))
.def("cast_Static", UI_WINDOW_CAST(CUIStatic))
.def("cast_TabButton", UI_WINDOW_CAST(CUITabButton))
.def("cast_TabControl", UI_WINDOW_CAST(CUITabControl))
.def("cast_TextWnd", UI_WINDOW_CAST(CUITextWnd))
.def("cast_TrackBar", UI_WINDOW_CAST(CUITrackBar))
];

module(L)
Expand Down Expand Up @@ -322,3 +389,5 @@ void CUIWindow::script_register(lua_State* L)
]
];
}

#undef UI_WINDOW_CAST
Loading