
https://youtu.be/vG856yaP9N8
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 Code:
struct ZCONFIG_VIDEO{
Add this almost at the end
PHP Code:
bool bChangeScoreboard; //new change scoreboard button //demon
Now go to the end of file, and above of #endif add:
PHP Code:
#define Z_VIDEO_CSCOREBOARD (ZGetConfiguration()->GetVideo()->bChangeScoreboard)
#define ZTOK_VIDEO_CSCOREBOARD "CSCOREBOARD"
In ZConfiguration.cpp search:
PHP Code:
childElement.GetChildContents(&m_MovingPicture.iResolution, ZTOK_MOVINGPICTURE_RESOLUTION );
PHP Code:
childElement.GetChildContents(&m_Video.bChangeScoreboard, ZTOK_VIDEO_CSCOREBOARD); //new scoreboard button //demon
PHP Code:
parentElement.AppendText("\n\t\t"); aElement = parentElement.CreateChildElement("NHARDWARETNL");
sprintf(temp, "%s", m_Video.bTerrible ? "true" : "false" );
aElement.SetContents(temp);
PHP Code:
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 Code:
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 Code:
//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 Code:
bool ZOptionInterface::SaveInterfaceOption(void){
ZIDLResource* pResource = ZApplication::GetGameInterface()->GetIDLResource();
PHP Code:
//new scoreboard button //demon
MButton* pWidget = (MButton*)pResource->FindWidget("ScoreBoardOption");
if(pWidget) { Z_VIDEO_CSCOREBOARD = pWidget->GetCheck(); }
in ZScreenEffectManager.h search:
PHP Code:
ZScreenEffect* m_pScorePanel;
PHP Code:
ZScreenEffect* m_pCScorePanel;
PHP Code:
void DrawScoreBoard();
PHP Code:
void DrawCScoreBoard ();
now in ZScreenEffectManager.cpp search:
PHP Code:
m_pScorePanel = new ZScreenEffect(m_pEffectMeshMgr->Get("ef_in_tab.elu"));
and just below, add this:
PHP Code:
m_pCScorePanel = new ZScreenEffect(m_pEffectMeshMgr->Get("ef_in_newtab.elu"));
in the same file, search:
PHP Code:
void ZScreenEffectManager::DrawScoreBoard(){
m_pScorePanel->Draw(0);
}
PHP Code:
void ZScreenEffectManager::DrawCScoreBoard(){
m_pCScorePanel->Draw(0);
}
PHP Code:
ZScreenEffectManager::ZScreenEffectManager()
PHP Code:
m_pScorePanel = NULL;
and just below, add this:
PHP Code:
m_pCScorePanel = NULL;
PHP Code:
void ZScreenEffectManager::Destroy()
PHP Code:
SAFE_DELETE(m_pScorePanel);
PHP Code:
SAFE_DELETE(m_pCScorePanel);
now in ZCombatInterface.cpp search:
PHP Code:
void ZCombatInterface::DrawScoreBoard(MDrawContext* pDC){
and inside the method search:
PHP Code:
ZGetScreenEffectManager()->DrawScoreBoard();
PHP Code:
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 Code:
<FRAME item="AudioOptionGroup" parent="OptionGroup">
PHP Code:
<!-- 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 Code:
<AddEffectElu name="ef_in_tab.elu">
<AddBaseModel name="ef_in_tab.elu" filename="ef_in_tab.elu" />
</AddEffectElu>
PHP Code:
<!-- new scoreboard button // demon -->
<AddEffectElu name="ef_in_newtab.elu">
<AddBaseModel name="ef_in_newtab.elu" filename="ef_in_newtab.elu" />
</AddEffectElu>