- Joined
- Jul 25, 2013
- Messages
- 20
- Reaction score
- 9
Please watch the video for support me. thanks.
Hello everyone, im releasing code for gunz, in this opportunity we gonna learn how to switch scoreboard in option menu inside gunz, like you see in the picture.
Im leaving a video, explaining how to do that, and explaining all code we gonna use in this tutorial.
In ZConfiguration.h search:
PHP:
struct ZCONFIG_VIDEO{
Add this almost at the end
PHP:
bool bChangeScoreboard; //new change scoreboard button //demon
Now go to the end of file, and above of #endif add:
PHP:
#define Z_VIDEO_CSCOREBOARD (ZGetConfiguration()->GetVideo()->bChangeScoreboard)
#define ZTOK_VIDEO_CSCOREBOARD "CSCOREBOARD"
In ZConfiguration.cpp search:
PHP:
childElement.GetChildContents(&m_MovingPicture.iResolution, ZTOK_MOVINGPICTURE_RESOLUTION );
and add above:
PHP:
childElement.GetChildContents(&m_Video.bChangeScoreboard, ZTOK_VIDEO_CSCOREBOARD); //new scoreboard button //demon
now we gonna search
PHP:
parentElement.AppendText("\n\t\t"); aElement = parentElement.CreateChildElement("NHARDWARETNL");
sprintf(temp, "%s", m_Video.bTerrible ? "true" : "false" );
aElement.SetContents(temp);
and add below, this
PHP:
parentElement.AppendText("\n\t\t"); aElement = parentElement.CreateChildElement(ZTOK_VIDEO_CSCOREBOARD);
sprintf(temp, "%s", m_Video.bChangeScoreboard ? "true" : "false");
aElement.SetContents(temp);
now in ZOptionInterface.cpp search:
PHP:
mlog("start InitInterface option\n");
/* // Mouse Sensitivity Min/Max (Z_MOUSE_SENSITIVITY_MIN ~ Z_MOUSE_SENSITIVITY_MAX)
BEGIN_WIDGETLIST("MouseSensitivitySlider", pResource, MSlider*, pWidget);
pWidget->SetMinMax(Z_MOUSE_SENSITIVITY_MIN, Z_MOUSE_SENSITIVITY_MAX);
pWidget->SetValue(Z_MOUSE_SENSITIVITY);
END_WIDGETLIST(); */
and add just below, this:
PHP:
//new scoreboard button //demon
MButton* pWidgett = (MButton*)pResource->FindWidget("ScoreBoardOption");
if( pWidgett ) { pWidgett->SetCheck(ZGetConfiguration()->GetVideo()->bChangeScoreboard); }
in the same file we gonna search:
PHP:
bool ZOptionInterface::SaveInterfaceOption(void){
ZIDLResource* pResource = ZApplication::GetGameInterface()->GetIDLResource();
and add just below, this
PHP:
//new scoreboard button //demon
MButton* pWidget = (MButton*)pResource->FindWidget("ScoreBoardOption");
if(pWidget) { Z_VIDEO_CSCOREBOARD = pWidget->GetCheck(); }
in ZScreenEffectManager.h search:
PHP:
ZScreenEffect* m_pScorePanel;
add below, this:
PHP:
ZScreenEffect* m_pCScorePanel;
in the same file search:
PHP:
void DrawScoreBoard();
below, add this
PHP:
void DrawCScoreBoard ();
now in ZScreenEffectManager.cpp search:
PHP:
m_pScorePanel = new ZScreenEffect(m_pEffectMeshMgr->Get("ef_in_tab.elu"));
and just below, add this:
PHP:
m_pCScorePanel = new ZScreenEffect(m_pEffectMeshMgr->Get("ef_in_newtab.elu"));
in the same file, search:
PHP:
void ZScreenEffectManager::DrawScoreBoard(){
m_pScorePanel->Draw(0);
}
and add this below:
PHP:
void ZScreenEffectManager::DrawCScoreBoard(){
m_pCScorePanel->Draw(0);
}
in the method:
PHP:
ZScreenEffectManager::ZScreenEffectManager()
search:
PHP:
m_pScorePanel = NULL;
and just below, add this:
PHP:
m_pCScorePanel = NULL;
in the method
PHP:
void ZScreenEffectManager::Destroy()
search
PHP:
SAFE_DELETE(m_pScorePanel);
and add just below, this
PHP:
SAFE_DELETE(m_pCScorePanel);
now in ZCombatInterface.cpp search:
PHP:
void ZCombatInterface::DrawScoreBoard(MDrawContext* pDC){
and inside the method search:
PHP:
ZGetScreenEffectManager()->DrawScoreBoard();
and replace with this
PHP:
if(ZGetConfiguration()->GetVideo()->bChangeScoreboard){
ZGetScreenEffectManager()->DrawScoreBoard();
}
else
{ ZGetScreenEffectManager()->DrawCScoreBoard();
}
this is all for source code, now we gonna do the interface
now in interface/default/option.xml search:
PHP:
<FRAME item="AudioOptionGroup" parent="OptionGroup">
and above add this:
PHP:
<!-- Button Scoreboard Change -->
<LABEL item="Label" parent="VideoOptionGroup">
<FONT>FONTa9</FONT>
<TEXTCOLOR>
<R>205</R>
<G>205</G>
<B>205</B>
</TEXTCOLOR>
<BOUNDS>
<X>2</X>
<Y>290</Y>
<W>300</W>
<H>24</H>
</BOUNDS>
<TEXT>Change Scoreboard</TEXT> <!-- ????? -->
</LABEL>
<BUTTON item="ScoreBoardOption" parent="VideoOptionGroup">
<BUTTONLOOK>Custom1ButtonLook</BUTTONLOOK>
<PUSHBUTTON/>
<BOUNDS>
<X>229</X>
<Y>290</Y>
<W>24</W>
<H>24</H>
</BOUNDS>
<ALIGN>
<HALIGN>right</HALIGN>
</ALIGN>
<CUSTOM/>
</BUTTON>
now in interface/default/combat/screeneffects.xml search:
PHP:
<AddEffectElu name="ef_in_tab.elu">
<AddBaseModel name="ef_in_tab.elu" filename="ef_in_tab.elu" />
</AddEffectElu>
and below add this:
PHP:
<!-- new scoreboard button // demon -->
<AddEffectElu name="ef_in_newtab.elu">
<AddBaseModel name="ef_in_newtab.elu" filename="ef_in_newtab.elu" />
</AddEffectElu>