设为首页收藏本站同能贴吧 切换语言 繁体中文
开启辅助访问 切换到窄版
扫描二维码关注官方公众号
返回列表
+ 发新帖
查看: 96|回复: 0

[转载发布] KItemDesc VX

[复制链接]
累计送礼:
0 个
累计收礼:
1 个
  • TA的每日心情
    慵懒
    3 天前
  • 签到天数: 207 天

    连续签到: 1 天

    [LV.7]常住居民III

    3646

    主题

    862

    回帖

    2万

    积分

    管理员

    Rank: 9Rank: 9Rank: 9

    VIP
    7
    卡币
    21262
    OK点
    16
    推广点
    0
    同能卷
    50
    积分
    25800

    灌水之王

    发表于 昨天 13:39 | 显示全部楼层 |阅读模式
    KItemDesc VX Zilsel Version
    version 1.0.2

    by Kyonides Arkanthes



    Introduction


    This scriptlet just pretends to implement zlsl's need of a different item description menu by adding an extra window to display an icon or picture plus the hero's comment.

    You may also want to activate a global switch to show skills as if they were simple items! :shocked: Don't worry! You can deactivate that at any given time!

    Warning: The player cannot change this on his own so you would need to let them use an event as a trigger.

    Just paste it in a script section above Main but below Scene_Debug.

    Screenshot





    The Script
                    Code:       
    # * KItemDesc VX Zilsel Version#   Scripter : Kyonides Arkanthes#   v1.0.2 - 2019-11-30# This scriptlet allows you to show custom icons and comments in the Inventory# Menu scene. It will show the party leader's opinion on a given item.# Optional: Place large icons in Graphics/Pictures folder with their item names.# You may also allow the player to check out his or her skills on the same menu# by activating a global switch via an event command. It can be deactivated at# any given time!module KItemDesc  INCLUDE_SKILLS_SWITCH_ID = 1  PICTURE_X = 12  PICTURE_Y = 12  PICTURE_CENTER_X = true # true - Ignores X coordinate, false - uses X  PICTURE_CENTER_Y = true # true - Ignores Y coordinate, false - uses Y  COMMENTS_Y = 180  ACTOR_OPINION_LABEL = "%s's Opinion"  # Comments may include newlines alias \n if needed.  DEFAULT_COMMENT = "The hero has nothing to say\nabout this"  @comments = {} # There's no need to edit this line.  # [[Kind, ID]] = { ActorID => "Hero's comment on current item", etc. }  # Kind Options - :item, :weapon, :armor, :skill - Check the following example.  @comments[[:item, 1]] = {    1 => "You know, I'll never need\npotions for I'm invincible!"  }  @comments.default = {} # Do not touch this! It will eat you alive!  def self.comments() @comments endendmodule Cache  def self.picture(filename) load_bitmap('Graphics/Pictures', filename) endendclass Game_Party  def leader() $game_actors[@actors[0]] endendclass ItemDescWindow < Window_Base  include KItemDesc  def initialize    super(272, 56, 272, 360)    self.contents = Bitmap.new(width - 32, height - 32)  end  def refresh(new_item)    return if @item == new_item    @item = new_item    c = self.contents    c.clear    return if @item.nil?    lid = $game_party.leader.id    name = $game_party.leader.name    key = [@item.type, @item.id]    comments = KItemDesc.comments[key][lid] || DEFAULT_COMMENT    comments = comments.split("\n")    text = sprintf(ACTOR_OPINION_LABEL, name)    w = width - 32    begin      bit = Cache.picture(@item.name)      rect = Rect.new(0, 0, bit.width, bit.height)      icon_x = PICTURE_CENTER_X ? w / 2 - bit.width / 2 : PICTURE_X      icon_y = PICTURE_CENTER_Y ? COMMENTS_Y / 2 - bit.height / 2 : PICTURE_Y      c.blt(icon_x, icon_y, bit, rect)    rescue      icon_x = PICTURE_CENTER_X ? w / 2 - 12 : PICTURE_X      icon_y = PICTURE_CENTER_Y ? COMMENTS_Y / 2 - 12 : PICTURE_Y      draw_icon(@item.icon_index, icon_x, icon_y)    end    c.draw_text(0, COMMENTS_Y, 288, 24, text)    comments.size.times do |n|      c.draw_text(0, COMMENTS_Y + 28 + n * 24, 288, 24, comments[n])    end  endendmodule RPG  class Item    def type() :item end  end  class Weapon    def type() :weapon end  end  class Armor    def type() :armor end  end  class Skill    def type() :skill end  endendclass Game_Party  def item_number(item)    number = case item    when RPG::Item then @items[item.id]    when RPG::Weapon then @weapons[item.id]    when RPG::Armor then @armors[item.id]    when RPG::Skill then skill_number(item.id)    end    number || 0  end  def item_keys() @items.keys.sort end  def weapon_keys() @weapons.keys.sort end  def armor_keys() @armors.keys.sort end  def skills() @actors.map{|a| a.skills } end  def skill_number(item_id) skills.select{|n| n == item_id}.size endendclass Window_Item  alias :kyon_itemdesc_win_item_up_help :update_help  def initialize(x, y, width, height)    super(x, y, width, height)    self.index = 0    @column_max = 2 if $game_temp.in_battle    refresh  end  def refresh    @data = []    $game_party.item_keys.each do |i|      @data << $data_items      self.index = @data.size - 1 if i == $game_party.last_item_id    end    unless $game_temp.in_battle      $game_party.weapon_keys.each{|i| @data << $data_weapons }      $game_party.armor_keys.each{|i| @data << $data_armors }      if $game_switches[KItemDesc::INCLUDE_SKILLS_SWITCH_ID]        $game_party.skills.each{|i| @data << $data_skills }      end    end    @data << nil if include?(nil)    @item_max = @data.size    create_contents    @item_max.times{|i| draw_item(i) }    @desc_window.refresh(@data[@index]) if @desc_window  end  def desc_window=(new_window)    @desc_window = new_window    @desc_window.refresh(@data[@index])  end  def update_help    kyon_itemdesc_win_item_up_help    @desc_window.refresh(@data[@index]) if @desc_window  endendclass Scene_Item  alias :kyon_itemdesc_scn_item_term :terminate  def start    create_menu_background    @viewport = Viewport.new(0, 0, 544, 416)    @item_desc = ItemDescWindow.new    @help_window = Window_Help.new    @help_window.viewport = @viewport    @item_window = Window_Item.new(0, 56, 272, 360)    @item_window.viewport = @viewport    @item_window.active = false    @item_window.help_window = @help_window    @item_window.desc_window = @item_desc    @target_window = Window_MenuStatus.new(0, 0)    hide_target_window  end  def terminate    kyon_itemdesc_scn_item_term    @item_desc.dispose  endend


    Terms & Conditions

    Free for use in any kind of videogame, but you must include my nickname and the URL in your game credits.


    本贴来自国际rpgmaker官方论坛作者:kyonides处,因国际论坛即将永久关站,为了存档多年珍贵资料,署名转载到本论坛存档,由于官方帖子为英文原帖,需要中文翻译请点击论坛顶部切换语言为中文就可以将帖子翻译成中文浏览,方便大家随时查看,原文地址:https://forums.rpgmakerweb.com/threads/kitemdesc-vx.115824/

    本帖子中包含更多资源

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

    x
    天天去同能,天天有童年!
    回复 送礼论坛版权

    使用道具 举报

    文明发言,和谐互动
    文明发言,和谐互动
    高级模式
    您需要登录后才可以回帖 登录 | 立即注册

    本版积分规则

    简体中文
    繁體中文
    English(英语)
    日本語(日语)
    Deutsch(德语)
    Русский язык(俄语)
    بالعربية(阿拉伯语)
    Türkçe(土耳其语)
    Português(葡萄牙语)
    ภาษาไทย(泰国语)
    한어(朝鲜语/韩语)
    Français(法语)
    关闭

    幸运抽奖

    社区每日抽奖来袭,快来试试你是欧皇还是非酋~

    立即查看

    聊天机器人
    Loading...

    QQ|Archiver|手机版|小黑屋|同能RPG制作大师 ( 沪ICP备12027754号-3 )

    GMT+8, 2026-7-10 01:10 , Processed in 0.140424 second(s), 52 queries .

    Powered by Discuz! X3.4

    Copyright © 2001-2020, Tencent Cloud.

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