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

卡片操作 移动系基本完成

parent c00efc2b
This diff was suppressed by a .gitattributes entry.
This diff was suppressed by a .gitattributes entry.
This diff was suppressed by a .gitattributes entry.
This diff was suppressed by a .gitattributes entry.
......@@ -66,11 +66,11 @@ class Card
'#{records.Fields.Item("CardPass").value}',
'#{records.Fields.Item("SCCardName").value}',
'#{records.Fields.Item("SCCardType").value}',
'#{records.Fields.Item("SCDCardType").value.empty? ? NULL : records.Fields.Item("SCDCardType").value}',
'#{records.Fields.Item("SCDCardType").value.empty? ? "NULL" : records.Fields.Item("SCDCardType").value}',
#{records.Fields.Item("CardATK").value || "NULL"},
#{records.Fields.Item("CardDef").value || "NULL"},
'#{records.Fields.Item("SCCardAttribute").value.empty? ? NULL : records.Fields.Item("SCCardAttribute").value}',
'#{records.Fields.Item("SCCardRace").value.empty? ? NULL : records.Fields.Item("SCCardRace").value}',
'#{records.Fields.Item("SCCardAttribute").value.empty? ? "NULL" : records.Fields.Item("SCCardAttribute").value}',
'#{records.Fields.Item("SCCardRace").value.empty? ? "NULL" : records.Fields.Item("SCCardRace").value}',
#{records.Fields.Item("CardStarNum").value || "NULL"},
'#{records.Fields.Item("SCCardDepict").value}',
#{case records.Fields.Item("ENCardBan").value; when "Normal"; 3; when "SubConfine"; 2; when "Confine"; 1; else; 0; end},
......
......@@ -127,6 +127,7 @@ end
#"Q"
#"273,1,zh99998(201448),zh99997(201629)"
class Iduel::Event::WATCHROOMSTART < Iduel::Event
attr_reader :room
def initialize(info)
id, name = info.split(",", 1)
@room = Iduel::Room.new(id.to_i, name, '', '', false, Iduel::Color[0])#:name, :player1, :player2, :crypted, :color
......
......@@ -15,9 +15,9 @@ class Scene_Hall < Scene
Surface.blit(@background,0,0,0,0,$screen,0,0)
@playerlist = Window_PlayerList.new(24,204)
@userinfo = Window_UserInfo.new(24,24, $iduel.user)
@roomlist = Window_RoomList.new(320,51)
@roomlist = Window_RoomList.new(320,50)
@active_window = @roomlist
@chat = Window_Chat.new(320,550,680,168)
@chat = Window_Chat.new(321,551,682,168)
$screen.update_rect(0,0,0,0)
bgm = Mixer::Music.load("audio/bgm/hall.ogg")
......
......@@ -3,27 +3,8 @@
#------------------------------------------------------------------------------
#  title
#==============================================================================
require_relative 'scene_duel'
class Scene_Watch < Scene_Duel
def start
Iduel::Event::OLIF.callback do |event|
p event
end
Iduel::Event::NOL.callback do |event|
p event
end
Iduel::Event::DOL.callback do |event|
p event
end
Iduel::Event::RMIF.callback do |event|66
p event
end
Iduel::Event::WMSG.callback do |event|
p event
end
end
def update
end
end
# To change this template, choose Tools | Templates
# and open the template in the editor.
class Widget_ScrollBar < Window
def initialize(x,y,height,max)
super(x,y,20,height,400)
@max = max
@up_button = Surface.load('graphics/hall/scroll_up.png')
@down_button = Surface.load('graphics/hall/scroll_down.png')
@back = Surface.load('graphics/hall/scroll_background.png')
@bar = Surface.load('graphics/hall/scroll.png')
@contents.fill_rect(0,0,@width, @height, 0xFFFFFFFF)
@background.fill_rect(0,0,@width, @height, 0xFFFFFFFF)
Surface.transform_draw(@back,@contents,0,1,@contents.h.to_f/@back.h,0,0,0,0,0)
Surface.transform_draw(@back,@background,0,1,@contents.h.to_f/@back.h,0,0,0,0,0)
refresh
end
def index=(index)
return if index == @index
if @index
clear(*item_rect(@index))
draw_item(@index, 0)
end
if index.nil? #or !@items.include? index
@index = nil
else
@index = index
draw_item(@index, 1)
end
end
def item_rect(index)
case index
when :up
[0,0,20,20]
when :scroll
[0,20,20,@height-40]
when :down
[0,@height-20,20,20]
end
end
def draw_item(index, status=0)
case index
when :up
Surface.blit(@up_button,status*20,0,20,20,@contents,0,0)
when :scroll
Surface.blit(@bar,status*20,0,20,24,@contents,0,20)
when :down
Surface.blit(@down_button,status*20,0,20,20,@contents,0,@height-20)
end
end
def refresh
[:up, :scroll, :down].each do |index|
draw_item(index, @index==index ? 1 : 0)
end
end
def mousemoved(x,y)
#p x,y
case y-@y
when 0...20 #上按钮
self.index = :up
when 20...(@height-20)
self.index = :scroll
else
self.index = :down
end
end
def clicked
p @index
#case index
#when :up
#p "up"
#end
end
end
......@@ -5,6 +5,7 @@
#==============================================================================
class Window_Chat < Window
require 'widget_scrollbar'
User_Color = [0,0,0xFF]
Text_Color = [0,0,0]
def initialize(x, y, width, height)
......@@ -12,6 +13,7 @@ class Window_Chat < Window
@chat_input = Widget_InputBox.new(416,723,586,24){|text|$iduel.chat text; add($iduel.user, text)}
@font = TTF.open("fonts/WenQuanYi Micro Hei.ttf", 16)
@contents.fill_rect(0,0,@width, @height, 0xFFFFFFFF)
@scroll = Widget_ScrollBar.new(@x+@width-20,@y,@height,0)
@list = []
end
def add(user, content)
......
......@@ -16,6 +16,7 @@ class Window_RoomList < Window_List
@item_max = 0
@font = TTF.open("fonts/WenQuanYi Micro Hei.ttf", 16)
@color = [0x03, 0x11, 0x22]
@scroll = Widget_ScrollBar.new(@x+@width,@y,@height,0)
end
def draw_item(index, status=0)
......
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