PDA

View Full Version : User Defined Colored Weapons


3y3w4nn4ch34t
22nd September 2004, 22:03
This is my post from unevenbalance. Works on bc23 source. Thanks to I Like Chicken for the original color tweak and Unknownhacker for finding my mistakes ;)


EXE section
================================================== =========================
EvilSettings.cpp

Add this to your GetPrivate block

GetPrivateProfileStruct("evilhack", "m_ColorFColoredWeapons", &m_ColorFColoredWeapons, sizeof(DWORD), Path);
GetPrivateProfileStruct("evilhack", "m_ColorHColoredWeapons", &m_ColorHColoredWeapons, sizeof(DWORD), Path);
GetPrivateProfileStruct("evilhack", "m_bFColoredWeapons", &m_bFColoredWeapons, sizeof(DWORD), Path);
GetPrivateProfileStruct("evilhack", "m_bHColoredWeapons", &m_bHColoredWeapons, sizeof(DWORD), Path);

Add to WritePrivate block

WritePrivateProfileStruct("evilhack", "m_ColorFColoredWeapons", (LPBYTE)&m_ColorFColoredWeapons, sizeof(DWORD), Path);
WritePrivateProfileStruct("evilhack", "m_ColorHColoredWeapons", (LPBYTE)&m_ColorHColoredWeapons, sizeof(DWORD), Path);
WritePrivateProfileStruct("evilhack", "m_bHColoredWeapons", (LPBYTE)&m_bHColoredWeapons,sizeof(BOOL), Path);
WritePrivateProfileStruct("evilhack", "m_bFColoredWeapons", (LPBYTE)&m_bFColoredWeapons, sizeof(BOOL), Path);

Look for

m_ColorHText = 0x0000FF;

And add

m_ColorFColoredWeapons = 0x004000;
m_ColorHColoredWeapons = 0x000040;
m_bHColoredWeapons = false;
m_bFColoredWeapons = false;

Look for

CONVERTCOLOR(m_ColorHText);

And add

CONVERTCOLOR(m_ColorFColoredWeapons);
CONVERTCOLOR(m_ColorHColoredWeapons);


PlayerMarksDlg.cpp
Look for

, m_bFDistance(FALSE)

And add

, m_bHColoredWeapons(FALSE)
, m_bFColoredWeapons(FALSE)

Look for

DDX_Check(pDX, IDC_MARKFRAGS, m_bMarkFrags);

And add

DDX_Control(pDX, IDC_COLOR_HCW, m_ColorHCWCtrl);
DDX_Control(pDX, IDC_COLOR_FCW, m_ColorFCWCtrl);
DDX_Check(pDX, IDC_HCOLOREDWEAPONS, m_bHColoredWeapons);
DDX_Check(pDX, IDC_FCOLOREDWEAPONS, m_bFColoredWeapons);

Search for

theApp.m_Settings.m_bMarkFrags = m_bMarkFrags;

And add

theApp.m_Settings.m_ColorHColoredWeapons = m_ColorHCWCtrl.m_Color;
theApp.m_Settings.m_ColorFColoredWeapons = m_ColorFCWCtrl.m_Color;
theApp.m_Settings.m_bHColoredWeapons = m_bHColoredWeapons;
theApp.m_Settings.m_bFColoredWeapons = m_bFColoredWeapons;

Search for

m_bMarkFrags = theApp.m_Settings.m_bMarkFrags;

And Add

m_ColorHCWCtrl.SetColor(theApp.m_Settings.m_ColorH ColoredWeapons);
m_ColorFCWCtrl.SetColor(theApp.m_Settings.m_ColorF ColoredWeapons);
m_bHColoredWeapons = theApp.m_Settings.m_bHColoredWeapons;
m_bFColoredWeapons = theApp.m_Settings.m_bFColoredWeapons;

EvilSettings.h
Search for

BOOL m_bSB;

And add

DWORD m_ColorFColoredWeapons;
DWORD m_ColorHColoredWeapons;
BOOL m_bHColoredWeapons;
BOOL m_bFColoredWeapons;

PlayerMarksDlg.h
Search for

CFontViewer m_FFontCtrl;

And add

CColorViewer m_ColorHCWCtrl;
CColorViewer m_ColorFCWCtrl;
BOOL m_bHColoredWeapons;
BOOL m_bFColoredWeapons;

