Commit 3d13036a authored by 神楽坂玲奈's avatar 神楽坂玲奈

内部用语 hall->lobby

parent df0e6321
This diff was suppressed by a .gitattributes entry.
This diff was suppressed by a .gitattributes entry.
This diff was suppressed by a .gitattributes entry.
......@@ -74,7 +74,7 @@ class Game_Event
class Chat < Game_Event
attr_reader :user, :content, :channel
def initialize(user, content, channel=:hall)
def initialize(user, content, channel=:lobby)
@user = user
@content = content
@channel = channel
......
......@@ -136,7 +136,7 @@ class Game_Event
def self.parse(info)
user, content = info.split(",", 2)
user = user == "System" ? User.new(100000, "iDuel管理中心") : User.parse(user)
self.new(user, content.gsub('@@@@', ','), :hall)
self.new(user, content.gsub('@@@@', ','), :lobby)
end
end
class Error
......
......@@ -77,10 +77,10 @@ class Iduel < Game
#def qroom(room)
# send(10, @key, room.id, checknum("QROOM", @session + room.id.to_s))
#end
def chat(msg, channel=:hall)
def chat(msg, channel=:lobby)
msg.gsub!(",", "@@@@")
case channel
when :hall
when :lobby
send(4, @key, msg, checknum("CHATP", @session))
when User #私聊
send(3, @key, "#{channel.name}(#{channel.id})", msg, checknum("CHATX", @session + "X" + "#{channel.name}(#{channel.id})"))
......
......@@ -36,7 +36,7 @@ class User
room = room()
result = case
when room.nil?
:hall
:lobby
when room.player2
:dueling
else
......
......@@ -9,7 +9,6 @@ begin
$config['screen'] ||= {}
$config['screen']['width'] ||= 1024
$config['screen']['height'] ||= 768
p $config
end
def save_config(file="config.yml")
File.open(file,"w"){|file| YAML.dump($config, file)}
......
......@@ -15,7 +15,7 @@ class NBX < Game
def login(username)
connect
Game_Event.push Game_Event::Login.new(User.new('localhost', username)) if @conn_hall
Game_Event.push Game_Event::Login.new(User.new('localhost', username)) if @conn_lobby
end
def host(name=@user.name)
......@@ -49,9 +49,9 @@ class NBX < Game
def exit
send(:room, "关闭游戏王NetBattleX 2.7.2▊▊▊730462") rescue nil
@recv_hall.kill rescue nil
@conn_hall.close rescue nil
@conn_hall = nil
@recv_lobby.kill rescue nil
@conn_lobby.close rescue nil
@conn_lobby = nil
@conn_room.close rescue nil
@conn_room = nil
@conn_room_server.close rescue nil
......@@ -64,9 +64,9 @@ class NBX < Game
def send(user, head, *args)
case user
when User #大厅里给特定用户的回复
@conn_hall.send("#{head}|#{args.join(',')}", 0, user.host, Port) if @conn_hall
@conn_lobby.send("#{head}|#{args.join(',')}", 0, user.host, Port) if @conn_lobby
when nil #大厅里的广播
@conn_hall.send("#{head}|#{args.join(',')}", 0, '<broadcast>', Port) if @conn_hall
@conn_lobby.send("#{head}|#{args.join(',')}", 0, '<broadcast>', Port) if @conn_lobby
when :room #房间里,发给对手和观战者
@conn_room.write(head.gsub("\n", "\r\n") + RS) if @conn_room
when :watchers #房间里,发给观战者
......@@ -78,13 +78,13 @@ class NBX < Game
require 'socket'
require 'open-uri'
begin
@conn_hall = UDPSocket.new
@conn_hall.setsockopt(Socket::SOL_SOCKET, Socket::SO_BROADCAST, true)
@conn_hall.bind('0.0.0.0', Port)
@conn_lobby = UDPSocket.new
@conn_lobby.setsockopt(Socket::SOL_SOCKET, Socket::SO_BROADCAST, true)
@conn_lobby.bind('0.0.0.0', Port)
Thread.abort_on_exception = true
@recv_hall = Thread.new do
@recv_lobby = Thread.new do
begin
recv *@conn_hall.recvfrom(1024) while @conn_hall
recv *@conn_lobby.recvfrom(1024) while @conn_lobby
rescue Exception => exception
self.exit
Game_Event.push Game_Event::Error.new(exception.class.to_s, exception.message)
......
......@@ -139,7 +139,7 @@ class Scene_Duel < Scene
event.action.run
refresh
when Game_Event::Leave
$scene = Scene_Hall.new
$scene = Scene_Lobby.new
when Game_Event::NewRoom
if event.room == $game.room
@player_lp_window.player = $game.room.player1
......
#encoding: UTF-8
#==============================================================================
# Scene_Hall
# Scene_Lobby
#------------------------------------------------------------------------------
# 大厅
#==============================================================================
class Scene_Hall < Scene
class Scene_Lobby < Scene
require_relative 'window_userlist'
require_relative 'window_userinfo'
require_relative 'window_roomlist'
require_relative 'window_chat'
def start
$game.refresh
@background = Surface.load("graphics/hall/background.png").display_format
@background = Surface.load("graphics/lobby/background.png").display_format
Surface.blit(@background,0,0,0,0,$screen,0,0)
@userlist = Window_UserList.new(24,204,$game.users)
@roomlist = Window_RoomList.new(320,50,$game.rooms)
......@@ -21,7 +21,7 @@ class Scene_Hall < Scene
@active_window = @roomlist
@chat = Window_Chat.new(321,551,682,168){|text|$game.chat text; Game_Event.push Game_Event::Chat.new($game.user, text)}
bgm = Mixer::Music.load("audio/bgm/hall.ogg")
bgm = Mixer::Music.load("audio/bgm/lobby.ogg")
Mixer.fade_in_music(bgm, -1, 800)
@bgm.destroy if @bgm
@bgm = bgm
......
......@@ -8,7 +8,6 @@ require_relative 'window_gameselect'
require_relative 'window_login'
require_relative 'scene_replay'
class Scene_Login < Scene
Vocab_Logging = "Logging"
def start
@background = Surface.load("graphics/login/background.png").display_format
@gameselect_window = Window_GameSelect.new(117,269,$config["game"])
......@@ -22,8 +21,8 @@ class Scene_Login < Scene
def handle_game(event)
case event
when Game_Event::Login
require_relative 'scene_hall'
$scene = Scene_Hall.new
require_relative 'scene_lobby'
$scene = Scene_Lobby.new
else
super
end
......
......@@ -24,7 +24,7 @@ class Scene_Watch < Scene_Duel
def handle_game(event)
case event
when Game_Event::Leave
Widget_Msgbox.new("离开房间", "观战结束", :ok => "确定") { $scene = Scene_Hall.new }
Widget_Msgbox.new("离开房间", "观战结束", :ok => "确定") { $scene = Scene_Lobby.new }
else
super
end
......
......@@ -17,7 +17,7 @@ class User
room = room()
case
when room.nil?
:hall
:lobby
when room.player2
:dueling
else
......
......@@ -3,10 +3,10 @@ class Widget_ScrollBar < Window
def initialize(parent_window,x,y,height)
super(x,y,20,height,400)
@parent_window = parent_window
@up_button = Surface.load('graphics/hall/scroll_up.png')
@down_button = Surface.load('graphics/hall/scroll_down.png')
@back = Surface.load('graphics/hall/scroll_background.png')
@bar = Surface.load('graphics/hall/scroll.png')
@up_button = Surface.load('graphics/lobby/scroll_up.png')
@down_button = Surface.load('graphics/lobby/scroll_down.png')
@back = Surface.load('graphics/lobby/scroll_background.png')
@bar = Surface.load('graphics/lobby/scroll.png')
@contents.fill_rect(0,0,@width, @height, 0xFFFFFFFF)
@scroll ||= 0
@scroll_max ||= 0
......
......@@ -56,7 +56,6 @@ class Window_GameSelect < Window_List
end
def clicked
load @items[@index]["file"] #TODO: load的这种架构微蛋疼,一时想不到更好的方案
p $config
$config['game'] = @items[@index]['name']
@login_window.destroy if @login_window
@login_window = Window_Login.new(316,316,$config[$config['game']]["username"],$config[$config['game']]["password"])
......
......@@ -9,10 +9,10 @@ class Window_RoomList < Window_Scrollable
attr_reader :items
WLH = 48
def initialize(x, y, items)
@button = Surface.load('graphics/hall/room.png')
@button = Surface.load('graphics/lobby/room.png')
@button.set_alpha(RLEACCEL, 255)
#@background = Surface.load 'graphics/hall/roomitems.png'
#@contents = Surface.load 'graphics/hall/roomitems.png'
#@background = Surface.load 'graphics/lobby/roomitems.png'
#@contents = Surface.load 'graphics/lobby/roomitems.png'
super(x,y,@button.w / 3, 48 * 10)
@item_max = 0
@font = TTF.open("fonts/WenQuanYi Micro Hei.ttf", 16)
......
......@@ -2,13 +2,13 @@
class Window_User < Window_List
WLH = 20
def initialize(x, y, user)
@background = Surface.load("graphics/hall/user.png").display_format
@background = Surface.load("graphics/lobby/user.png").display_format
super(x,y,@background.w,@background.h, 300)
@font = TTF.open('fonts/WenQuanYi Micro Hei.ttf', 16)
@user = user
@contents = Surface.load("graphics/hall/user.png").display_format #TODO:调用已经加载了的背景
@contents = Surface.load("graphics/lobby/user.png").display_format #TODO:调用已经加载了的背景
@avatar_boarder = Surface.load("graphics/hall/avatar_boader.png")
@avatar_boarder = Surface.load("graphics/lobby/avatar_boader.png")
@items = ["发送消息", "查看资料"]
@items << "加入游戏" if user.status == :waiting
@items << "观战" if user.status == :dueling
......@@ -26,7 +26,7 @@ class Window_User < Window_List
@font.draw_blended_utf8(@contents, @user.name, 172, 24, 0x00,0x00,0x00)
@font.draw_blended_utf8(@contents, "id: #{@user.id}" , 172, 32+WLH, 0x00,0x00,0x00)
@font.draw_blended_utf8(@contents, "#{'房间' + @user.room.id.to_s + ' ' if @user.room}#{case @user.status;when :hall;'大厅';when :dueling;'决斗中';when :waiting;'等待中';end}", 172, 32+WLH*2, 0x00,0x00,0x00)
@font.draw_blended_utf8(@contents, "#{'房间' + @user.room.id.to_s + ' ' if @user.room}#{case @user.status;when :lobby;'大厅';when :dueling;'决斗中';when :waiting;'等待中';end}", 172, 32+WLH*2, 0x00,0x00,0x00)
end
def clear(x=0,y=0,width=@width,height=@height)
......
......@@ -7,11 +7,11 @@
class Window_UserInfo < Window
def initialize(x, y, user)
@avatar_boarder = Surface.load("graphics/hall/avatar_boader.png")
@avatar_boarder = Surface.load("graphics/lobby/avatar_boader.png")
super(x,y,240,144)
@font = TTF.open('fonts/WenQuanYi Micro Hei.ttf', 16)
@user = user
@background = Surface.load("graphics/hall/userinfo.png").display_format
@background = Surface.load("graphics/lobby/userinfo.png").display_format
refresh
end
......
......@@ -9,8 +9,8 @@ class Window_UserList < Window_Scrollable
attr_reader :x, :y, :width, :height
WLH = 20
def initialize(x, y, items)
#@contents = Surface.load "graphics/hall/useritems.png"
#@background = Surface.load "graphics/hall/useritems.png"
#@contents = Surface.load "graphics/lobby/useritems.png"
#@background = Surface.load "graphics/lobby/useritems.png"
super(x,y,272,540)
@font = TTF.open("fonts/WenQuanYi Micro Hei.ttf", 16)
@color = [0x03, 0x11, 0x22]
......
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