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

Project1

 找回密码
 注册会员
搜索
查看: 1217|回复: 0
打印 上一主题 下一主题

[已经过期] 请问一下,Szyu的派系脚本怎么换行

[复制链接]

Lv1.梦旅人

梦石
0
星屑
61
在线时间
4 小时
注册时间
2021-4-13
帖子
2
跳转到指定楼层
1
发表于 2023-3-10 06:08:32 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式

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

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

x
本帖最后由 RovinoVargas 于 2023-3-10 06:22 编辑

就是下面的脚本,:description显示在游戏里会挤在一起,不管怎么样都不能换行。
我不是很懂这个,不知道怎么改,所以来问一下各位大佬

就是这个
  1. #~ #== Szyu Scripts presents =====================================================
  2. # * Szyu Scripts' 简单派系
  3. # Version 1.1
  4. # by Szyu
  5. #
  6. #== Download ==================================================================
  7. # * pastebin:
  8. # http://adf.ly/4920670/simple-factions
  9. #
  10. #== About =====================================================================
  11. # * 该脚本可以为游戏添加自定义派系系统,可以使用事件脚本进行控制
  12. #
  13. #== 使用方法 ================================================================
  14. # * 在下面的 SZS_Factions 模块中修改设定.
  15. #
  16. # * 使用  $game_factions[索引]  来引用指定索引的派系
  17. #   !第一个派系的索引是 0!
  18. #
  19. # * 增加派系声望值:
  20. #    $game_factions.gain_reputation(id, 数值)   
  21. #   减少派系声望值:
  22. #    $game_factions.lose_reputation(id, 数值)
  23. #   如果派系不可见,数值变动将不会出现在派系列表里
  24. #
  25. # * 设定当前事件页的派系,使用注释: <faction: 索引>  
  26. #
  27. # * 在分支条件里使用脚本检查当前事件页的派系:
  28. #   event.faction
  29. #   结果将返回事件的派系索引,无派系时返回  nil.
  30. #
  31. # * 在分支条件里使用脚本:
  32. #   if event.faction && $game_factions[event.faction].reputation > x
  33. #   来对比当前事件的派系值是否大于x
  34. #
  35. #== Terms of Use ==============================================================
  36. # * You are free to use this script for commercial and non-commercial projects.
  37. # However I'd like you to inform me of the projects you are planning to use it
  38. # in, so I can keep track of where my scripts are used.
  39. #
  40. #== Import ====================================================================
  41. $imported = {} if $imported.nil?
  42. $imported["SZ-FACTIONS"] = true
  43. #==============================================================================
  44. module SZS_Factions
  45.   # 设定派系等级:
  46.   #   :name       - 派系等级名称
  47.   #   :rep_min    - 派系等级的最低值
  48.   #   :bar_color1 - Default_BarColor1为nil或未定义时显示的值槽的颜色1
  49.   #   :bar_color2 - Default_BarColor2为nil或未定义时显示的值槽的颜色2
  50.   Levels = [
  51.     {:name => "过街老鼠", :rep_min => 0,
  52.           :bar_color1 => Color.new(220, 20,18),
  53.           :bar_color2 => Color.new(140, 5,30)},
  54.          
  55.     {:name => "芸芸众生", :rep_min =>  1000,
  56.           :bar_color1 => Color.new(40, 32, 218)},
  57.          
  58.     {:name => "略有耳闻", :rep_min => 1800},
  59.    
  60.     {:name => "声名显赫", :rep_min => 2400,
  61.           :bar_color1 => Color.new(52, 242, 32)}
  62.   ]
  63.   #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  64.   # 派系类别. 可以自由增减派系类别:
  65.   #   :faction  - 定义符号, 类似 :type => "巴啦啦小魔仙"   
  66.   FactionType = {
  67.       :faction => "商业派系",
  68.       :individual => "独立派系"
  69.   }
  70.   #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  71.   # 派系列表:
  72.   #   :name           - 派系名称
  73.   #   :type           - 派系类别
  74.   #   :initial_value  - 派系初始声望值
  75.   #   :discovered     - 该派系是否在游戏一开始就可见
  76.   #   :graphic        - 显示的图像
  77.   #   :description    - 显示的说明文字
  78.   Factions = [
  79.     {:name => "复仇者联盟", :type => :faction, :initial_value => 1250, :discovered => true,
  80.       :graphic => "logo",:description =>
  81.       "硬核派系,总是取胜。忠诚是其会员得原则之一,面对它们时不要掉以轻心..."},
  82.     {:name => "创世纪协会", :type => :faction, :initial_value => 1000},
  83.     {:name => "地球猫猫教", :type => :individual, :initial_value => 0,:discovered => true,
  84.       :graphic => "logo",:description => "你已被猫猫包围。"},
  85.   ]
  86.   #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  87.   # 是否启用菜单指令
  88.   UseInMenu = true
  89.   MenuTerm = "派系"
  90.   #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  91.   # 是否显示派系说明文字、图像和说明文字对齐方式
  92.   UseDescriptions = false
  93.   UseGraphics = false
  94.   DescriptionAlignment = 1
  95.   #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  96.   # 派系声望值上限
  97.   MaxReputation = 2500
  98.   #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  99.   # 拍戏声望值值槽默认的颜色1和颜色2
  100.   Default_BarColor1 = Color.new(172,196,36)
  101.   Default_BarColor2 = Color.new(82,106,16)
  102. end

  103. #==============================================================================
  104. # ** Game Faction
  105. #==============================================================================
  106. class Game_Faction
  107.   attr_reader :id
  108.   attr_reader :name
  109.   attr_reader :reputation
  110.   attr_reader :type
  111.   attr_reader :level
  112.   #--------------------------------------------------------------------------
  113.   # * Initialize
  114.   #--------------------------------------------------------------------------
  115.   def initialize(id)
  116.     @id = id
  117.     fac = SZS_Factions::Factions[id]
  118.     @name = fac[:name]
  119.     @type = fac[:type]
  120.     @reputation = fac[:initial_value]
  121.     check_level
  122.   end
  123.   #--------------------------------------------------------------------------
  124.   # * Gain Reputation
  125.   #--------------------------------------------------------------------------
  126.   def gain_reputation(amount)
  127.     @reputation += amount
  128.     check_level
  129.   end
  130.   #--------------------------------------------------------------------------
  131.   # * Lose Reputation
  132.   #--------------------------------------------------------------------------
  133.   def lose_reputation(amount)
  134.     gain_reputation(-amount)
  135.   end
  136.   #--------------------------------------------------------------------------
  137.   # * Check Reputation Level
  138.   #--------------------------------------------------------------------------
  139.   def check_level
  140.     lv = -1
  141.     SZS_Factions::Levels.each do |rlv|
  142.       lv += 1 if @reputation >= rlv[:rep_min]
  143.     end
  144.     @level = lv
  145.   end
  146. end

  147. #==============================================================================
  148. # ** Game Factions
  149. #==============================================================================
  150. class Game_Factions
  151.   #--------------------------------------------------------------------------
  152.   # * Object Initialization
  153.   #--------------------------------------------------------------------------
  154.   def initialize
  155.     @data = []
  156.   end
  157.   #--------------------------------------------------------------------------
  158.   # * Get Actor
  159.   #--------------------------------------------------------------------------
  160.   def [](fac_id)
  161.     return nil unless SZS_Factions::Factions[fac_id]
  162.     @data[fac_id] ||= Game_Faction.new(fac_id)
  163.   end
  164.   #--------------------------------------------------------------------------
  165.   # * Get All Factions not nil
  166.   #--------------------------------------------------------------------------
  167.   def all_factions
  168.     return @data.select{|f| !f.nil?}
  169.   end
  170.   #--------------------------------------------------------------------------
  171.   # * Get All Factions of a certain type
  172.   #--------------------------------------------------------------------------
  173.   def factions_of(type)
  174.     return @data.select{|f| !f.nil? && f.type == type}
  175.   end
  176.   #--------------------------------------------------------------------------
  177.   # * Gain Reputation
  178.   #--------------------------------------------------------------------------
  179.   def gain_reputation(fac_id, amount)
  180.     return nil unless SZS_Factions::Factions[fac_id]
  181.     @data[fac_id] ||= Game_Faction.new(fac_id)
  182.     @data[fac_id].gain_reputation(amount)
  183.   end
  184.   #--------------------------------------------------------------------------
  185.   # * Lose Reputation
  186.   #--------------------------------------------------------------------------
  187.   def lose_reputation(fac_id, amount)
  188.     gain_reputation(fac_id, -amount)
  189.   end
  190. end

  191. #==============================================================================
  192. # ** Game_Event
  193. #==============================================================================
  194. class Game_Event < Game_Character
  195.   #--------------------------------------------------------------------------
  196.   # * Get Faction ID of the event's current page
  197.   #--------------------------------------------------------------------------
  198.   def faction
  199.     @page.list.map{|l| l.parameters}.each do |line|
  200.       next if line[0].nil?
  201.       if line[0] =~ /<faction:\s*(\d+)\s*>/i
  202.         fac_id = $1.to_i
  203.         return fac_id if SZS_Factions::Factions[fac_id]
  204.       end
  205.     end
  206.     return nil
  207.   end
  208. end

  209. #==============================================================================
  210. # ** Game_Interpreter
  211. #==============================================================================
  212. class Game_Interpreter
  213.   #--------------------------------------------------------------------------
  214.   # * Get Current event
  215.   #--------------------------------------------------------------------------
  216.   def event
  217.     $game_map.events[@event_id] || nil
  218.   end
  219. end

  220. #==============================================================================
  221. # ** DataManager
  222. #==============================================================================
  223. class << DataManager
  224.   alias :szs_factions_create_game_objects :create_game_objects
  225.   alias :szs_factions_make_save_contents :make_save_contents
  226.   alias :szs_factions_extract_save_contents :extract_save_contents
  227.   alias :szs_factions_setup_new_game :setup_new_game
  228.   #--------------------------------------------------------------------------
  229.   # * Create Game Objects
  230.   #--------------------------------------------------------------------------
  231.   def create_game_objects
  232.     szs_factions_create_game_objects
  233.     $game_factions = Game_Factions.new
  234.   end
  235.   #--------------------------------------------------------------------------
  236.   # * Create Save Contents
  237.   #--------------------------------------------------------------------------
  238.   def make_save_contents
  239.     contents = szs_factions_make_save_contents
  240.     contents[:factions]        = $game_factions
  241.     contents
  242.   end
  243.   #--------------------------------------------------------------------------
  244.   # * Extract Save Contents
  245.   #--------------------------------------------------------------------------
  246.   def extract_save_contents(contents)
  247.     szs_factions_extract_save_contents(contents)
  248.     $game_factions        = contents[:factions]
  249.   end
  250.   #--------------------------------------------------------------------------
  251.   # * Set Up New Game
  252.   #--------------------------------------------------------------------------
  253.   def setup_new_game
  254.     szs_factions_setup_new_game
  255.     SZS_Factions::Factions.select{|f| f[:discovered]}.each do |f|
  256.       $game_factions[SZS_Factions::Factions.index(f)]
  257.     end
  258.   end
  259. end

  260. #==============================================================================
  261. # ** Scene FactionList
  262. #==============================================================================
  263. class Scene_FactionList < Scene_Base
  264.   #--------------------------------------------------------------------------
  265.   # * Start
  266.   #--------------------------------------------------------------------------
  267.   def start
  268.     super
  269.     create_category_window
  270.     create_help_window
  271.     create_fac_list_window
  272.     create_desc_window if SZS_Factions::UseDescriptions
  273.   end
  274.   #--------------------------------------------------------------------------
  275.   # * Create Category Window
  276.   #--------------------------------------------------------------------------
  277.   def create_category_window
  278.     @category_win = Window_FactionCategory.new
  279.     @category_win.set_handler(:ok,     method(:on_category_ok))
  280.     @category_win.set_handler(:cancel, method(:return_scene))
  281.   end
  282.   #--------------------------------------------------------------------------
  283.   # * Create Status Window
  284.   #--------------------------------------------------------------------------
  285.   def create_help_window
  286.     @help_window = Window_FactionStatus.new
  287.   end
  288.   #--------------------------------------------------------------------------
  289.   # * Create List Window
  290.   #--------------------------------------------------------------------------
  291.   def create_fac_list_window
  292.     y = @category_win.height
  293.     w = Graphics.width
  294.     h = Graphics.height-y-@help_window.height
  295.     w /= 2 if SZS_Factions::UseDescriptions
  296.     @fac_list_win = Window_FactionList.new(0,y,w,h)
  297.     @fac_list_win.help_window = @help_window
  298.     @fac_list_win.set_handler(:cancel, method(:on_faction_cancel))
  299.     @category_win.reputation_window = @fac_list_win
  300.   end
  301.   #--------------------------------------------------------------------------
  302.   # * Create Description Window
  303.   #--------------------------------------------------------------------------
  304.   def create_desc_window
  305.     y = @category_win.height
  306.     h = Graphics.height-y-@help_window.height
  307.     x = @fac_list_win.width
  308.     w = Graphics.width - x
  309.     @desc_window = Window_FactionDescription.new(x,y,w,h)
  310.     @fac_list_win.description_window = @desc_window
  311.   end
  312.   #--------------------------------------------------------------------------
  313.   # * Terminate
  314.   #--------------------------------------------------------------------------
  315.   def terminate
  316.     super
  317.     @category_win.dispose
  318.     @fac_list_win.dispose
  319.     @help_window.dispose
  320.     @desc_window.dispose if @desc_window
  321.   end
  322.   #--------------------------------------------------------------------------
  323.   # * On Category selected
  324.   #--------------------------------------------------------------------------
  325.   def on_category_ok
  326.     @fac_list_win.activate.select(0)
  327.   end
  328.   #--------------------------------------------------------------------------
  329.   # * On List cancel
  330.   #--------------------------------------------------------------------------
  331.   def on_faction_cancel
  332.     @fac_list_win.deactivate.select(-1)
  333.     @help_window.faction = nil
  334.     @desc_window.faction = nil if @desc_window
  335.     @category_win.activate
  336.   end
  337. end

  338. #==============================================================================
  339. # ** Scene_Menu
  340. #==============================================================================
  341. class Scene_Menu < Scene_MenuBase
  342.   alias :szs_factions_create_command_window :create_command_window
  343.   #--------------------------------------------------------------------------
  344.   # * Create Command Window
  345.   #--------------------------------------------------------------------------
  346.   def create_command_window
  347.     szs_factions_create_command_window
  348.     @command_window.set_handler(:factions, method(:command_factions))
  349.   end
  350.   #--------------------------------------------------------------------------
  351.   # * Command Factions
  352.   #--------------------------------------------------------------------------
  353.   def command_factions
  354.     SceneManager.call(Scene_FactionList)
  355.   end
  356. end

  357. #==============================================================================
  358. # ** Window_FactionCategory
  359. #==============================================================================
  360. class Window_FactionCategory < Window_HorzCommand
  361.   #--------------------------------------------------------------------------
  362.   # * Public Instance Variables
  363.   #--------------------------------------------------------------------------
  364.   attr_reader   :reputation_window
  365.   #--------------------------------------------------------------------------
  366.   # * Object Initialization
  367.   #--------------------------------------------------------------------------
  368.   def initialize
  369.     super(0, 0)
  370.   end
  371.   #--------------------------------------------------------------------------
  372.   # * Get Window Width
  373.   #--------------------------------------------------------------------------
  374.   def window_width
  375.     Graphics.width
  376.   end
  377.   #--------------------------------------------------------------------------
  378.   # * Get Digit Count
  379.   #--------------------------------------------------------------------------
  380.   def col_max
  381.     return SZS_Factions::FactionType.size
  382.   end
  383.   #--------------------------------------------------------------------------
  384.   # * Frame Update
  385.   #--------------------------------------------------------------------------
  386.   def update
  387.     super
  388.     @reputation_window.category = current_symbol if @reputation_window
  389.   end
  390.   #--------------------------------------------------------------------------
  391.   # * Create Command List
  392.   #--------------------------------------------------------------------------
  393.   def make_command_list
  394.     SZS_Factions::FactionType.each do |k, v|
  395.       add_command(v,k)
  396.     end
  397.   end
  398.   #--------------------------------------------------------------------------
  399.   # * Set Item Window
  400.   #--------------------------------------------------------------------------
  401.   def reputation_window=(reputation_window)
  402.     @reputation_window = reputation_window
  403.     update
  404.   end
  405. end

  406. #==============================================================================
  407. # ** Window_FactionList
  408. #==============================================================================
  409. class Window_FactionList < Window_Selectable
  410.   attr_reader :description_window
  411.   #--------------------------------------------------------------------------
  412.   # * Object Initialization
  413.   #--------------------------------------------------------------------------
  414.   def initialize(x, y, width, height)
  415.     super
  416.     @category = :none
  417.     @data = []
  418.   end
  419.   #--------------------------------------------------------------------------
  420.   # * Set Category
  421.   #--------------------------------------------------------------------------
  422.   def category=(category)
  423.     return if @category == category
  424.     @category = category
  425.     refresh
  426.     self.oy = 0
  427.   end
  428.   #--------------------------------------------------------------------------
  429.   # * Set Description Window
  430.   #--------------------------------------------------------------------------
  431.   def description_window=(dw)
  432.     @description_window = dw
  433.     refresh
  434.   end
  435.   #--------------------------------------------------------------------------
  436.   # * Get Digit Count
  437.   #--------------------------------------------------------------------------
  438.   def col_max
  439.     return SZS_Factions::UseDescriptions ? 1 : 2
  440.   end
  441.   #--------------------------------------------------------------------------
  442.   # * Get Number of Items
  443.   #--------------------------------------------------------------------------
  444.   def item_max
  445.     @data ? @data.size : 1
  446.   end
  447.   #--------------------------------------------------------------------------
  448.   # * Get Item
  449.   #--------------------------------------------------------------------------
  450.   def item
  451.     @data && index >= 0 ? @data[index] : nil
  452.   end
  453.   #--------------------------------------------------------------------------
  454.   # * Get Activation State of Selection Item
  455.   #--------------------------------------------------------------------------
  456.   def current_item_enabled?
  457.     return true
  458.   end
  459.   #--------------------------------------------------------------------------
  460.   # * Create Item List
  461.   #--------------------------------------------------------------------------
  462.   def make_item_list
  463.     @data = $game_factions.factions_of(@category)
  464.   end
  465.   #--------------------------------------------------------------------------
  466.   # * Restore Previous Selection Position
  467.   #--------------------------------------------------------------------------
  468.   def select_last
  469.     select(@data.index($game_party.last_item.object) || 0)
  470.   end
  471.   #--------------------------------------------------------------------------
  472.   # * Draw Item
  473.   #--------------------------------------------------------------------------
  474.   def draw_item(index)
  475.     item = @data[index]
  476.     if item
  477.       rect = item_rect(index)
  478.       rect.width -= 4
  479.       draw_text_ex(rect.x,rect.y, item.name)
  480.     end
  481.   end
  482.   #--------------------------------------------------------------------------
  483.   # * Update Help Text
  484.   #--------------------------------------------------------------------------
  485.   def update_help
  486.     @help_window.faction = item if @help_window
  487.     @description_window.faction = item if @description_window
  488.   end
  489.   #--------------------------------------------------------------------------
  490.   # * Refresh
  491.   #--------------------------------------------------------------------------
  492.   def refresh
  493.     make_item_list
  494.     create_contents
  495.     draw_all_items
  496.   end
  497. end

  498. #==============================================================================
  499. # ** Window_FactionStatus
  500. #==============================================================================
  501. class Window_FactionStatus < Window_Base
  502.   attr_reader :faction
  503.   #--------------------------------------------------------------------------
  504.   # * Initialize
  505.   #--------------------------------------------------------------------------
  506.   def initialize
  507.     h = fitting_height(1)
  508.     super(0,Graphics.height-h,Graphics.width, h)
  509.   end
  510.   #--------------------------------------------------------------------------
  511.   # * Set Faction
  512.   #--------------------------------------------------------------------------
  513.   def faction=(faction)
  514.     @faction=faction
  515.     refresh
  516.   end
  517.   #--------------------------------------------------------------------------
  518.   # * Refresh
  519.   #--------------------------------------------------------------------------
  520.   def refresh
  521.     contents.clear
  522.     return unless @faction
  523.     draw_reputation
  524.     draw_reputation_text
  525.   end
  526.   #--------------------------------------------------------------------------
  527.   # * Draw Reputation
  528.   #--------------------------------------------------------------------------
  529.   def draw_reputation
  530.     draw_rep_gauge(0, 0, contents.width/3*2,line_height-8,
  531.       @faction.reputation.to_f/SZS_Factions::MaxReputation,
  532.       hp_gauge_color1, hp_gauge_color2)
  533.     change_color(system_color)
  534.     draw_current_and_max_values(96, 0, 132,
  535.       @faction.reputation, SZS_Factions::MaxReputation,
  536.       normal_color, normal_color)
  537.   end
  538.   #--------------------------------------------------------------------------
  539.   # * Draw Reputation Gauge
  540.   #--------------------------------------------------------------------------
  541.   def draw_rep_gauge(x, y, width,height, rate, color1, color2)
  542.     fill_w = (width * rate).to_i
  543.     gauge_y = y+(line_height-height)/2
  544.     contents.fill_rect(x, gauge_y, width, height, gauge_back_color)
  545.     contents.gradient_fill_rect(x, gauge_y, fill_w, height,
  546.     SZS_Factions::Levels[faction.level][:bar_color1] || SZS_Factions::Default_BarColor1,
  547.     SZS_Factions::Levels[faction.level][:bar_color2] || SZS_Factions::Default_BarColor2)
  548.   end
  549.   #--------------------------------------------------------------------------
  550.   # * Draw Reputation Text
  551.   #--------------------------------------------------------------------------
  552.   def draw_reputation_text
  553.     x = contents.width/3*2+8
  554.     txt = SZS_Factions::Levels[faction.level][:name]
  555.     fc = Color.new(0,0,0,96)
  556.     contents.fill_rect(x,0,contents.width-x,line_height, fc)
  557.     draw_text(x,0,contents.width-x,line_height, txt,1)
  558.   end
  559. end

  560. #==============================================================================
  561. # ** Window_FactionDescription
  562. #==============================================================================
  563. class Window_FactionDescription < Window_Base
  564.   attr_reader :faction
  565.   #--------------------------------------------------------------------------
  566.   # * Initialize
  567.   #--------------------------------------------------------------------------
  568.   def initialize(x,y,w,h)
  569.     super(x,y,w,h)
  570.   end
  571.   #--------------------------------------------------------------------------
  572.   # * Set Faction
  573.   #--------------------------------------------------------------------------
  574.   def faction=(faction)
  575.     @faction=faction
  576.     refresh
  577.   end
  578.   #--------------------------------------------------------------------------
  579.   # * Refresh
  580.   #--------------------------------------------------------------------------
  581.   def refresh
  582.     contents.clear
  583.     return unless @faction
  584.     draw_faction_graphic if SZS_Factions::UseGraphics
  585.     draw_faction_desc if SZS_Factions::UseDescriptions
  586.   end
  587.   #--------------------------------------------------------------------------
  588.   # * Draw Faction Graphic
  589.   #--------------------------------------------------------------------------
  590.   def draw_faction_graphic
  591.     return unless SZS_Factions::Factions[@faction.id][:graphic]
  592.     gr = Cache.picture(SZS_Factions::Factions[@faction.id][:graphic])
  593.     aspect = gr.width.to_f / gr.height.to_f
  594.     h = contents.width * aspect
  595.     contents.stretch_blt(Rect.new(0,(contents.height-h),contents.width, h),
  596.         gr, Rect.new(0,0,gr.width, gr.height))
  597.   end
  598.   #--------------------------------------------------------------------------
  599.   # * Draw Faction Description
  600.   #--------------------------------------------------------------------------
  601.   def draw_faction_desc
  602.     return unless SZS_Factions::Factions[@faction.id][:description]
  603.     i = 0
  604.     split_text(SZS_Factions::Factions[@faction.id][:description]).each do |line|
  605.       draw_line_back(0, line_height*i, contents.width, line_height)
  606.       draw_text(0, line_height * i, contents.width, line_height, line, SZS_Factions::DescriptionAlignment)
  607.       i += 1
  608.     end
  609.   end
  610.   #--------------------------------------------------------------------------
  611.   # * Draw Line Back
  612.   #--------------------------------------------------------------------------
  613.   def draw_line_back(x,y,w,h)
  614.     contents.fill_rect(x,y+1,w,h-2, Color.new(0,0,0,96))
  615.   end
  616.   #--------------------------------------------------------------------------
  617.   # * Split Text
  618.   #--------------------------------------------------------------------------
  619.   def split_text(txt)
  620.     txt_splits = []
  621.     line = ""
  622.     txt.split.each do |word|
  623.       line += word + " "
  624.       if contents.text_size(line).width > width
  625.         txt_splits << line
  626.         line = ""
  627.       end
  628.     end
  629.     txt_splits << line if line.size > 0
  630.     txt_splits
  631.   end
  632. end

  633. #==============================================================================
  634. # ** Window_MenuCommand
  635. #==============================================================================
  636. class Window_MenuCommand < Window_Command
  637.   alias :szs_factions_add_original_commands :add_original_commands
  638.   #--------------------------------------------------------------------------
  639.   # * For Adding Original Commands
  640.   #--------------------------------------------------------------------------
  641.   def add_original_commands
  642.     szs_factions_add_original_commands
  643.     add_command(SZS_Factions::MenuTerm,   :factions) if SZS_Factions::UseInMenu
  644.   end
  645. end
复制代码


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

本版积分规则

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

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

GMT+8, 2024-11-1 13:22

Powered by Discuz! X3.1

© 2001-2013 Comsenz Inc.

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