Skip to content

Commit

Permalink
fix toggle for xp meter
Browse files Browse the repository at this point in the history
  • Loading branch information
planqi committed Jan 20, 2017
1 parent 3f236ca commit e4d0632
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 0 deletions.
14 changes: 14 additions & 0 deletions BH/Modules/ScreenInfo/ScreenInfo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,20 @@ void ScreenInfo::OnGameJoin(const string& name, const string& pass, int diff) {
startLevel = (int)D2COMMON_GetUnitStat(pUnit, STAT_LEVEL, 0);
}

void ScreenInfo::OnKey(bool up, BYTE key, LPARAM lParam, bool* block) {
for (map<string,Toggle>::iterator it = Toggles.begin(); it != Toggles.end(); it++) {
if (key == (*it).second.toggle) {
*block = true;
if (up) {
(*it).second.state = !(*it).second.state;
}
return;
}
}
return;
}


// Right-clicking in the chat console pastes from the clipboard
void ScreenInfo::OnRightClick(bool up, int x, int y, bool* block) {
if (up)
Expand Down
1 change: 1 addition & 0 deletions BH/Modules/ScreenInfo/ScreenInfo.h
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ class ScreenInfo : public Module {
startExperience(0), startLevel(0) {};

void OnLoad();
void OnKey(bool up, BYTE key, LPARAM lParam, bool* block);
void OnGameJoin(const string& name, const string& pass, int diff);
void OnGameExit();

Expand Down

0 comments on commit e4d0632

Please sign in to comment.