设为首页收藏本站|繁體中文

Project1

 找回密码
 注册会员
搜索
查看: 3259|回复: 5
打印 上一主题 下一主题

Vlue的「简单图标物品栏」兼容「右侧滚动条」

[复制链接]

Lv5.捕梦者

梦石
0
星屑
24394
在线时间
5061 小时
注册时间
2016-3-8
帖子
1622
跳转到指定楼层
1
发表于 2020-9-10 21:04:25 | 显示全部楼层 |只看大图 回帖奖励 |倒序浏览 |阅读模式

加入我们,或者,欢迎回来。

您需要 登录 才可以下载或查看,没有帐号?注册会员

x
本帖最后由 alexncf125 于 2024-1-25 13:05 编辑

@cinderelmini
大大的右侧滚动条与下方的脚本合用会有瑕疵喔
问题好像与page_row_max有关?


RUBY 代码复制
  1. #简单图标物品栏 v1.0
  2. #----------#
  3. #特点: 看, 是图标! 而不是列表!
  4. #
  5. #使用方法:    即插即用.
  6. #
  7. #----------#
  8. #-- Script by: V.M of D.T
  9. #
  10. #- Questions or comments can be:
  11. #    given by email: [email protected]
  12. #    provided on facebook: [url]http://www.facebook.com/DaimoniousTailsGames[/url]
  13. #   All my other scripts and projects can be found here: [url]http://daimonioustails.weebly.com/[/url]
  14. #
  15. #--- Free to use in any project, commercial or non-commercial, with credit given
  16. # - - Though a donation's always a nice way to say thank you~ (I also accept actual thank you's)
  17.  
  18. class Window_ItemList < Window_Selectable
  19.   def col_max
  20.     (self.width - standard_padding) / 42
  21.   end
  22.   def page_row_max
  23.     7
  24.   end
  25.   def item_height
  26.     36
  27.   end
  28.   def item_width
  29.     36
  30.   end
  31.   def contents_height
  32.     [super - super % item_height, row_max * (item_height + spacing)].max
  33.   end
  34.   def spacing
  35.     6
  36.   end
  37.   def top_row
  38.     oy / (item_height + spacing)
  39.   end
  40.   def top_row=(row)
  41.     row = 0 if row < 0
  42.     row = row_max - 1 if row > row_max - 1
  43.     self.oy = row * (item_height + spacing)
  44.   end
  45.   def item_rect(index)
  46.     rect = Rect.new
  47.     rect.width = item_width
  48.     rect.height = item_height
  49.     rect.x = index % col_max * (item_width + spacing) + spacing
  50.     rect.y = index / col_max * (item_height + spacing) + spacing
  51.     rect
  52.   end
  53.   def draw_item(index)
  54.     item = @data[index]
  55.     if item
  56.       rect = item_rect(index)
  57.       rect.width -= 4
  58.       rect.x += 2
  59.       big_rect = Rect.new(rect.x-1,rect.y-1,rect.width+2,rect.height+2)
  60.       contents.fill_rect(big_rect, Color.new(0,0,0,255))
  61.       contents.fill_rect(rect, Color.new(0,0,0,100))
  62.       draw_icon(item.icon_index, rect.x+6, rect.y+6)
  63.       contents.font.size = 12
  64.       number = $game_party.item_number(item)
  65.       if number > 1
  66.         draw_text(rect.x + 20, rect.y + 28, 24, contents.font.size, "x" + number.to_s)
  67.       end
  68.     end
  69.   end
  70. end

Lv5.捕梦者

梦石
0
星屑
24394
在线时间
5061 小时
注册时间
2016-3-8
帖子
1622
2
 楼主| 发表于 2020-9-11 15:03:42 | 显示全部楼层
cinderelmini 发表于 2020-9-11 13:06
啊……这还是有点年头的产物了……我看看先……


检查了一遍,大概找到问题是什么原 ...

按大大的脚本改了后, 很多東西的位置和宽高都不同了
我想我转用MOG好了, 不过还是大大的滚动条最美观

点评

呃,可能你是把line_height和item_leight分开使用了吧,单纯这个脚本的话我这边这样改之后没什么排版问题。如果改动太多的话用mog确实会比较方便233  发表于 2020-9-11 16:32
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 注册会员

本版积分规则

拿上你的纸笔,建造一个属于你的梦想世界,加入吧。
 注册会员
找回密码

站长信箱:[email protected]|手机版|小黑屋|无图版|Project1游戏制作

GMT+8, 2024-5-6 03:20

Powered by Discuz! X3.1

© 2001-2013 Comsenz Inc.

快速回复 返回顶部 返回列表