Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add CenterViewOn with LOCATION parameter #18

Merged
merged 1 commit into from
Nov 30, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions OP2Helper.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -239,6 +239,11 @@ void CenterViewOnPlayerCC() {
}
}

void CenterViewOn(enum PlayerNum playerNum, const LOCATION& location) {
Player[playerNum].CenterViewOn(location.x, location.y);
}


void AddMapMessage(const char* message, const Unit& sourceUnit, int soundIndex, int toPlayerNum) {
// Message is not modified by Outpost 2, but was not declared as const. Cast to avoid warnings/errors.
TethysGame::AddMessage(sourceUnit, const_cast<char*>(message), toPlayerNum, soundIndex);
Expand Down
2 changes: 2 additions & 0 deletions OP2Helper.h
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,8 @@ void RandomizeList(int numItems, ListItemType list[])

// Centers the local player's screen on their CC, if they have one.
void CenterViewOnPlayerCC();
// Overload taking a location object
void CenterViewOn(enum PlayerNum playerNum, const LOCATION& location);

// To send message to all players, Set toPlayerNum to -1.
// Default sound effect is phone ringing (sending text message to other player)
Expand Down