Commit 0fd0f358 authored by 神楽坂玲奈's avatar 神楽坂玲奈

stat

parent 6c384388
...@@ -67,12 +67,14 @@ class Scene_Lobby < Scene ...@@ -67,12 +67,14 @@ class Scene_Lobby < Scene
case event case event
when Game_Event::AllUsers when Game_Event::AllUsers
@userlist.items = $game.users @userlist.items = $game.users
@userinfo.users = $game.users.size
when Game_Event::AllRooms, Game_Event::AllServers when Game_Event::AllRooms, Game_Event::AllServers
@roomlist.items = $game.rooms.find_all { |room| @roomlist.items = $game.rooms.find_all { |room|
$game.filter[:servers].include?(room.server) and $game.filter[:servers].include?(room.server) and
$game.filter[:waiting_only] ? (room.status == :wait) : true and $game.filter[:waiting_only] ? (room.status == :wait) : true and
$game.filter[:normal_only] ? (!room.tag? && (room.ot == 0) && (room.lp = 8000)) : true $game.filter[:normal_only] ? (!room.tag? && (room.ot == 0) && (room.lp = 8000)) : true
} }
@userinfo.rooms = $game.rooms.size
when Game_Event::Join when Game_Event::Join
join(event.room) join(event.room)
when Game_Event::Watch when Game_Event::Watch
......
require_relative 'window_host' require_relative 'window_host'
class Window_LobbyButtons < Window_List class Window_LobbyButtons < Window_List
def initialize(x, y) def initialize(x, y)
@items = [I18n.t('lobby.faq'), I18n.t('lobby.filter'), I18n.t('lobby.editdeck'), I18n.t('lobby.newroom'), I18n.t('lobby.match')] @items = [I18n.t('lobby.forum'), I18n.t('lobby.filter'), I18n.t('lobby.editdeck'), I18n.t('lobby.newroom'), I18n.t('lobby.match')]
@button = Surface.load("graphics/lobby/button.png") @button = Surface.load("graphics/lobby/button.png")
super(x, y, @items.size*@button.w/3+@items.size*4, 30) super(x, y, @items.size*@button.w/3+@items.size*4, 30)
@font = TTF.open(Font, 15) @font = TTF.open(Font, 15)
...@@ -34,7 +34,7 @@ class Window_LobbyButtons < Window_List ...@@ -34,7 +34,7 @@ class Window_LobbyButtons < Window_List
case @index case @index
when 0 #常见问题 when 0 #常见问题
require_relative 'dialog' require_relative 'dialog'
Dialog.web "https://my-card.in/login?user[name]=#{CGI.escape $game.user.name}&user[password]=#{CGI.escape $game.password}&continue=/topics/1453" Dialog.web "http://forum.my-card.in/"
when 1 #房间筛选 when 1 #房间筛选
if @filter_window and !@filter_window.destroyed? if @filter_window and !@filter_window.destroyed?
@filter_window.destroy @filter_window.destroy
......
...@@ -13,6 +13,10 @@ class Window_UserInfo < Window ...@@ -13,6 +13,10 @@ class Window_UserInfo < Window
@user = user @user = user
@background = Surface.load("graphics/lobby/userinfo.png").display_format @background = Surface.load("graphics/lobby/userinfo.png").display_format
refresh refresh
require 'open-uri'
Thread.new{
open('https://my-card.in/match_count'){|f|self.match = f.read.to_i}
}
end end
def refresh def refresh
...@@ -24,9 +28,22 @@ class Window_UserInfo < Window ...@@ -24,9 +28,22 @@ class Window_UserInfo < Window
end end
@font.draw_blended_utf8(@contents, @user.name, 160, 12, 0x00,0x00,0x00) unless @user.name.empty? @font.draw_blended_utf8(@contents, @user.name, 160, 12, 0x00,0x00,0x00) unless @user.name.empty?
@font.draw_blended_utf8(@contents, @user.id.to_s , 160, 12+16*2, 0x00,0x00,0x00) unless @user.id.to_s.empty? #@font.draw_blended_utf8(@contents, @user.id.to_s , 160, 12+16*2, 0x00,0x00,0x00) unless @user.id.to_s.empty?
@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
end
def match=(count)
clear(160, 12+16*5, 120, 16)
@font.draw_blended_utf8(@contents, "匹配:#{count}", 160, 12+16*5, 0x00,0x00,0x00)
end
def rooms=(count)
clear(160, 12+16*6, 120, 16)
@font.draw_blended_utf8(@contents, "房间:#{count}", 160, 12+16*6, 0x00,0x00,0x00)
end
def users=(count)
clear(160, 12+16*7, 120, 16)
@font.draw_blended_utf8(@contents, "在线人数:#{count}", 160, 12+16*7, 0x00,0x00,0x00)
end end
def dispose def dispose
@thread.exit @thread.exit
......
...@@ -11,7 +11,7 @@ zh: ...@@ -11,7 +11,7 @@ zh:
remember: "记住密码" remember: "记住密码"
replay: "录像" replay: "录像"
lobby: lobby:
faq: "常见问题" forum: "论坛"
editdeck: "卡组编辑" editdeck: "卡组编辑"
newroom: "建立房间" newroom: "建立房间"
lobby: "大厅" lobby: "大厅"
......
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