Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
M
mycard
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Packages
Packages
List
Container Registry
Analytics
Analytics
CI / CD
Code Review
Insights
Issues
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
xiaoye
mycard
Commits
a411afd0
Commit
a411afd0
authored
Jul 18, 2012
by
神楽坂玲奈
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
0.7.3, 官网地址更新.
parent
e899fee9
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
50 additions
and
52 deletions
+50
-52
Rakefile
Rakefile
+1
-1
lib/association.rb
lib/association.rb
+1
-1
lib/resolution.rb
lib/resolution.rb
+0
-2
lib/update.rb
lib/update.rb
+7
-7
lib/window_lobbybuttons.rb
lib/window_lobbybuttons.rb
+1
-1
lib/ygocore/server.yml
lib/ygocore/server.yml
+2
-2
lib/ygocore/user.rb
lib/ygocore/user.rb
+38
-38
No files found.
Rakefile
View file @
a411afd0
...
@@ -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
...
...
lib/association.rb
View file @
a411afd0
...
@@ -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
...
...
lib/resolution.rb
View file @
a411afd0
...
@@ -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
...
...
lib/update.rb
View file @
a411afd0
...
@@ -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
...
...
lib/window_lobbybuttons.rb
View file @
a411afd0
...
@@ -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
...
...
lib/ygocore/server.yml
View file @
a411afd0
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
lib/ygocore/user.rb
View file @
a411afd0
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
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment