mirror of
https://github.com/2006-Scape/apollo.git
synced 2026-07-03 16:49:11 +00:00
Remove the World singleton.
This commit is contained in:
@@ -81,7 +81,7 @@ class ProcMessageHandler < MessageHandler
|
||||
|
||||
# Creates the ProcMessageListener.
|
||||
def initialize(block, option)
|
||||
super()
|
||||
super($world)
|
||||
@block = block
|
||||
@option = option
|
||||
end
|
||||
@@ -200,15 +200,5 @@ def on_command(args, proc)
|
||||
raise 'Command message must have one or two arguments.' unless (1..2).include?(args.length)
|
||||
|
||||
rights = args.length == 2 ? args[1] : RIGHTS_STANDARD
|
||||
PluginContext::add_command_listener(args[0].to_s, ProcCommandListener.new(rights, proc))
|
||||
end
|
||||
|
||||
# Defines an action to be taken upon login.
|
||||
def on_login(proc)
|
||||
PluginContext::add_login_listener(ProcLoginListener.new(proc))
|
||||
end
|
||||
|
||||
# Defines an action to be taken upon logout.
|
||||
def on_logout(proc)
|
||||
PluginContext::add_logout_listener(ProcLogoutListener.new(proc))
|
||||
$world.command_dispatcher.register(args[0].to_s, ProcCommandListener.new(rights, proc))
|
||||
end
|
||||
@@ -4,7 +4,9 @@ java_import 'org.apollo.game.model.Position'
|
||||
|
||||
# Sends the player's position.
|
||||
on :command, :pos, RIGHTS_MOD do |player, command|
|
||||
player.send_message("You are at: #{player.position}.")
|
||||
position = player.position
|
||||
player.send_message("You are at: #{position}.")
|
||||
player.send_message("Local coordinates: (#{position.get_local_x}, #{position.get_local_y}).")
|
||||
end
|
||||
|
||||
# Teleports the player to the specified position.
|
||||
|
||||
@@ -47,7 +47,7 @@ def get_npc(hash)
|
||||
|
||||
z = hash.delete(:z)
|
||||
position = Position.new(hash.delete(:x), hash.delete(:y), z == nil ? 0 : z)
|
||||
return Npc.new(id, position)
|
||||
return Npc.new($world, id, position)
|
||||
end
|
||||
|
||||
# Applies a decoded hash (one aquired using parse_hash) to the specified npc.
|
||||
|
||||
@@ -18,8 +18,8 @@ CHARACTER_DESIGN = 3559
|
||||
# Sends the appropriate data to the client when the player logs in to the game.
|
||||
on :login do |event, player|
|
||||
if player.in_tutorial_island
|
||||
TutorialInstructions::show_instruction(player)
|
||||
INITIAL_TABS.each_with_index { |tab, index| player.send(SwitchTabInterfaceMessage.new(index, tab)) }
|
||||
# TutorialInstructions::show_instruction(player)
|
||||
# INITIAL_TABS.each_with_index { |tab, index| player.send(SwitchTabInterfaceMessage.new(index, tab)) }
|
||||
|
||||
if (player.tutorial_island_progress == :not_started)
|
||||
show_hint_icon(player)
|
||||
|
||||
Reference in New Issue
Block a user