Commit 583e0311 authored by 神楽坂玲奈's avatar 神楽坂玲奈

1.3.8

parent cc2da82b
......@@ -12,11 +12,23 @@ class Scene_Title < Scene
def start
WM::set_caption("MyCard v#{Update::Version}", "MyCard")
title = Dir.glob("graphics/titles/title_*.*")
if $config['screen']['height'] == 640
title.reject!{|t|t['full']}
else
title.reject!{|t|t['resize']}
end
title = title[rand(title.size)]
title = "graphics/titles/title_#{$config['screen']['height'] == 768 ? 'full' : 'resize'}_special.png" if title['special']
@background = Surface.load(title).display_format
Surface.blit(@background,0,0,0,0,$screen,0,0)
@command_window = Window_Title.new(title["left"] ? 200 : title["right"] ? 600 : title["special"] ? 42 : 400, title["special"] ? 321 : $config['screen']['height']/2-100)
buttons_img = "graphics/system/titlebuttons.png"
if matched = title.match(/title_(\d+)/)
index = matched[1]
if File.exist? "graphics/titles/titlebuttons_#{index}.png"
buttons_img = "graphics/titles/titlebuttons_#{index}.png"
end
end
@command_window = Window_Title.new(title["left"] ? 200 : title["right"] ? 600 : title["special"] ? 42 : 400, title["special"] ? 321 : $config['screen']['height']/2-100,buttons_img)
(@decision_se = Mixer::Wave.load("audio/se/decision.ogg") if SDL.inited_system(INIT_AUDIO) != 0) rescue nil
super
end
......
......@@ -2,7 +2,7 @@
require "fileutils"
require_relative 'card'
module Update
Version = '1.2.3'
Version = '1.3.8'
URL = "https://my-card.in/mycard/update.json?version=#{Version}"
class <<self
attr_reader :thumbnails, :images
......
......@@ -34,7 +34,7 @@ class Window_LobbyButtons < Window_List
case @index
when 0 #常见问题
require_relative 'dialog'
Dialog.web "http://forum.my-card.in/"
Dialog.web "https://forum.my-card.in/"
when 1 #房间筛选
if @filter_window and !@filter_window.destroyed?
@filter_window.destroy
......@@ -50,25 +50,31 @@ class Window_LobbyButtons < Window_List
return if @waiting
@waiting = true
waiting_window = Widget_Msgbox.new("自动匹配", "正在等待对手")
require 'open-uri'
require 'uri'
require 'net/http'
require 'net/https'
Thread.new {
begin
open('https://my-card.in/match') { |f|
@waiting = false
if f.read =~ /^mycard:\/\/([\d\.]+):(\d+)\/(.*?)(\?server_auth=true)?$/
room = Room.new(nil, $3.to_s)
room.server = Server.new(nil, nil, $1, $2.to_i, !!$4)
$game.join(room)
else
$log.error('自动匹配非法回复'){f.read}
Widget_Msgbox.new("自动匹配", "错误: #{exception}", ok: "确定")
end
}
uri = URI.parse("https://my-card.in/match")
http = Net::HTTP.new(uri.host,uri.port)
http.use_ssl = true
http.verify_mode = OpenSSL::SSL::VERIFY_NONE
req = Net::HTTP::Post.new(uri.path)
req.basic_auth $game.username, $game.password
res = http.request(req)
@waiting = false
if res.body =~ /^mycard:\/\/([\d\.]+):(\d+)\/(.*?)(\?server_auth=true)?$/
room = Room.new(nil, $3.to_s)
room.server = Server.new(nil, nil, $1, $2.to_i, !!$4)
$game.join(room)
else
$log.error('自动匹配非法回复'){res.body}
Widget_Msgbox.new("自动匹配", "错误: #{res.body}", ok: "确定")
end
rescue Exception => exception
@waiting = false
$log.error('自动匹配出错'){exception}
Widget_Msgbox.new("自动匹配", "匹配失败: #{exception}", ok: "确定")
$log.error('自动匹配出错'){exception.to_s.encode('UTF-8')}
Widget_Msgbox.new("自动匹配", "匹配失败: #{exception.to_s.encode('UTF-8')}", ok: "确定")
end
}
end
......
......@@ -3,8 +3,8 @@ class Window_Title < Window_List
Button_Count = 5
WLH = 50
attr_reader :x, :y, :width, :height, :single_height, :index
def initialize(x,y)
@button = Surface.load("graphics/system/titlebuttons.png")
def initialize(x,y,img="graphics/system/titlebuttons.png")
@button = Surface.load(img)
@button.set_alpha(RLEACCEL,255)
@single_height = @button.h / Button_Count
super(x,y,@button.w / 3,WLH * Button_Count - (WLH - @button.h / Button_Count))
......
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