Resource.h
Add

#define IDC_COLOR_HCW 1072
#define IDC_COLOR_FCW 1073
#define IDC_HCOLOREDWEAPONS 1074
#define IDC_FCOLOREDWEAPONS 1075


EvilConfig.rc
Search for

CONTROL "Mark Frag Grenades",IDC_MARKFRAGS,"Button",
BS_AUTOCHECKBOX | BS_VCENTER | WS_TABSTOP,0,146,84,13

And add

LTEXT "Static",IDC_COLOR_FCW,215,37,36,14,SS_NOTIFY |
SS_CENTERIMAGE
CONTROL "Colored Weapons",IDC_FCOLOREDWEAPONS,"Button",
BS_AUTOCHECKBOX | BS_VCENTER | WS_TABSTOP,194,76,71,17
LTEXT "Weapon Color",IDC_STATIC,206,20,48,14,SS_CENTERIMAGE
LTEXT "Static",IDC_COLOR_HCW,215,111,36,14,SS_NOTIFY |
SS_CENTERIMAGE
CONTROL "Colored Weapons",IDC_HCOLOREDWEAPONS,"Button",
BS_AUTOCHECKBOX | BS_VCENTER | WS_TABSTOP,193,7,72,13
LTEXT "Weapon Color",IDC_STATIC,205,94,48,14,SS_CENTERIMAGE

*Youll need to position this^^^
----------------------------------------------------------------------------------------------------------------------
Dll Section

NewIDirect3DDevice.cpp
Search for

m_LastOTexCrc = m_pCurrentTexture->m_Crc32; //For double weapon detection prevention
Result = pD3DDevice8->DrawIndexedPrimitive(Type, MinIndex, NumVertices, StartIndex, PrimitiveCount);

And Add

