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

Project1

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

[已经解决] 换个问题 请问这个脚本 显示在游戏里的时候怎么换行

[复制链接]
回帖奖励 100 星屑 回复本帖可获得 10 星屑奖励! 每人限 2 次(中奖概率 50%)

Lv3.寻梦者

梦石
0
星屑
1906
在线时间
303 小时
注册时间
2020-3-17
帖子
50
跳转到指定楼层
1
发表于 2022-3-15 15:16:21 | 只看该作者 |只看大图 回帖奖励 |倒序浏览 |阅读模式

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

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

x
本帖最后由 SYK1494715212 于 2022-3-18 16:53 编辑

就是下面那个脚本
里面的说明内容不管怎么写都是一行
想知道有没有什么办法让那个说明在游戏里显示的时候
换行
不要全都挤在一起

因为换了个问题所以
下面的图可以无视

RUBY 代码复制
  1. #~ #== Szyu Scripts presents =====================================================
  2. # * Szyu Scripts' 简单派系
  3. # Version 1.1
  4. # by Szyu
  5. #
  6. #== Download ==================================================================
  7. # * pastebin:
  8. # [url]http://adf.ly/4920670/simple-factions[/url]
  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. #==============================================================================
  105. # ** Game Faction
  106. #==============================================================================
  107. class Game_Faction
  108.   attr_reader :id
  109.   attr_reader :name
  110.   attr_reader :reputation
  111.   attr_reader :type
  112.   attr_reader :level
  113.   #--------------------------------------------------------------------------
  114.   # * Initialize
  115.   #--------------------------------------------------------------------------
  116.   def initialize(id)
  117.     @id = id
  118.     fac = SZS_Factions::Factions[id]
  119.     @name = fac[:name]
  120.     @type = fac[:type]
  121.     @reputation = fac[:initial_value]
  122.     check_level
  123.   end
  124.   #--------------------------------------------------------------------------
  125.   # * Gain Reputation
  126.   #--------------------------------------------------------------------------
  127.   def gain_reputation(amount)
  128.     @reputation += amount
  129.     check_level
  130.   end
  131.   #--------------------------------------------------------------------------
  132.   # * Lose Reputation
  133.   #--------------------------------------------------------------------------
  134.   def lose_reputation(amount)
  135.     gain_reputation(-amount)
  136.   end
  137.   #--------------------------------------------------------------------------
  138.   # * Check Reputation Level
  139.   #--------------------------------------------------------------------------
  140.   def check_level
  141.     lv = -1
  142.     SZS_Factions::Levels.each do |rlv|
  143.       lv += 1 if @reputation >= rlv[:rep_min]
  144.     end
  145.     @level = lv
  146.   end
  147. end
  148.  
  149. #==============================================================================
  150. # ** Game Factions
  151. #==============================================================================
  152. class Game_Factions
  153.   #--------------------------------------------------------------------------
  154.   # * Object Initialization
  155.   #--------------------------------------------------------------------------
  156.   def initialize
  157.     @data = []
  158.   end
  159.   #--------------------------------------------------------------------------
  160.   # * Get Actor
  161.   #--------------------------------------------------------------------------
  162.   def [](fac_id)
  163.     return nil unless SZS_Factions::Factions[fac_id]
  164.     @data[fac_id] ||= Game_Faction.new(fac_id)
  165.   end
  166.   #--------------------------------------------------------------------------
  167.   # * Get All Factions not nil
  168.   #--------------------------------------------------------------------------
  169.   def all_factions
  170.     return @data.select{|f| !f.nil?}
  171.   end
  172.   #--------------------------------------------------------------------------
  173.   # * Get All Factions of a certain type
  174.   #--------------------------------------------------------------------------
  175.   def factions_of(type)
  176.     return @data.select{|f| !f.nil? && f.type == type}
  177.   end
  178.   #--------------------------------------------------------------------------
  179.   # * Gain Reputation
  180.   #--------------------------------------------------------------------------
  181.   def gain_reputation(fac_id, amount)
  182.     return nil unless SZS_Factions::Factions[fac_id]
  183.     @data[fac_id] ||= Game_Faction.new(fac_id)
  184.     @data[fac_id].gain_reputation(amount)
  185.   end
  186.   #--------------------------------------------------------------------------
  187.   # * Lose Reputation
  188.   #--------------------------------------------------------------------------
  189.   def lose_reputation(fac_id, amount)
  190.     gain_reputation(fac_id, -amount)
  191.   end
  192. end
  193.  
  194. #==============================================================================
  195. # ** Game_Event
  196. #==============================================================================
  197. class Game_Event < Game_Character
  198.   #--------------------------------------------------------------------------
  199.   # * Get Faction ID of the event's current page
  200.   #--------------------------------------------------------------------------
  201.   def faction
  202.     @page.list.map{|l| l.parameters}.each do |line|
  203.       next if line[0].nil?
  204.       if line[0] =~ /<faction:\s*(\d+)\s*>/i
  205.         fac_id = $1.to_i
  206.         return fac_id if SZS_Factions::Factions[fac_id]
  207.       end
  208.     end
  209.     return nil
  210.   end
  211. end
  212.  
  213. #==============================================================================
  214. # ** Game_Interpreter
  215. #==============================================================================
  216. class Game_Interpreter
  217.   #--------------------------------------------------------------------------
  218.   # * Get Current event
  219.   #--------------------------------------------------------------------------
  220.   def event
  221.     $game_map.events[@event_id] || nil
  222.   end
  223. end
  224.  
  225. #==============================================================================
  226. # ** DataManager
  227. #==============================================================================
  228. class << DataManager
  229.   alias :szs_factions_create_game_objects :create_game_objects
  230.   alias :szs_factions_make_save_contents :make_save_contents
  231.   alias :szs_factions_extract_save_contents :extract_save_contents
  232.   alias :szs_factions_setup_new_game :setup_new_game
  233.   #--------------------------------------------------------------------------
  234.   # * Create Game Objects
  235.   #--------------------------------------------------------------------------
  236.   def create_game_objects
  237.     szs_factions_create_game_objects
  238.     $game_factions = Game_Factions.new
  239.   end
  240.   #--------------------------------------------------------------------------
  241.   # * Create Save Contents
  242.   #--------------------------------------------------------------------------
  243.   def make_save_contents
  244.     contents = szs_factions_make_save_contents
  245.     contents[:factions]        = $game_factions
  246.     contents
  247.   end
  248.   #--------------------------------------------------------------------------
  249.   # * Extract Save Contents
  250.   #--------------------------------------------------------------------------
  251.   def extract_save_contents(contents)
  252.     szs_factions_extract_save_contents(contents)
  253.     $game_factions        = contents[:factions]
  254.   end
  255.   #--------------------------------------------------------------------------
  256.   # * Set Up New Game
  257.   #--------------------------------------------------------------------------
  258.   def setup_new_game
  259.     szs_factions_setup_new_game
  260.     SZS_Factions::Factions.select{|f| f[:discovered]}.each do |f|
  261.       $game_factions[SZS_Factions::Factions.index(f)]
  262.     end
  263.   end
  264. end
  265.  
  266. #==============================================================================
  267. # ** Scene FactionList
  268. #==============================================================================
  269. class Scene_FactionList < Scene_Base
  270.   #--------------------------------------------------------------------------
  271.   # * Start
  272.   #--------------------------------------------------------------------------
  273.   def start
  274.     super
  275.     create_category_window
  276.     create_help_window
  277.     create_fac_list_window
  278.     create_desc_window if SZS_Factions::UseDescriptions
  279.   end
  280.   #--------------------------------------------------------------------------
  281.   # * Create Category Window
  282.   #--------------------------------------------------------------------------
  283.   def create_category_window
  284.     @category_win = Window_FactionCategory.new
  285.     @category_win.set_handler(:ok,     method(:on_category_ok))
  286.     @category_win.set_handler(:cancel, method(:return_scene))
  287.   end
  288.   #--------------------------------------------------------------------------
  289.   # * Create Status Window
  290.   #--------------------------------------------------------------------------
  291.   def create_help_window
  292.     @help_window = Window_FactionStatus.new
  293.   end
  294.   #--------------------------------------------------------------------------
  295.   # * Create List Window
  296.   #--------------------------------------------------------------------------
  297.   def create_fac_list_window
  298.     y = @category_win.height
  299.     w = Graphics.width
  300.     h = Graphics.height-y-@help_window.height
  301.     w /= 2 if SZS_Factions::UseDescriptions
  302.     @fac_list_win = Window_FactionList.new(0,y,w,h)
  303.     @fac_list_win.help_window = @help_window
  304.     @fac_list_win.set_handler(:cancel, method(:on_faction_cancel))
  305.     @category_win.reputation_window = @fac_list_win
  306.   end
  307.   #--------------------------------------------------------------------------
  308.   # * Create Description Window
  309.   #--------------------------------------------------------------------------
  310.   def create_desc_window
  311.     y = @category_win.height
  312.     h = Graphics.height-y-@help_window.height
  313.     x = @fac_list_win.width
  314.     w = Graphics.width - x
  315.     @desc_window = Window_FactionDescription.new(x,y,w,h)
  316.     @fac_list_win.description_window = @desc_window
  317.   end
  318.   #--------------------------------------------------------------------------
  319.   # * Terminate
  320.   #--------------------------------------------------------------------------
  321.   def terminate
  322.     super
  323.     @category_win.dispose
  324.     @fac_list_win.dispose
  325.     @help_window.dispose
  326.     @desc_window.dispose if @desc_window
  327.   end
  328.   #--------------------------------------------------------------------------
  329.   # * On Category selected
  330.   #--------------------------------------------------------------------------
  331.   def on_category_ok
  332.     @fac_list_win.activate.select(0)
  333.   end
  334.   #--------------------------------------------------------------------------
  335.   # * On List cancel
  336.   #--------------------------------------------------------------------------
  337.   def on_faction_cancel
  338.     @fac_list_win.deactivate.select(-1)
  339.     @help_window.faction = nil
  340.     @desc_window.faction = nil if @desc_window
  341.     @category_win.activate
  342.   end
  343. end
  344.  
  345. #==============================================================================
  346. # ** Scene_Menu
  347. #==============================================================================
  348. class Scene_Menu < Scene_MenuBase
  349.   alias :szs_factions_create_command_window :create_command_window
  350.   #--------------------------------------------------------------------------
  351.   # * Create Command Window
  352.   #--------------------------------------------------------------------------
  353.   def create_command_window
  354.     szs_factions_create_command_window
  355.     @command_window.set_handler(:factions, method(:command_factions))
  356.   end
  357.   #--------------------------------------------------------------------------
  358.   # * Command Factions
  359.   #--------------------------------------------------------------------------
  360.   def command_factions
  361.     SceneManager.call(Scene_FactionList)
  362.   end
  363. end
  364.  
  365. #==============================================================================
  366. # ** Window_FactionCategory
  367. #==============================================================================
  368. class Window_FactionCategory < Window_HorzCommand
  369.   #--------------------------------------------------------------------------
  370.   # * Public Instance Variables
  371.   #--------------------------------------------------------------------------
  372.   attr_reader   :reputation_window
  373.   #--------------------------------------------------------------------------
  374.   # * Object Initialization
  375.   #--------------------------------------------------------------------------
  376.   def initialize
  377.     super(0, 0)
  378.   end
  379.   #--------------------------------------------------------------------------
  380.   # * Get Window Width
  381.   #--------------------------------------------------------------------------
  382.   def window_width
  383.     Graphics.width
  384.   end
  385.   #--------------------------------------------------------------------------
  386.   # * Get Digit Count
  387.   #--------------------------------------------------------------------------
  388.   def col_max
  389.     return SZS_Factions::FactionType.size
  390.   end
  391.   #--------------------------------------------------------------------------
  392.   # * Frame Update
  393.   #--------------------------------------------------------------------------
  394.   def update
  395.     super
  396.     @reputation_window.category = current_symbol if @reputation_window
  397.   end
  398.   #--------------------------------------------------------------------------
  399.   # * Create Command List
  400.   #--------------------------------------------------------------------------
  401.   def make_command_list
  402.     SZS_Factions::FactionType.each do |k, v|
  403.       add_command(v,k)
  404.     end
  405.   end
  406.   #--------------------------------------------------------------------------
  407.   # * Set Item Window
  408.   #--------------------------------------------------------------------------
  409.   def reputation_window=(reputation_window)
  410.     @reputation_window = reputation_window
  411.     update
  412.   end
  413. end
  414.  
  415. #==============================================================================
  416. # ** Window_FactionList
  417. #==============================================================================
  418. class Window_FactionList < Window_Selectable
  419.   attr_reader :description_window
  420.   #--------------------------------------------------------------------------
  421.   # * Object Initialization
  422.   #--------------------------------------------------------------------------
  423.   def initialize(x, y, width, height)
  424.     super
  425.     @category = :none
  426.     @data = []
  427.   end
  428.   #--------------------------------------------------------------------------
  429.   # * Set Category
  430.   #--------------------------------------------------------------------------
  431.   def category=(category)
  432.     return if @category == category
  433.     @category = category
  434.     refresh
  435.     self.oy = 0
  436.   end
  437.   #--------------------------------------------------------------------------
  438.   # * Set Description Window
  439.   #--------------------------------------------------------------------------
  440.   def description_window=(dw)
  441.     @description_window = dw
  442.     refresh
  443.   end
  444.   #--------------------------------------------------------------------------
  445.   # * Get Digit Count
  446.   #--------------------------------------------------------------------------
  447.   def col_max
  448.     return SZS_Factions::UseDescriptions ? 1 : 2
  449.   end
  450.   #--------------------------------------------------------------------------
  451.   # * Get Number of Items
  452.   #--------------------------------------------------------------------------
  453.   def item_max
  454.     @data ? @data.size : 1
  455.   end
  456.   #--------------------------------------------------------------------------
  457.   # * Get Item
  458.   #--------------------------------------------------------------------------
  459.   def item
  460.     @data && index >= 0 ? @data[index] : nil
  461.   end
  462.   #--------------------------------------------------------------------------
  463.   # * Get Activation State of Selection Item
  464.   #--------------------------------------------------------------------------
  465.   def current_item_enabled?
  466.     return true
  467.   end
  468.   #--------------------------------------------------------------------------
  469.   # * Create Item List
  470.   #--------------------------------------------------------------------------
  471.   def make_item_list
  472.     @data = $game_factions.factions_of(@category)
  473.   end
  474.   #--------------------------------------------------------------------------
  475.   # * Restore Previous Selection Position
  476.   #--------------------------------------------------------------------------
  477.   def select_last
  478.     select(@data.index($game_party.last_item.object) || 0)
  479.   end
  480.   #--------------------------------------------------------------------------
  481.   # * Draw Item
  482.   #--------------------------------------------------------------------------
  483.   def draw_item(index)
  484.     item = @data[index]
  485.     if item
  486.       rect = item_rect(index)
  487.       rect.width -= 4
  488.       draw_text_ex(rect.x,rect.y, item.name)
  489.     end
  490.   end
  491.   #--------------------------------------------------------------------------
  492.   # * Update Help Text
  493.   #--------------------------------------------------------------------------
  494.   def update_help
  495.     @help_window.faction = item if @help_window
  496.     @description_window.faction = item if @description_window
  497.   end
  498.   #--------------------------------------------------------------------------
  499.   # * Refresh
  500.   #--------------------------------------------------------------------------
  501.   def refresh
  502.     make_item_list
  503.     create_contents
  504.     draw_all_items
  505.   end
  506. end
  507.  
  508. #==============================================================================
  509. # ** Window_FactionStatus
  510. #==============================================================================
  511. class Window_FactionStatus < Window_Base
  512.   attr_reader :faction
  513.   #--------------------------------------------------------------------------
  514.   # * Initialize
  515.   #--------------------------------------------------------------------------
  516.   def initialize
  517.     h = fitting_height(1)
  518.     super(0,Graphics.height-h,Graphics.width, h)
  519.   end
  520.   #--------------------------------------------------------------------------
  521.   # * Set Faction
  522.   #--------------------------------------------------------------------------
  523.   def faction=(faction)
  524.     @faction=faction
  525.     refresh
  526.   end
  527.   #--------------------------------------------------------------------------
  528.   # * Refresh
  529.   #--------------------------------------------------------------------------
  530.   def refresh
  531.     contents.clear
  532.     return unless @faction
  533.     draw_reputation
  534.     draw_reputation_text
  535.   end
  536.   #--------------------------------------------------------------------------
  537.   # * Draw Reputation
  538.   #--------------------------------------------------------------------------
  539.   def draw_reputation
  540.     draw_rep_gauge(0, 0, contents.width/3*2,line_height-8,
  541.       @faction.reputation.to_f/SZS_Factions::MaxReputation,
  542.       hp_gauge_color1, hp_gauge_color2)
  543.     change_color(system_color)
  544.     draw_current_and_max_values(96, 0, 132,
  545.       @faction.reputation, SZS_Factions::MaxReputation,
  546.       normal_color, normal_color)
  547.   end
  548.   #--------------------------------------------------------------------------
  549.   # * Draw Reputation Gauge
  550.   #--------------------------------------------------------------------------
  551.   def draw_rep_gauge(x, y, width,height, rate, color1, color2)
  552.     fill_w = (width * rate).to_i
  553.     gauge_y = y+(line_height-height)/2
  554.     contents.fill_rect(x, gauge_y, width, height, gauge_back_color)
  555.     contents.gradient_fill_rect(x, gauge_y, fill_w, height,
  556.     SZS_Factions::Levels[faction.level][:bar_color1] || SZS_Factions::Default_BarColor1,
  557.     SZS_Factions::Levels[faction.level][:bar_color2] || SZS_Factions::Default_BarColor2)
  558.   end
  559.   #--------------------------------------------------------------------------
  560.   # * Draw Reputation Text
  561.   #--------------------------------------------------------------------------
  562.   def draw_reputation_text
  563.     x = contents.width/3*2+8
  564.     txt = SZS_Factions::Levels[faction.level][:name]
  565.     fc = Color.new(0,0,0,96)
  566.     contents.fill_rect(x,0,contents.width-x,line_height, fc)
  567.     draw_text(x,0,contents.width-x,line_height, txt,1)
  568.   end
  569. end
  570.  
  571. #==============================================================================
  572. # ** Window_FactionDescription
  573. #==============================================================================
  574. class Window_FactionDescription < Window_Base
  575.   attr_reader :faction
  576.   #--------------------------------------------------------------------------
  577.   # * Initialize
  578.   #--------------------------------------------------------------------------
  579.   def initialize(x,y,w,h)
  580.     super(x,y,w,h)
  581.   end
  582.   #--------------------------------------------------------------------------
  583.   # * Set Faction
  584.   #--------------------------------------------------------------------------
  585.   def faction=(faction)
  586.     @faction=faction
  587.     refresh
  588.   end
  589.   #--------------------------------------------------------------------------
  590.   # * Refresh
  591.   #--------------------------------------------------------------------------
  592.   def refresh
  593.     contents.clear
  594.     return unless @faction
  595.     draw_faction_graphic if SZS_Factions::UseGraphics
  596.     draw_faction_desc if SZS_Factions::UseDescriptions
  597.   end
  598.   #--------------------------------------------------------------------------
  599.   # * Draw Faction Graphic
  600.   #--------------------------------------------------------------------------
  601.   def draw_faction_graphic
  602.     return unless SZS_Factions::Factions[@faction.id][:graphic]
  603.     gr = Cache.picture(SZS_Factions::Factions[@faction.id][:graphic])
  604.     aspect = gr.width.to_f / gr.height.to_f
  605.     h = contents.width * aspect
  606.     contents.stretch_blt(Rect.new(0,(contents.height-h),contents.width, h),
  607.         gr, Rect.new(0,0,gr.width, gr.height))
  608.   end
  609.   #--------------------------------------------------------------------------
  610.   # * Draw Faction Description
  611.   #--------------------------------------------------------------------------
  612.   def draw_faction_desc
  613.     return unless SZS_Factions::Factions[@faction.id][:description]
  614.     i = 0
  615.     split_text(SZS_Factions::Factions[@faction.id][:description]).each do |line|
  616.       draw_line_back(0, line_height*i, contents.width, line_height)
  617.       draw_text(0, line_height * i, contents.width, line_height, line, SZS_Factions::DescriptionAlignment)
  618.       i += 1
  619.     end
  620.   end
  621.   #--------------------------------------------------------------------------
  622.   # * Draw Line Back
  623.   #--------------------------------------------------------------------------
  624.   def draw_line_back(x,y,w,h)
  625.     contents.fill_rect(x,y+1,w,h-2, Color.new(0,0,0,96))
  626.   end
  627.   #--------------------------------------------------------------------------
  628.   # * Split Text
  629.   #--------------------------------------------------------------------------
  630.   def split_text(txt)
  631.     txt_splits = []
  632.     line = ""
  633.     txt.split.each do |word|
  634.       line += word + " "
  635.       if contents.text_size(line).width > width
  636.         txt_splits << line
  637.         line = ""
  638.       end
  639.     end
  640.     txt_splits << line if line.size > 0
  641.     txt_splits
  642.   end
  643. end
  644.  
  645. #==============================================================================
  646. # ** Window_MenuCommand
  647. #==============================================================================
  648. class Window_MenuCommand < Window_Command
  649.   alias :szs_factions_add_original_commands :add_original_commands
  650.   #--------------------------------------------------------------------------
  651.   # * For Adding Original Commands
  652.   #--------------------------------------------------------------------------
  653.   def add_original_commands
  654.     szs_factions_add_original_commands
  655.     add_command(SZS_Factions::MenuTerm,   :factions) if SZS_Factions::UseInMenu
  656.   end
  657. end

X(T}DWIK6M7L(QIXWV]GN33.png (36.73 KB, 下载次数: 16)

X(T}DWIK6M7L(QIXWV]GN33.png
↖这就是个新手,什么都不懂,大佬见谅。

Lv3.寻梦者

梦石
0
星屑
1906
在线时间
303 小时
注册时间
2020-3-17
帖子
50
2
 楼主| 发表于 2022-3-15 20:47:40 | 只看该作者
真的,求求各位大佬了……
要我重新发个悬赏也行啊……
↖这就是个新手,什么都不懂,大佬见谅。
回复 支持 反对

使用道具 举报

Lv3.寻梦者

梦石
0
星屑
1906
在线时间
303 小时
注册时间
2020-3-17
帖子
50
3
 楼主| 发表于 2022-3-18 16:54:50 | 只看该作者
就是:description那里……
↖这就是个新手,什么都不懂,大佬见谅。
回复 支持 反对

使用道具 举报

Lv4.逐梦者

梦石
0
星屑
10708
在线时间
922 小时
注册时间
2017-10-10
帖子
25
4
发表于 2022-3-21 16:10:57 | 只看该作者
你要的效果?

只要这样...

还是问题已经解决了?

点评

解决了,还是谢谢回答了。  发表于 2022-3-22 17:37
回复 支持 反对

使用道具 举报

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

本版积分规则

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

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

GMT+8, 2024-4-28 02:36

Powered by Discuz! X3.1

© 2001-2013 Comsenz Inc.

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