- Joined
- Feb 11, 2010
- Messages
- 302
- Reaction score
- 26
This my first time to share source, if I make mistake, or my bad english, I am sorry
Main idea is to give configuration on default.charclass to disable or enable extreme, assassin and science character selection on create new character page
I use RanNewWorld Source code from this thread, but this idea can implemented almost on all source code, if you have programming knowledge and editing
I try to explain this step as simple as I can,
this can be achieve with few step
- add configuration variable on header file
- set configuration variable default value
- load configuration variable value from default.charclass
- set UI behavior base on configuration
- add configuration to default.charclass
lets begin the explanation
- add configuration variable on header file, try to find this code on GLogicData.h
add this code below bCLUB_2OTHERSCHOOL or anywhere else as long as inside that namespace
- set configuration variable default value, because we already add on header file, then we need to give default value on GLogicData.cpp
try find this namespace and add bold code
- load configuration variable value from default.charclass, we already have variable to receive our configuration, then we need to load that value from default.charclass
try find this code on GLogicDataLoad.cpp, then add bold code
- set UI behavior base on configuration, we already load configuration value, then we need to set UI behavior based on our configuration
try find this code on CreateCharacterNew.cpp and edit like below
original
edited
original
edited
original
edited
original
edited
original
edited
original
edited
- add configuration to default.charclass,
dont forget to add this configuration at default.charclass
Main idea is to give configuration on default.charclass to disable or enable extreme, assassin and science character selection on create new character page
I use RanNewWorld Source code from this thread, but this idea can implemented almost on all source code, if you have programming knowledge and editing
I try to explain this step as simple as I can,
this can be achieve with few step
- add configuration variable on header file
- set configuration variable default value
- load configuration variable value from default.charclass
- set UI behavior base on configuration
- add configuration to default.charclass
lets begin the explanation
- add configuration variable on header file, try to find this code on GLogicData.h
Code:
namespace GLCONST_CHAR
{
..................
}
add this code below bCLUB_2OTHERSCHOOL or anywhere else as long as inside that namespace
Code:
namespace GLCONST_CHAR
{
.......................
.......................
extern BOOL bPARTY_2OTHERSCHOOL;
extern BOOL bCLUB_2OTHERSCHOOL;
[B]extern BOOL bENABLE_EXTREME;
extern BOOL bENABLE_SCIENCE;
extern BOOL bENABLE_ASSASSIN;[/B]
..........................
..........................
}
- set configuration variable default value, because we already add on header file, then we need to give default value on GLogicData.cpp
try find this namespace and add bold code
Code:
namespace GLCONST_CHAR
{
.........................
.........................
BOOL bPARTY_2OTHERSCHOOL = TRUE;
BOOL bCLUB_2OTHERSCHOOL = TRUE;
[B]BOOL bENABLE_EXTREME = TRUE;
BOOL bENABLE_SCIENCE = TRUE;
BOOL bENABLE_ASSASSIN = TRUE;[/B]
.........................
.........................
}
- load configuration variable value from default.charclass, we already have variable to receive our configuration, then we need to load that value from default.charclass
try find this code on GLogicDataLoad.cpp, then add bold code
Code:
namespace GLCONST_CHAR
{
...................
..................
cFILE.getflag( "bPARTY_2OTHERSCHOOL", 1, 1, bPARTY_2OTHERSCHOOL );
cFILE.getflag( "bCLUB_2OTHERSCHOOL", 1, 1, bCLUB_2OTHERSCHOOL );
[B]cFILE.getflag("bENABLE_EXTREME", 1, 1, bENABLE_EXTREME);
cFILE.getflag("bENABLE_SCIENCE", 1, 1, bENABLE_SCIENCE);
cFILE.getflag("bENABLE_ASSASSIN", 1, 1, bENABLE_ASSASSIN);[/B]
........................
.......................
}
- set UI behavior base on configuration, we already load configuration value, then we need to set UI behavior based on our configuration
try find this code on CreateCharacterNew.cpp and edit like below
original
Code:
void CCreateCharacterNew::CreateSubControl()
{
...................
...................
{
m_pSelectClassImg[0] = new CUIControl;
m_pSelectClassImg[0]->CreateSub ( this, "2012_NEW_CHAR_SELECT_CLASS_IMAGE0", UI_FLAG_DEFAULT, SELECT_CLASS_IMAGE0);
m_pSelectClassImg[0]->SetVisibleSingle ( TRUE );
m_pSelectClassImg[0]->SetTransparentOption( TRUE );
RegisterControl ( m_pSelectClassImg[0] );
}
...................
...................
}
edited
Code:
void CCreateCharacterNew::CreateSubControl()
{
...................
...................
{
m_pSelectClassImg[0] = new CUIControl;
[B]if( GLCONST_CHAR::bENABLE_EXTREME )
{
m_pSelectClassImg[0]->CreateSub ( this, "2012_NEW_CHAR_SELECT_CLASS_IMAGE0", UI_FLAG_DEFAULT, SELECT_CLASS_IMAGE0);
m_pSelectClassImg[0]->SetVisibleSingle ( TRUE );
m_pSelectClassImg[0]->SetTransparentOption( TRUE );
RegisterControl ( m_pSelectClassImg[0] );
}[/B]
}
...................
...................
}
original
Code:
void CCreateCharacterNew::CreateSubControl()
{
...................
...................
m_pSelectClassSetImg[0] = new CUIControl;
m_pSelectClassSetImg[0]->CreateSub ( this, "2012_NEW_CHAR_SELECT_CLASS_SET_IMAGE0", UI_FLAG_DEFAULT, SELECT_CLASS_SET_IMAGE0);
m_pSelectClassSetImg[0]->SetVisibleSingle ( FALSE );
m_pSelectClassSetImg[0]->SetTransparentOption( TRUE );
RegisterControl ( m_pSelectClassSetImg[0] );
...................
...................
}
edited
Code:
void CCreateCharacterNew::CreateSubControl()
{
...................
...................
m_pSelectClassSetImg[0] = new CUIControl;
[B] if( GLCONST_CHAR::bENABLE_EXTREME )
{
m_pSelectClassSetImg[0]->CreateSub ( this, "2012_NEW_CHAR_SELECT_CLASS_SET_IMAGE0", UI_FLAG_DEFAULT, SELECT_CLASS_SET_IMAGE0);
m_pSelectClassSetImg[0]->SetVisibleSingle ( FALSE );
m_pSelectClassSetImg[0]->SetTransparentOption( TRUE );
RegisterControl ( m_pSelectClassSetImg[0] );
}[/B]
...................
...................
}
original
Code:
void CCreateCharacterNew::CreateSubControl()
{
...................
...................
{
m_pSelectClassImg[5] = new CUIControl;
m_pSelectClassImg[5]->CreateSub ( this, "2012_NEW_CHAR_SELECT_CLASS_IMAGE5", UI_FLAG_DEFAULT, SELECT_CLASS_IMAGE5);
m_pSelectClassImg[5]->SetVisibleSingle ( TRUE );
m_pSelectClassImg[5]->SetTransparentOption( TRUE );
RegisterControl ( m_pSelectClassImg[5] );
}
...................
...................
}
edited
Code:
void CCreateCharacterNew::CreateSubControl()
{
...................
...................
{
m_pSelectClassImg[5] = new CUIControl;
[B] if( GLCONST_CHAR::bENABLE_SCIENCE )
{
m_pSelectClassImg[5]->CreateSub ( this, "2012_NEW_CHAR_SELECT_CLASS_IMAGE5", UI_FLAG_DEFAULT, SELECT_CLASS_IMAGE5);
m_pSelectClassImg[5]->SetVisibleSingle ( FALSE );
m_pSelectClassImg[5]->SetTransparentOption( TRUE );
RegisterControl ( m_pSelectClassImg[5] );
}[/B]
}
...................
...................
}
original
Code:
void CCreateCharacterNew::CreateSubControl()
{
...................
...................
{
m_pSelectClassSetImg[5] = new CUIControl;
m_pSelectClassSetImg[5]->CreateSub ( this, "2012_NEW_CHAR_SELECT_CLASS_SET_IMAGE5", UI_FLAG_DEFAULT, SELECT_CLASS_SET_IMAGE5);
m_pSelectClassSetImg[5]->SetVisibleSingle ( FALSE );
m_pSelectClassSetImg[5]->SetTransparentOption( TRUE );
RegisterControl ( m_pSelectClassSetImg[5] );
}
...................
...................
}
edited
Code:
void CCreateCharacterNew::CreateSubControl()
{
...................
...................
{
m_pSelectClassSetImg[5] = new CUIControl;
[B] if( GLCONST_CHAR::bENABLE_SCIENCE )
{
m_pSelectClassSetImg[5]->CreateSub ( this, "2012_NEW_CHAR_SELECT_CLASS_SET_IMAGE5", UI_FLAG_DEFAULT, SELECT_CLASS_SET_IMAGE5);
m_pSelectClassSetImg[5]->SetVisibleSingle ( FALSE );
m_pSelectClassSetImg[5]->SetTransparentOption( TRUE );
RegisterControl ( m_pSelectClassSetImg[5] );
}[/B]
}
...................
...................
}
original
Code:
void CCreateCharacterNew::CreateSubControl()
{
...................
...................
{
m_pSelectClassImg[6] = new CUIControl;
m_pSelectClassImg[6]->CreateSub ( this, "2012_NEW_CHAR_SELECT_CLASS_IMAGE6", UI_FLAG_DEFAULT, SELECT_CLASS_IMAGE6);
m_pSelectClassImg[6]->SetVisibleSingle ( TRUE );
m_pSelectClassImg[6]->SetTransparentOption( TRUE );
RegisterControl ( m_pSelectClassImg[6] );
}
...................
...................
}
edited
Code:
void CCreateCharacterNew::CreateSubControl()
{
...................
...................
{
m_pSelectClassImg[6] = new CUIControl;
[B]if( GLCONST_CHAR::bENABLE_ASSASSIN )
{
m_pSelectClassImg[6]->CreateSub ( this, "2012_NEW_CHAR_SELECT_CLASS_IMAGE6", UI_FLAG_DEFAULT, SELECT_CLASS_IMAGE6);
m_pSelectClassImg[6]->SetVisibleSingle ( TRUE );
m_pSelectClassImg[6]->SetTransparentOption( TRUE );
RegisterControl ( m_pSelectClassImg[6] );
}[/B]
}
...................
...................
}
original
Code:
void CCreateCharacterNew::CreateSubControl()
{
...................
...................
{
m_pSelectClassSetImg[6] = new CUIControl;
m_pSelectClassSetImg[6]->CreateSub ( this, "2012_NEW_CHAR_SELECT_CLASS_SET_IMAGE6", UI_FLAG_DEFAULT, SELECT_CLASS_SET_IMAGE6);
m_pSelectClassSetImg[6]->SetVisibleSingle ( FALSE );
m_pSelectClassSetImg[6]->SetTransparentOption( TRUE );
RegisterControl ( m_pSelectClassSetImg[6] );
}
...................
...................
}
Code:
void CCreateCharacterNew::CreateSubControl()
{
...................
...................
{
m_pSelectClassSetImg[6] = new CUIControl;
[B]if( GLCONST_CHAR::bENABLE_ASSASSIN )
{
m_pSelectClassSetImg[6]->CreateSub ( this, "2012_NEW_CHAR_SELECT_CLASS_SET_IMAGE6", UI_FLAG_DEFAULT, SELECT_CLASS_SET_IMAGE6);
m_pSelectClassSetImg[6]->SetVisibleSingle ( FALSE );
m_pSelectClassSetImg[6]->SetTransparentOption( TRUE );
RegisterControl ( m_pSelectClassSetImg[6] );
}[/B]
}
...................
...................
}
dont forget to add this configuration at default.charclass
Code:
.............
bENABLE_EXTREME 1
bENABLE_SCIENCE 1
bENABLE_ASSASSIN 1
............
Last edited: