加入我们,或者,欢迎回来。
您需要 登录 才可以下载或查看,没有帐号?注册会员
x
本帖最后由 alexncf125 于 2024-1-25 13:05 编辑
@cinderelmini
大大的右侧滚动条与下方的脚本合用会有瑕疵喔
问题好像与page_row_max有关?
#简单图标物品栏 v1.0 #----------# #特点: 看, 是图标! 而不是列表! # #使用方法: 即插即用. # #----------# #-- Script by: V.M of D.T # #- Questions or comments can be: # provided on facebook: [url]http://www.facebook.com/DaimoniousTailsGames[/url] # All my other scripts and projects can be found here: [url]http://daimonioustails.weebly.com/[/url] # #--- Free to use in any project, commercial or non-commercial, with credit given # - - Though a donation's always a nice way to say thank you~ (I also accept actual thank you's) class Window_ItemList < Window_Selectable def col_max (self.width - standard_padding) / 42 end def page_row_max 7 end def item_height 36 end def item_width 36 end def contents_height [super - super % item_height, row_max * (item_height + spacing)].max end def spacing 6 end def top_row oy / (item_height + spacing) end def top_row=(row) row = 0 if row < 0 row = row_max - 1 if row > row_max - 1 self.oy = row * (item_height + spacing) end def item_rect(index) rect = Rect.new rect.width = item_width rect.height = item_height rect.x = index % col_max * (item_width + spacing) + spacing rect.y = index / col_max * (item_height + spacing) + spacing rect end def draw_item(index) item = @data[index] if item rect = item_rect(index) rect.width -= 4 rect.x += 2 big_rect = Rect.new(rect.x-1,rect.y-1,rect.width+2,rect.height+2) contents.fill_rect(big_rect, Color.new(0,0,0,255)) contents.fill_rect(rect, Color.new(0,0,0,100)) draw_icon(item.icon_index, rect.x+6, rect.y+6) contents.font.size = 12 number = $game_party.item_number(item) if number > 1 draw_text(rect.x + 20, rect.y + 28, 24, contents.font.size, "x" + number.to_s) end end end end
#简单图标物品栏 v1.0
#----------#
#特点: 看, 是图标! 而不是列表!
#
#使用方法: 即插即用.
#
#----------#
#-- Script by: V.M of D.T
#
#- Questions or comments can be:
# provided on facebook: [url]http://www.facebook.com/DaimoniousTailsGames[/url]
# All my other scripts and projects can be found here: [url]http://daimonioustails.weebly.com/[/url]
#
#--- Free to use in any project, commercial or non-commercial, with credit given
# - - Though a donation's always a nice way to say thank you~ (I also accept actual thank you's)
class Window_ItemList < Window_Selectable
def col_max
(self.width - standard_padding) / 42
end
def page_row_max
7
end
def item_height
36
end
def item_width
36
end
def contents_height
[super - super % item_height, row_max * (item_height + spacing)].max
end
def spacing
6
end
def top_row
oy / (item_height + spacing)
end
def top_row=(row)
row = 0 if row < 0
row = row_max - 1 if row > row_max - 1
self.oy = row * (item_height + spacing)
end
def item_rect(index)
rect = Rect.new
rect.width = item_width
rect.height = item_height
rect.x = index % col_max * (item_width + spacing) + spacing
rect.y = index / col_max * (item_height + spacing) + spacing
rect
end
def draw_item(index)
item = @data[index]
if item
rect = item_rect(index)
rect.width -= 4
rect.x += 2
big_rect = Rect.new(rect.x-1,rect.y-1,rect.width+2,rect.height+2)
contents.fill_rect(big_rect, Color.new(0,0,0,255))
contents.fill_rect(rect, Color.new(0,0,0,100))
draw_icon(item.icon_index, rect.x+6, rect.y+6)
contents.font.size = 12
number = $game_party.item_number(item)
if number > 1
draw_text(rect.x + 20, rect.y + 28, 24, contents.font.size, "x" + number.to_s)
end
end
end
end
|