Commit d0b8b5a5 authored by 神楽坂玲奈's avatar 神楽坂玲奈

卡片操作初步

parent 0e7ae05a
......@@ -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
......
......@@ -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)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment