- Joined
- Jan 9, 2009
- Messages
- 614
- Reaction score
- 152
So I wanted to see if I could make my own camera option, turned out to be pretty easy, and since I don't see a lot of servers with it, I figured i'd release it (I'm sure it's not the cleanest code you guys have seen, it's probably downright crappy looking, but it gets the job done. Also, updatedist is a optional function for resetting the distance in game, i won't post it because it's simple to create. a function with one line of code in it)
Step 1:Open ZCOnfiguration.cpp.
Step 2:
Step 3:
Step 4: Open ZConfiguration.h
step 5:
Step 6:
Step 7:Open ZOptionInterface.cpp
Step 8:
Step 9:
Step 10: Open ZCamera.h
Step 11:Open ZCamera.cpp
Step 12:
Step 13:
Step 14:
Add this to your option.xml(note, change the optiongroup to whatever you want):
If this was already release I apologize, I didnt see it though if you guys have any questionsor problems let me know.
Step 1:Open ZCOnfiguration.cpp.
search for this:
childElement.GetChildContents(&m_Etc.nCrossHair, ZTOK_ETC_CROSSHAIR);
Add this below it :
childElement.GetChildContents(&m_Etc.nCameraDistance, ZTOK_ETC_CAMERA);
Step 2:
search for this :
parentElement.AppendText("\n\t\t");
aElement = parentElement.CreateChildElement(ZTOK_ETC_CROSSHAIR);
sprintf(temp, "%d", m_Etc.nCrossHair);
aElement.SetContents(temp);
Under it, add this:
//Camera Distance
parentElement.AppendText("\n\t\t");
aElement = parentElement.CreateChildElement(ZTOK_ETC_CAMERA);
sprintf(temp, "%d", m_Etc.nCameraDistance);
aElement.SetContents(temp);
Step 3:
Search for this :
m_Etc.nCrossHair = 0;
Under it, add this: m_Etc.nCameraDistance = 290.f; // 290.f = default value
Step 4: Open ZConfiguration.h
Search for this int nCrossHair;
under it, add this:
int nCameraDistance;
step 5:
Search for this :
#define ZTOK_ETC_CROSSHAIR "CROSSHAIR"
under it, add this:
#define ZTOK_ETC_CAMERA "CAMERA"
Step 6:
search for this:
#define Z_ETC_CROSSHAIR (ZGetConfiguration()->GetEtc()->nCrossHair)
under it, add this:
#define Z_ETC_CAMERA (ZGetConfiguration()->GetEtc()->nCameraDistance)
Step 7:Open ZOptionInterface.cpp
At the top add this under #include "ZInterfaceListener.h":
#include "ZCamera.h"
Step 8:
Search for this:
ZCanvas* pCrossHairPreview = (ZCanvas*)pResource->FindWidget("CrossHairPreviewCanvas");
if (pCrossHairPreview)
{
pCrossHairPreview->SetOnDrawCallback(ZCrossHair::OnDrawOptionCrossHairPreview);
}
Under it, add this:
pComboBox = (MComboBox*)pResource->FindWidget("CameraDistance");
if (pComboBox)
{
pComboBox->SetSelIndex(Z_ETC_CAMERA);
ZGetCamera()->RSetCameraDistance(Z_ETC_CAMERA);
}
Step 9:
search for this:
MComboBox* pComboBox = (MComboBox*)pResource->FindWidget("CrossHairComboBox");
if (pComboBox)
{
Z_ETC_CROSSHAIR = pComboBox->GetSelIndex();
}
Under it, add this:
pComboBox = (MComboBox*)pResource->FindWidget("CameraDistance");
if (pComboBox)
{
Z_ETC_CAMERA = pComboBox->GetSelIndex ();
ZGetCamera()->RSetCameraDistance(Z_ETC_CAMERA);
ZGetCamera()->UpdateDist();
}
Step 10: Open ZCamera.h
under this:
void StopShock();
Add this:
void RSetCameraDistance(unsigned short nCameraDistance = 0.f);
Step 11:Open ZCamera.cpp
At the top, under CAMERA_WALL_TRACKSPEED, add this:
unsigned short g_nCameraDistance = 0.f;
Step 12:
Search for ZCamera::Init(), above it, add this:
void ZCamera::RSetCameraDistance(unsigned short nCameraDistance)
{
switch (nCameraDistance)
{
case 0: { g_nCameraDistance = 290.f; } break;
case 1: { g_nCameraDistance = 390.f; } break;
case 2: { g_nCameraDistance = 490.f; } break;
case 3: { g_nCameraDistance = 590.f; } break;
case 4: { g_nCameraDistance = 690.f; } break;
case 5: { g_nCameraDistance = 790.f; } break;
case 6: { g_nCameraDistance = 890.f; } break;
case 7: { g_nCameraDistance = 990.f; } break;
default:{ g_nCameraDistance = 290.f; } break;
}
}
Step 13:
Inside, ZCamera::Init(), near the top, replace m_fdist and m_fcurrantdist with this:
m_fDist = g_nCameraDistance;
m_fCurrentDist = g_nCameraDistance;
Step 14:
Add this to your option.xml(note, change the optiongroup to whatever you want):
<LABEL item="Label" parent="VideoOptionGroup2">
<FONT>FONTa9</FONT>
<TEXTCOLOR>
<R>205</R>
<G>205</G>
<B>205</B>
</TEXTCOLOR>
<BOUNDS>
<X>2</X>
<Y>240</Y>
<W>300</W>
<H>24</H>
</BOUNDS>
<TEXT>CameraDistance</TEXT> <!-- 1초당 프레임 제한 -->
</LABEL>
<COMBOBOX item="CameraDistance" parent="VideoOptionGroup">
<LISTBOXLOOK>CustomListBoxLook</LISTBOXLOOK>
<BUTTONLOOK>ListBoxButtonLook</BUTTONLOOK>
<FONT>FONTa9</FONT>
<TEXTCOLOR>
<R>205</R>
<G>205</G>
<B>205</B>
</TEXTCOLOR>
<TEXTALIGN>
<VALIGN>center</VALIGN>
<HALIGN>left</HALIGN>
</TEXTALIGN>
<BOUNDS>
<X>105</X>
<Y>240</Y>
<W>90</W>
<H>24</H>
</BOUNDS>
<ALIGN>
<HALIGN>right</HALIGN>
</ALIGN>
<LISTITEM selected="true">Default</LISTITEM>
<LISTITEM>390</LISTITEM>
<LISTITEM>490</LISTITEM>
<LISTITEM>590</LISTITEM>
<LISTITEM>690</LISTITEM>
<LISTITEM>790</LISTITEM>
<LISTITEM>890</LISTITEM>
<LISTITEM>990</LISTITEM>
<DROPSIZE>80</DROPSIZE>
<COMBOTYPE>1</COMBOTYPE>
</COMBOBOX>
If this was already release I apologize, I didnt see it though if you guys have any questionsor problems let me know.
Last edited: