Commit 048ddc28 authored by 神楽坂玲奈's avatar 神楽坂玲奈

手卡描绘

parent d0b8b5a5
cd /d %~dp0
del graphics\avatars\*_*.png
del Thumbs.db /s /F /A:S
\ No newline at end of file
No preview for this file type
This diff was suppressed by a .gitattributes entry.
This diff was suppressed by a .gitattributes entry.
This diff was suppressed by a .gitattributes entry.
...@@ -12,7 +12,7 @@ class Card ...@@ -12,7 +12,7 @@ class Card
@db.results_as_hash = true @db.results_as_hash = true
#PicPath = '/media/44CACC1DCACC0D5C/game/yu-gi-oh/YGODATA/YGOPIC' #PicPath = '/media/44CACC1DCACC0D5C/game/yu-gi-oh/YGODATA/YGOPIC'
PicPath = 'E:/game/yu-gi-oh/YGODATA/YGOPIC' PicPath = 'E:/game/yu-gi-oh/YGODATA/YGOPIC'
CardBack = Surface.load "graphics/field/card.png" CardBack = Surface.load "graphics/field/card.jpg"
class << self class << self
def find(id, order_by=nil) def find(id, order_by=nil)
case id case id
...@@ -24,7 +24,7 @@ class Card ...@@ -24,7 +24,7 @@ class Card
when Hash when Hash
old_new(id) old_new(id)
when nil when nil
Card.find(1).instance_eval{@image = CardBack} unless @all[1] Card.find(1)#.instance_eval{@image = CardBack} unless @all[1]
@all[1] @all[1]
else else
sql = "select * from YGODATA where " << id sql = "select * from YGODATA where " << id
...@@ -110,18 +110,22 @@ class Card ...@@ -110,18 +110,22 @@ class Card
@all.clear #清空缓存 @all.clear #清空缓存
end end
end end
attr_accessor :id attr_accessor :id
attr_accessor :name attr_accessor :number
attr_accessor :type attr_accessor :name
attr_accessor :race attr_accessor :card_type
attr_accessor :attrbuite attr_accessor :monster_type
attr_accessor :depict attr_accessor :atk
attr_accessor :ban attr_accessor :def
attr_accessor :adjust attr_accessor :attribute
attr_accessor :effecttype attr_accessor :type
attr_accessor :starnum attr_accessor :level
attr_accessor :atk attr_accessor :lore
attr_accessor :def attr_accessor :status
attr_accessor :stats
attr_accessor :archettypes
attr_accessor :mediums
attr_accessor :tokens
def initialize(hash) def initialize(hash)
@id = hash['id'].to_i @id = hash['id'].to_i
...@@ -147,9 +151,12 @@ class Card ...@@ -147,9 +151,12 @@ class Card
@image ||= Surface.load "#{PicPath}/#{@id-1}.jpg" rescue Surface.load "graphics/field/card.png" @image ||= Surface.load "#{PicPath}/#{@id-1}.jpg" rescue Surface.load "graphics/field/card.png"
end end
def image_small def image_small
@image_small ||= image.transform_surface(0,0,54.0/image.w, 81.0/image.h,0) @image_small ||= image.transform_surface(0,0,54.0/image.w, 81.0/image.h,0).copy_rect(1,1,54,81) #尼玛!
end end
def unknown? def unknown?
@id == 1 @id == 1
end end
def monster?
!@attribute.nil?
end
end end
\ No newline at end of file
...@@ -200,6 +200,11 @@ class Action ...@@ -200,6 +200,11 @@ class Action
"[#{@id}] ◎→[11年3月1日禁卡表]先攻" "[#{@id}] ◎→[11年3月1日禁卡表]先攻"
end end
end end
class Draw
def escape
"[#{@id}] ◎→抽牌"
end
end
class Reset class Reset
def escape def escape
"[#{@id}] ◎→[11年3月1日禁卡表] Duel!!" "[#{@id}] ◎→[11年3月1日禁卡表] Duel!!"
......
...@@ -14,12 +14,15 @@ class Scene ...@@ -14,12 +14,15 @@ class Scene
start start
while $scene == self while $scene == self
update update
sleep 0.01 #sleep 0.01
end end
terminate terminate
end end
def initialize def initialize
@windows = [] @windows = []
#@fps = Window.new(0,0,100,24)
#@font = TTF.open('fonts/WenQuanYi Micro Hei.ttf', 16)
#@fpscount = 0
end end
#-------------------------------------------------------------------------- #--------------------------------------------------------------------------
# ● 开始处理 # ● 开始处理
...@@ -49,9 +52,13 @@ class Scene ...@@ -49,9 +52,13 @@ class Scene
while event = Event.poll while event = Event.poll
handle(event) handle(event)
end end
#@fps.clear(0,0,100,24)
#@font.draw_blended_utf8(@fps.contents, @fpscount, 160, 12, 0x00,0x00,0x00)
#@fpscount += 1
$screen.put(@background,0,0) $screen.put(@background,0,0)
@windows.each do |window| @windows.each do |window|
$screen.put(window.contents, window.x, window.y) if window.contents Surface.blit(window.contents, *window.viewport, $screen, window.x, window.y) if window.contents && window.visible
#$screen.put(window.contents, window.x, window.y) if window.contents && window.visible
end end
$screen.update_rect(0,0,0,0) $screen.update_rect(0,0,0,0)
end end
......
...@@ -15,6 +15,9 @@ class Scene_Duel < Scene ...@@ -15,6 +15,9 @@ class Scene_Duel < Scene
require_relative 'game_card' require_relative 'game_card'
require_relative 'game_field' require_relative 'game_field'
attr_reader :cardinfo_window
attr_reader :action_window
def initialize(room) def initialize(room)
super() super()
@room = room @room = room
...@@ -28,7 +31,6 @@ class Scene_Duel < Scene ...@@ -28,7 +31,6 @@ class Scene_Duel < Scene
@player1_lp = Window_LP.new(0,0, @room.player1, true) @player1_lp = Window_LP.new(0,0, @room.player1, true)
@player2_lp = Window_LP.new(360,0, @room.player2, false) @player2_lp = Window_LP.new(360,0, @room.player2, false)
@phases_window = Window_Phases.new(124, 357) @phases_window = Window_Phases.new(124, 357)
@turn_player = true @turn_player = true
...@@ -40,15 +42,19 @@ class Scene_Duel < Scene ...@@ -40,15 +42,19 @@ class Scene_Duel < Scene
Action.player_field = @player_field Action.player_field = @player_field
Action.opponent_field = @opponent_field Action.opponent_field = @opponent_field
@cardinfo_window = Window_CardInfo.new(1024-160, 0)
@action_window = Window_Action.new
$screen.update_rect(0,0,0,0) $screen.update_rect(0,0,0,0)
end end
def change_phase(phase) def change_phase(phase)
Action::ChangePhase.new(@turn_player, [:DP, :SP, :M1, :BP, :M2, :EP][phase]).run
if phase == 5 if phase == 5
@turn_player = !@turn_player @turn_player = !@turn_player
@phase = 0 @phase = 0
@phases_window.player = @turn_player @phases_window.player = @turn_player
Action::Turn_End.new(true, "Turn End", @player_field.lp, @player_field.hand.size, @player_field.deck.size, @player_field.graveyard.size, @player_field.removed.size, @player_field, 1).run Action::Turn_End.new(true, "Turn End", @player_field.lp, @player_field.hand.size, @player_field.deck.size, @player_field.graveyard.size, @player_field.removed.size, @player_field, 1).run
else else
@phase = @phases_window.phase = phase @phase = @phases_window.phase = phase
...@@ -65,11 +71,14 @@ class Scene_Duel < Scene ...@@ -65,11 +71,14 @@ class Scene_Duel < Scene
def handle(event) def handle(event)
case event case event
when Event::MouseMotion when Event::MouseMotion
if @active_window and !@active_window.include? event.x, event.y
@active_window.lostfocus
end
self.windows.reverse.each do |window| self.windows.reverse.each do |window|
if window.include? event.x, event.y if window.include? event.x, event.y
@active_window = window @active_window = window
@active_window.mousemoved(event.x, event.y) @active_window.mousemoved(event.x, event.y)
break break true
end end
end end
when Event::MouseButtonDown when Event::MouseButtonDown
...@@ -94,8 +103,8 @@ class Scene_Duel < Scene ...@@ -94,8 +103,8 @@ class Scene_Duel < Scene
end end
end end
when Mouse::BUTTON_RIGHT when Mouse::BUTTON_RIGHT
if @player_field_window.action_window if @action_window
@player_field_window.action_window.next @action_window.next
end end
end end
when Event::KeyDown when Event::KeyDown
...@@ -119,6 +128,7 @@ class Scene_Duel < Scene ...@@ -119,6 +128,7 @@ class Scene_Duel < Scene
def handle_iduel(event) def handle_iduel(event)
case event case event
when Iduel::Event::Action when Iduel::Event::Action
p event
event.action.run event.action.run
@player_field_window.refresh @player_field_window.refresh
@opponent_field_window.refresh @opponent_field_window.refresh
......
class Window class Window
WLH = 24 WLH = 24
attr_reader :x, :y, :width, :height, :z, :contents attr_accessor :x, :y, :width, :height, :z, :contents, :angle, :visible, :viewport
def initialize(x, y, width, height, z=200) def initialize(x, y, width, height, z=200)
@x = x @x = x
@y = y @y = y
@z = z @z = z
@width = width @width = width
@height = height @height = height
@visible = true
@viewport = [0, 0, @width, @height]
big_endian = ([1].pack("N") == [1].pack("L"))
=begin
if big_endian
rmask = 0xff000000
gmask = 0x00ff0000
bmask = 0x0000ff00
amask = 0x000000ff
else
rmask = 0x000000ff
gmask = 0x0000ff00
bmask = 0x00ff0000
amask = 0xff000000
end
#p rmask, gmask, bmask, amask
=end
amask = 0xff000000
rmask = 0x00ff0000
gmask = 0x0000ff00
bmask = 0x000000ff
unless @background unless @background
@background = Surface.new(SWSURFACE|SRCALPHA, @width, @height, 32, 0xFF0000, 0x00FF00, 0x0000FF, 0xFF000000) @background = Surface.new(SWSURFACE, @width, @height, 32, rmask, gmask, bmask, amask)
@background.fill_rect(0,0,@width,@height,0xFF00FF00) @background.fill_rect(0,0,@width,@height,0x66000000)
end end
unless @contents unless @contents
@contents = Surface.new(SWSURFACE|SRCALPHA, @width, @height, 32, 0xFF0000, 0x00FF00, 0x0000FF, 0xFF000000) @contents = Surface.new(SWSURFACE, @width, @height, 32, rmask, gmask, bmask, amask)
@contents.fill_rect(0,0,@width,@height,0xFF00FF00) @contents.fill_rect(0,0,@width,@height,0x66000000)
end end
#按Z坐标插入 #按Z坐标插入
unless $scene.windows.each_with_index do |window, index| unless $scene.windows.each_with_index do |window, index|
...@@ -53,4 +74,7 @@ class Window ...@@ -53,4 +74,7 @@ class Window
def clicked def clicked
#子类定义 #子类定义
end end
def lostfocus
#子类定义
end
end end
\ No newline at end of file
...@@ -5,19 +5,36 @@ class Window_Action < Window_List ...@@ -5,19 +5,36 @@ class Window_Action < Window_List
Color = [0x00,0x00,0x00] Color = [0x00,0x00,0x00]
Color_Disabled = [0x66,0x66,0x66] Color_Disabled = [0x66,0x66,0x66]
Color_Selected = [0x00,0x00,0xFF] Color_Selected = [0x00,0x00,0xFF]
def initialize(x,y,list,list_available=Array.new(list.size, true)) def initialize#,list,list_available=Array.new(list.size, true))
super(x,y,100,list.size*WLH,300) super(0,0,100,20*WLH,300)
@list = list @background.fill_rect(0,0,@width, @height, 0xCC555500)
@list_available = list_available @contents.fill_rect(0,0,@width, @height, 0xCC555500)
@item_max = @list.size
@font = TTF.open('fonts/WenQuanYi Micro Hei.ttf', 16) @font = TTF.open('fonts/WenQuanYi Micro Hei.ttf', 16)
refresh @visible = false
self.index = @list.find_index(true) || 0
end end
def list=(list)
if list
@list = list.keys
@list_available = list.values
@height = @viewport[3] = @list.size*WLH
@contents.fill_rect(0,0,@width, @viewport[3], 0xCC555500)
@item_max = @list.size
@index = @list_available.find_index(true) || 0
refresh
#p @index
@visible = true
else
@visible = false
end
end
def index=(index) def index=(index)
super(index) if index super(index) if index
#p @index
end end
def draw_item(index, status=0) def draw_item(index, status=0)
#p index, status, @index
case status case status
when 0 when 0
color = @list_available[index] ? Color : Color_Disabled color = @list_available[index] ? Color : Color_Disabled
...@@ -38,4 +55,6 @@ class Window_Action < Window_List ...@@ -38,4 +55,6 @@ class Window_Action < Window_List
def mousemoved(x,y) def mousemoved(x,y)
self.index = (y - @y) / WLH self.index = (y - @y) / WLH
end end
def lostfocus
end
end end
# To change this template, choose Tools | Templates
# and open the template in the editor.
class Window_CardInfo < Window
WLH = 20
def initialize(x,y)
super(x,y,160,768,300)
@font = TTF.open("fonts/WenQuanYi Micro Hei.ttf", 16)
self.card = nil
end
def card=(card)
@card = card || Card.find(nil)
refresh
end
def refresh
@contents.put @card.image,0,0
@contents.fill_rect(0,230, @width, @height-230,0xCC005555)
@font.draw_blended_utf8(@contents, "[#{@card.name}]", 0, 230, 0xFF, 0xFF, 0x55)
start = 0
line = 0
@card.lore.size.times do |char|
if @font.text_size(@card.lore[start..char])[0] > @width
@font.draw_blended_utf8(@contents, @card.lore[start...char], 0, 254+line*WLH, 0xFF, 0xFF, 0xFF)
start = char
line = line.next
end
end
if start <= @card.lore.size - 1
@font.draw_blended_utf8(@contents, @card.lore[start...@card.lore.size], 0, 254+line*WLH, 0xFF, 0xFF, 0xFF)
end
end
end
#encoding: UTF-8
#============================================================================== #==============================================================================
# ■ Scene_Title # ■ Scene_Title
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
...@@ -7,6 +8,7 @@ ...@@ -7,6 +8,7 @@
class Window_Field < Window class Window_Field < Window
require 'card' require 'card'
require 'window_action' require 'window_action'
require 'window_cardinfo'
Field_Pos = [[56,0], #场地魔法 Field_Pos = [[56,0], #场地魔法
[140, 84], [234,84], [328,84],[422,84], [516, 84], #后场 [140, 84], [234,84], [328,84],[422,84], [516, 84], #后场
[140, 0], [234, 0], [328, 0],[422, 0], [516, 0]] #前场 [140, 0], [234, 0], [328, 0],[422, 0], [516, 0]] #前场
...@@ -15,47 +17,59 @@ class Window_Field < Window ...@@ -15,47 +17,59 @@ class Window_Field < Window
Removed_Pos = [657,0] #除外区 Removed_Pos = [657,0] #除外区
Deck_Pos = [598, 84] Deck_Pos = [598, 84]
Hand_Pos = [0, 201, 62, 8] #手卡: x, y, width, 间距 Hand_Pos = [0, 201, 62, 8] #手卡: x, y, width, 间距
Card_Size = [Card::CardBack.w, Card::CardBack.h] #Card_Size = [Card::CardBack.w, Card::CardBack.h]
Card_Size = [54, 81]
attr_reader :action_window attr_reader :action_window
def initialize(x, y, field,player=true) def initialize(x, y, field,player=true)
@border = Surface.load 'graphics/field/border.png'
super(x,y,711,282) super(x,y,711,282)
@field = field @field = field
@player = player @player = player
@items = { @items = {}
:deck => Deck_Pos + Card_Size, @cards = {}
:extra => Extra_Pos + Card_Size,
:removed => Removed_Pos + Card_Size,
:graveyard => Graveyard_Pos + Card_Size,
}
refresh refresh
end end
def refresh def refresh
@items.each_key{|index|draw_item(index)} @items.clear
@cards.clear
if !@field.deck.empty?
@items[:deck] = Deck_Pos + Card_Size
@cards[:deck] = @field.deck.first
end
if !@field.extra.empty?
@items[:extra] = Extra_Pos + Card_Size
@cards[:extra] = @field.extra.first
end
if !@field.removed.empty?
@items[:removed] = Removed_Pos + Card_Size
@cards[:removed] = @field.extra.first
end
if !@field.graveyard.empty?
@items[:graveyard] = Graveyard_Pos + Card_Size
@cards[:graveyard] = @field.graveyard.first
end
@field.field.each_with_index do |card, index|
if card
@items[index] = [Field_Pos[index][0], Field_Pos[index][1]]+ Card_Size
@cards[index] = card
end
end
hand_width = @field.hand.size * Hand_Pos[2] + (@field.hand.size-1) * Hand_Pos[3] hand_width = @field.hand.size * Hand_Pos[2] + (@field.hand.size-1) * Hand_Pos[3]
hand_x = (@width - hand_width) / 2 hand_x = (@width - hand_width) / 2
#if @player @field.hand.each_with_index do |card, index|
# @items[index+11] = [hand_x+index*Hand_Pos[2], Hand_Pos[1]]+ Card_Size
@field.field.each_with_index {|card, index|@contents.put(card.image_small, Field_Pos[index][0], Field_Pos[index][1]) if card} @cards[index+11] = card
@field.hand.each_with_index {|card, index|@contents.put(card.image_small, hand_x+index*Hand_Pos[2], Hand_Pos[1]) if card} end
#else
#Surface.transform_blit(@field.deck.first.image_small, @contents, 180, 1, 1, 0, 0, @width-Deck_Pos[0], @height-Deck_Pos[1],0) if !@field.deck.empty? @contents.fill_rect(0,0,@width, @height, 0x66000000)
# @field.field.each_with_index {|card, index|Surface.transform_blit(card.image_small, @contents, 180, 1, 1, 0, 0, @width-Field_Pos[index][0], @height-Field_Pos[index][1],0) if card} @items.each_key{|index|draw_item(index)}
# @field.hand.each_with_index {|card, index|Surface.blit(card.image_small, 0,0,0,0, @contents, @width-hand_x-index*Hand_Pos[2]-card.image_small.w, @height-Hand_Pos[1]-card.image_small.h) if card}
#end
end end
def draw_item(index, status=0) def draw_item(index, status=0)
case index @contents.put(@cards[index].image_small, @items[index][0], @items[index][1])
when :deck @contents.put(@border, @items[index][0]-1, @items[index][1]-1) if status == 1
@contents.put(@field.deck.first.image_small, Deck_Pos[0], Deck_Pos[1]) if !@field.deck.empty?
when :extra
@contents.put(@field.extra.first.image_small, Extra_Pos[0], Extra_Pos[1]) if !@field.extra.empty?
when :removed
@contents.put(@field.removed.first.image_small, Removed_Pos[0], Removed_Pos[1]) if !@field.removed.empty?
when :graveyard
@contents.put(@field.graveyard.first.image_small, Graveyard_Pos[0], Graveyard_Pos[1]) if !@field.graveyard.empty?
end
end end
def item_rect(index) def item_rect(index)
@items[index] @items[index]
...@@ -63,55 +77,90 @@ class Window_Field < Window ...@@ -63,55 +77,90 @@ class Window_Field < Window
def index=(index) def index=(index)
return if index == @index return if index == @index
if @index if @index
clear(*item_rect(@index)) clear(@items[@index][0]-1,@items[@index][1]-1,@items[@index][2]+2, @items[@index][3]+2)
draw_item(@index, 0) draw_item(@index, 0)
end end
if index.nil? or !@items.has_key?(index) if index.nil? or !@items.has_key?(index) or (index == :deck and @field.deck.empty?) or (index == :removed and @field.removed.empty?) or (index == :extra and @field.extra.empty?) or (index == :graveyard and @field.graveyard.empty?)
@index = nil @index = nil
@action_window.destroy if @action_window $scene.action_window.list = nil
@action_window = nil
else else
@index = index @index = index
draw_item(@index, 1) draw_item(@index, 1)
case @index case @index
when :deck when :deck
@action_names = ["抽卡", @index_card = @field.deck.first
"卡组洗切", @action_names = {"抽卡" => true,
"抽卡(双方确认)", "卡组洗切" => true,
"顶牌回卡组底部", "抽卡(双方确认)" => true,
"顶牌送入墓地", "顶牌回卡组底部" => true,
"顶牌从游戏中除外", "顶牌送入墓地" => true,
"顶牌背面除外", "顶牌从游戏中除外" => true,
"确认顶牌", "顶牌背面除外" => true,
"双方确认顶牌" "确认顶牌" => true,
] "双方确认顶牌" => true
@action_avalable = [true, true, false, false, false, false, false, false] }
when :extra when :extra
@action_names = ["特殊召唤/发动", @index_card = @field.extra.first
"效果发动", @action_names = {"特殊召唤/发动" => true,
"从游戏中除外", "效果发动" => true,
"送入墓地" "从游戏中除外" => true,
] "送入墓地" => true
@action_avalable = [true, true, false, false] }
when :removed when :removed
@action_names = ["特殊召唤/发动", @index_card = @field.removed.first
"效果发动", @action_names = {"特殊召唤/发动" => true,
"加入手卡", "效果发动" => true,
"返回卡组", "加入手卡" => true,
"送入墓地" "返回卡组" => true,
] "送入墓地" => true
@action_avalable = [true, true, false, false, false] }
when :graveyard when :graveyard
@action_names = ["特殊召唤/发动", @index_card = @field.graveyard.first
"效果发动", @action_names = {"特殊召唤/发动" => true,
"加入手卡", "效果发动" => true,
"返回卡组", "加入手卡" => true,
"从游戏中除外" "返回卡组" => true,
] "从游戏中除外" => true
@action_avalable = [true, true, false, false, false] }
when 0..5
@index_card = @field.field[@index]
@action_names = {"效果发动" => true,
"返回卡组" => true,
"送入墓地" => true,
"从游戏中除外" => true,
"加入手卡" => true,
"打开/盖伏" => true
}
when 6..10
@index_card = @field.field[@index]
@action_names = {"攻/守形式转换" => true,
"里侧/表侧转换" => true,
"转为里侧守备" => true,
"攻击宣言" => true,
"效果发动" => true,
"转移控制权" => true,
"放回卡组顶端" => true,
"送入墓地" => true,
"解放" => true,
"加入手卡" => true,
"送入对手墓地" => true
}
when Integer #手卡
@index_card = @field.hand[@index-11]
@action_names = {"放置到场上" => true,
"召唤" => @index_card.monster?,
"发动" => !@index_card.monster?,
"特殊召唤" => true,
"放回卡组顶端" => true,
"送入墓地" => true,
"从游戏中除外" => true,
"效果发动" => true
}
end end
$scene.action_window.list = @action_names
@action_window = Window_Action.new(@x+@items[index][0],@y+@items[index][1]-@action_names.size*Window_Action::WLH,@action_names, @action_avalable) $scene.cardinfo_window.card = @index_card
$scene.action_window.x = @x + @items[@index][0] - ($scene.action_window.width - @items[@index][2])/2
$scene.action_window.y = @y + @items[@index][1] - $scene.action_window.viewport[3]#height
end end
end end
def mousemoved(x,y) def mousemoved(x,y)
...@@ -121,6 +170,30 @@ class Window_Field < Window ...@@ -121,6 +170,30 @@ class Window_Field < Window
end end
end end
end end
def cursor_up
#def clicked $scene.action_window.cursor_up
end
def cursor_down
$scene.action_window.cursor_down
end
def cursor_left
#self.index = @index ? (@index - 1) % [@list.size, @item_max].min : 0
end
def cursor_right
#self.index = @index ? (@index + 1) % [@list.size, @item_max].min : 0
end
def lostfocus
self.index = nil
end
def clicked
return if !$scene.action_window.visible
case @index
when :deck
case $scene.action_window.index
when 0
Action::Draw.new(true).run
end
end
refresh
end
end end
\ No newline at end of file
...@@ -37,7 +37,7 @@ class Window_List < Window ...@@ -37,7 +37,7 @@ class Window_List < Window
[0, @index*self.class::WLH, @width, self.class::WLH] [0, @index*self.class::WLH, @width, self.class::WLH]
end end
def refresh def refresh
@item_max.times {|index|draw_item(index)} @item_max.times {|index|draw_item(index, index==@index ? 1 : 0)}
end end
def cursor_up def cursor_up
self.index = @index ? (@index - @column_max) % [@list.size, @item_max].min : 0 self.index = @index ? (@index - @column_max) % [@list.size, @item_max].min : 0
...@@ -56,6 +56,9 @@ class Window_List < Window ...@@ -56,6 +56,9 @@ class Window_List < Window
#return unless include?(x,y) #return unless include?(x,y)
#self.index = (y - @y) / @single_height #self.index = (y - @y) / @single_height
end end
def lostfocus
self.index = nil
end
def clicked def clicked
$scene.refresh_rect(*item_rect(@index)){draw_item(@index, 2)} if @index $scene.refresh_rect(*item_rect(@index)){draw_item(@index, 2)} if @index
end end
......
#<SDL::Event::Active:0x2a17ef8 @gain=false, @state=1>
#<SDL::Event::Active:0x2a17c40 @gain=true, @state=1>
<< #0|zh99997,96e79218965eb72c92a549dd5a330112,f5276841bca2e536788917498435693b,20110131Ąé
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