Skip to content

Commit

Permalink
ShowGameTextForAll function
Browse files Browse the repository at this point in the history
  • Loading branch information
kodeyeen committed May 8, 2024
1 parent a40e89c commit 1b88194
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 0 deletions.
1 change: 1 addition & 0 deletions include/player.h
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ extern "C"
Array player_getAll();
void player_sendDeathMessageToAll(void* killer, void* killee, int weapon);
void player_sendEmptyDeathMessageToAll();
void player_sendGameTextToAll(String msg, int time, int style);

int player_getID(void* player);

Expand Down
5 changes: 5 additions & 0 deletions player.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,11 @@ extern "C"
return call<void>("player_sendEmptyDeathMessageToAll");
}

void player_sendGameTextToAll(String msg, int time, int style)
{
return call<void>("player_sendGameTextToAll", msg, time, style);
}

int player_getID(void* player)
{
return call<int>("player_getID", player);
Expand Down
7 changes: 7 additions & 0 deletions player.go
Original file line number Diff line number Diff line change
Expand Up @@ -226,6 +226,13 @@ func SendDeathMessage(killer *Player, killee *Player, weapon int) {
}
}

func ShowGameTextForAll(msg string, delay time.Duration, style int) {
cMsg := newCString(msg)
defer freeCString(cMsg)

C.player_sendGameTextToAll(cMsg, C.int(delay.Milliseconds()), C.int(style))
}

type Player struct {
handle unsafe.Pointer
}
Expand Down

0 comments on commit 1b88194

Please sign in to comment.