if (GameInfo.m_Settings.m_bFColoredWeapons)
if (
//NADES
m_pCurrentTexture->m_Crc32 == 0x17E5ACA9 ||//FRAG
m_pCurrentTexture->m_Crc32 == 0x2DD0B8F9 ||//FRAG
m_pCurrentTexture->m_Crc32 == 0x62EBB4B2 ||//SMOKE
m_pCurrentTexture->m_Crc32 == 0x8083E16A ||//SMOKE
m_pCurrentTexture->m_Crc32 == 0x6F86174 ||//FLASH
m_pCurrentTexture->m_Crc32 == 0x8E58FE7 ||//FLASH
m_pCurrentTexture->m_Crc32 == 0xeB50E4F5 ||//INCENDIARY
m_pCurrentTexture->m_Crc32 == 0x6EFDD60D ||//INCENDIARY
m_pCurrentTexture->m_Crc32 == 0xBF4F30CE ||//Miles FRAG
m_pCurrentTexture->m_Crc32 == 0x2A1563AC ||//Opfor FRAG
//GUNS
m_pCurrentTexture->m_Crc32 == 0xEF9A8CB ||//M203
m_pCurrentTexture->m_Crc32 == 0x1DE7D796 ||//M203
m_pCurrentTexture->m_Crc32 == 0xB5AF24CF ||//M16A2
m_pCurrentTexture->m_Crc32 == 0xC069DACB ||//M16A2
m_pCurrentTexture->m_Crc32 == 0xBCBDA20D ||//M249
m_pCurrentTexture->m_Crc32 == 0xE667160B ||//M249
m_pCurrentTexture->m_Crc32 == 0xA8FCFD66 ||//M82
m_pCurrentTexture->m_Crc32 == 0x3E32E77C ||//M82
m_pCurrentTexture->m_Crc32 == 0x6522E718 ||//M24
m_pCurrentTexture->m_Crc32 == 0x7456CC36 ||//M24
m_pCurrentTexture->m_Crc32 == 0xFF022694 ||//M4A1auto
m_pCurrentTexture->m_Crc32 == 0xE4E4F770 ||//M4A1auto
m_pCurrentTexture->m_Crc32 == 0xD6FB35B2 ||//M4A1
m_pCurrentTexture->m_Crc32 == 0xAD05CE1A ||//M4A1
m_pCurrentTexture->m_Crc32 == 0x60A85176 ||//M4A1SOPMODW Winter cammo
m_pCurrentTexture->m_Crc32 == 0xFC85B6E3 ||//M4A1SOPMODW Winter cammo
m_pCurrentTexture->m_Crc32 == 0x60A85176 ||//M4A1SOPMODW Desert cammo
m_pCurrentTexture->m_Crc32 == 0x6C9547B1 ||//M4A1SOPMODW Desert cammo
m_pCurrentTexture->m_Crc32 == 0x60A85176 ||//M4A1SOPMODW Black
m_pCurrentTexture->m_Crc32 == 0x59B761DC ||//M4A1SOPMODW Black
m_pCurrentTexture->m_Crc32 == 0x8622F69F ||//SPR
m_pCurrentTexture->m_Crc32 == 0x969603A5 ||//SPR
m_pCurrentTexture->m_Crc32 == 0xB04944EB ||//SPR
m_pCurrentTexture->m_Crc32 == 0x3E42DDC2 ||//SPR
m_pCurrentTexture->m_Crc32 == 0x4D359C9 ||//M9
m_pCurrentTexture->m_Crc32 == 0xDE4CB40A ||//M9
m_pCurrentTexture->m_Crc32 == 0xD233779C ||//RPG7
m_pCurrentTexture->m_Crc32 == 0x4A35317F ||//RPG7
m_pCurrentTexture->m_Crc32 == 0x39AF0E6B ||//AT4
m_pCurrentTexture->m_Crc32 == 0x21142FFB ||//AT4
m_pCurrentTexture->m_Crc32 == 0x1C2AF9AB ||//M870
m_pCurrentTexture->m_Crc32 == 0xB4F162D5 ||//M870

//M4A1SOPMODW acessories
m_pCurrentTexture->m_Crc32 == 0x5338D3AB ||//ACOG4 Desert cammo
m_pCurrentTexture->m_Crc32 == 0x33A13C5 ||//ACOG4 Black
m_pCurrentTexture->m_Crc32 == 0x4A5CEAA8 ||//ACOG4 Winter cammo
m_pCurrentTexture->m_Crc32 == 0x858E03C6 ||//M68 Desert cammo
m_pCurrentTexture->m_Crc32 == 0xF06A1369 ||//M68 Black
m_pCurrentTexture->m_Crc32 == 0x93260206 ||//M68 Winter cammo
m_pCurrentTexture->m_Crc32 == 0x4FFC6B50 ||//REFLEX Desert cammo
m_pCurrentTexture->m_Crc32 == 0x83AA377F ||//REFLEX Black
m_pCurrentTexture->m_Crc32 == 0xCED2628B ||//REFLEX Winter cammo
m_pCurrentTexture->m_Crc32 == 0xEBC63677 ||//QDS Desert cammo
m_pCurrentTexture->m_Crc32 == 0xD57579A9 ||//QDS Black
m_pCurrentTexture->m_Crc32 == 0x36FFF568 ||//QDS Winter cammo
m_pCurrentTexture->m_Crc32 == 0xC4E75F83 ||//HARRIS Desert cammo
m_pCurrentTexture->m_Crc32 == 0x71D2FB6E ||//HARRIS Black
m_pCurrentTexture->m_Crc32 == 0x5C777FBF ||//HARRIS Winter cammo
m_pCurrentTexture->m_Crc32 == 0x8339903E ||//M203A1 Desert cammo
m_pCurrentTexture->m_Crc32 == 0x90ACB94C ||//M203A1 Black
m_pCurrentTexture->m_Crc32 == 0x6BC28D2C ||//M203A1 Winter cammo
m_pCurrentTexture->m_Crc32 == 0xC4F61EF ||//M203A1 Distance calculator
m_pCurrentTexture->m_Crc32 == 0x9D70604F ||//Heatshield
m_pCurrentTexture->m_Crc32 == 0x1B14EEE9 //Ironsights
)

