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

Project1

 找回密码
 注册会员
搜索

我想要个菜单里边显示时间的窗口 ·········

查看数: 3826 | 评论数: 8 | 收藏 4
关灯 | 提示:支持键盘翻页<-左 右->
    组图打开中,请稍候......
发布时间: 2013-5-4 16:41

正文摘要:

本帖最后由 光の異形 于 2013-5-5 18:39 编辑 试着改金钱的窗口 一直失败 ·············

回复

alwsheng 发表于 2013-7-15 22:02:06
j433463 发表于 2013-5-5 03:32
其实只需要这样子:

#encoding:utf-8

请问下,你这个脚本怎么添加个窗口
光の異形 发表于 2013-5-5 18:38:44
j433463 发表于 2013-5-5 14:49
如上,注释掉有 # 的那一行,并且开启 Window_MenuCommand 脚本,item 是物品,skill 是技能,equip 是装备 ...


嗯 明白了   我只有1分呢 扣掉的 那真是穷光光啊
j433463 发表于 2013-5-5 14:49:47
本帖最后由 j433463 于 2013-5-5 14:52 编辑
  1. class Window_MenuCommand
  2.   def add_hand_book_command
  3.     #add_command("图鉴",:hand_book) #这一行注释起来不用了
  4.   end
复制代码
如上,注释掉有 # 的那一行,并且开启 Window_MenuCommand 脚本,
  1.   #--------------------------------------------------------------------------
  2.   # ● 向指令清单加入主要的指令
  3.   #--------------------------------------------------------------------------
  4.   def add_main_commands
  5.     add_command(Vocab::item,   :item,   main_commands_enabled)
  6.     add_command("图鉴", :hand_book) #加入这一行
  7.     add_command(Vocab::skill,  :skill,  main_commands_enabled)
  8.     add_command(Vocab::equip,  :equip,  main_commands_enabled)
  9.     add_command(Vocab::status, :status, main_commands_enabled)
  10.   end
复制代码
item 是物品,skill 是技能,equip 是装备,status 是状态,自己看要放在哪个下面,就自己把那一行移过去。

不过我测试时开启图鉴有错误讯息,可能有别的脚本配套吧?不过那跟我无关,反正不影响您要的修改结果。

另外,最好不要一帖多问,不然版主会出来扣分滴,有别的问题请另外开新帖,而这个帖的问题解决后请把主题前那个改成[已经解决]。

评分

参与人数 1星屑 +100 收起 理由
Sion + 100 感谢解答

查看全部评分

j433463 发表于 2013-5-5 03:32:17
其实只需要这样子:

RUBY 代码复制
  1. #encoding:utf-8
  2. #==============================================================================
  3. # ■ Window_Menu_Playtime
  4. #------------------------------------------------------------------------------
  5. #  显示游戏累计时间的视窗
  6. #==============================================================================
  7.  
  8. class Window_Menu_Playtime < Window_Base
  9.   def initialize
  10.     super(0, 0, window_width, fitting_height(1))
  11.     update
  12.   end
  13.   #--------------------------------------------------------------------------
  14.   # ● 取得视窗的宽度
  15.   #--------------------------------------------------------------------------
  16.   def window_width
  17.     return 160
  18.   end
  19.   #--------------------------------------------------------------------------
  20.   # ● 更新画面
  21.   #--------------------------------------------------------------------------
  22.   def update
  23.     super
  24.     return if $game_system.playtime == @playtime
  25.     @playtime = $game_system.playtime
  26.     contents.clear
  27.     draw_icon(280,0,0)
  28.     draw_text(contents.rect, $game_system.playtime_s, 2)
  29.   end
  30.   #--------------------------------------------------------------------------
  31.   # ● 开启视窗
  32.   #--------------------------------------------------------------------------
  33.   def open
  34.     refresh
  35.     super
  36.   end
  37. end


上面的脚本放到 Window_XXX 窗口那一排的最后,名称定为 Window_Menu_Playtime

然后打开 Scene_Menu 主菜单脚本,在 def start 的 end 之前加一行

RUBY 代码复制
  1. create_playtime_window


最后,在生成状态视窗 def create_status_window 的 end 下方放这一段

RUBY 代码复制
  1. #--------------------------------------------------------------------------
  2.   # ● 生成游戏时间视窗
  3.   #--------------------------------------------------------------------------
  4.   def create_playtime_window
  5.     @playtime_window = Window_Menu_Playtime.new
  6.     @playtime_window.x = 0
  7.     @playtime_window.y = Graphics.height - @gold_window.height * 2
  8.     @playtime_window.opacity = 0
  9.   end


这样会在主菜单的左下角最底下的金钱窗口上面显示一个时间窗口,这是完全按照默认脚本程式码语法来写的,应该不会有冲突错误。
1936989618 发表于 2013-5-4 17:33:23
#============================================================================
#Pause Menu Features
#By Ventwig
#Version 1.3 - April 10 2012
#For RPGMaker VX Ace
#============================================================================
# This simple scirpt was a request by JayPB08, then I decided I'd let everyone
# have it :)
# Thanks apoclaydon for pointing out a mistake where the icon didn't change!
#=============================================================================
# Description:
# This code draws a gold window, and a playtime window (which counts up)
# Right under the command window. They're two seperate windows to look nicer,
# and you can disable one if you'd like :)
# You can also draw icons, too!
# And in v 1.3, I added a Gold Window Extension!
#==============================================================================
# Compatability:
#  alias-es Scene_Menu Start
#  Creates two new methods in Scene_Menu
#  Works with Spike's Monentary System! OMG!
#===============================================================================
# Instructions: Put in materials, above main.Plug'N'Play
#==============================================================================
# Please give Credit to Ventwig if you would like to use one of my scripts
# in a NON-COMMERCIAL project.
# Please ask for permission if you would like to use it in a commercial game.
# You may not re-distribute any of my scripts or claim as your own.
# You may not release edits without permission, combatability patches are okay.
#===============================================================================
module VENTWIG #Do not touch

