Commit 3349bd95 authored by zh99998's avatar zh99998

版本0.5.0 ygocore头像

parent 804cdbc3
......@@ -24,7 +24,7 @@ end
spec = Gem::Specification.new do |s|
s.name = 'mycard'
s.version = '0.4.9'
s.version = '0.5.0'
s.extra_rdoc_files = ['README.txt', 'LICENSE.txt']
s.summary = 'a card game'
s.description = s.summary
......
......@@ -46,7 +46,7 @@ begin
WM::set_caption("MyCard", "MyCard")
WM::icon = Surface.load("graphics/system/icon.gif")
$screen = Screen.open($config['screen']['width'], $config['screen']['height'], 0, HWSURFACE | ($config['screen']['fullscreen'] ? FULLSCREEN : 0))
Mixer.open(Mixer::DEFAULT_FREQUENCY,Mixer::DEFAULT_FORMAT,Mixer::DEFAULT_CHANNELS,512)
Mixer.open(Mixer::DEFAULT_FREQUENCY,Mixer::DEFAULT_FORMAT,Mixer::DEFAULT_CHANNELS,4096)
Mixer.set_volume_music(60)
TTF.init
Thread.abort_on_exception = true
......
......@@ -2,7 +2,7 @@ require 'open-uri'
require "fileutils"
require_relative 'card'
module Update
Version = '0.4.9'
Version = '0.5.0'
URL = "http://card.touhou.cc/mycard/update.json?version=#{Version}"
class <<self
attr_reader :thumbnails, :images, :status
......
......@@ -13,6 +13,25 @@ class User
@certified ? [0,0,0] : [128,128,128]
end
def space
Widget_Msgbox.new("查看资料", "功能未实现", :ok => "确定")
if @certified
system("start 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
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