Commit 55e3947e authored by 神楽坂玲奈's avatar 神楽坂玲奈

ygocore

parent bda578b1
File mode changed from 100755 to 100644
...@@ -6,7 +6,7 @@ begin ...@@ -6,7 +6,7 @@ begin
def load_config(file="config.yml") def load_config(file="config.yml")
require 'yaml' require 'yaml'
$config = YAML.load_file("config.yml") rescue {} $config = YAML.load_file("config.yml") rescue {}
$config ||= {} $config = {} unless $config.is_a? Hash
$config['bgm'] = true if $config['bgm'].nil? $config['bgm'] = true if $config['bgm'].nil?
$config['screen'] ||= {} $config['screen'] ||= {}
$config['screen']['width'] ||= 1024 $config['screen']['width'] ||= 1024
......
...@@ -15,7 +15,7 @@ class Window_Announcements < Window ...@@ -15,7 +15,7 @@ class Window_Announcements < Window
def refresh def refresh
clear clear
return unless @item return unless @item
if @transforming if @transforming and @last_item
@font.style = TTF::STYLE_NORMAL @font.style = TTF::STYLE_NORMAL
@font.draw_blended_utf8(@contents, @last_item.title, 0, -@transforming, *@color) @font.draw_blended_utf8(@contents, @last_item.title, 0, -@transforming, *@color)
@time_font.draw_blended_utf8(@contents, @last_item.time.strftime('%Y-%m-%d'), 300, -@transforming+4, *@time_color) if @last_item.time @time_font.draw_blended_utf8(@contents, @last_item.time.strftime('%Y-%m-%d'), 300, -@transforming+4, *@time_color) if @last_item.time
......
...@@ -38,6 +38,7 @@ class Window_RoomList < Window_Scrollable ...@@ -38,6 +38,7 @@ class Window_RoomList < Window_Scrollable
self.index = (y - @y) / WLH + @scroll self.index = (y - @y) / WLH + @scroll
end end
def clicked def clicked
return if @last_clicked and Time.now - @last_clicked < 3 #ygocore 加入房间时可能弹Tk窗询问主程序位置 防止重复点击
return unless @index and room = @items[@index] return unless @index and room = @items[@index]
if room.full? if room.full?
@joinroom_msgbox = Widget_Msgbox.new("加入房间", "正在加入观战") @joinroom_msgbox = Widget_Msgbox.new("加入房间", "正在加入观战")
...@@ -46,5 +47,6 @@ class Window_RoomList < Window_Scrollable ...@@ -46,5 +47,6 @@ class Window_RoomList < Window_Scrollable
@joinroom_msgbox = Widget_Msgbox.new("加入房间", "正在加入房间") @joinroom_msgbox = Widget_Msgbox.new("加入房间", "正在加入房间")
$game.join room $game.join room
end end
@last_clicked = Time.now
end end
end end
\ No newline at end of file
...@@ -23,7 +23,7 @@ class Window_UserInfo < Window ...@@ -23,7 +23,7 @@ class Window_UserInfo < Window
@contents.put(@avatar_boarder, 0, 0) @contents.put(@avatar_boarder, 0, 0)
end end
@font.draw_blended_utf8(@contents, @user.name, 160, 12, 0x00,0x00,0x00) @font.draw_blended_utf8(@contents, @user.name, 160, 12, 0x00,0x00,0x00) unless @user.name.empty?
@font.draw_blended_utf8(@contents, "id: #{@user.id}" , 160, 12+16*2, 0x00,0x00,0x00) @font.draw_blended_utf8(@contents, "id: #{@user.id}" , 160, 12+16*2, 0x00,0x00,0x00)
@font.draw_blended_utf8(@contents, "Lv: #{@user.level}" , 160, 12+16*3, 0x00,0x00,0x00) if @user.respond_to? :level and @user.level #TODO:规范化,level是iduel专属的,但是又不太想让iduel来重定义这个window @font.draw_blended_utf8(@contents, "Lv: #{@user.level}" , 160, 12+16*3, 0x00,0x00,0x00) if @user.respond_to? :level and @user.level #TODO:规范化,level是iduel专属的,但是又不太想让iduel来重定义这个window
@font.draw_blended_utf8(@contents, "经验: #{@user.exp}", 160, 12+16*4, 0x00,0x00,0x00) if @user.respond_to? :exp and @user.exp @font.draw_blended_utf8(@contents, "经验: #{@user.exp}", 160, 12+16*4, 0x00,0x00,0x00) if @user.respond_to? :exp and @user.exp
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
load File.expand_path('window_login.rb', File.dirname(__FILE__)) load File.expand_path('window_login.rb', File.dirname(__FILE__))
require 'open-uri' require 'open-uri'
class Ygocore < Game class Ygocore < Game
Register_Url = 'http://sh.convnet.net:7922/?userregist=NEW' Register_Url = 'http://sh.convnet.net:7955/regist.html'
Port = 7911 Port = 7911
Server = '221.226.68.62' Server = '221.226.68.62'
...@@ -21,6 +21,9 @@ class Ygocore < Game ...@@ -21,6 +21,9 @@ class Ygocore < Game
load File.expand_path('room.rb', File.dirname(__FILE__)) load File.expand_path('room.rb', File.dirname(__FILE__))
end end
def login(username, password) def login(username, password)
if username.empty?
return Widget_Msgbox.new("登陆", "请输入用户名", :ok => "确定")
end
connect connect
@password = password @password = password
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))
......
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