Source Development Fitting Room in Game

zLuke

Active Pirate
Registered
LV
0
 
Joined
Jan 29, 2026
Messages
37
Reaction score
10
Points
28

View and try on all the items in the game. © zLuke​



Copy to source\client\src files UIFittingRoomForm.cpp and UIFittingRoomForm.h from the archive
add these files to your VS2022 project

Add to UIGlobalVar.h str ~100
C++:
    class CFittingRoomMgr;
Add to UIGlobalVar.h str ~195
C++:
extern CFittingRoomMgr    g_stUIFittingRoom;
Add to UIGlobalVar.cpp str ~40
C++:
#include "UIFittingRoomForm.h"
Add to UIGlobalVar.cpp str ~125
C++:
CFittingRoomMgr    g_stUIFittingRoom;
To view the wings, you need to enable the file EffectObj.cpp ~ str 1170 - 1185
to find:
C++:
if(_pTerrain)
    if(!_pTerrain->IsPointVisible(_vPos.x, _vPos.y))
    {
        if (!_pEffCtrl->GetPartCtrl()->IsPlaying())
replace:
C++:
if(_pTerrain && (!_pObj || !_pObj->IsHide()))
    if(!_pTerrain->IsPointVisible(_vPos.x, _vPos.y))
    {
        if (!_pEffCtrl->GetPartCtrl()->IsPlaying())

and compile the client

Add to the end client\scripts\lua\forms\minimap.clu
JavaScript:
-------------------------------------
--Fitting Room
-------------------------------------
frmFittingRoom = UI_CreateForm( "frmFittingRoom", FALSE, 514, 458, 0, 0, TRUE, FALSE )
UI_FormSetHotKey( frmFittingRoom, ALT_KEY, HOTKEY_H )
UI_ShowForm( frmFittingRoom, FALSE )
UI_AddFormToTemplete( frmFittingRoom, FORM_MAIN )
UI_FormSetIsEscClose( frmFittingRoom, TRUE )
UI_SetIsDrag( frmFittingRoom, TRUE)
UI_SetFormStyle( frmFittingRoom, 1)

imgBackGround1 = UI_CreateCompent( frmFittingRoom, IMAGE_TYPE, "imgBackGround1", 514, 458, 0, 0 )
UI_LoadImage( imgBackGround1, "texture/ui/FittingRoom.png", NORMAL, 514, 458, 0, 0 )

-- 3D character preview
ui3dplayer = UI_CreateCompent( frmFittingRoom, UI3D_COMPENT, "ui3dplayer", 280, 380, 232, 50 )

-- Rotate character left/right
btnTurnleft3d = UI_CreateCompent( frmFittingRoom, BUTTON_TYPE, "btnTurnleft3d", 37, 37, 280, 404 )
--UI_SetHint( btnTurnleft3d, "Turn left" )

btnTurnright3d = UI_CreateCompent( frmFittingRoom, BUTTON_TYPE, "btnTurnright3d", 37, 37, 418, 404 )
--UI_SetHint( btnTurnright3d, "Turn right" )

-- Clear all try-on (reset to current look)
btnClearAll = UI_CreateCompent( frmFittingRoom, BUTTON_TYPE, "btnClearAll", 90, 25, 325, 406 )
UI_LoadButtonImage( btnClearAll, "texture/ui/FittingRoom.png", 93, 28, 141, 493, true )

-- Close form button
btnCloseall = UI_CreateCompent( frmFittingRoom, BUTTON_TYPE, "btnCloseall", 16, 16, 491, 5 )
UI_LoadButtonImage( btnCloseall, "texture/ui/FittingRoom.png", 16, 16, 4, 504, true )
UI_SetButtonModalResult( btnCloseall, BUTTON_CLOSE )

-- Item list: 9 visible rows (icon + name), page controls for the rest
local imgSquareItem = {}
for i = 0, 7 do
    imgSquareItem[i] =  UI_CreateCompent( frmFittingRoom, IMAGE_TYPE, "imgSquareItem_"..i, 38, 38, 38, 71+i*39 )
    UI_LoadImage( imgSquareItem[i], "texture/ui/FittingRoom.png", NORMAL, 38, 38, 7, 461 )
   
    UI_CreateCompent( frmFittingRoom, COMMAND_ONE_TYPE, "cmdItem_"..i, 32, 32, 40, 73+i*39 )
   
    local lab = UI_CreateCompent( frmFittingRoom, LABELEX_TYPE, "labName_"..i, 130, 25, 82, 75+i*39+6 )
    UI_SetTextColor( lab, 4294631710 )

    local btn = UI_CreateCompent( frmFittingRoom, BUTTON_TYPE, "btnTryon_"..i, 130, 20, 82, 75+i*39+6 )
    UI_SetHint( btn, "Try on" )
end

-- Combo: item type (Weapon, Head, Body, etc.)
cboItemType = UI_CreateCompent( frmFittingRoom, COMBO_TYPE, "cboItemType", 100, 25, 120, 25 )
UI_ComboSetStyle( cboItemType, true )
UI_ComboSetTextColor( cboItemType, 4294631710 )
lstItemType = UI_GetList( cboItemType )
UI_SetListFontColor( lstItemType, 4294631710, 4278255360 )
UI_SetSize( lstItemType, 100, 90 )
UI_SetMargin( lstItemType, 8, 10, 8, 0 )
UI_SetListRowHeight( lstItemType, 20 )
UI_LoadImage( lstItemType, "texture/ui/FittingRoom.png", COMPENT_BACK, 66, 86, 74, 513 )
UI_SetListIsMouseFollow( lstItemType, true )

-- Combo: race (Lance, Carciz, Phyllis, Ami) filters item list and switches preview model
cboRace = UI_CreateCompent( frmFittingRoom, COMBO_TYPE, "cboRace", 100, 25, 350, 25 )
UI_ComboSetStyle( cboRace, true )
UI_ComboSetTextColor( cboRace, 4294631710 )
lstRace = UI_GetList( cboRace )
UI_SetListFontColor( lstRace, 4294631710, 4278255360 )
UI_SetSize( lstRace, 100, 90 )
UI_SetListRowHeight( lstRace, 20 )
UI_LoadImage( lstRace, "texture/ui/FittingRoom.png", COMPENT_BACK, 66, 86, 74, 513 )
UI_SetListIsMouseFollow( lstRace, true )


-- Pagination controls
btnLeftPage = UI_CreateCompent( frmFittingRoom, BUTTON_TYPE, "btnLeftPage", 10, 14, 95, 412 )
UI_LoadButtonImage( btnLeftPage, "texture/ui/FittingRoom.png", 10, 14, 152, 550, true )
UI_SetIsShow( btnLeftPage, false )

labListPage = UI_CreateCompent( frmFittingRoom, LABELEX_TYPE, "labListPage", 80, 20, 126, 412 )
UI_SetCaption( labListPage, "" )
UI_SetTextColor( labListPage, 4294631710 )
UI_SetIsShow( labListPage, false )

btnRightPage = UI_CreateCompent( frmFittingRoom, BUTTON_TYPE, "btnRightPage", 10, 14, 175, 412 )
UI_LoadButtonImage( btnRightPage, "texture/ui/FittingRoom.png", 10, 14, 171, 529, true )
UI_SetIsShow( btnRightPage, false )
Copy file FittingRoom.png from the arhive to client\texture\ui\

You can remove certain items from the view. To do this, add their ID to the list UIFittingRoomForm.cpp. The list must end with 0.
C++:
// Item IDs that must not be shown in the fitting room list. Add IDs to exclude; list ends with 0.
static const int s_arrFittingRoomExcludedItemIds[] = {
    128, 129, 130, 131, 132, 133, 134, 136, 137, 138, 139, 140,
    0  // terminator
};

Compile client.
Enjoy!
 

Attachments

Last edited: