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
54a59906
Commit
54a59906
authored
Mar 08, 2012
by
神楽坂玲奈
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ygocore thc
parent
d34b5cfe
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
36 additions
and
11 deletions
+36
-11
graphics/lobby/button.png
graphics/lobby/button.png
+0
-0
lib/scene_lobby.rb
lib/scene_lobby.rb
+6
-5
lib/window_announcements.rb
lib/window_announcements.rb
+1
-0
lib/window_host.rb
lib/window_host.rb
+23
-0
lib/ygocore/game.rb
lib/ygocore/game.rb
+6
-6
No files found.
graphics/lobby/button.png
0 → 100644
View file @
54a59906
This diff was suppressed by a .gitattributes entry.
lib/scene_lobby.rb
View file @
54a59906
...
@@ -10,6 +10,7 @@ class Scene_Lobby < Scene
...
@@ -10,6 +10,7 @@ class Scene_Lobby < Scene
require_relative
'window_userinfo'
require_relative
'window_userinfo'
require_relative
'window_roomlist'
require_relative
'window_roomlist'
require_relative
'window_chat'
require_relative
'window_chat'
require_relative
'window_host'
require_relative
'chatmessage'
require_relative
'chatmessage'
require_relative
'scene_duel'
require_relative
'scene_duel'
attr_reader
:chat_window
attr_reader
:chat_window
...
@@ -22,7 +23,7 @@ class Scene_Lobby < Scene
...
@@ -22,7 +23,7 @@ class Scene_Lobby < Scene
@userlist
=
Window_UserList
.
new
(
24
,
204
,
$game
.
users
)
@userlist
=
Window_UserList
.
new
(
24
,
204
,
$game
.
users
)
@roomlist
=
Window_RoomList
.
new
(
320
,
50
,
$game
.
rooms
)
@roomlist
=
Window_RoomList
.
new
(
320
,
50
,
$game
.
rooms
)
@userinfo
=
Window_UserInfo
.
new
(
24
,
24
,
$game
.
user
)
@userinfo
=
Window_UserInfo
.
new
(
24
,
24
,
$game
.
user
)
@host_window
=
Window_Host
.
new
(
900
,
16
)
@active_window
=
@roomlist
@active_window
=
@roomlist
@chat_window
=
Window_Chat
.
new
(
313
,
543
,
698
,
212
)
@chat_window
=
Window_Chat
.
new
(
313
,
543
,
698
,
212
)
@count
=
0
@count
=
0
...
@@ -40,11 +41,11 @@ class Scene_Lobby < Scene
...
@@ -40,11 +41,11 @@ class Scene_Lobby < Scene
when
Key
::
RETURN
when
Key
::
RETURN
@active_window
.
clicked
@active_window
.
clicked
when
Key
::
F2
when
Key
::
F2
@joinroom_msgbox
=
Widget_Msgbox
.
new
(
"创建房间"
,
"正在等待对手"
)
#
@joinroom_msgbox = Widget_Msgbox.new("创建房间", "正在等待对手")
$game
.
host
(
"test"
)
$game
.
host
Room
.
new
(
0
,
$game
.
user
.
name
)
when
Key
::
F3
when
Key
::
F3
@joinroom_msgbox
=
Widget_Msgbox
.
new
(
"加入房间"
,
"正在加入房间"
)
#
@joinroom_msgbox = Widget_Msgbox.new("加入房间", "正在加入房间")
$game
.
join
'localhost'
#
$game.join 'localhost'
when
Key
::
F5
when
Key
::
F5
if
@roomlist
.
items
and
room
=
@roomlist
.
items
.
find
{
|
room
|
room
.
player1
==
$game
.
user
or
room
.
player2
==
$game
.
user
}
if
@roomlist
.
items
and
room
=
@roomlist
.
items
.
find
{
|
room
|
room
.
player1
==
$game
.
user
or
room
.
player2
==
$game
.
user
}
$game
.
qroom
room
$game
.
qroom
room
...
...
lib/window_announcements.rb
View file @
54a59906
...
@@ -61,6 +61,7 @@ class Window_Announcements < Window
...
@@ -61,6 +61,7 @@ class Window_Announcements < Window
super
super
end
end
def
clicked
def
clicked
return
unless
@item
require
'launchy'
require
'launchy'
Launchy
.
open
(
@item
.
url
)
if
@item
.
url
Launchy
.
open
(
@item
.
url
)
if
@item
.
url
end
end
...
...
lib/window_host.rb
0 → 100644
View file @
54a59906
#encoding: UTF-8
class
Window_Host
<
Window_List
def
initialize
(
x
,
y
)
super
(
x
,
y
,
86
,
30
)
@items
=
[
"新房间"
]
@button
=
Surface
.
load
(
"graphics/lobby/button.png"
)
@font
=
TTF
.
open
(
"fonts/WenQuanYi Micro Hei.ttf"
,
16
)
refresh
end
def
draw_item
(
index
,
status
=
0
)
Surface
.
blit
(
@button
,
status
*
@button
.
w
/
3
,
0
,
@button
.
w
/
3
,
@button
.
h
,
@contents
,
0
,
0
)
@font
.
draw_blended_utf8
(
@contents
,
"新房间"
,
16
,
5
,
20
,
10
,
180
)
end
def
mousemoved
(
x
,
y
)
self
.
index
=
0
end
def
lostfocus
(
active_window
=
nil
)
self
.
index
=
nil
end
def
clicked
$game
.
join
Room
.
new
(
0
,
$game
.
user
.
name
)
end
end
lib/ygocore/game.rb
View file @
54a59906
...
@@ -2,9 +2,9 @@
...
@@ -2,9 +2,9 @@
load
File
.
expand_path
(
'window_login.rb'
,
File
.
dirname
(
__FILE__
))
load
File
.
expand_path
(
'window_login.rb'
,
File
.
dirname
(
__FILE__
))
require
'open-uri'
require
'open-uri'
class
Ygocore
<
Game
class
Ygocore
<
Game
Register_Url
=
'http://
sh.convnet.net:7955/regist
.html'
Register_Url
=
'http://
140.113.242.65/register
.html'
Port
=
7911
Port
=
7911
Server
=
'
221.226.68.62
'
Server
=
'
140.113.242.65
'
WM_LBUTTONDOWN
=
0x201
WM_LBUTTONDOWN
=
0x201
WM_LBUTTONUP
=
0x202
WM_LBUTTONUP
=
0x202
...
@@ -128,7 +128,7 @@ class Ygocore < Game
...
@@ -128,7 +128,7 @@ class Ygocore < Game
def
refresh
def
refresh
Thread
.
new
do
Thread
.
new
do
begin
begin
open
(
'http://
sh.convnet.net
:7922/'
)
do
|
file
|
open
(
'http://
140.113.242.65
:7922/'
)
do
|
file
|
file
.
set_encoding
(
"GBK"
)
file
.
set_encoding
(
"GBK"
)
info
=
file
.
read
.
encode
(
"UTF-8"
)
info
=
file
.
read
.
encode
(
"UTF-8"
)
Game_Event
.
push
Game_Event
::
AllUsers
.
parse
info
Game_Event
.
push
Game_Event
::
AllUsers
.
parse
info
...
@@ -149,11 +149,11 @@ class Ygocore < Game
...
@@ -149,11 +149,11 @@ class Ygocore < Game
$config
[
'ygocore'
][
'announcements'
]
||=
[
Announcement
.
new
(
"正在读取公告..."
,
nil
,
nil
)]
$config
[
'ygocore'
][
'announcements'
]
||=
[
Announcement
.
new
(
"正在读取公告..."
,
nil
,
nil
)]
Thread
.
new
do
Thread
.
new
do
begin
begin
open
(
'http://
sh.convnet.net
:7922/'
)
do
|
file
|
open
(
'http://
140.113.242.65
:7922/'
)
do
|
file
|
file
.
set_encoding
"GBK"
file
.
set_encoding
"GBK"
announcements
=
[]
announcements
=
[]
file
.
read
.
scan
(
/<div style="color:red" >
(.*?)<\/div>/
).
each
do
|
title
,
others
|
file
.
read
.
encode
(
"UTF-8"
).
scan
(
/<div style="color:red" >公告:
(.*?)<\/div>/
).
each
do
|
title
,
others
|
announcements
<<
Announcement
.
new
(
title
.
encode
(
"UTF-8"
),
"http://sh.convnet.net:7922
/"
,
nil
)
announcements
<<
Announcement
.
new
(
title
,
"http://140.113.242.65
/"
,
nil
)
end
end
$config
[
'ygocore'
][
'announcements'
].
replace
announcements
$config
[
'ygocore'
][
'announcements'
].
replace
announcements
save_config
save_config
...
...
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