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

0.7.3, 官网地址更新.

parent e899fee9
...@@ -20,7 +20,7 @@ end ...@@ -20,7 +20,7 @@ end
spec = Gem::Specification.new do |s| spec = Gem::Specification.new do |s|
s.name = 'mycard' s.name = 'mycard'
s.version = '0.7.0' s.version = '0.7.3'
s.extra_rdoc_files = ['README.txt', 'LICENSE.txt'] s.extra_rdoc_files = ['README.txt', 'LICENSE.txt']
s.summary = 'a card game' s.summary = 'a card game'
s.description = s.summary s.description = s.summary
......
...@@ -45,7 +45,7 @@ module Association ...@@ -45,7 +45,7 @@ module Association
if clicked == :ok if clicked == :ok
yield yield
else else
Widget_Msgbox.new("mycard", "没有进行关联,要重新关联请删除config.yml") Widget_Msgbox.new("mycard", "未进行关联,要重新关联请删除config.yml", ok: "确定")
$config['no_assoc'] = true $config['no_assoc'] = true
Config.save Config.save
end end
......
...@@ -9,7 +9,6 @@ module Resolution ...@@ -9,7 +9,6 @@ module Resolution
end end
def system def system
return [1024, 768]
if Windows if Windows
require 'win32api' require 'win32api'
get_system_metrics = Win32API.new "User32.dll", "GetSystemMetrics", ["L"], "L" get_system_metrics = Win32API.new "User32.dll", "GetSystemMetrics", ["L"], "L"
...@@ -22,7 +21,6 @@ module Resolution ...@@ -22,7 +21,6 @@ module Resolution
def default def default
system_resolution = self.system system_resolution = self.system
all.each do |width, height| all.each do |width, height|
#p [width, height, system_resolution[0], system_resolution[1], (system_resolution[0] < width and system_resolution[1] < height)]
return [width, height] if system_resolution[0] > width and system_resolution[1] > height return [width, height] if system_resolution[0] > width and system_resolution[1] > height
end end
all.last all.last
......
...@@ -3,7 +3,7 @@ require "fileutils" ...@@ -3,7 +3,7 @@ require "fileutils"
require_relative 'card' require_relative 'card'
module Update module Update
Version = '0.7.3' Version = '0.7.3'
URL = "http://card.touhou.cc/mycard/update.json?version=#{Version}" URL = "http://my-card.in/mycard/update.json?version=#{Version}"
class <<self class <<self
attr_reader :thumbnails, :images, :status attr_reader :thumbnails, :images, :status
def start def start
...@@ -114,23 +114,23 @@ module Update ...@@ -114,23 +114,23 @@ module Update
thread = Thread.new do thread = Thread.new do
while number = @thumbnails.pop while number = @thumbnails.pop
@status.replace "正在下载缩略卡图 (剩余#{@thumbnails.size}张)" @status.replace "正在下载缩略卡图 (剩余#{@thumbnails.size}张)"
open("http://card.touhou.cc/images/cards/ygocore/thumbnail/#{number}.jpg", 'rb') do |remote| open("http://my-card.in/images/cards/ygocore/thumbnail/#{number}.jpg", 'rb') do |remote|
next if File.file? "ygocore/pics/thumbnail/#{number}.jpg" next if File.file? "ygocore/pics/thumbnail/#{number}.jpg"
#$log.debug('下载缩略卡图'){"http://card.touhou.cc/images/cards/ygocore/thumbnail/#{number}.jpg 到 ygocore/pics/thumbnail/#{number}.jpg" } #$log.debug('下载缩略卡图'){"http://my-card.in/images/cards/ygocore/thumbnail/#{number}.jpg 到 ygocore/pics/thumbnail/#{number}.jpg" }
open("ygocore/pics/thumbnail/#{number}.jpg", 'wb') do |local| open("ygocore/pics/thumbnail/#{number}.jpg", 'wb') do |local|
local.write remote.read local.write remote.read
end end
end rescue $log.error('下载缩略出错'){"http://card.touhou.cc/images/cards/ygocore/thumbnail/#{number}.jpg 到 ygocore/pics/thumbnail/#{number}.jpg" } end rescue $log.error('下载缩略出错'){"http://my-card.in/images/cards/ygocore/thumbnail/#{number}.jpg 到 ygocore/pics/thumbnail/#{number}.jpg" }
end end
while number = @images.pop while number = @images.pop
@status.replace "正在下载完整卡图 (剩余#{@images.size}张)" @status.replace "正在下载完整卡图 (剩余#{@images.size}张)"
#$log.debug('下载完整卡图'){"http://card.touhou.cc/images/cards/ygocore/#{number}.jpg 到 ygocore/pics/#{number}.jpg" } #$log.debug('下载完整卡图'){"http://my-card.in/images/cards/ygocore/#{number}.jpg 到 ygocore/pics/#{number}.jpg" }
open("http://card.touhou.cc/images/cards/ygocore/#{number}.jpg", 'rb') do |remote| open("http://my-card.in/images/cards/ygocore/#{number}.jpg", 'rb') do |remote|
next if File.file? "ygocore/pics/#{number}.jpg" next if File.file? "ygocore/pics/#{number}.jpg"
open("ygocore/pics/#{number}.jpg", 'wb') do |local| open("ygocore/pics/#{number}.jpg", 'wb') do |local|
local.write remote.read local.write remote.read
end end
end rescue $log.error('下载完整卡图出错'){"http://card.touhou.cc/images/cards/ygocore/#{number}.jpg 到 ygocore/pics/#{number}.jpg" } end rescue $log.error('下载完整卡图出错'){"http://my-card.in/images/cards/ygocore/#{number}.jpg 到 ygocore/pics/#{number}.jpg" }
end end
end end
thread.priority = -1 thread.priority = -1
......
...@@ -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 "http://card.touhou.cc/login?user[name]=#{CGI.escape $game.user.name}&user[password]=#{CGI.escape $game.password}&continue=/topics/1453" Dialog.web "http://my-card.in/login?user[name]=#{CGI.escape $game.user.name}&user[password]=#{CGI.escape $game.password}&continue=/topics/1453"
when 1 #卡组编辑 when 1 #卡组编辑
require_relative 'deck' require_relative 'deck'
$game.class.deck_edit $game.class.deck_edit
......
register: http://card.touhou.cc/register register: http://my-card.in/register
api: http://122.0.65.71:7922/ api: http://122.0.65.71:7922/
index: http://card.touhou.cc/ index: http://my-card.in/
server: 122.0.65.71 server: 122.0.65.71
port: 7911 port: 7911
\ No newline at end of file
class User class User
attr_reader :certified attr_reader :certified
def initialize(id, name = "", certified = true) def initialize(id, name = "", certified = true)
@id = id @id = id
@name = name @name = name
@certified = certified @certified = certified
end end
def set(id, name = :keep, certified = :keep) def set(id, name = :keep, certified = :keep)
@id = id unless id == :keep @id = id unless id == :keep
@name = name unless name == :keep @name = name unless name == :keep
@certified = certified unless certified == :keep @certified = certified unless certified == :keep
end end
def color def color
@certified ? [0,0,0] : [128,128,128] @certified ? [0,0,0] : [128,128,128]
end end
def space def space
if @certified if @certified
Dialog.web "http://card.touhou.cc/users/#{CGI.escape @id.to_s}" Dialog.web "http://my-card.in/users/#{CGI.escape @id.to_s}"
else else
Widget_Msgbox.new("查看资料", "用户#{@name}没有注册", :ok => "确定") Widget_Msgbox.new("查看资料", "用户#{@name}没有注册", :ok => "确定")
end end
end end
def avatar(size = :small) def avatar(size = :small)
cache = "graphics/avatars/mycard_#{@id}_#{size}.png" cache = "graphics/avatars/mycard_#{@id}_#{size}.png"
result = Surface.load(cache) rescue Surface.load("graphics/avatars/loading_#{size}.gif") result = Surface.load(cache) rescue Surface.load("graphics/avatars/loading_#{size}.gif")
scene = $scene scene = $scene
if block_given? if block_given?
yield result yield result
Thread.new do Thread.new do
require 'cgi' require 'cgi'
open("http://card.touhou.cc/users/#{CGI.escape @id.to_s}.png", 'rb') {|io|open(cache, 'wb') {|c|c.write io.read}} rescue cache = "graphics/avatars/noavatar_#{size}.gif" open("http://my-card.in/users/#{CGI.escape @id.to_s}.png", 'rb') {|io|open(cache, 'wb') {|c|c.write io.read}} rescue cache = "graphics/avatars/noavatar_#{size}.gif"
(yield Surface.load(cache) if scene == $scene) rescue nil (yield Surface.load(cache) if scene == $scene) rescue nil
end end
else else
result result
end end
end end
end end
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