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

Project1

 找回密码
 注册会员
搜索
查看: 2985|回复: 2

[已经解决] 大地图显示不同区域的名称

[复制链接]

Lv2.观梦者

梦石
0
星屑
893
在线时间
93 小时
注册时间
2019-1-14
帖子
11
发表于 2019-7-28 20:26:00 | 显示全部楼层 |阅读模式

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

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

x
又来麻烦各位大神了、在一个大地图上可以显示不同区域的名称吗?
例如:在同一个地图上显示澳大利亚,然后在同一地图的某个区域显示中国?

Lv4.逐梦者

梦石
1
星屑
14499
在线时间
2086 小时
注册时间
2017-9-28
帖子
662
发表于 2019-7-28 21:27:29 | 显示全部楼层
  1. #==============================================================================
  2. # ** 区域名称
  3. # Author: Hime
  4. # Version: 1.1
  5. # Date: May 5, 2012
  6. #------------------------------------------------------------------------------
  7. # ** Change log
  8. # 1.1
  9. #   -created a custom region window
  10. #   -now shows the party leader by default
  11. # 1.0 May 5, 2012
  12. #   -initial release
  13. #------------------------------------------------------------------------------
  14. # 本脚本会自动追踪玩家所处的区域(通过区域id),当玩家进入新区域时显示一个信息
  15. # 提示
  16. #
  17. # 使用方法,使用地图备注:
  18. #    <region names>
  19. #       1: 区域名称
  20. #       2: 区域名称
  21. #       10: 区域名称
  22. #    </region names>
  23. #
  24. # 请将“区域名称”替换为其他文字
  25. #------------------------------------------------------------------------------
  26. # 本脚本和yanfly的“区域战斗背景”兼容,在下面设定。
  27. #==============================================================================
  28. $imported = {} if $imported.nil?

  29. module Tsuki
  30.   module Region_Names
  31.     #进入新区域时显示的信息前半部分
  32.     Entrance_Message = "已进入: "
  33.    
  34.     #你是否使用了 yanfly 闲谈窗口?
  35.     Use_Gab = false
  36.   end
  37. end

  38. module Tsuki
  39.   module Regex
  40.     module Map
  41.       Region_Names_On = /<(?:REGION_NAMES|region names)>/i
  42.       Region_Names_Off = /<\/(?:REGION_NAMES|region names)>/i
  43.       Region_Names_ID = /(\d+):[ ](.*)/i
  44.     end
  45.   end
  46. end

  47. class RPG::Map
  48.   attr_accessor :region_names
  49.   
  50.   def load_notetags_region_names
  51.     @region_names = {}
  52.     @region_battlebacks_on = false
  53.     self.note.split(/[\r\n]+/).each do |line|
  54.       case line
  55.       when Tsuki::Regex::Map::Region_Names_On
  56.         @region_names_on = true
  57.       when Tsuki::Regex::Map::Region_Names_Off
  58.         
  59.         @region_names_on = false
  60.       when Tsuki::Regex::Map::Region_Names_ID
  61.         next unless @region_names_on
  62.         rid = $1.to_i
  63.         @region_names[rid] = "" if @region_names[rid].nil?
  64.         @region_names[rid] = $2.to_s
  65.       end
  66.     end
  67.   end
  68. end

  69. class Game_Map
  70.   
  71.   alias tsuki_regionNames_setup setup
  72.   def setup(map_id)
  73.     tsuki_regionNames_setup(map_id)
  74.     @map.load_notetags_region_names
  75.   end
  76.   
  77.   def region_names
  78.     return @map.region_names
  79.   end
  80.    
  81.   def region_name
  82.     name = region_names[$game_player.region_id]
  83.     return name if name else ""
  84.   end
  85. end

  86. class Game_Player < Game_Character
  87.   
  88.   #attr_reader :last_region
  89.   alias tsuki_regionNames_initialize initialize
  90.   def initialize
  91.     tsuki_regionNames_initialize
  92.     @last_region = 0
  93.     @region_changed = false
  94.   end
  95.   
  96.   alias tsuki_regionNames_update update
  97.   def update
  98.     tsuki_regionNames_update
  99.     @region_changed = @last_region != region_id && region_id != 0
  100.     @last_region = region_id if region_id != 0
  101.   end
  102.   
  103.   def region_changed?
  104.     @region_changed
  105.   end
  106. end

  107. class Scene_Map < Scene_Base
  108.   
  109.   alias tsuki_regionName_update_scene update_scene
  110.   def update_scene
  111.     tsuki_regionName_update_scene
  112.     update_region_change unless scene_changing?
  113.   end
  114.   
  115.   def update_region_change
  116.     if $game_player.region_changed?
  117.       message = Tsuki::Region_Names::Entrance_Message + $game_map.region_name
  118.       if $imported["YEA-GabWindow"] && Tsuki::Region_Names::Use_Gab
  119.         Game_Interpreter.new.gab(message, 0)
  120.       else
  121.         @region_name_window.open(message)
  122.       end
  123.     end
  124.   end
  125.   
  126.   alias tsuki_regionName_create_all_windows create_all_windows
  127.   def create_all_windows
  128.     tsuki_regionName_create_all_windows
  129.     create_region_location_window
  130.   end
  131.   
  132.   #--------------------------------------------------------------------------
  133.   # * Create Region Name Window
  134.   #--------------------------------------------------------------------------
  135.   def create_region_location_window
  136.     @region_name_window = Window_RegionName.new
  137.   end
  138. end

  139. #==============================================================================
  140. # ** Window_RegionName
  141. #------------------------------------------------------------------------------
  142. #  This window displays the region name on the map.
  143. #==============================================================================

  144. class Window_RegionName < Window_Base
  145.   #--------------------------------------------------------------------------
  146.   # * Object Initialization
  147.   #--------------------------------------------------------------------------
  148.   def initialize
  149.     super(300, 0, window_width, fitting_height(1))
  150.     self.opacity = 0
  151.     self.contents_opacity = 0
  152.     @show_count = 0
  153.     refresh
  154.   end
  155.   #--------------------------------------------------------------------------
  156.   # * Get Window Width
  157.   #--------------------------------------------------------------------------
  158.   def window_width
  159.     return 240
  160.   end
  161.   #--------------------------------------------------------------------------
  162.   # * Frame Update
  163.   #--------------------------------------------------------------------------
  164.   def update
  165.     super
  166.     if @show_count > 0 && $game_map.name_display
  167.       update_fadein
  168.       @show_count -= 1
  169.     else
  170.       update_fadeout
  171.     end
  172.   end
  173.   #--------------------------------------------------------------------------
  174.   # * Update Fadein
  175.   #--------------------------------------------------------------------------
  176.   def update_fadein
  177.     self.contents_opacity += 16
  178.   end
  179.   #--------------------------------------------------------------------------
  180.   # * Update Fadeout
  181.   #--------------------------------------------------------------------------
  182.   def update_fadeout
  183.     self.contents_opacity -= 16
  184.   end
  185.   #--------------------------------------------------------------------------
  186.   # * Open Window
  187.   #--------------------------------------------------------------------------
  188.   def open(name)
  189.     refresh(name)
  190.     @show_count = 150
  191.     self.contents_opacity = 0
  192.     self
  193.   end
  194.   #--------------------------------------------------------------------------
  195.   # * Close Window
  196.   #--------------------------------------------------------------------------
  197.   def close
  198.     @show_count = 0
  199.     self
  200.   end
  201.   #--------------------------------------------------------------------------
  202.   # * Refresh
  203.   #--------------------------------------------------------------------------
  204.   def refresh(name="")
  205.     contents.clear
  206.     unless name.empty? || @show_count == 150
  207.       draw_background(contents.rect)
  208.       draw_text(contents.rect, name, 1)
  209.     end
  210.   end
  211.   #--------------------------------------------------------------------------
  212.   # * Draw Background
  213.   #--------------------------------------------------------------------------
  214.   def draw_background(rect)
  215.     temp_rect = rect.clone
  216.     temp_rect.width /= 2
  217.     contents.gradient_fill_rect(temp_rect, back_color2, back_color1)
  218.     temp_rect.x = temp_rect.width
  219.     contents.gradient_fill_rect(temp_rect, back_color1, back_color2)
  220.   end
  221.   #--------------------------------------------------------------------------
  222.   # * Get Background Color 1
  223.   #--------------------------------------------------------------------------
  224.   def back_color1
  225.     Color.new(0, 0, 0, 192)
  226.   end
  227.   #--------------------------------------------------------------------------
  228.   # * Get Background Color 2
  229.   #--------------------------------------------------------------------------
  230.   def back_color2
  231.     Color.new(0, 0, 0, 0)
  232.   end
  233. end
复制代码

评分

参与人数 1星屑 +50 收起 理由
VIPArcher + 50 认可答案

查看全部评分

VA外站脚本汉化群:226308173   |    部分远古文件备份:https://wwzv.lanzoue.com/b02rac5pc  密码:acgm
回复 支持 1 反对 0

使用道具 举报

Lv2.观梦者

梦石
0
星屑
893
在线时间
93 小时
注册时间
2019-1-14
帖子
11
 楼主| 发表于 2019-7-28 21:55:54 | 显示全部楼层

感谢!!!!!!!!!!
回复 支持 反对

使用道具 举报

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

本版积分规则

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

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

GMT+8, 2024-3-29 03:53

Powered by Discuz! X3.1

© 2001-2013 Comsenz Inc.

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