查看: 1858|回复: 6

[已经解决] 标题脚本想加入网页跳转的选项

[复制链接]
梦石
0
星屑
50
在线时间
135 小时
注册时间
2012-6-14
回帖
32
发表于 2013-8-18 20:16:09 | 显示全部楼层 |阅读模式

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

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

×
本帖最后由 kkwo 于 2013-8-20 18:33 编辑

我开始标题打算加入网页跳转这个功能
可是这个脚本跟我用的标题脚本似乎会相冲
导致标题不会显示出网页跳转
所以想请问我想要在标题加入网页跳转的功能应该怎么做?
下面列出我使用的脚本
标题网页跳转
[pre lang="ruby" line="1"]#==============================================================================
# ■ Window_TitleCommand
#------------------------------------------------------------------------------
#  66RPG /YUI
#    2011/12/22
#==============================================================================


class Window_TitleCommand < Window_Command
  #--------------------------------------------------------------------------
  # ● 生成指令列表
  #--------------------------------------------------------------------------
  def make_command_list
   add_command(Vocab::new_game, :new_game)
    add_command(Vocab::continue, :continue, continue_enabled)
    add_command("测试", :jump)#引号内中文自由编辑
    add_command(Vocab::shutdown, :shutdown)
  end
end

#==============================================================================
# ■ Scene_Title
#------------------------------------------------------------------------------
#  标题画面
#==============================================================================

class Scene_Title < Scene_Base
  #--------------------------------------------------------------------------
  # ● 开始处理
  #--------------------------------------------------------------------------
  def start
    super
    SceneManager.clear
    Graphics.freeze
    create_background
    create_foreground
    create_command_window
    play_title_music
  end
  #--------------------------------------------------------------------------
  # ● 取得渐变速度
  #--------------------------------------------------------------------------
  def transition_speed
    return 20
  end
  #--------------------------------------------------------------------------
  # ● 结束处理
  #--------------------------------------------------------------------------
  def terminate
    super
    SceneManager.snapshot_for_background
    dispose_background
    dispose_foreground
  end
  #--------------------------------------------------------------------------
  # ● 生成背景
  #--------------------------------------------------------------------------
  def create_background
    @sprite1 = Sprite.new
    @sprite1.bitmap = Cache.title1($data_system.title1_name)
    @sprite2 = Sprite.new
    @sprite2.bitmap = Cache.title2($data_system.title2_name)
    center_sprite(@sprite1)
    center_sprite(@sprite2)
  end
  #--------------------------------------------------------------------------
  # ● 生成前景
  #--------------------------------------------------------------------------
  def create_foreground
    @foreground_sprite = Sprite.new
    @foreground_sprite.bitmap = Bitmap.new(Graphics.width, Graphics.height)
    @foreground_sprite.z = 100
    draw_game_title if $data_system.opt_draw_title
  end
  #--------------------------------------------------------------------------
  # ● 描画游戏标题
  #--------------------------------------------------------------------------
  def draw_game_title
    @foreground_sprite.bitmap.font.size = 48
    rect = Rect.new(0, 0, Graphics.width, Graphics.height / 2)
    @foreground_sprite.bitmap.draw_text(rect, $data_system.game_title, 1)
  end
  #--------------------------------------------------------------------------
  # ● 释放背景
  #--------------------------------------------------------------------------
  def dispose_background
    @sprite1.bitmap.dispose
    @sprite1.dispose
    @sprite2.bitmap.dispose
    @sprite2.dispose
  end
  #--------------------------------------------------------------------------
  # ● 释放前景
  #--------------------------------------------------------------------------
  def dispose_foreground
    @foreground_sprite.bitmap.dispose
    @foreground_sprite.dispose
  end
  #--------------------------------------------------------------------------
  # ● 执行活动块的居中化
  #--------------------------------------------------------------------------
  def center_sprite(sprite)
    sprite.ox = sprite.bitmap.width / 2
    sprite.oy = sprite.bitmap.height / 2
    sprite.x = Graphics.width / 2
    sprite.y = Graphics.height / 2
  end
  #--------------------------------------------------------------------------
  # ● 生成指令窗口
  #--------------------------------------------------------------------------
  def create_command_window
    @command_window = Window_TitleCommand.new
    @command_window.set_handler(:new_game, method(:command_new_game))
    @command_window.set_handler(:continue, method(:command_continue))
    @command_window.set_handler(:jump, method(:command_jump))
    @command_window.set_handler(:shutdown, method(:command_shutdown))
  end
  #--------------------------------------------------------------------------
  # ● 关闭指令窗口
  #--------------------------------------------------------------------------
  def close_command_window
    @command_window.close
    update until @command_window.close?
  end
  #--------------------------------------------------------------------------
  # ● 指令[新游戏]
  #--------------------------------------------------------------------------
  def command_new_game
    DataManager.setup_new_game
    close_command_window
    fadeout_all
    $game_map.autoplay
    SceneManager.goto(Scene_Map)
  end
  #--------------------------------------------------------------------------
  # ● 指令[继续]
  #--------------------------------------------------------------------------
  def command_continue
    close_command_window
    SceneManager.call(Scene_Load)
  end
    #--------------------------------------------------------------------------
  # ● 跳转网页
  #--------------------------------------------------------------------------
  def command_jump
  @jump = Win32API.new('shell32.dll','ShellExecuteA',%w(p p p p p i),'i')#
  @jump.call(0, 'open','http://blog.sina.com.cn',0, 0, 1) # 修改网址
   @command_window.activate
  end
  #--------------------------------------------------------------------------
  # ● 指令[退出]
  #--------------------------------------------------------------------------
  def command_shutdown
    close_command_window
    fadeout_all
    SceneManager.exit
  end
  #--------------------------------------------------------------------------
  # ● 演奏标题画面的音乐
  #--------------------------------------------------------------------------
  def play_title_music
    $data_system.title_bgm.play
    RPG::BGS.stop
    RPG::ME.stop
  end
end[/pre]
标题
[pre lang="ruby" line="1"]#==============================================================================
# ■ VXAce-RGSS3-17 タイトルカスタマイズ [main]        by Claimh
#==============================================================================

#==============================================================================
# ■ Title
#==============================================================================
module Title
  #--------------------------------------------------------------------------
  # ● スキップコマンド : C, B, 方向キー
  #--------------------------------------------------------------------------
  def self.skip_trigger?
    (Input.trigger?(:C) or Input.trigger?(:B) or Input.dir4 > 0)
  end
end


#==============================================================================
# ■ Title::Scene
#==============================================================================
module Title::Scene
  S_START = 0  # 起動
  S_LOGO  = 1  # ロゴシーン
  S_DEMO  = 2  # イベントデモ
  S_TITLE = 3  # タイトル
  #--------------------------------------------------------------------------
  # ● ロゴシーンの有無
  #--------------------------------------------------------------------------
  def self.enable_logo(timeout=false)
    false
  end
  #--------------------------------------------------------------------------
  # ● イベントシーンの有無
  #--------------------------------------------------------------------------
  def self.enable_demo(timeout=false)
    false
  end
end

#==============================================================================
# ■ TitleBack  : 背景プレーン
#==============================================================================
class TitleBack < Plane
  #--------------------------------------------------------------------------
  # ● オブジェクト初期化
  #--------------------------------------------------------------------------
  def initialize(b, main=false)
    @Index = main ? 0 : 1
    super(Viewport.new(0, 0, Graphics.width, Graphics.height))
    self.bitmap = b
    self.viewport.z = 100
    fit_screen if Title::TB_FIT[@index]
    @stop = false
    reset_pos
    stop_pos
  end
  def bwz;  (bitmap.width * zoom_x).truncate; end # ズーム後のbitmap幅
  def bhz;  (bitmap.height* zoom_y).truncate; end # ズーム後のbitmap高さ
  def vw;   viewport.rect.width;   end
  def vh;   viewport.rect.height;  end
  #--------------------------------------------------------------------------
  # ● オブジェクト破棄
  #--------------------------------------------------------------------------
  def dispose
    self.bitmap.dispose
    self.viewport.dispose
    super
  end
  #--------------------------------------------------------------------------
  # ● 画面にフィットさせる
  #--------------------------------------------------------------------------
  def fit_screen
    x_zoom = vw  * 1.0 / bitmap.width
    y_zoom = vh * 1.0 / bitmap.height
    zoom = x_zoom > y_zoom ? x_zoom : y_zoom
    self.zoom_x = self.zoom_y = zoom
  end
  #--------------------------------------------------------------------------
  # ● 画像位置の設定
  #--------------------------------------------------------------------------
  def x4; 0;  end
  def x5; (bwz - vw) / 2;  end
  def x6; (bwz - vw);  end
  def y2; (bhz - vh);  end
  def y5; (bhz - vh) / 2;  end
  def y8; 0;  end
  def reset_pos
    case Title::TB_BASE[@index]
    when 1; self.ox = x4; self.oy = y2
    when 2; self.ox = x5; self.oy = y2
    when 3; self.ox = x6; self.oy = y2
    when 4; self.ox = x4; self.oy = y5
    when 6; self.ox = x6; self.oy = y5
    when 7; self.ox = x4; self.oy = y8
    when 8; self.ox = x5; self.oy = y8
    when 9; self.ox = x6; self.oy = y8
    else;   self.ox = x5; self.oy = y5
    end
  end
  #--------------------------------------------------------------------------
  # ● 終端点の設定
  #--------------------------------------------------------------------------
  def stop_pos
    case Title::TB_BASE[@index]
    when 1,4,7; @x_gap = x6
    when 3,6,9; @x_gap = x4
    else;       @x_gap = nil
    end
    case Title::TB_BASE[@index]
    when 1,2,3; @y_gap = y8
    when 7,8,9; @y_gap = y2
    else;       @y_gap = nil
    end
  end
  #--------------------------------------------------------------------------
  # ● スクロール判定
  #--------------------------------------------------------------------------
  def scroll?
    Title::SCROLL_TG[@index]
  end
  #--------------------------------------------------------------------------
  # ● スクロール終端判定
  #--------------------------------------------------------------------------
  def scroll_stop?
    return unless Title::SCROLL_STOP[@index]
    if !@x_gap.nil?
#      p "#{self.ox}, #{@x_gap}"
      case Title::SCROLL_DIR[@index]
      when 1,4,7; x_end_stop if self.ox < @x_gap
      when 3,6,9; x_end_stop if self.ox > @x_gap
      end
    end
    if !@y_gap.nil?
#      p "#{self.oy}, #{@y_gap}"
      case Title::SCROLL_DIR[@index]
      when 1,2,3; y_end_stop if self.oy > @y_gap
      when 7,8,9; y_end_stop if self.oy < @y_gap
      end
    end
  end
  def x_end_stop
    self.ox = @x_gap
    @stop = true
  end
  def y_end_stop
    self.oy = @y_gap
    @stop = true
  end
  #--------------------------------------------------------------------------
  # ● Xスクロール
  #--------------------------------------------------------------------------
  def scroll_x(n)
    self.ox = self.ox + n * Title::SCROLL_SPD[@index]
  end
  def scroll_r;  scroll_x( 1)  end
  def scroll_l;  scroll_x(-1)  end
  #--------------------------------------------------------------------------
  # ● Yスクロール
  #--------------------------------------------------------------------------
  def scroll_y(n)
    self.oy = self.oy + n * Title::SCROLL_SPD[@index]
  end
  def scroll_u;  scroll_y(-1)  end
  def scroll_d;  scroll_y( 1)  end
  #--------------------------------------------------------------------------
  # ● フレーム更新
  #--------------------------------------------------------------------------
  def update
    return unless scroll?
    return if @stop
    case Title::SCROLL_DIR[@index]
    when 1; scroll_l; scroll_d
    when 2;           scroll_d
    when 3; scroll_r; scroll_d
    when 4; scroll_l
    when 6; scroll_r
    when 7; scroll_l; scroll_u
    when 8;           scroll_u
    when 9; scroll_r; scroll_u
    end
    scroll_stop?
    self.ox %= viewport.rect.width
    self.oy %= viewport.rect.height
  end
end


#==============================================================================
# ■ Spriteset_TitleMap  : タイトル背景マップ
#==============================================================================
class Spriteset_TitleMap < Spriteset_Map
  #--------------------------------------------------------------------------
  # ● フレーム更新
  #--------------------------------------------------------------------------
  def update
    super
    $game_map.update(true)
  end
end


#==============================================================================
# ■ Title::TitleName
#==============================================================================
class Title::TitleName
  #--------------------------------------------------------------------------
  # ● オブジェクト初期化
  #--------------------------------------------------------------------------
  def initialize(type)
    @type = type
    @name = @file = ""
    @rect = Rect.new
    @x_align = @y_align = 0
  end
  #--------------------------------------------------------------------------
  # ● 描画対象の矩形
  #--------------------------------------------------------------------------
  def src_rect(name, file, bitmap)
    if @type
      @name = name
      @srect = bitmap.text_size(name)
    else
      @file = file
      b = Cache.system(file)
      @srect = Rect.new(0, 0, b.width, b.height)
    end
  end
  #--------------------------------------------------------------------------
  # ● タイトル矩形の計算
  #--------------------------------------------------------------------------
  def calc_rect(config, half=true)
    if config.x < 0
      @rect.x += config.width
      @rect.width = Graphics.width - config.width
      @x_align = 1
    else
      @rect.x = config.x
      @rect.width = @srect.width
    end
    if config.y < 0
      @rect.y += config.height
      @rect.height = half ? Graphics.height / 2 : Graphics.height
      @y_align = 1
    else
      @rect.y = config.y
      @rect.height = @srect.height
    end
  end
  #--------------------------------------------------------------------------
  # ● タイトル描画
  #--------------------------------------------------------------------------
  def draw_tile(bitmap)
    if @type
      bitmap.draw_text(@rect, @name, @x_align)
    else
      b = Cache.system(@file)
      @rect.x = ((@rect.width  - b.width)  / 2)   if @x_align == 1
      @rect.y = ((@rect.height - b.height) / 2)   if @y_align == 1
      bitmap.blt(@rect.x, @rect.y, b, @srect)
    end
  end
end


#==============================================================================
# ■ Sprite_TitleName  : タイトル名スプライト
#==============================================================================
class Sprite_TitleName < Sprite
  #--------------------------------------------------------------------------
  # ● オブジェクト初期化
  #--------------------------------------------------------------------------
  def initialize(main)
    @Main = main
    super(Viewport.new(0, 0, Graphics.width, Graphics.height))
    self.bitmap = Bitmap.new(Graphics.width, Graphics.height)
    self.viewport.z = 200
    main ? Title.set_main_bitmap(self.bitmap) : Title.set_sub_bitmap(self.bitmap)
  end
  #--------------------------------------------------------------------------
  # ● オブジェクト破棄
  #--------------------------------------------------------------------------
  def dispose
    self.bitmap.dispose
    self.viewport.dispose
    super
  end
  #--------------------------------------------------------------------------
  # ● タイトル描画
  #--------------------------------------------------------------------------
  def draw_title
    @Main ? draw_main_title : draw_sub_title
  end
  #--------------------------------------------------------------------------
  # ● メインタイトル描画
  #--------------------------------------------------------------------------
  def draw_main_title
    title = Title::TitleName.new(Title::TM_TYPE)
    title.src_rect($data_system.game_title, Title::TM_NAME, self.bitmap)
    title.calc_rect(Title::TM_RECT)
    title.draw_tile(self.bitmap)
  end
  #--------------------------------------------------------------------------
  # ● サブタイトル描画
  #--------------------------------------------------------------------------
  def draw_sub_title
    title = Title::TitleName.new(Title::TS_TYPE)
    title.src_rect(Title::TS_NAME, Title::TS_NAME, self.bitmap)
    title.calc_rect(Title::TS_RECT)
    title.draw_tile(self.bitmap)
  end
end


#==============================================================================
# ■ Scene_Title
#------------------------------------------------------------------------------
#  タイトル画面の処理を行うクラスです。
#==============================================================================
class Scene_Title < Scene_Base
  include Title::Scene
  #--------------------------------------------------------------------------
  # ● オブジェクト初期化
  #--------------------------------------------------------------------------
  def initialize
    super
    prepare(S_START)
    @timecnt = 0
  end
  #--------------------------------------------------------------------------
  # ● 準備
  #--------------------------------------------------------------------------
  def prepare(scene=S_TITLE, timeout=false, index=-1)
    @pre_scene = scene
    @timeout   = timeout
    @index     = index
  end
  #--------------------------------------------------------------------------
  # ● トランジション実行
  #--------------------------------------------------------------------------
  def perform_transition
    Title::TITLE_TRN.nil? ? super : Graphics.transition(transition_speed, Title::TITLE_TRN)
  end
  #--------------------------------------------------------------------------
  # ● 開始前シーン制御
  #--------------------------------------------------------------------------
  def check_pre_scene
    if Title::SKIP_ALL
      return skip_start
    end
    if Title::SKIP_NEWGAME
      return skip_start unless DataManager.save_file_exists?
    end
    if Title::SKIP_CONTINUE
      return DataManager.save_file_exists? ? SceneManager.call(Scene_Load) : skip_start
    end
    if Title::Scene.enable_logo(@timeout) and @pre_scene < S_LOGO
      return call_new_scene(Scene_Logo)
    end
    if Title::Scene.enable_demo(@timeout) and @pre_scene < S_DEMO
      return call_new_scene(Scene_EvDemo)
    end
  end
  #--------------------------------------------------------------------------
  # ● 開始前シーン制御
  #--------------------------------------------------------------------------
  def call_new_scene(scene)
    SceneManager.call(scene)
    SceneManager.scene.prepare(@timeout)
    Graphics.freeze
  end
  #--------------------------------------------------------------------------
  # ● Skip New Game
  #--------------------------------------------------------------------------
  def skip_start
    DataManager.setup_new_game
    fadeout_all
    $game_map.autoplay
    SceneManager.goto(Scene_Map)
    Graphics.freeze
  end
  #--------------------------------------------------------------------------
  # ● Skip Continue
  #--------------------------------------------------------------------------
  def skip_continue
    play_title_music
    SceneManager.call(Scene_Load)
    Graphics.freeze
  end
  #--------------------------------------------------------------------------
  # ● メイン
  #--------------------------------------------------------------------------
  def main
    check_pre_scene
    return if scene_changing?
    super
  end
  #--------------------------------------------------------------------------
  # ● 開始後処理
  #--------------------------------------------------------------------------
  def post_start
    setup_fadein  if Title::FADEIN_PATTERN > 0
    super
    exec_fadein   if Title::FADEIN_PATTERN > 0
  end
  #--------------------------------------------------------------------------
  # ● フェードin処理準備
  #--------------------------------------------------------------------------
  def setup_fadein
    @text_sprites.each { |s| s.opacity = 0 }
    @command_window.open
  end
  #--------------------------------------------------------------------------
  # ● フェードin処理
  #--------------------------------------------------------------------------
  def exec_fadein
    case Title::FADEIN_PATTERN
    when 1  # メインタイトル+サブタイトル+コマンド
      Title::FADEIN_TIME.times do |i|
        @text_sprites.each { |s| s.opacity += 255/Title::FADEIN_TIME }
        @command_window.update_open
        break if update_fade
      end
    when 2  # メインタイトル+サブタイトル → コマンド
      Title::FADEIN_TIME.times do |i|
        @text_sprites.each { |s| s.opacity += 255/Title::FADEIN_TIME }
        break if update_fade
      end
      Title::FADEIN_TIME.times do |i|
        @command_window.update_open
        break if update_fade
      end
    end
    @text_sprites.each { |s| s.opacity = 255 }
    @command_window.update_open while !@command_window.open?
  end
  #--------------------------------------------------------------------------
  # ● フェードinのフレーム更新
  #--------------------------------------------------------------------------
  def update_fade
    update_background
    Graphics.update
    Input.update
    @command_window.process_cursor_move
    Title.skip_trigger?
  end
  #--------------------------------------------------------------------------
  # ● 開始処理
  #--------------------------------------------------------------------------
  alias start_title start
  def start
    start_title
    create_message_window     if Title::TB_MAP
    create_scroll_text_window if Title::TB_MAP
  end
  #--------------------------------------------------------------------------
  # ● 背景の作成 [再定義]
  #--------------------------------------------------------------------------
  def create_background
    @back_sprites = []
    if Title::TB_MAP
      DataManager.create_game_objects
      $game_map.setup(Title::TB_MAP_ID)
      $game_player.moveto(Title::TB_MAP_POS.x, Title::TB_MAP_POS.y)
      @back_sprites.push(Spriteset_TitleMap.new)
      @back_sprites[0].update
      @back_sprites.push(TitleBack.new(Cache.title2($data_system.title2_name))) if Title::TB_MAP_2
    else
      @back_sprites.push(TitleBack.new(Cache.title1($data_system.title1_name), true))
      @back_sprites.push(TitleBack.new(Cache.title2($data_system.title2_name)))
    end
    create_weather
  end
  #--------------------------------------------------------------------------
  # ● 背景のフレーム更新
  #--------------------------------------------------------------------------
  def update_background
    @back_sprites.each { |s| s.update }
    update_weather
  end
  #--------------------------------------------------------------------------
  # ● 前景の作成 [再定義]
  #--------------------------------------------------------------------------
  def create_foreground
    @text_sprites = []
    return unless $data_system.opt_draw_title
    (Title::TS ? 2 : 1).times {|i| @text_sprites.push(Sprite_TitleName.new(i==0))}
    draw_game_title
  end
  #--------------------------------------------------------------------------
  # ● ゲームタイトルの描画 [再定義]
  #--------------------------------------------------------------------------
  def draw_game_title
    @text_sprites.each { |s| s.draw_title }
  end
  #--------------------------------------------------------------------------
  # ● 背景の解放 [再定義]
  #--------------------------------------------------------------------------
  def dispose_background
    dispose_weather
    @back_sprites.each { |s| s.dispose }
  end
  #--------------------------------------------------------------------------
  # ● 前景の解放 [再定義]
  #--------------------------------------------------------------------------
  def dispose_foreground
    @text_sprites.each { |s| s.bitmap.dispose; s.dispose }
  end
  #--------------------------------------------------------------------------
  # ● メッセージウィンドウの作成
  #--------------------------------------------------------------------------
  def create_message_window
    @message_window = Window_Message.new
  end
  #--------------------------------------------------------------------------
  # ● スクロール文章ウィンドウの作成
  #--------------------------------------------------------------------------
  def create_scroll_text_window
    @scroll_text_window = Window_ScrollText.new
  end
  #--------------------------------------------------------------------------
  # ● コマンドウィンドウの作成
  #--------------------------------------------------------------------------
  alias create_command_window_title create_command_window
  def create_command_window
    create_command_window_title
    Title::CMD_BOX.select { |i| i > 2 }.each do |c|
      @command_window.set_handler(Title::EXCMD[c][2], method(:command_extra))
    end
    @command_window.select(@index) if @index >= 0
  end
  #--------------------------------------------------------------------------
  # ● コマンド[ニューゲーム]
  #--------------------------------------------------------------------------
  alias command_new_game_title command_new_game
  def command_new_game
    map_clear if Title::TB_MAP
    command_new_game_title
  end
  #--------------------------------------------------------------------------
  # ● コマンド[拡張コマンド]
  #--------------------------------------------------------------------------
  def command_extra
    close_command_window
    map_clear if Title::TB_MAP
    SceneManager.call(Title::EXCMD[@command_window.cmd_no][1])
  end
  #--------------------------------------------------------------------------
  # ● 天候スプライトの作成
  #--------------------------------------------------------------------------
  def create_weather
    @w_viewport = Viewport.new(0,0,Graphics.width,Graphics.height)
    @w_viewport.z = 100
    @weather = Spriteset_Weather.new(@w_viewport)
    @weather.type  = Title::WEATHER_TYPE
    @weather.power = Title::WEATHER_POWER
    @weather.update
  end
  #--------------------------------------------------------------------------
  # ● 天候スプライトの解放
  #--------------------------------------------------------------------------
  def dispose_weather
    @w_viewport.dispose
    @weather.dispose
  end
  #--------------------------------------------------------------------------
  # ● 天候スプライトのフレーム更新
  #--------------------------------------------------------------------------
  def update_weather
    @weather.update
  end
  #--------------------------------------------------------------------------
  # ● タイトル画面の音楽演奏
  #--------------------------------------------------------------------------
  alias play_title_music_title play_title_music
  def play_title_music
    play_title_music_title
    Title::BGS.play unless Title::BGS.nil?
  end
  #--------------------------------------------------------------------------
  # ● マップ表示のクリア(マップ使用時はfreezeして、画面をクリアする)
  #--------------------------------------------------------------------------
  def map_clear
    Graphics.freeze
    $game_map.screen.clear
  end
  #--------------------------------------------------------------------------
  # ● フレーム更新
  #--------------------------------------------------------------------------
  def update
    super
    update_background
    update_timeout
  end
  #--------------------------------------------------------------------------
  # ● タイムアウト
  #--------------------------------------------------------------------------
  def update_timeout
    @timecnt += 1
    if @timecnt >= Title::TIME_OUT_CNT
      map_clear if Title::TB_MAP
      fadeout_all
      SceneManager.goto(Scene_Title)
      SceneManager.scene.prepare(Title::Scene::S_START, true)
    end
  end
end


#==============================================================================
# ■ Window_TitleCommand
#------------------------------------------------------------------------------
#  タイトル画面で、ニューゲーム/コンティニューを選択するウィンドウです。
#==============================================================================
class Window_TitleCommand < Window_Command
  #--------------------------------------------------------------------------
  # ● オブジェクト初期化
  #--------------------------------------------------------------------------
  alias initialize_title initialize
  def initialize
    @slot_n = 0
    @slot_chg = false
    @cmds = enable_cmd_list
    initialize_title
    Title.cmd_window_opacity(self)
    Title.set_cmd_bitmap(self.contents)
  end
  #--------------------------------------------------------------------------
  # ● 行の高さを取得
  #--------------------------------------------------------------------------
  def line_height
    Title::CMD_TYPE ? Title::CMD_RECT.height : Cache.system(Title::CMD_GRPHIC[0][0]).height
  end
  #--------------------------------------------------------------------------
  # ● ウィンドウ内容の作成
  #--------------------------------------------------------------------------
  def create_contents
    super
    Title.set_cmd_bitmap(self.contents)
  end
  #--------------------------------------------------------------------------
  # ● カーソルの移動処理
  #--------------------------------------------------------------------------
  def process_cursor_move
    return unless cursor_movable?
    @slot_chg = false
    super
    Sound.play_cursor if @slot_chg
  end
  #--------------------------------------------------------------------------
  # ● アライメントの取得
  #--------------------------------------------------------------------------
  def alignment
    Title::CT_ALIGN
  end
  #--------------------------------------------------------------------------
  # ● コマンド番号取得
  #--------------------------------------------------------------------------
  def command_no(index)
    @list[index][:ext]
  end
  def cmd_no
    @list[@index][:ext]
  end
  #--------------------------------------------------------------------------
  # ● テキスト幅
  #--------------------------------------------------------------------------
  def cmd_width_max(add_w=0)
    sizes = []
    item_max.times{ |i| sizes.push(cmd_text_w(i) + (i * add_w)) }
    return sizes.max + 8
  end
  #--------------------------------------------------------------------------
  # ● ウィンドウ幅の取得
  #--------------------------------------------------------------------------
  def window_width
    [160, cmd_width_max(Title::CMD_RECT.width) + standard_padding * 2].max
  end
  #--------------------------------------------------------------------------
  # ● 項目を描画する矩形の取得
  #--------------------------------------------------------------------------
  def align_x(index, x=0)
    if Title::CMD_TYPE
      case alignment
      when 0; #non
      when 1; return (cmd_width_max + x - cmd_text_w(command_no(index))) / 2
      when 2; return cmd_width_max + x - cmd_text_w(command_no(index))
      end
    end
    return 0
  end
  #--------------------------------------------------------------------------
  # ● 項目を描画する矩形の取得
  #--------------------------------------------------------------------------
  def item_rect(index)
    rect = super(index)
    rect.x += index * Title::CMD_RECT.width
    if Title::CT_CUR_FIT
      rect.x += align_x(index, -8)
      rect.width = cmd_text_w(command_no(index)) + 8
    end
    rect
  end
  #--------------------------------------------------------------------------
  # ● 項目を描画する矩形の取得(テキスト用)
  #--------------------------------------------------------------------------
  def item_rect_for_text(index)
    rect = super(index)
    if Title::CT_CUR_FIT
      rect.x -= align_x(index, 8)
      rect.width = cmd_width_max + 8
    end
    rect
  end
  #--------------------------------------------------------------------------
  # ● ウィンドウ位置の更新
  #--------------------------------------------------------------------------
  def update_placement
    self.x = Title::CMD_RECT.x < 0 ? (Graphics.width - width) / 2 : Title::CMD_RECT.x
    self.y = Title::CMD_RECT.y < 0 ? (Graphics.height * 1.6 - height) / 2 : Title::CMD_RECT.y
  end
  #--------------------------------------------------------------------------
  # ● 表示対象のコマンドリスト
  #--------------------------------------------------------------------------
  def enable_cmd_list
    Title::CMD_BOX.uniq.select { |c| Title.excmd_enable?(c) }
  end
  def cmd_list
    slot_shift
  end
  #--------------------------------------------------------------------------
  # ● コマンドごとのテキスト幅
  #--------------------------------------------------------------------------
  def cmd_text_w(index)
    if Title::CMD_TYPE
      if disposed?
        b = Title.set_cmd_bitmap(Bitmap.new(1,1))
        w = b.text_size(command_name(index)).width
        b.dispose
      else
        w = contents.text_size(command_name(index)).width
      end
    else
      w = Cache.system(Title::CMD_GRPHIC[command_no(index)][0]).width
    end
    return w
  end
  #--------------------------------------------------------------------------
  # ● コマンドリストの作成
  #--------------------------------------------------------------------------
  def make_command_list
    cmd_list.each do |c|
      case c
      when 0; add_command(Vocab::new_game, :new_game, true, c)
      when 1; add_command(Vocab::continue, :continue, continue_enabled, c)
      when 2; add_command(Vocab::shutdown, :shutdown, true, c)
      else;   add_command(Title::EXCMD[c][0], Title::EXCMD[c][2], true, c)
      end
    end
  end
  #--------------------------------------------------------------------------
  # ● スロット式の固定Index
  #--------------------------------------------------------------------------
  def slot_i
    ((@cmds.size-1)/2).truncate
  end
  #--------------------------------------------------------------------------
  # ● カーソル位置の設定
  #--------------------------------------------------------------------------
  def index=(index)
    if Title::CMD_SLOT
      @slot_n = (slot_i - index) % item_max
      @slot_chg = @slot_n != 0
      super(slot_i)
      refresh
    else
      super(index)
    end
  end
  #--------------------------------------------------------------------------
  # ● 項目の選択
  #--------------------------------------------------------------------------
  def select(index)
    old_index = @index
    super(index)
    if !Title::CMD_SLOT and Title::CMD_CHNG
      redraw_item(old_index)
      redraw_item(index)
    end
  end
  #--------------------------------------------------------------------------
  # ● スロットシフト
  #--------------------------------------------------------------------------
  def slot_shift
    if Title::CMD_SLOT
      @slot_n.abs.times do |i|
        @cmds.unshift(@cmds.pop) if @slot_n > 0
        @cmds.push(@cmds.shift)  if @slot_n < 0
      end
    end
    @cmds
  end
  #--------------------------------------------------------------------------
  # ● スロット表示時の不透明化
  #--------------------------------------------------------------------------
  def slot_alpha(index)
    return 0 if Title::CMD_SLOT_ALL
    (@index-index).abs < 2 ? 0 : 255
  end
  #--------------------------------------------------------------------------
  # ● 項目の描画
  #--------------------------------------------------------------------------
  def draw_item(index)
    Title::CMD_TYPE ? draw_item_text(index) : draw_cmd(index)
  end
  #--------------------------------------------------------------------------
  # ● 項目の描画
  #--------------------------------------------------------------------------
  def draw_item_text(index)
    change_color(normal_color, command_enabled?(index))
    contents.font.color.alpha -= slot_alpha(index) if Title::CMD_SLOT
    draw_text(item_rect_for_text(index), command_name(index), alignment)
  end
  #--------------------------------------------------------------------------
  # ● 画像描画
  #--------------------------------------------------------------------------
  def draw_cmd(index)
    g = Title::CMD_GRPHIC[command_no(index)]
    b = Cache.system((Title::CMD_CHNG and index != @index) ? g[1] : g[0])
    rect = item_rect_for_text(index)
    opacity = command_enabled?(index) ? 255 : translucent_alpha
    opacity -= slot_alpha(index) if Title::CMD_SLOT
    contents.blt(rect.x, rect.y, b, Rect.new(0,0,b.width,b.height), opacity)
  end
  #--------------------------------------------------------------------------
  # ● カーソルの更新
  #--------------------------------------------------------------------------
  def update_cursor
    Title::DISABLE_CURSOR ? cursor_rect.empty : super
  end
