Commit 8b973851 authored by 神楽坂玲奈's avatar 神楽坂玲奈

OS数据库更新至0530, OS卡组导入ygocore

parent 4f13bad6
No preview for this file type
......@@ -4,14 +4,12 @@
#------------------------------------------------------------------------------
#  title
#==============================================================================
require_relative 'card'
class Deck
attr_accessor :main
attr_accessor :side
attr_accessor :extra
attr_accessor :temp
#DeckPath = '/media/44CACC1DCACC0D5C/game/yu-gi-oh/deck'
DeckPath = 'E:/game/yu-gi-oh/deck'
def initialize(main, side=[], extra=[], temp=[])
@main = main
@side = side
......@@ -24,7 +22,7 @@ class Deck
extra = []
temp = []
now = main
open(File.expand_path(name, DeckPath)) do |file|
open(name) do |file|
file.set_encoding "GBK", "UTF-8", :invalid => :replace, :undef => :replace
while line = file.readline.chomp!
case line
......
......@@ -37,6 +37,7 @@ class Scene_Title < Scene
when 2
require_relative 'widget_msgbox'
require_relative 'scene_login'
require_relative 'deck'
load 'lib/ygocore/game.rb' #TODO:不规范啊不规范
Ygocore.deck_edit
when 3
......
require_relative 'window_host'
class Window_LobbyButtons < Window_List
def initialize(x,y)
@items = ["常见问题","卡组编辑","建立房间"]
@button = Surface.load("graphics/lobby/button.png")
super(x,y,@items.size*@button.w/3+@items.size*4,30)
@font = TTF.open("fonts/wqy-microhei.ttc", 15)
refresh
end
def draw_item(index, status=0)
x,y=item_rect(index)
Surface.blit(@button, status*@button.w/3,0,@button.w/3,@button.h, @contents, x,y)
draw_stroked_text(@items[index], x+8,y+3,2,@font,[0xdf,0xf1,0xff], [0x27,0x43,0x59])
end
def item_rect(index)
[index*@button.w/3+(index)*4, 0, @button.w/3, @height]
end
def mousemoved(x,y)
if (x-@x) % (@button.w/3+4) >= @button.w/3
self.index = nil
else
self.index = (x-@x)/(@button.w/3+4)
end
end
def lostfocus(active_window = nil)
self.index = nil
end
def clicked
case @index
when 0 #常见问题
require_relative 'dialog'
Dialog.web "http://card.touhou.cc/login?user[name]=#{CGI.escape $game.user.name}&user[password]=#{CGI.escape $game.password}&continue=/topics/1453"
when 1 #卡组编辑
$game.class.deck_edit
when 2 #建立房间
@host_window = Window_Host.new(300,200)
end
end
def update
@host_window.update if @host_window and !@host_window.destroyed?
end
end
require_relative 'window_host'
class Window_LobbyButtons < Window_List
def initialize(x, y)
@items = ["常见问题", "卡组编辑", "建立房间"]
@button = Surface.load("graphics/lobby/button.png")
super(x, y, @items.size*@button.w/3+@items.size*4, 30)
@font = TTF.open("fonts/wqy-microhei.ttc", 15)
refresh
end
def draw_item(index, status=0)
x, y=item_rect(index)
Surface.blit(@button, status*@button.w/3, 0, @button.w/3, @button.h, @contents, x, y)
draw_stroked_text(@items[index], x+8, y+3, 2, @font, [0xdf, 0xf1, 0xff], [0x27, 0x43, 0x59])
end
def item_rect(index)
[index*@button.w/3+(index)*4, 0, @button.w/3, @height]
end
def mousemoved(x, y)
if (x-@x) % (@button.w/3+4) >= @button.w/3
self.index = nil
else
self.index = (x-@x)/(@button.w/3+4)
end
end
def lostfocus(active_window = nil)
self.index = nil
end
def clicked
case @index
when 0 #常见问题
require_relative 'dialog'
Dialog.web "http://card.touhou.cc/login?user[name]=#{CGI.escape $game.user.name}&user[password]=#{CGI.escape $game.password}&continue=/topics/1453"
when 1 #卡组编辑
require_relative 'deck'
$game.class.deck_edit
when 2 #建立房间
@host_window = Window_Host.new(300, 200)
end
end
def update
@host_window.update if @host_window and !@host_window.destroyed?
end
end
This diff is collapsed.
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