Commit bda578b1 authored by 神楽坂玲奈's avatar 神楽坂玲奈

ygocore

parent f7dfd90e
...@@ -40,11 +40,11 @@ class Scene_Lobby < Scene ...@@ -40,11 +40,11 @@ class Scene_Lobby < Scene
when Key::RETURN when Key::RETURN
@active_window.clicked @active_window.clicked
when Key::F2 when Key::F2
$game.host("test")
@joinroom_msgbox = Widget_Msgbox.new("创建房间", "正在等待对手") @joinroom_msgbox = Widget_Msgbox.new("创建房间", "正在等待对手")
$game.host("test")
when Key::F3 when Key::F3
$game.join 'localhost'
@joinroom_msgbox = Widget_Msgbox.new("加入房间", "正在加入房间") @joinroom_msgbox = Widget_Msgbox.new("加入房间", "正在加入房间")
$game.join 'localhost'
when Key::F5 when Key::F5
if @roomlist.items and room = @roomlist.items.find{|room|room.player1 == $game.user or room.player2 == $game.user} if @roomlist.items and room = @roomlist.items.find{|room|room.player1 == $game.user or room.player2 == $game.user}
$game.qroom room $game.qroom room
......
...@@ -40,11 +40,11 @@ class Window_RoomList < Window_Scrollable ...@@ -40,11 +40,11 @@ class Window_RoomList < Window_Scrollable
def clicked def clicked
return unless @index and room = @items[@index] return unless @index and room = @items[@index]
if room.full? if room.full?
$game.watch room
@joinroom_msgbox = Widget_Msgbox.new("加入房间", "正在加入观战") @joinroom_msgbox = Widget_Msgbox.new("加入房间", "正在加入观战")
$game.watch room
else else
$game.join room
@joinroom_msgbox = Widget_Msgbox.new("加入房间", "正在加入房间") @joinroom_msgbox = Widget_Msgbox.new("加入房间", "正在加入房间")
$game.join room
end end
end end
end end
\ No newline at end of file
...@@ -26,7 +26,7 @@ class Ygocore < Game ...@@ -26,7 +26,7 @@ class Ygocore < Game
Game_Event.push Game_Event::Login.new(User.new(username.to_sym, username)) Game_Event.push Game_Event::Login.new(User.new(username.to_sym, username))
end end
def watch(room) def watch(room)
join(room) Widget_Msgbox.new("观战", "ygocore不支持加入已经开始游戏的房间", :ok => "确定")
end end
def join(room) def join(room)
return if @last_clicked and Time.now - @last_clicked < 3 #防止重复点击 return if @last_clicked and Time.now - @last_clicked < 3 #防止重复点击
...@@ -94,11 +94,11 @@ class Ygocore < Game ...@@ -94,11 +94,11 @@ class Ygocore < Game
@@keybd_event.call(VK_RETURN,0,0,0) @@keybd_event.call(VK_RETURN,0,0,0)
@@keybd_event.call(VK_RETURN,0,KEYEVENTF_KEYUP,0) @@keybd_event.call(VK_RETURN,0,KEYEVENTF_KEYUP,0)
else else
Widget_Msgbox.new("加入房间", 'ygocore运行失败') Widget_Msgbox.new("加入房间", 'ygocore运行失败', :ok => "确定")
end end
end end
end end
$scene = Scene_Lobby.new Widget_Msgbox.new("加入房间","已经加入房间").destroy #仅仅为了消掉正在加入房间的消息框
end end
def refresh def refresh
Thread.new do Thread.new do
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment