查看: 2048|回复: 2

[已经解决] Yanfly戰鬥結算的道具獲得畫面的編排問題

[复制链接]
梦石
0
星屑
5256
在线时间
760 小时
注册时间
2009-1-21
回帖
236
发表于 2015-8-27 15:07:46 | 显示全部楼层 |阅读模式

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

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

×
RT

他原本像是道具欄式
左右左右的顯示方式

我想把它改成了直列式的方式去顯示
01.jpg

目前道具名稱顯示已經成功了
但是後面數量的顯示
你會發現第二個數字特別的黑
因為他似乎重疊了

弄了很久還是不知道該怎麼把他分開ლ(゚Д゚ლ)

因為腳本很長
所以我擷取了可能會用到的部分、參數
  1. #--------------------------------------------------------------------------
  2.   # item_rect
  3.   #--------------------------------------------------------------------------
  4.   def item_rect(index)
  5.     rect = Rect.new
  6.     rect.width = item_width
  7.     rect.height = contents.height
  8.     rect.x = index % col_max * (item_width + spacing)
  9.     rect.y = index / col_max * item_height
  10.     return rect
  11.   end
复制代码
[pre lang="ruby"]#==============================================================================
# ¡ Window_VictorySpoils
#==============================================================================

class Window_VictorySpoils < Window_ItemList
  
  #--------------------------------------------------------------------------
  # initialize
  #--------------------------------------------------------------------------
  def initialize
    super(0, fitting_height(1), Graphics.width, window_height)
    self.z = 200
    hide
  end
  
  #--------------------------------------------------------------------------
  # window_height
  #--------------------------------------------------------------------------
  def window_height
    return Graphics.height - fitting_height(4) - fitting_height(1)
  end
  
  #--------------------------------------------------------------------------
  # spacing
  #--------------------------------------------------------------------------
  def spacing; return 32; end
  
  #--------------------------------------------------------------------------
  # make
  #--------------------------------------------------------------------------
  def make(gold, drops)
    @gold = gold
    @drops = drops
    refresh
    unselect
  end
  
  #--------------------------------------------------------------------------
  # make_item_list
  #--------------------------------------------------------------------------
  def make_item_list
    @data = [nil]
    items = {}
    weapons = {}
    armours = {}
    @goods = {}
    for item in @drops
      case item
      when RPG::Item
        items[item] = 0 if items[item].nil?
        items[item] += 1
      when RPG::Weapon
        weapons[item] = 0 if weapons[item].nil?
        weapons[item] += 1
      when RPG::Armor
        armours[item] = 0 if armours[item].nil?
        armours[item] += 1
      end
    end
    items = items.sort { |a,b| a[0].id <=> b[0].id }
    weapons = weapons.sort { |a,b| a[0].id <=> b[0].id }
    armours = armours.sort { |a,b| a[0].id <=> b[0].id }
    for key in items; @goods[key[0]] = key[1]; @data.push(key[0]); end
    for key in weapons; @goods[key[0]] = key[1]; @data.push(key[0]); end
    for key in armours; @goods[key[0]] = key[1]; @data.push(key[0]); end
  end
  
  #--------------------------------------------------------------------------
  # draw_item
  #--------------------------------------------------------------------------
  def draw_item(index)
    item = @data[index]
    rect = item_rect(index)
    reset_font_settings
    if item.nil?
      draw_gold(rect)
      return
    end
    rect.width -= 4
    draw_item_name(item, 20, 24*index, true, rect.width - 24)
    draw_item_number(rect, item)
  end
  
  #--------------------------------------------------------------------------
  # draw_gold
  #--------------------------------------------------------------------------
  def draw_gold(rect)
    text = Vocab.currency_unit
    draw_currency_value(@gold, text, rect.x, rect.y, rect.width)
  end
  
  #--------------------------------------------------------------------------
  # draw_item_number
  #--------------------------------------------------------------------------
  def draw_item_number(rect, item)
    number = @goods[item].group
    if $imported["YEA-AdjustLimits"]
      contents.font.size = YEA::LIMIT::ITEM_FONT
      text = sprintf(YEA::LIMIT::ITEM_PREFIX, number)
      draw_text(20, rect.y+20, rect.width, rect.height, text, 2)
    else
      draw_text(20, rect.y, rect.width, rect.height, sprintf(":%s", number), 2)
    end
  end
  
end # Window_VictorySpoils
[/pre]


如果還有缺少腳本的部分
請再提出來

還請大家幫忙解惑
謝謝_(:з」∠)_
梦石
0
星屑
48
在线时间
784 小时
注册时间
2013-1-4
回帖
1057
发表于 2015-8-27 15:24:36 | 显示全部楼层
忽然想哭。。。回帖还要验证码。。。ORZ
话说把整个结算的窗口重写不就好了

点评

我只是想調整他的編排方式,有必要整個視窗打掉重建嗎...(ᇂдᇂ )  发表于 2015-8-27 15:43
RM-GUI延期。。。最近被黑心老板压迫T_T
二次元少女的shitake,长着长脸,身高165,蓝色卷双马尾,FCUP,瞳色黑色,病气和御宅属性,是天才少女。
回复

使用道具 举报

梦石
0
星屑
5256
在线时间
760 小时
注册时间
2009-1-21
回帖
236
 楼主| 发表于 2015-8-27 22:32:06 | 显示全部楼层

嘖嘖
問題解決了

把
  1. def draw_item_number(rect, item)
复制代码
裡面的東西全部搬到
  1. def draw_item(index)
复制代码
裡面

再稍微修改 X、Y 做排版
莫名其妙的就好了 (ᇂдᇂ )

01.jpg
這是我目前的成果 _(:з」∠)_

感覺還是好空
不知道要加什麼進去
回复

使用道具 举报

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

本版积分规则

Powered by Discuz! X5.0 © 2001-2026 Discuz! Team.

在本版发帖返回顶部