[release] how to switch scoreboard in option gunz

Results 1 to 4 of 4
  1. #1
    Apprentice Jason Demon is offline
    MemberRank
    Jul 2013 Join Date
    PerúLocation
    16Posts

    cool [release] how to switch scoreboard in option gunz



    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.iResolutionZTOK_MOVINGPICTURE_RESOLUTION ); 
    and add above:
    PHP Code:
    childElement.GetChildContents(&m_Video.bChangeScoreboardZTOK_VIDEO_CSCOREBOARD); //new scoreboard button //demon 
    now we gonna search
    PHP Code:
    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 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    
    MButtonpWidgett = (MButton*)pResource->FindWidget("ScoreBoardOption");
        if( 
    pWidgett )    {        pWidgett->SetCheck(ZGetConfiguration()->GetVideo()->bChangeScoreboard);    } 
    in the same file we gonna search:
    PHP Code:
    bool ZOptionInterface::SaveInterfaceOption(void){
    ZIDLResourcepResource ZApplication::GetGameInterface()->GetIDLResource(); 
    and add just below, this
    PHP Code:
    //new scoreboard button //demon    
    MButtonpWidget = (MButton*)pResource->FindWidget("ScoreBoardOption");
        if(
    pWidget)    {        Z_VIDEO_CSCOREBOARD pWidget->GetCheck();    } 
    in ZScreenEffectManager.h search:
    PHP Code:
    ZScreenEffect*    m_pScorePanel
    add below, this:
    PHP Code:
    ZScreenEffect*    m_pCScorePanel
    in the same file search:
    PHP Code:
    void DrawScoreBoard(); 
    below, add this
    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);

    and add this below:
    PHP Code:
    void ZScreenEffectManager::DrawCScoreBoard(){
        
    m_pCScorePanel->Draw(0);

    in the method:
    PHP Code:
    ZScreenEffectManager::ZScreenEffectManager() 
    search:
    PHP Code:
    m_pScorePanel NULL
    and just below, add this:
    PHP Code:
    m_pCScorePanel NULL
    in the method
    PHP Code:
    void ZScreenEffectManager::Destroy() 
    search
    PHP Code:
    SAFE_DELETE(m_pScorePanel); 
    and add just below, this
    PHP Code:
    SAFE_DELETE(m_pCScorePanel); 
    now in ZCombatInterface.cpp search:
    PHP Code:
    void ZCombatInterface::DrawScoreBoard(MDrawContextpDC){ 
    and inside the method search:
    PHP Code:
    ZGetScreenEffectManager()->DrawScoreBoard(); 
    and replace with this
    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"
    and above add this:
    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
    and below add this:
    PHP Code:
    <!-- new scoreboard button // demon -->
    <AddEffectElu name="ef_in_newtab.elu">    
    <
    AddBaseModel name="ef_in_newtab.elu" filename="ef_in_newtab.elu" />
    </
    AddEffectElu


  2. #2
    Member Gunzlatinov3 is offline
    MemberRank
    Nov 2016 Join Date
    PeruLocation
    74Posts

    Re: [release] how to switch scoreboard in option gunz

    great contribution, I hope you publish more good things like this contribution.

  3. #3
    Infraction Banned jorklenis2 is offline
    MemberRank
    Oct 2011 Join Date
    PanamáLocation
    878Posts

    Re: [release] how to switch scoreboard in option gunz

    Very good, but I do not think it is very useful, and that would be just one more option for the game that nobody would use, you will notice, but very good code.

  4. #4
    Valued Member ragezonezs is offline
    MemberRank
    Feb 2011 Join Date
    118Posts

    Re: [release] how to switch scoreboard in option gunz

    Hope you share the scoreboard of fg ^^



Advertisement