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

0.7.3, 官网地址更新.

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