//Save current AMBIENT Renderstate
{
DWORD curState;
pD3DDevice8->GetRenderState(D3DRS_AMBIENT, &curState);
pD3DDevice8->SetRenderState(D3DRS_AMBIENT, GameInfo.m_Settings.m_ColorFColoredWeapons);
//Draw the model
Result = pD3DDevice8->DrawIndexedPrimitive(Type, MinIndex, NumVertices, StartIndex, PrimitiveCount);

}
if (GameInfo.m_Settings.m_bHColoredWeapons)
if (
//GUNS
m_pCurrentTexture->m_Crc32 == 0x47F0A16C ||//AK47
m_pCurrentTexture->m_Crc32 == 0xB7E34495 ||//AK47
m_pCurrentTexture->m_Crc32 == 0xD7E93E15 ||//AK47
m_pCurrentTexture->m_Crc32 == 0x8B63313B ||//AKS74U
m_pCurrentTexture->m_Crc32 == 0x3DC7D210 ||//AKS74U
m_pCurrentTexture->m_Crc32 == 0x6306A3B0 ||//AKS74U
m_pCurrentTexture->m_Crc32 == 0xF187A11F ||//AKS74U
m_pCurrentTexture->m_Crc32 == 0xBAA30729 ||//GP30
m_pCurrentTexture->m_Crc32 == 0xFDB493C1 ||//GP30
m_pCurrentTexture->m_Crc32 == 0xB6B20847 ||//GP30
m_pCurrentTexture->m_Crc32 == 0x7FAB89A ||//RPK
m_pCurrentTexture->m_Crc32 == 0xC69C9DAA ||//RPK
m_pCurrentTexture->m_Crc32 == 0x42F81DB2 ||//SVD
m_pCurrentTexture->m_Crc32 == 0xC5A2D3A8 ||//SVD
m_pCurrentTexture->m_Crc32 == 0x3E778BF0 ||//SVD
m_pCurrentTexture->m_Crc32 == 0x5630CCFB ||//MOSIN
m_pCurrentTexture->m_Crc32 == 0xC58F8E75 ||//MOSIN
m_pCurrentTexture->m_Crc32 == 0x2D2ED136 ||//VSS
m_pCurrentTexture->m_Crc32 == 0x2FFB0247 ||//VSS
m_pCurrentTexture->m_Crc32 == 0x4CD088A1 ||//AKS74UUBN
m_pCurrentTexture->m_Crc32 == 0x997DF659 ||//AKS74UUBN
m_pCurrentTexture->m_Crc32 == 0x5630CCFB ||//AKS74UUBN

//AKS-74U acessories
m_pCurrentTexture->m_Crc32 == 0xAE697060 ||//POS1 4x
m_pCurrentTexture->m_Crc32 == 0x240A4C83 ||//PK01 1x
m_pCurrentTexture->m_Crc32 == 0x5DCC6BC2 ||//PBS
m_pCurrentTexture->m_Crc32 == 0x644E18F9 //EKP1S 1x reflex
)

//Save current AMBIENT Renderstate
{
DWORD curState;
pD3DDevice8->GetRenderState(D3DRS_AMBIENT, &curState);
pD3DDevice8->SetRenderState(D3DRS_AMBIENT, GameInfo.m_Settings.m_ColorHColoredWeapons);
//Draw the model
Result = pD3DDevice8->DrawIndexedPrimitive(Type, MinIndex, NumVertices, StartIndex, PrimitiveCount);


}

gil
22nd September 2004, 22:14
I posted it in the Evilhack Modification Thread, here (http://www.mpcforum.com/showpost.php?p=538773&postcount=27) ;)

hope you dont mind.
JBL isnt here ATM, when he comes back he can edit it as he wishes.

3y3w4nn4ch34t
22nd September 2004, 22:17
I was gonna post it there but the thread was closed. :P

gil
22nd September 2004, 22:21
Yes, to keep it organized, only mods can add ;)


off-topic: congratulations on the 1000th post !!! :D

JohnBLucky
23rd September 2004, 00:26
Yes, very nice indeed, hehe. I hadn't added it since I don't like reposting things from DFP or other private sites, so thanks a bunch for posting it here yo! :)

HYT3CKR3DN3CK
8th October 2004, 13:55
I added this mod to my bc23 source hack and i get this error when i click on the playermarks button... All the other buttons work fine thou.
http://img.photobucket.com/albums/v482/hyt3ckr3dn3ck/error.jpg

3y3w4nn4ch34t
8th October 2004, 19:57
You need to recheck your source. My tutorial will compile without errors. Ive used it on all sources just fine. Probably have a H and F missplaced in one of the lines. :cool:

HYT3CKR3DN3CK
8th October 2004, 23:03
Ok ill try it again thx for the reply :)

I went throu and did it all again twice and still when i open my loader and click on the player marks button it errors out on me. Could it have anything to do with the posistioning?