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
8b973851
Commit
8b973851
authored
Jun 05, 2012
by
神楽坂玲奈
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
OS数据库更新至0530, OS卡组导入ygocore
parent
4f13bad6
Changes
5
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
178 additions
and
129 deletions
+178
-129
data/data.sqlite
data/data.sqlite
+0
-0
lib/deck.rb
lib/deck.rb
+2
-4
lib/scene_title.rb
lib/scene_title.rb
+1
-0
lib/window_lobbybuttons.rb
lib/window_lobbybuttons.rb
+49
-42
lib/ygocore/game.rb
lib/ygocore/game.rb
+126
-83
No files found.
data/data.sqlite
View file @
8b973851
No preview for this file type
lib/deck.rb
View file @
8b973851
...
@@ -4,14 +4,12 @@
...
@@ -4,14 +4,12 @@
#------------------------------------------------------------------------------
#------------------------------------------------------------------------------
# title
# title
#==============================================================================
#==============================================================================
require_relative
'card'
class
Deck
class
Deck
attr_accessor
:main
attr_accessor
:main
attr_accessor
:side
attr_accessor
:side
attr_accessor
:extra
attr_accessor
:extra
attr_accessor
:temp
attr_accessor
:temp
#DeckPath = '/media/44CACC1DCACC0D5C/game/yu-gi-oh/deck'
DeckPath
=
'E:/game/yu-gi-oh/deck'
def
initialize
(
main
,
side
=
[],
extra
=
[],
temp
=
[])
def
initialize
(
main
,
side
=
[],
extra
=
[],
temp
=
[])
@main
=
main
@main
=
main
@side
=
side
@side
=
side
...
@@ -24,7 +22,7 @@ class Deck
...
@@ -24,7 +22,7 @@ class Deck
extra
=
[]
extra
=
[]
temp
=
[]
temp
=
[]
now
=
main
now
=
main
open
(
File
.
expand_path
(
name
,
DeckPath
)
)
do
|
file
|
open
(
name
)
do
|
file
|
file
.
set_encoding
"GBK"
,
"UTF-8"
,
:invalid
=>
:replace
,
:undef
=>
:replace
file
.
set_encoding
"GBK"
,
"UTF-8"
,
:invalid
=>
:replace
,
:undef
=>
:replace
while
line
=
file
.
readline
.
chomp!
while
line
=
file
.
readline
.
chomp!
case
line
case
line
...
...
lib/scene_title.rb
View file @
8b973851
...
@@ -37,6 +37,7 @@ class Scene_Title < Scene
...
@@ -37,6 +37,7 @@ class Scene_Title < Scene
when
2
when
2
require_relative
'widget_msgbox'
require_relative
'widget_msgbox'
require_relative
'scene_login'
require_relative
'scene_login'
require_relative
'deck'
load
'lib/ygocore/game.rb'
#TODO:不规范啊不规范
load
'lib/ygocore/game.rb'
#TODO:不规范啊不规范
Ygocore
.
deck_edit
Ygocore
.
deck_edit
when
3
when
3
...
...
lib/window_lobbybuttons.rb
View file @
8b973851
require_relative
'window_host'
require_relative
'window_host'
class
Window_LobbyButtons
<
Window_List
class
Window_LobbyButtons
<
Window_List
def
initialize
(
x
,
y
)
def
initialize
(
x
,
y
)
@items
=
[
"常见问题"
,
"卡组编辑"
,
"建立房间"
]
@items
=
[
"常见问题"
,
"卡组编辑"
,
"建立房间"
]
@button
=
Surface
.
load
(
"graphics/lobby/button.png"
)
@button
=
Surface
.
load
(
"graphics/lobby/button.png"
)
super
(
x
,
y
,
@items
.
size
*
@button
.
w
/
3
+
@items
.
size
*
4
,
30
)
super
(
x
,
y
,
@items
.
size
*
@button
.
w
/
3
+
@items
.
size
*
4
,
30
)
@font
=
TTF
.
open
(
"fonts/wqy-microhei.ttc"
,
15
)
@font
=
TTF
.
open
(
"fonts/wqy-microhei.ttc"
,
15
)
refresh
refresh
end
end
def
draw_item
(
index
,
status
=
0
)
x
,
y
=
item_rect
(
index
)
def
draw_item
(
index
,
status
=
0
)
Surface
.
blit
(
@button
,
status
*
@button
.
w
/
3
,
0
,
@button
.
w
/
3
,
@button
.
h
,
@contents
,
x
,
y
)
x
,
y
=
item_rect
(
index
)
draw_stroked_text
(
@items
[
index
],
x
+
8
,
y
+
3
,
2
,
@font
,[
0xdf
,
0xf1
,
0xff
],
[
0x27
,
0x43
,
0x59
])
Surface
.
blit
(
@button
,
status
*
@button
.
w
/
3
,
0
,
@button
.
w
/
3
,
@button
.
h
,
@contents
,
x
,
y
)
end
draw_stroked_text
(
@items
[
index
],
x
+
8
,
y
+
3
,
2
,
@font
,
[
0xdf
,
0xf1
,
0xff
],
[
0x27
,
0x43
,
0x59
])
def
item_rect
(
index
)
end
[
index
*
@button
.
w
/
3
+
(
index
)
*
4
,
0
,
@button
.
w
/
3
,
@height
]
end
def
item_rect
(
index
)
def
mousemoved
(
x
,
y
)
[
index
*
@button
.
w
/
3
+
(
index
)
*
4
,
0
,
@button
.
w
/
3
,
@height
]
if
(
x
-
@x
)
%
(
@button
.
w
/
3
+
4
)
>=
@button
.
w
/
3
end
self
.
index
=
nil
else
def
mousemoved
(
x
,
y
)
self
.
index
=
(
x
-
@x
)
/
(
@button
.
w
/
3
+
4
)
if
(
x
-
@x
)
%
(
@button
.
w
/
3
+
4
)
>=
@button
.
w
/
3
end
self
.
index
=
nil
end
else
def
lostfocus
(
active_window
=
nil
)
self
.
index
=
(
x
-
@x
)
/
(
@button
.
w
/
3
+
4
)
self
.
index
=
nil
end
end
end
def
clicked
case
@index
def
lostfocus
(
active_window
=
nil
)
when
0
#常见问题
self
.
index
=
nil
require_relative
'dialog'
end
Dialog
.
web
"http://card.touhou.cc/login?user[name]=
#{
CGI
.
escape
$game
.
user
.
name
}
&user[password]=
#{
CGI
.
escape
$game
.
password
}
&continue=/topics/1453"
when
1
#卡组编辑
def
clicked
$game
.
class
.
deck_edit
case
@index
when
2
#建立房间
when
0
#常见问题
@host_window
=
Window_Host
.
new
(
300
,
200
)
require_relative
'dialog'
end
Dialog
.
web
"http://card.touhou.cc/login?user[name]=
#{
CGI
.
escape
$game
.
user
.
name
}
&user[password]=
#{
CGI
.
escape
$game
.
password
}
&continue=/topics/1453"
end
when
1
#卡组编辑
def
update
require_relative
'deck'
@host_window
.
update
if
@host_window
and
!
@host_window
.
destroyed?
$game
.
class
.
deck_edit
end
when
2
#建立房间
end
@host_window
=
Window_Host
.
new
(
300
,
200
)
end
end
def
update
@host_window
.
update
if
@host_window
and
!
@host_window
.
destroyed?
end
end
lib/ygocore/game.rb
View file @
8b973851
This diff is collapsed.
Click to expand it.
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