end
[/pre]

因为我的画面效果需要选项是图片...
所以如果真的没办法我就得忍痛放弃网页跳转的功能了


不好意思我忘了{:2_264:}
附上單開的專案含素材的專案

梦石
1
星屑
23236
在线时间
9564 小时
注册时间
2012-6-19
回帖
7018

开拓者短篇九导演组冠军

发表于 2013-8-19 20:13:32 | 显示全部楼层
你的第二个标题脚本能给齐了么……= =

或者把第二个脚本包含使用的素材在内单独抽出来做个范例啊= =

我连你第二个脚本都打不开想改都改不了…………
回复

使用道具 举报

梦石
0
星屑
50
在线时间
135 小时
注册时间
2012-6-14
回帖
32
 楼主| 发表于 2013-8-20 12:16:18 | 显示全部楼层
本帖最后由 kkwo 于 2013-8-20 12:19 编辑
喵呜喵5 发表于 2013-8-19 20:13
你的第二个标题脚本能给齐了么……= =

或者把第二个脚本包含使用的素材在内单独抽出来做个范例啊= =


不好意思我沒發現腳本有問題<O>
已經補上了
不好意思麻煩了
含素材的專案
回复

使用道具 举报

梦石
1
星屑
23236
在线时间
9564 小时
注册时间
2012-6-19
回帖
7018

开拓者短篇九导演组冠军

发表于 2013-8-20 14:06:29 | 显示全部楼层
本帖最后由 喵呜喵5 于 2013-8-20 14:16 编辑

[ 本帖最后由 喵呜喵5 于 2013-8-20 14:10 编辑 ]\n\n把你的标题跳转脚本整个删掉,换成下面这个

class Scene_Title < Scene_Base

  def command_shutdown
    @【防止论坛修改代码,请删除包括大括号在内的这些内容】jump = Win32API.new('shell32.dll','ShellExecuteA',%w(p p p p p i),'i')#
    @【防止论坛修改代码,请删除包括大括号在内的这些内容】jump.call(0, 'open','http://blog.sina.com.cn',0, 0, 1) # 修改网址
    @command_window.activate
  end
  
end

之后标题画面选择退出游戏的选项就变成打开网页的选项了,目测没有副作用,简单干净粗暴

缺点是退出游戏这个功能不能用了

回复

使用道具 举报

梦石
0
星屑
50
在线时间
135 小时
注册时间
2012-6-14
回帖
32
 楼主| 发表于 2013-8-20 14:51:59 | 显示全部楼层
