Disable Special Weapons From Scroll
Had someone the other day ask me if I could make a widget that would disable weapon scrolls, so here it is.
ZConfiguration.h:
1. In ZConfiguration.h, place this in the ZCONFIG_ETC struct
2. Next, Search for ZTOK_ETC_CROSSHAIR, under it place this:
Code:
#define ZTOK_ETC_SW_SCROLL "DISABLE_SW"
3. Search for Z_ETC_CROSSHAIR, under it, place this:
Code:
#define Z_ETC_SW_SCROLL (ZGetConfiguration()->GetEtc()->bDisableSW)
<!-- End ZConfiguration.h -->
ZConfiguration.cpp:
1. Search for childElement.GetChildContents(&m_Etc.nCrossHair, ZTOK_ETC_CROSSHAIR); under it, place this:
Code:
childElement.GetChildContents(&m_Etc.bDisableSW, ZTOK_ETC_SW_SCROLL);
2. Again search for ZTOK_ETC_CROSSHAIR, you'll find this:
Code:
// crosshair
parentElement.AppendText("\n\t\t");
aElement = parentElement.CreateChildElement(ZTOK_ETC_CROSSHAIR);
sprintf(temp, "%d", m_Etc.nCrossHair);
aElement.SetContents(temp);
Under that, place this:
Code:
//Scroll
parentElement.AppendText("\n\t\t");
aElement = parentElement.CreateChildElement(ZTOK_ETC_SW_SCROLL);
sprintf(temp, "%s", m_Etc.bDisableSW ? "TRUE" : "FALSE");
aElement.SetContents(temp);
<!-- End ZConfiguration.cpp -->
ZOptionInterface.cpp:
1. Search for "CrosshairComboBox" In InitInterfaceOption, above that line, paste this:
Code:
MButton* pScroll = (MButton*)pResource->FindWidget("DisableSWScroll");
if (pScroll)
{
pScroll->SetCheck(Z_ETC_SW_SCROLL);
}
2. Search for "CrosshairComboBox" in SaveInterfaceOption, above that, paste this:
Code:
MButton* pScroll = (MButton*)pResource->FindWidget("DisableSWScroll");
if (pScroll)
{
if (Z_ETC_SW_SCROLL != pScroll->GetCheck())
{
Z_ETC_SW_SCROLL = pScroll->GetCheck();
}
if (Z_ETC_SW_SCROLL)
ZGetConfiguration()->GetEtc()->bDisableSW = true;
else
ZGetConfiguration()->GetEtc()->bDisableSW = false;
}
<!-- End ZOptionInterface.cpp -->
ZGameInterface.cpp:
1. In ZGameInterface.cpp, search for this:
Code:
for(int i = MMCIP_MELEE; i < MMCIP_CUSTOM2 + 1; i++)
Inside that for loop, under nPos = nHasItemCount, paste this:
Code:
if (ZGetConfiguration()->GetEtc()->bDisableSW && (i == MMCIP_CUSTOM1 || i == MMCIP_CUSTOM2)) continue;
(Continue Statement skips current iteration)
<!-- End ZGameInterface.cpp -->
Xml Work:
Code:
<LABEL item="DisableSWScroll" parent="EtcOptionGroup">
<FONT>FONTa9</FONT>
<TEXTCOLOR>
<R>205</R>
<G>205</G>
<B>205</B>
</TEXTCOLOR>
<BOUNDS>
<X>2</X>
<Y>318</Y>
<W>300</W>
<H>24</H>
</BOUNDS>
<TEXT>Disable Special Weapon Scroll</TEXT>
</LABEL>
<BUTTON item="DisableSWScroll" parent="EtcOptionGroup">
<BUTTONLOOK>Custom1ButtonLook</BUTTONLOOK>
<PUSHBUTTON/>
<BOUNDS>
<X>229</X>
<Y>318</Y>
<W>24</W>
<H>24</H>
</BOUNDS>
<ALIGN>
<HALIGN>right</HALIGN>
</ALIGN>
</BUTTON>
Put the xml wherever you want in option.xml, change the parent & x/y position to w/e you want, let me know if there's any bugs.
Re: Disable Special Weapons From Scroll
Re: Disable Special Weapons From Scroll
Screenshot what? If you mean screenshot the code working, can't exactly screenshot a weaponswitch lol, I'd have to make a vid. Trust me it works, I wouldn't do a release unless I tested it.
Re: Disable Special Weapons From Scroll
Re: Disable Special Weapons From Scroll
Re: Disable Special Weapons From Scroll
Uh yep, a lot of people have no clue how to do this, so why not release it for those that can't. I'll be doing it with much nicer code very soon. Does your post serve any purpose?
Re: Disable Special Weapons From Scroll
I still maintain the conclusion that you've come very, very far positively since you started GunZ development. Great to see you contributing to the community at large.
Speaking of which, I haven't done that recently... ;)
Re: Disable Special Weapons From Scroll
Quote:
Originally Posted by
SecretsOThePast
I still maintain the conclusion that you've come very, very far positively since you started GunZ development. Great to see you contributing to the community at large.
Speaking of which, I haven't done that recently... ;)
Thanks Secrets, I still don't think I'm any good, but glad you see improvement. :) Speaking of releasing code, I have some code I'd like go to over with you sometime. I'd like to release my multifont option for GunZ, but I'm thinking there's a better way to code it.