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
d0b8b5a5
Commit
d0b8b5a5
authored
Nov 16, 2011
by
神楽坂玲奈
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
卡片操作初步
parent
0e7ae05a
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
72 additions
and
29 deletions
+72
-29
config.yml
config.yml
+7
-7
lib/window_action.rb
lib/window_action.rb
+10
-5
lib/window_field.rb
lib/window_field.rb
+39
-1
nbproject/project.xml
nbproject/project.xml
+16
-16
No files found.
config.yml
View file @
d0b8b5a5
---
fullscreen
:
false
width
:
1024
height
:
768
autologin
:
true
username
:
zh99997
password
:
"
111111"
---
fullscreen
:
false
width
:
1024
height
:
768
autologin
:
true
username
:
zh99997
password
:
"
111111"
lib/window_action.rb
View file @
d0b8b5a5
...
...
@@ -2,9 +2,13 @@
# and open the template in the editor.
class
Window_Action
<
Window_List
Color
=
[
0x00
,
0x00
,
0x00
]
Color_Disabled
=
[
0x66
,
0x66
,
0x66
]
Color_Selected
=
[
0x00
,
0x00
,
0xFF
]
def
initialize
(
x
,
y
,
list
,
list_available
=
Array
.
new
(
list
.
size
,
true
))
super
(
x
,
y
,
100
,
list
.
size
*
WLH
,
300
)
@list
=
list
@list_available
=
list_available
@item_max
=
@list
.
size
@font
=
TTF
.
open
(
'fonts/WenQuanYi Micro Hei.ttf'
,
16
)
refresh
...
...
@@ -16,15 +20,16 @@ class Window_Action < Window_List
def
draw_item
(
index
,
status
=
0
)
case
status
when
0
@font
.
draw_blended_utf8
(
@contents
,
@list
[
index
]
,
0
,
index
*
WLH
,
0x00
,
0x00
,
0x00
)
color
=
@list_available
[
index
]
?
Color
:
Color_Disabled
@font
.
draw_blended_utf8
(
@contents
,
@list
[
index
]
,
0
,
index
*
WLH
,
*
color
)
when
1
@font
.
draw_blended_utf8
(
@contents
,
@list
[
index
]
,
0
,
index
*
WLH
,
0x00
,
0x00
,
0xFF
)
@font
.
draw_blended_utf8
(
@contents
,
@list
[
index
]
,
0
,
index
*
WLH
,
*
Color_Selected
)
end
end
def
next
if
index
=
@list
[
@index
.
next
...
@list
.
size
].
find_index
(
true
)
self
.
index
=
index
elsif
index
=
@list
[
0
..
@index
].
find_index
(
true
)
if
index
=
@list
_available
[
@index
.
next
...
@list
.
size
].
find_index
(
true
)
self
.
index
=
index
+
@index
.
next
elsif
index
=
@list
_available
[
0
..
@index
].
find_index
(
true
)
self
.
index
=
index
else
self
.
index
=
(
@index
+
1
)
%
@list
.
size
...
...
lib/window_field.rb
View file @
d0b8b5a5
...
...
@@ -73,7 +73,45 @@ class Window_Field < Window
else
@index
=
index
draw_item
(
@index
,
1
)
@action_window
=
Window_Action
.
new
(
@x
+
@items
[
index
][
0
],
@y
+
@items
[
index
][
1
],[
"测试动作1"
,
"测试动作2"
,
"测试动作3"
])
case
@index
when
:deck
@action_names
=
[
"抽卡"
,
"卡组洗切"
,
"抽卡(双方确认)"
,
"顶牌回卡组底部"
,
"顶牌送入墓地"
,
"顶牌从游戏中除外"
,
"顶牌背面除外"
,
"确认顶牌"
,
"双方确认顶牌"
]
@action_avalable
=
[
true
,
true
,
false
,
false
,
false
,
false
,
false
,
false
]
when
:extra
@action_names
=
[
"特殊召唤/发动"
,
"效果发动"
,
"从游戏中除外"
,
"送入墓地"
]
@action_avalable
=
[
true
,
true
,
false
,
false
]
when
:removed
@action_names
=
[
"特殊召唤/发动"
,
"效果发动"
,
"加入手卡"
,
"返回卡组"
,
"送入墓地"
]
@action_avalable
=
[
true
,
true
,
false
,
false
,
false
]
when
:graveyard
@action_names
=
[
"特殊召唤/发动"
,
"效果发动"
,
"加入手卡"
,
"返回卡组"
,
"从游戏中除外"
]
@action_avalable
=
[
true
,
true
,
false
,
false
,
false
]
end
@action_window
=
Window_Action
.
new
(
@x
+
@items
[
index
][
0
],
@y
+
@items
[
index
][
1
]
-
@action_names
.
size
*
Window_Action
::
WLH
,
@action_names
,
@action_avalable
)
end
end
def
mousemoved
(
x
,
y
)
...
...
nbproject/project.xml
View file @
d0b8b5a5
<?xml version="1.0" encoding="UTF-8"?>
<project
xmlns=
"http://www.netbeans.org/ns/project/1"
>
<type>
org.netbeans.modules.ruby.rubyproject
</type>
<configuration>
<data
xmlns=
"http://www.netbeans.org/ns/ruby-project/1"
>
<name>
iduel
</name>
<source-roots>
<root
id=
"src.dir"
/>
</source-roots>
<test-roots>
<root
id=
"test.src.dir"
/>
<root
id=
"spec.src.dir"
/>
</test-roots>
</data>
</configuration>
</project>
<?xml version="1.0" encoding="UTF-8"?>
<project
xmlns=
"http://www.netbeans.org/ns/project/1"
>
<type>
org.netbeans.modules.ruby.rubyproject
</type>
<configuration>
<data
xmlns=
"http://www.netbeans.org/ns/ruby-project/1"
>
<name>
iduel
</name>
<source-roots>
<root
id=
"src.dir"
/>
</source-roots>
<test-roots>
<root
id=
"test.src.dir"
/>
<root
id=
"spec.src.dir"
/>
</test-roots>
</data>
</configuration>
</project>
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