Skip to content

Commit

Permalink
change interface to take player_index or name
Browse files Browse the repository at this point in the history
  • Loading branch information
Choumiko committed Oct 27, 2015
1 parent 9c3de7d commit 978318d
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions remote.lua
Original file line number Diff line number Diff line change
Expand Up @@ -12,18 +12,20 @@ function interface.reset_player(player_name_or_index)
player_data.remote_viewer = nil
end

function interface.hide_expando(event)
if global.player_data[event.player_index].expandoed then
resmon.on_click.YARM_expando(event)
function interface.hide_expando(player_name_or_index)
local player = game.get_player(player_name_or_index)
if global.player_data[player.index].expandoed then
resmon.on_click.YARM_expando({player_index=player.index})
return true
end

return false
end

function interface.show_expando(event)
if not global.player_data[event.player_index].expandoed then
resmon.on_click.YARM_expando(event)
function interface.show_expando(player_name_or_index)
local player = game.get_player(player_name_or_index)
if not global.player_data[player.index].expandoed then
resmon.on_click.YARM_expando({player_index=player.index})
return false
end

Expand Down

0 comments on commit 978318d

Please sign in to comment.