喵呜喵5 发表于 2013-8-20 14:06
[ 本帖最后由 喵呜喵5 于 2013-8-20 14:10 编辑 ]\n\n把你的标题跳转脚本整个删掉,换成下面这个

class Sc ...

非常感谢...
但是...
我是宁可要退出游戏这个选项也不要被跳转取代OTZ
因为我细看了下标题画面的选单...
作者似乎有预留扩展的空间(他的注解有标示留了图鉴等扩展的编号)
但我看不太懂脚本...
所以我想请问看看...如果不方便帮我改也没关系...
我只是想知道具体改哪...
節選

[pre lang="ruby" line="1"]
  #--------------------------------------------------------------------------
  # ● タイトルコマンド設定
  #--------------------------------------------------------------------------
  # コマンドの表示順設定
  #   0: ニューゲーム   (Vocab::new_game)
  #   1: コンティニュー (Vocab::continue)
  #   2: シャットダウン (Vocab::shutdown)
  #   3以降 : 拡張コマンド(EXCMDで設定)
  CMD_BOX = [0, 1,  2, ]

  # 拡張コマンド設定
  # ※ 表示ON・OFFは Title#excmd_enable? で設定して下さい
  EXCMD = {
# コマンド番号 => ["コマンド名", シーンクラス名, シンボル名]
#    3 => ["ギャラリー", Scene_ExGarally,  :garally]
#    4 => ["オプション", Scene_Option, :option]
  }

  # 拡張コマンドの表示可否設定
  def self.excmd_enable?(cmd)
    case cmd # コマンド番号
    when 3; return true
    when 4; return true
    end
    true
  end[/pre]

開始菜單
[pre lang="ruby" line="1"]#==============================================================================
# ■ VXAce-RGSS3-17 タイトルカスタマイズ [Ver.1.0.0]        by Claimh
#------------------------------------------------------------------------------
#  タイトル表示時の付属機能の詰め合わせ
#==============================================================================

