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
syntax_j
mycard
Commits
583e0311
Commit
583e0311
authored
Jul 03, 2014
by
神楽坂玲奈
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1.3.8
parent
cc2da82b
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
39 additions
and
21 deletions
+39
-21
lib/scene_title.rb
lib/scene_title.rb
+14
-2
lib/update.rb
lib/update.rb
+1
-1
lib/window_lobbybuttons.rb
lib/window_lobbybuttons.rb
+22
-16
lib/window_title.rb
lib/window_title.rb
+2
-2
No files found.
lib/scene_title.rb
View file @
583e0311
...
...
@@ -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
...
...
lib/update.rb
View file @
583e0311
...
...
@@ -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
...
...
lib/window_lobbybuttons.rb
View file @
583e0311
...
...
@@ -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
"http
s
://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
|
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
f
.
read
=~
/^mycard:\/\/([\d\.]+):(\d+)\/(.*?)(\?server_auth=true)?$/
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
(
'自动匹配非法回复'
){
f
.
read
}
Widget_Msgbox
.
new
(
"自动匹配"
,
"错误:
#{
exception
}
"
,
ok:
"确定"
)
$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
...
...
lib/window_title.rb
View file @
583e0311
...
...
@@ -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
))
...
...
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