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

temp3

parents 7252ed1a 8031a2a0
This diff was suppressed by a .gitattributes entry.
This diff was suppressed by a .gitattributes entry.
This diff was suppressed by a .gitattributes entry.
This diff was suppressed by a .gitattributes entry.
This diff was suppressed by a .gitattributes entry.
This diff was suppressed by a .gitattributes entry.
......@@ -8,12 +8,17 @@ begin
$config['bgm'] = true if $config['bgm'].nil?
$config['screen'] ||= {}
$config['screen']['width'] ||= 1024
<<<<<<< HEAD
$config['screen']['height'] ||= 768
=======
$config['screen']['height'] ||= 640
>>>>>>> 8031a2a
end
def save_config(file="config.yml")
File.open(file, "w") { |file| YAML.dump($config, file) }
end
<<<<<<< HEAD
def register_url_protocol
if RUBY_PLATFORM["win"] || RUBY_PLATFORM["ming"]
......@@ -63,6 +68,21 @@ begin
$config['no_assoc'] = true
save_config
end
=======
def register_url_protocol
if RUBY_PLATFORM["win"] || RUBY_PLATFORM["ming"]
require 'win32/registry'
pwd = Dir.pwd.gsub('/', '\\')
path = '"' + pwd + '\ruby\bin\rubyw.exe" -C"' + pwd + '" -KU lib/main.rb'
command = path + ' "%1"'
icon = '"' + pwd + '\mycard.exe", 0'
Win32::Registry::HKEY_CLASSES_ROOT.create('mycard') { |reg| reg['URL Protocol'] = path.ljust path.bytesize unless (reg['URL Protocol'] == path rescue false) }
Win32::Registry::HKEY_CLASSES_ROOT.create('mycard\shell\open\command') { |reg| reg[nil] = command.ljust command.bytesize unless (reg[nil] == command rescue false) }
Win32::Registry::HKEY_CLASSES_ROOT.create('mycard\DefaultIcon') { |reg| reg[nil] = icon.ljust icon.bytesize unless (reg[nil] == icon rescue false) }
Win32::Registry::HKEY_CLASSES_ROOT.create('.ydk') { |reg| reg[nil] = 'mycard' unless (reg[nil] == 'mycard' rescue false) }
Win32::Registry::HKEY_CLASSES_ROOT.create('.yrp') { |reg| reg[nil] = 'mycard' unless (reg[nil] == 'mycard' rescue false) }
Win32::Registry::HKEY_CLASSES_ROOT.create('.deck') { |reg| reg[nil] = 'mycard' unless (reg[nil] == 'mycard' rescue false) }
>>>>>>> 8031a2a
end
end
......@@ -89,7 +109,10 @@ begin
require_relative 'quickstart'
$scene = false
when /register_web_protocol/
<<<<<<< HEAD
$assoc_requested = true
=======
>>>>>>> 8031a2a
register_url_protocol
$scene = false
end
......@@ -136,19 +159,27 @@ begin
#初始化标题场景
require_relative 'scene_title'
<<<<<<< HEAD
require_relative 'dialog'
=======
>>>>>>> 8031a2a
$scene = Scene_Title.new
#自动更新
require_relative 'update'
Update.start
WM::set_caption("MyCard v#{Update::Version}", "MyCard")
<<<<<<< HEAD
if assoc_need?
request_assoc do
register_url_protocol rescue Dialog.uac("ruby/bin/rubyw.exe", "-KU lib/main.rb register_web_protocol")
end
end
=======
require_relative 'dialog'
register_url_protocol rescue Dialog.uac("ruby/bin/rubyw.exe", "-KU lib/main.rb register_web_protocol")
>>>>>>> 8031a2a
$log.info("main") { "初始化成功" }
end
rescue Exception => exception
......
......@@ -25,7 +25,11 @@ class Scene_Lobby < Scene
@userinfo = Window_UserInfo.new(24,24, $game.user)
@host_window = Window_LobbyButtons.new(748,18)
@active_window = @roomlist
<<<<<<< HEAD
@chat_window = Window_Chat.new(313,543,698,212)
=======
@chat_window = Window_Chat.new(313,$config['screen']['height'] - 225,698,212)
>>>>>>> 8031a2a
@count = 0
super
end
......
......@@ -13,7 +13,19 @@ class Scene_Login < Scene
def start
WM::set_caption("MyCard v#{Update::Version}", "MyCard")
@background = Surface.load("graphics/login/background.png").display_format
@gameselect_window = Window_GameSelect.new(117,269)
#======================================================
# We'll pay fpr that soon or later.
#======================================================
if $config['screen']['height'] == 768
@gameselect_window = Window_GameSelect.new(117,269)
elsif $config['screen']['height'] == 640
@gameselect_window = Window_GameSelect.new(117,134)
else
raise "无法分辨的分辨率"
end
#======================================================
# ENDS HERE
#======================================================
super
end
def update
......
......@@ -2,7 +2,11 @@ require 'open-uri'
require "fileutils"
require_relative 'card'
module Update
<<<<<<< HEAD
Version = '0.7.2'
=======
Version = '0.7.0'
>>>>>>> 8031a2a
URL = "http://card.touhou.cc/mycard/update.json?version=#{Version}"
class <<self
attr_reader :thumbnails, :images, :status
......
......@@ -24,7 +24,19 @@ class Window_GameSelect < Window_List
self.items = @items
self.index = @items.find_index{|game|game["name"] == $config['game']} || 0
clicked
@announcements_window = Window_Announcements.new(313,265,600,24)
#======================================================
# We'll pay fpr that soon or later.
#======================================================
if $config['screen']['height'] == 768
@announcements_window = Window_Announcements.new(313,265,600,24)
elsif $config['screen']['height'] == 640
@announcements_window = Window_Announcements.new(313,130,600,24)
else
raise "无法分辨的分辨率"
end
#======================================================
# ENDS HERE
#======================================================
refresh
end
def draw_item(index, status=0)
......@@ -60,7 +72,19 @@ class Window_GameSelect < Window_List
load @items[@index]["file"].encode("GBK") #TODO: load的这种架构微蛋疼,一时想不到更好的方案
$config['game'] = @items[@index]['name']
@login_window.destroy if @login_window
@login_window = Window_Login.new(316,316,$config[$config['game']]["username"],$config[$config['game']]["password"])
#======================================================
# We'll pay fpr that soon or later.
#======================================================
if $config['screen']['height'] == 768
@login_window = Window_Login.new(316,316,$config[$config['game']]["username"],$config[$config['game']]["password"])
elsif $config['screen']['height'] == 640
@login_window = Window_Login.new(316,183,$config[$config['game']]["username"],$config[$config['game']]["password"])
else
raise "无法分辨的分辨率"
end
#======================================================
# ENDS HERE
#======================================================
@announcements_window.refresh if @announcements_window
@game = @index
refresh
......
......@@ -14,7 +14,11 @@ class Window_RoomList < Window_Scrollable
@button.set_alpha(RLEACCEL, 255)
#@background = Surface.load 'graphics/lobby/roomitems.png'
#@contents = Surface.load 'graphics/lobby/roomitems.png'
<<<<<<< HEAD
super(x,y,@button.w / 3, 48 * 10)
=======
super(x,y,@button.w / 3, ($config['screen']['height'] - 288) / 48 * 48)
>>>>>>> 8031a2a
@item_max = 0
@font = TTF.open("fonts/wqy-microhei.ttc", 16)
@color = [0x03, 0x11, 0x22]
......
......@@ -11,7 +11,7 @@ class Window_UserList < Window_Scrollable
def initialize(x, y, items)
#@contents = Surface.load "graphics/lobby/useritems.png"
#@background = Surface.load "graphics/lobby/useritems.png"
super(x,y,272,540)
super(x,y,272,$config['screen']['height'] - 220)
@font = TTF.open("fonts/wqy-microhei.ttc", 16)
@color = [0x03, 0x11, 0x22]
@color_friend = [0, 128, 0]
......
This diff was suppressed by a .gitattributes entry.
This diff was suppressed by a .gitattributes entry.
This diff was suppressed by a .gitattributes entry.
This diff was suppressed by a .gitattributes entry.
This diff was suppressed by a .gitattributes entry.
This diff was suppressed by a .gitattributes entry.
This diff was suppressed by a .gitattributes entry.
This diff was suppressed by a .gitattributes entry.
This diff was suppressed by a .gitattributes entry.
This diff was suppressed by a .gitattributes entry.
This diff was suppressed by a .gitattributes entry.
This diff was suppressed by a .gitattributes entry.
This diff was suppressed by a .gitattributes entry.
This diff was suppressed by a .gitattributes entry.
This diff was suppressed by a .gitattributes entry.
This diff was suppressed by a .gitattributes entry.
This diff was suppressed by a .gitattributes entry.
This diff was suppressed by a .gitattributes entry.
This diff was suppressed by a .gitattributes entry.
This diff was suppressed by a .gitattributes entry.
This diff was suppressed by a .gitattributes entry.
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