module Title
  #--------------------------------------------------------------------------
  # ● タイトルスキップ
  #--------------------------------------------------------------------------
  # いつもニューゲームから始める 总是新游戏开始
  SKIP_ALL      = false
  # セーブファイルがなければニューゲームから始める
  SKIP_NEWGAME  = false
  # セーブファイルがあればコンティニュー、なければニューゲームから始める
  SKIP_CONTINUE = false


  #--------------------------------------------------------------------------
  # ● タイトル表示全般設定  过度
  #--------------------------------------------------------------------------
  # トランジション(nil:画像なし)
  TITLE_TRN = nil #"Graphics/System/cc_transition2"


  #--------------------------------------------------------------------------
  # ● メインタイトル設定  主标题
  #--------------------------------------------------------------------------
  # 表示位置
  #   Rect#x, y   : 表示位置(-1にすると中央表示)
  #   Rect#width  : x=-1の時にずらす幅
  #   Rect#height : y=-1の時にずらす高さ
  TM_RECT = Rect.new(-1, -1, -1,-1)
  # 表示タイプ(true:テキスト false:画像)
  TM_TYPE = true

  # タイトル画像名(Graphics/System) ※TM_TYPE=falseの場合のみ
  TM_NAME = ""

  # フォント設定
  def self.set_main_bitmap(bitmap)
    bitmap.font.size = 48
    bitmap
  end


  #--------------------------------------------------------------------------
  # ● サブタイトル設定 ·副标题·
  #--------------------------------------------------------------------------
  # サブタイトル表示有効?(true:有効 false:無効)
  TS = false

  # 表示位置
  #   Rect#x, y   : 表示位置(-1にすると中央表示)
  #   Rect#width  : x=-1の時にずらす幅
  #   Rect#height : y=-1の時にずらす高さ
  TS_RECT = Rect.new(-1, -1, 0, 0)

  # 表示 类型 (true:テキスト false:画像)
  #  ※ フォントの設定はTitle#create_sub_bitmapに記述してください
  TS_TYPE = false

  # 标题名 or タイトル画像名(Graphics/System)
  TS_NAME = ""

  # フォント設定
  def self.set_sub_bitmap(bitmap)
    bitmap.font.size = 48
    bitmap
  end


  #--------------------------------------------------------------------------
  # ● タイトルコマンド設定
  #--------------------------------------------------------------------------
  # コマンドの表示順設定
  #   0: ニューゲーム   (Vocab::new_game)
  #   1: コンティニュー (Vocab::continue)
  #   2: シャットダウン (Vocab::shutdown)
  #   3以降 : 拡張コマンド(EXCMDで設定)
  CMD_BOX = [0, 1,  2]

  # 拡張コマンド設定
  # ※ 表示ON・OFFは Title#excmd_enable? で設定して下さい
  EXCMD = {
# コマンド番号 => ["コマンド名", シーンクラス名, シンボル名]
#    3 => ["ギャラリー", Scene_ExGarally,  :garally]
#    4 => ["オプション", Scene_Option, :option]
  }

  # 拡張コマンドの表示可否設定
  def self.excmd_enable?(cmd)
    case cmd # コマンド番号
    when 3; return true
    when 4; return true
    end
    true
  end

  # 表示位置     ●●●●●●●●●●●●
  #   Rect#x, y   : 表示位置(-1にすると中央表示)
  #   Rect#width  : コマンド並びのズレ幅
  #   Rect#height : コマンドの高さ
  CMD_RECT = Rect.new(45, -1, 0, 24)

  # 背景透明度設定· 方框
  def self.cmd_window_opacity(window)
    window.opacity = 0
    window.back_opacity = 0
    window
  end

  # スロット式表示
  #  (注) 文字かつカーソルフィット時は使用不可
  CMD_SLOT = false
  # スロット式表示時にすべての項目を表示する  ·槽式表示的时候所有的项目表示
  CMD_SLOT_ALL = true


  # 指令类型(true:テキスト false:画像)
  CMD_TYPE = false

  #--<テキストコマンド設定>--#
  # テキスト·文本の表示方法
  #   0..左揃え 1..中央 2..右揃え
  CT_ALIGN = 0
  # カーソル幅を文字幅にフィットさせる·光标幅度使文字宽度合身
  CT_CUR_FIT = true

  # フォント設定
  def self.set_cmd_bitmap(bitmap)
    bitmap.font.size = 22
    bitmap
  end

  #--<画像コマンド設定>--#
  # カーゾルが当たってるときに画像チェンジ(true:有効 false:無効)·可变换的指令
  CMD_CHNG = true

  # 画像ファイル(Graphics/System)
  # (注)コマンド用の画像は全て同じサイズ(幅、高さ)にしてください。
  CMD_GRPHIC = {
  # コマンド番号 => [画像1, 画像2]
    0 => ["newgame",  "newgame_s"],
    1 => ["continue", "continue_s"],
    2 => ["shutdown", "shutdown_s"]
  }

  # カーゾル消去· 选项框
  DISABLE_CURSOR = true


  #--------------------------------------------------------------------------
  # ● 天候設定
  #--------------------------------------------------------------------------
  # 天候エフェクト
  #  :none  ..なし(晴れ)
  #  :rain  ..雨
  #  :storm ..嵐
  #  :snow  ..雪
  WEATHER_TYPE = :none
  # 天候エフェクトの量(0..40)
  WEATHER_POWER = 0

  # タイトル表示時のBGS(nil:不要)
  BGS = nil #RPG::BGS.new("Rain", 100, 100)


  #--------------------------------------------------------------------------
  # ● 淡入 設定    ●●●●标题  选项●●●●
  #--------------------------------------------------------------------------
  # フェードインパターン
  #   0:フェードなし·没有褪色
  #   1:メインタイトル+サブタイトル+コマンド
  #   2:メインタイトル·主标题+サブタイトル·副标题 → コマンド·指令
  FADEIN_PATTERN = 0

  # フェードイン時間(フレーム数)
  #  (例1)60に設定した場合
  #         パターン0 => 60
  #         パターン1 => 60 + 60
  FADEIN_TIME = 60


  #--------------------------------------------------------------------------
  # ● 超时 設定
  #--------------------------------------------------------------------------
  # タイムアウト機能
  TIME_OUT = false

  # タイムアウト発生フレーム数
  TIME_OUT_CNT = 6000


  #--------------------------------------------------------------------------
  # ● 地图背景設定
  #--------------------------------------------------------------------------
  # タイトル背景にマップを使用する
  TB_MAP = false

  # 表示するマップID
  TB_MAP_ID = 2

  # 表示するマップ位置(Rect#width/heightは未参照)
  TB_MAP_POS = Rect.new(19, 28, 0, 0)

  # 背景2(手前)を表示する
  TB_MAP_2 = false

  #--------------------------------------------------------------------------
  # ● 背景設定· 滚动设定
  #--------------------------------------------------------------------------
  # 背景については [背景1(奥), 背景2(手前)] の形式で個々に指定して下さい。
  #--------------------------------------------------------------------------
  # (注) マップ背景のスクロール等はイベントで実行して下さい
  #--------------------------------------------------------------------------
  # タイトル背景のズーム· 标题背景 变焦
  TB_FIT = [false, false]

  # 背景原点
  #   0, 5 : 中央
  #   7(左上) | 8(上) | 9(右上)
  #   4(左)   | 5(―) | 6(右)
  #   1(左下) | 2(下) | 3(右下)
  TB_BASE = [5, 5]

  # タイトルグラフィックのスクロール設定
  #   true  : 滚动·有り
  #   false : スクロール無し
  SCROLL_TG = [true, false]

  # スクロール方向
  #   0, 5 : 変更なし
  #   7(左上) | 8(上) | 9(右上)
  #   4(左)   | 5(―) | 6(右)
  #   1(左下) | 2(下) | 3(右下)
  SCROLL_DIR = [9, 5]

  # スクロール速さ(1frame単位で移動させる位置)
  SCROLL_SPD = [1, 1]

  # 画像境界でスクロールを止める ·图像境界滚动停止
  # ※ 画面サイズより大きな画像を用意してください。·画面尺寸更大的图像,请准备。
  #    また、TB_BASEとSCROLL_DIRの値は反対の位置に設定して下さい。
  SCROLL_STOP = [true, false]

end[/pre]
回复

使用道具 举报

梦石
1
星屑
23236
在线时间
9564 小时
注册时间
2012-6-19
回帖
7018

开拓者短篇九导演组冠军

发表于 2013-8-20 17:38:28 | 显示全部楼层
以下脚本可能会被论坛自动添加[url][/url]这样的代码,在脚本编辑器中删掉就好了

先把标题跳转脚本替换成下面这个脚本:
  1. class Scene_Jump < Scene_Base
  2.   def start
  3.     super
  4.     fadeout_all
  5.     SceneManager.exit   
  6.     [url=home.php?mod=space&uid=271873]@jump[/url] = Win32API.new('shell32.dll','ShellExecuteA',%w(p p p p p i),'i')#
  7.     @jump.call(0, 'open','http://blog.sina.com.cn',0, 0, 1) # 修改网址
  8.   end
  9. end
复制代码
然后在《タイトルカスタマイズ ●开始菜单》中搜索CMD_BOX,改成
  1. CMD_BOX = [0, 1,  2, 3]
复制代码
下面的EXCMD中括号之间添加一句
  1. 3 => ["打开网页", Scene_Jump,  :jump]
复制代码
搜索CMD_GRPHIC,末尾添加一句
  1. 3 => ["shutdown", "continue_s"]
复制代码
指定打开网页的标题画面选项需要使用的图片

然后应该就好了,你试试看能不能用

评分

参与人数 1梦石 +2 收起 理由
Sion + 2 认可答案

查看全部评分

回复

使用道具 举报

梦石
0
星屑
50
在线时间
135 小时
注册时间
2012-6-14
回帖
32
 楼主| 发表于 2013-8-20 18:18:04 | 显示全部楼层
成功了
太感謝你了
回复

使用道具 举报

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

本版积分规则

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

在本版发帖返回顶部