em
[NM] Scene_Map
Não Acho
when PACKET_ADMIN_COMMAND; handle_admin_command(data)
Meu [NM] Scene_Map
-----
em
[NM] Window_Interaction
Nãp Achou
$game_trade = Game_Trade.new
Meu [NM] Window_Interaction
[NM] Scene_Map
Não Acho
when PACKET_ADMIN_COMMAND; handle_admin_command(data)
Meu [NM] Scene_Map
- Código:
#==============================================================================
# ** Scene_Map
#------------------------------------------------------------------------------
# Esta classe trata da cena de mapa.
#------------------------------------------------------------------------------
# Autor: Valentine
#==============================================================================
class Scene_Map
#--------------------------------------------------------------------------
# * Criação de janelas
#--------------------------------------------------------------------------
def create_windows
@item_icon = Icon.new(nil, 637, 575, 'Item', '', ["#{$data_system.words.item} (I)"]) { $windows[:equip].trigger }
@skill_icon = Icon.new(nil, 672, 575, 'Skill', '', ["#{$data_system.words.skill} (K)"]) { $windows[:skill].trigger }
@character_icon = Icon.new(nil, 707, 575, 'Character', '', ["#{Vocab::CHARACTER} (C)"]) { $windows[:character].trigger }
@options_icon = Icon.new(nil, 742, 575, 'Options', '', ["#{Vocab::OPTIONS} (O)"]) { $windows[:option].trigger }
$windows[:hud] = Sprite_Hud.new
$windows[:hotkey] = Sprite_Hotkey.new
$windows[:chat] = Window_Chat.new
$windows[:equip] = Window_Equip.new
$windows[:item] = Window_Item.new
$windows[:skill] = Window_Skill.new
$windows[:character] = Window_Character.new
$windows[:interaction] = Window_Interaction.new
$windows[:shop] = Window_Shop.new
$windows[:histrade] = Window_HisTrade.new
$windows[:mytrade] = Window_MyTrade.new
$windows[:trade] = Window_Trade.new
$windows[:option] = Window_Option.new
$windows[:amount] = Window_Amount.new
$windows[:choice] = Window_Choice.new
end
#--------------------------------------------------------------------------
# * Exibição
#--------------------------------------------------------------------------
def dispose
@item_icon.dispose
@skill_icon.dispose
@character_icon.dispose
@options_icon.dispo se
for window in $windows.values
window.dispose
end
end
#--------------------------------------------------------------------------
# * Atualização do frame
#--------------------------------------------------------------------------
def update_windows
$party_manager.update
@item_icon.update
@skill_icon.update
@character_icon.update
@options_icon.update
for window in $windows.values
window.update if window.visible #and window != $windows[:trade]
end
if $windows[:equip].visible
$windows[:item].x = $windows[:equip].x
$windows[:item].y = $windows[:equip].y + 69
end
if $windows[:histrade].visible
$windows[:mytrade].x = $windows[:histrade].x
$windows[:mytrade].y = $windows[:histrade].y + 121
$windows[:trade].x = $windows[:mytrade].x
$windows[:trade].y = $windows[:mytrade].y + 121
#$windows[:trade].update
end
end
#--------------------------------------------------------------------------
# * Atualização dos gatilhos das janelas
#--------------------------------------------------------------------------
def update_trigger_windows
$windows[:shop].on_close if $game_player.moving? and $windows[:shop].visible
$windows[:chat].trigger if Input.trigger?(Input::F5)
close_windows if Input.trigger?(Input::B)
return if $typing
if Input.trigger?(Input::Key['I'])
$windows[:equip].trigger
elsif Input.trigger?(Input::Key['K'])
$windows[:skill].trigger
elsif Input.trigger?(Input::Key['C'])
$windows[:character].trigger
elsif Input.trigger?(Input::Key['O'])
$windows[:option].trigger
end
end
#--------------------------------------------------------------------------
# * Fechar todas as janelas
#--------------------------------------------------------------------------
def close_windows
$windows[:equip].on_close
$windows[:skill].on_close
$windows[:character].on_close
$windows[:interaction].on_close
$windows[:shop].on_close
$windows[:histrade].on_close
$windows[:option].on_close
$windows[:amount].on_close
$windows[:choice].on_close
end
end
-----
em
[NM] Window_Interaction
Nãp Achou
$game_trade = Game_Trade.new
Meu [NM] Window_Interaction
- Código:
#==============================================================================
# ** Window_Interaction
#------------------------------------------------------------------------------
# Esta classe trata da janela de interação.
#------------------------------------------------------------------------------
# Autor: Valentine
#==============================================================================
class Window_Interaction < Window_Base
#--------------------------------------------------------------------------
# * Variáveis públicas
#--------------------------------------------------------------------------
attr_reader :index # índice do jogador
#--------------------------------------------------------------------------
# * Inicialização dos objetos
#--------------------------------------------------------------------------
def initialize
super(0, 0, 91, 92)
self.contents = Bitmap.new(width - 32, height - 32)
self.visible = self.active = false
@private_button = Button.new(self, 16, 21, Vocab::PRIVATE, 59) { private_chat }
@trade_button = Button.new(self, 16, 42, Vocab::TRADE, 59) { call_trade }
@party_button = Button.new(self, 16, 63, LMM_Party::PARTY, 59) { call_party}
@dragable = true
@closable = true
@index = 0
end
#--------------------------------------------------------------------------
# * Abrir janela
# index : índice do jogador
#--------------------------------------------------------------------------
def open(index)
@index = index
self.x = $mouse.x + 6
self.y = $mouse.y + 6
on_open
end
#--------------------------------------------------------------------------
# * Bate-papo privado
#--------------------------------------------------------------------------
def private_chat
# Clone impede que o nome do jogador seja alterado
$windows[:chat].private_box.text = $network.players[@index].name.clone
$windows[:chat].change_talk(4)
on_close
end
#--------------------------------------------------------------------------
# * Troca
#--------------------------------------------------------------------------
def call_trade
$network.request(Constants::REQUEST_TRADE, @index) unless $game_trade.in_trade
on_close
end
def call_party
if $party_manager.members.size == (LMM_Party::MAX_MEMBERS - 1)
$windows[:chat].write(LMM_Party::FULL, 5)
on_close
return
elsif $party_manager.members.has_key?(@index.to_s)
$windows[:chat].write("#{$party_manager.members[@index.to_s].name} "+LMM_Party::ALREADY, 5)
on_close
return
end
$network.party_member(0,"#{@index};#{$game_party.actors[0].name}")
on_close
end
end