##################################################################
#Customization! Yay!
##################################################################

  #Disables (hides) the name/time window.
  #No point in this script if both are true...
  #True and False, default is both false.
  DISABLE_NAME = false
  DISABLE_TIME = false

  #Sets where to draw the window(s)
  #Either under the command menu, or over the gold hud
  #True = Under the command
  #False = Over Gold
  #Default false
  UNDER_COMMAND = false

  #Chooses whether or not an icon will be drawn in the windows.
  DRAW_ICON = true

  #Chooses whether or not to replace the gold window with a
  #new icon-gold window. This is seperate to extend compatibility.
  #Like Spike's Monentary System
  DRAW_GICON = true

  #The index of the icon.
  #Def NAME = 131 TIME = 280 GOLE = 361
  NAME_ICON = 231
  TIME_ICON = 280
  GOLD_ICON = 0


#########################################################################
#End Of configuration. Touch anything below and it'll delete system32   #
#########################################################################
end

class Window_MenuMapName < Window_Base
  def initialize
    super(0,100,160,50)
    if VENTWIG::DRAW_ICON == true
      draw_text(30,0,120,25,$game_map.display_name)
      draw_icon(VENTWIG::NAME_ICON,0,0,enabled = true)
    else
      draw_text(0,0,160,25,$game_map.display_name)
    end
  end
end

class Window_MenuPlaytime < Window_Base
  def initialize
    super(0,100,160,50)
    if VENTWIG::DRAW_ICON == true
      draw_text(30,0,160,25,$game_system.playtime_s)
        self.opacity = 0
      draw_icon(VENTWIG::TIME_ICON,0,0,enabled = true)
    else
      draw_text(0,0,160,25,$game_system.playtime_s)
    end
  end
  def update
    contents.clear
    if VENTWIG::DRAW_ICON == true
      draw_text(30,0,160,25,$game_system.playtime_s)
      draw_icon(VENTWIG::TIME_ICON,0,0,enabled = true)
    else
      draw_text(0,0,160,25,$game_system.playtime_s)
    end
  end
end

class Scene_Menu < Scene_MenuBase
  alias ventwig_map_name_menu_start start
  def start
    ventwig_map_name_menu_start
    if VENTWIG::DISABLE_NAME == false
      create_map_name_window
    end
    if VENTWIG::DISABLE_TIME == false
      create_playtime_window
    end
  end
  def create_map_name_window
    if VENTWIG::UNDER_COMMAND == true
      @namemap_window = Window_MenuMapName.new
      @namemap_window.x = 0
      @namemap_window.y = @command_window.height
      @namemap_window.width = @command_window.width
      @namemap_window.height = 50
    end
    if VENTWIG::UNDER_COMMAND == false
      if VENTWIG::DISABLE_TIME == false
        @namemap_window = Window_MenuMapName.new
        @namemap_window.x = 0
        @namemap_window.y = @gold_window.y - 100
        @namemap_window.width = @command_window.width
        @namemap_window.height = 50
      end
      if VENTWIG::DISABLE_TIME == true
        @namemap_window = Window_MenuMapName.new
        @namemap_window.x = 0
        @namemap_window.y = @gold_window.y - 50
        @namemap_window.width = @command_window.width
        @namemap_window.height = 50
      end
    end
  end
  def create_playtime_window
    if VENTWIG::UNDER_COMMAND == true
      if VENTWIG::DISABLE_NAME == false
        @playtime_window = Window_MenuPlaytime.new
        @playtime_window.x = 0
        @playtime_window.y = @namemap_window.y + @namemap_window.height
        @playtime_window.width = @command_window.width
        @playtime_window.height = 50
      end
      if VENTWIG::DISABLE_NAME == true
        @playtime_window = Window_MenuPlaytime.new
        @playtime_window.x = 0
        @playtime_window.y = @command_window.height
        @playtime_window.width = @command_window.width
        @playtime_window.height = 50
      end
    end
    if VENTWIG::UNDER_COMMAND == false
      if VENTWIG::DISABLE_NAME == false
        @playtime_window = Window_MenuPlaytime.new
        @playtime_window.x = 0
        @playtime_window.y = @namemap_window.y + @namemap_window.height
        @playtime_window.width = @command_window.width
        @playtime_window.height = 50
      end
      if VENTWIG::DISABLE_NAME == true
        @playtime_window = Window_MenuPlaytime.new
        @playtime_window.x = 0
        @playtime_window.y = @gold_window.y - 50
        @playtime_window.width = @command_window.width
        @playtime_window.height = 50
      end
    end
  end
end

还附加显示地图名

评分

参与人数 1星屑 +100 收起 理由
Sion + 100 感谢解答

查看全部评分

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

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

GMT+8, 2024-11-18 08:50

Powered by Discuz! X3.1

© 2001-2013 Comsenz Inc.

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