Skip to content

Commit

Permalink
Code fix + font update
Browse files Browse the repository at this point in the history
  • Loading branch information
Rex109 committed Oct 2, 2021
1 parent bb640a9 commit a3488e0
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
8 changes: 6 additions & 2 deletions iw3velometer/dllmain.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,8 @@ unsigned char velocityR = 255;
unsigned char velocityG = 255;
unsigned char velocityB = 255;

std::string selectedFont = "Arial";

int toggleKey = 0x60;
int resetKey = 0x61;

Expand All @@ -66,7 +68,7 @@ HRESULT __stdcall hookedEndScene(IDirect3DDevice9* pDevice) {
RECT maxRectangle = { 0, 0, screenrect.right - screenrect.left + maxVelocityX, screenrect.bottom - screenrect.top + maxVelocityY };

if (!font)
D3DXCreateFont(pDevice, fontSize, 0, FW_REGULAR, 1, 0, DEFAULT_CHARSET, OUT_DEFAULT_PRECIS, DEFAULT_QUALITY, DEFAULT_PITCH | FF_DONTCARE, "Arial", &font);
D3DXCreateFont(pDevice, fontSize, 0, FW_REGULAR, 1, 0, DEFAULT_CHARSET, OUT_DEFAULT_PRECIS, DEFAULT_QUALITY, DEFAULT_PITCH | FF_DONTCARE, selectedFont.c_str(), &font);

float x, y;
ReadProcessMemory(process, reinterpret_cast<PVOID>(0x79449C), &x, sizeof(x), nullptr);
Expand Down Expand Up @@ -158,7 +160,9 @@ bool initConfig()
showMaxVelocity = false;

pv = ini.GetValue("Config", "fontSize", "60");
fontSize = (int)std::stof(pv);
fontSize = std::stoi(pv);
pv = ini.GetValue("Config", "font", "Arial");
selectedFont = pv;

pv = ini.GetValue("Config", "maxVelocityX", "0");
maxVelocityX = std::stof(pv);
Expand Down
2 changes: 2 additions & 0 deletions iw3velometer/iw3velometer.ini
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
showMaxVelocity=True
#Font size
fontSize=60
#Changes the font, as long you get the correct font name you can use any font installed on your system
font=Arial
#Position of the max velocity
maxVelocityX=0
maxVelocityY=-110
Expand Down

0 comments on commit a3488e0

Please sign in to comment.