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

Project1

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

[已经解决] 请问这个脚本 怎么退出 点进去就不能退出了。。

[复制链接]

Lv3.寻梦者

梦石
0
星屑
2385
在线时间
912 小时
注册时间
2014-10-14
帖子
1331

开拓者

跳转到指定楼层
1
发表于 2016-12-6 02:23:17 | 只看该作者 |只看大图 回帖奖励 |倒序浏览 |阅读模式

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

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

x
本帖最后由 j296196585 于 2016-12-6 02:24 编辑

RUBY 代码复制
  1. class Window_HelpSkillLv < Window_Base
  2.   #--------------------------------------------------------------------------
  3.   # ● 初始化对像
  4.   #--------------------------------------------------------------------------
  5.   def initialize
  6.     super(0, 0, 240, 13*32)
  7.     self.opacity = 200
  8.     self.z = 9000
  9.     self.contents = Bitmap.new(width - 32, height - 32)
  10.   end
  11.   def dispose
  12.     super
  13.     if @icon != nil
  14.       @icon.dispose
  15.       @icon = nil
  16.     end
  17.   end
  18.   #--------------------------------------------------------------------------
  19.   # ● 设置文本
  20.   #     text  : 窗口显示的字符串
  21.   #     align : 对齐方式 (0..左对齐、1..中间对齐、2..右对齐)
  22.   #--------------------------------------------------------------------------
  23.   def set_text(x, y, skill)
  24.     # 如果文本和对齐方式的至少一方与上次的不同
  25.     if x != @x or y != @y or skill != @skill
  26.       # 再描绘文本
  27.       self.contents.clear
  28.       self.x = x
  29.       self.y = y
  30.       if @icon != nil
  31.         @icon.dispose
  32.         @icon = nil
  33.       end
  34.       #——————————color
  35.       for b in 1..150
  36.       @color_2 = Color.new(255, 128, 255, 80 - b)
  37.       @color_3 = Color.new(255, 128, 255, 60 + b)
  38.       self.contents.fill_rect(
  39.       Rect.new(2 * b + 4, 0, 2, 30), @color_2)
  40.       self.contents.fill_rect(
  41.       Rect.new(2 * b + 4 - 32, 0, 2, 30), @color_3) if b < 20
  42.       @color_2 = Color.new(192, 192, 192, 80 - b)
  43.       @color_3 = Color.new(192, 192, 192, 60 + b)
  44.       self.contents.fill_rect(
  45.       Rect.new(2 * b + 4, 32, 2, 30), @color_2)
  46.       self.contents.fill_rect(
  47.       Rect.new(2 * b + 4 - 32, 32, 2, 30), @color_3) if b < 20
  48.       @color_2 = Color.new(255, 255, 128, 80 - b)
  49.       @color_3 = Color.new(255, 255, 128, 60 + b)
  50.       self.contents.fill_rect(
  51.       Rect.new(2 * b + 4, 64, 2, 30), @color_2)
  52.       self.contents.fill_rect(
  53.       Rect.new(2 * b + 4 - 32, 64, 2, 30), @color_3) if b < 20
  54.       @color_2 = Color.new(128, 255, 128, 80 - b)
  55.       @color_3 = Color.new(128, 255, 128, 60 + b)
  56.       self.contents.fill_rect(
  57.       Rect.new(2 * b + 4, 96, 2, 30), @color_2)
  58.       self.contents.fill_rect(
  59.       Rect.new(2 * b + 4 - 32, 96, 2, 30), @color_3) if b < 20
  60.       @color_2 = Color.new(128, 255, 255, 80 - b)
  61.       @color_3 = Color.new(128, 255, 255, 60 + b)
  62.       self.contents.fill_rect(
  63.       Rect.new(2 * b + 4, 128, 2, 30), @color_2)
  64.       self.contents.fill_rect(
  65.       Rect.new(2 * b + 4-32, 128, 2, 30), @color_3) if b < 20
  66.       @color_2 = Color.new(255, 128, 255, 80 - b)
  67.       @color_3 = Color.new(255, 128, 255, 60 + b)
  68.       self.contents.fill_rect(
  69.       Rect.new(2 * b + 4, 128+32, 2, 30), @color_2)
  70.       self.contents.fill_rect(
  71.       Rect.new(2 * b + 4-32, 128+32, 2, 30), @color_3) if b < 20
  72.       @color_2 = Color.new(255, 255, 128, 80 - b)
  73.       @color_3 = Color.new(255, 255, 128, 60 + b)
  74.       self.contents.fill_rect(
  75.       Rect.new(2 * b + 4, 128+32*2, 2, 30), @color_2)
  76.       self.contents.fill_rect(
  77.       Rect.new(2 * b + 4-32, 128+32*2, 2, 30), @color_3) if b < 20
  78.       @color_2 = Color.new(192, 192, 192, 80 - b)
  79.       @color_3 = Color.new(192, 192, 192, 60 + b)
  80.       self.contents.fill_rect(
  81.       Rect.new(2 * b + 4, 128+32*3, 2, 30), @color_2)
  82.       self.contents.fill_rect(
  83.       Rect.new(2 * b + 4-32, 128+32*3, 2, 30), @color_3) if b < 20
  84.       @color_2 = Color.new(255, 128, 255, 80 - b)
  85.       @color_3 = Color.new(255, 128, 255, 60 + b)
  86.       self.contents.fill_rect(
  87.       Rect.new(2 * b + 4, 128+32*4, 2, 30), @color_2)
  88.       self.contents.fill_rect(
  89.       Rect.new(2 * b + 4-32, 128+32*4, 2, 30), @color_3) if b < 20
  90.       @color_2 = Color.new(128, 255, 255, 80 - b)
  91.       @color_3 = Color.new(128, 255, 255, 60 + b)
  92.       self.contents.fill_rect(
  93.       Rect.new(2 * b + 4, 128+32*5, 2, 30), @color_2)
  94.       self.contents.fill_rect(
  95.       Rect.new(2 * b + 4-32, 128+32*5, 2, 30), @color_3) if b < 20
  96.       @color_2 = Color.new(255, 128, 255, 80 - b)
  97.       @color_3 = Color.new(255, 128, 255, 60 + b)
  98.       self.contents.fill_rect(
  99.       Rect.new(2 * b + 4, 128+32*6, 2, 30), @color_2)
  100.       self.contents.fill_rect(
  101.       Rect.new(2 * b + 4-32, 128+32*6, 2, 30), @color_3) if b < 20
  102.       @color_2 = Color.new(255, 255, 128, 80 - b)
  103.       @color_3 = Color.new(255, 255, 128, 60 + b)
  104.       self.contents.fill_rect(
  105.       Rect.new(2 * b + 4, 128+32*7, 2, 30), @color_2)
  106.       self.contents.fill_rect(
  107.       Rect.new(2 * b + 4-32, 128+32*7, 2, 30), @color_3) if b < 20
  108.       end
  109.       #——————————size
  110.       self.contents.font.size = 15
  111.       #——————————icon
  112.       @icon = RPG::Cache.icon(skill.icon_name)
  113.       self.contents.blt(
  114.       0, 4, @icon, Rect.new(0, 0, @icon.width, @icon.height))
  115.       #——————————id
  116.       yes_id = true
  117.       if yes_id
  118.       self.contents.font.color = text_color(3)
  119.       self.contents.draw_text(40, 0, width - 8, 32, "["+skill.id.to_s+"]")
  120.       #——————————name
  121.       x_plus = contents.text_size("["+skill.id.to_s+"]").width
  122.       else
  123.       x_plus = 0
  124.       end
  125.       self.contents.font.color = normal_color
  126.       self.contents.draw_text(40+x_plus, 0, width - 8, 32, skill.name)
  127.       #——————————description
  128.       self.contents.font.color = normal_color
  129.       self.contents.draw_text(0, 32, width - 8, 32, skill.description)
  130.       #——————————scope
  131.       self.contents.font.color = system_color
  132.       self.contents.draw_text(0, 32*2, width - 8, 32, "效果范围:")
  133.       self.contents.font.color = normal_color
  134.       case skill.scope
  135.       when 0
  136.         self.contents.draw_text(0, 32*2, width - 8, 32, "无", 1)
  137.       when 1
  138.         self.contents.draw_text(0, 32*2, width - 8, 32, "敌单体", 1)
  139.       when 2
  140.         self.contents.draw_text(0, 32*2, width - 8, 32, "敌全体", 1)
  141.       when 3
  142.         self.contents.draw_text(0, 32*2, width - 8, 32, "己方单体", 1)
  143.       when 4
  144.         self.contents.draw_text(0, 32*2, width - 8, 32, "己方全体", 1)
  145.       when 5
  146.         self.contents.draw_text(20, 32*2, width - 8, 32, "己方单体(HP 0)", 1)
  147.       when 6
  148.         self.contents.draw_text(20, 32*2, width - 8, 32, "己方全体(HP 0)", 1)
  149.       when 7
  150.         self.contents.draw_text(0, 32*2, width - 8, 32, "使用者", 1)
  151.       end
  152.       #——————————occasion
  153.       self.contents.font.color = system_color
  154.       self.contents.draw_text(0, 32*3, width - 8, 32, "可能使用的场合:")
  155.       self.contents.font.color = normal_color
  156.       case skill.scope
  157.       when 0
  158.         self.contents.draw_text(40, 32*3, width - 8, 32, "平时", 1)
  159.       when 1
  160.         self.contents.draw_text(40, 32*3, width - 8, 32, "战斗中", 1)
  161.       when 2
  162.         self.contents.draw_text(40, 32*3, width - 8, 32, "菜单中", 1)
  163.       when 3
  164.         self.contents.draw_text(40, 32*3, width - 8, 32, "不能使用", 1)
  165.       end
  166.       #——————————sp_cost
  167.       self.contents.font.color = system_color
  168.       self.contents.draw_text(
  169.       0, 32*4, width - 8, 32, "消耗"+$data_system.words.sp+":")
  170.       self.contents.font.color = normal_color
  171.       self.contents.draw_text(0, 32*4, width - 8, 32, skill.sp_cost.to_s, 1)
  172.       #——————————power
  173.       self.contents.font.color = system_color
  174.       self.contents.draw_text(0, 32*5, width - 8, 32, "基础威力:")
  175.       self.contents.font.color = normal_color
  176.       self.contents.draw_text(0, 32*5, width - 8, 32, skill.power.to_s, 1)
  177.       #——————————hit
  178.       self.contents.font.color = system_color
  179.       self.contents.draw_text(0, 32*6, width - 8, 32, "命中率:")
  180.       self.contents.font.color = normal_color
  181.       self.contents.draw_text(0, 32*6, width - 8, 32, skill.hit.to_s, 1)
  182.       #——————————element_set
  183.       self.contents.font.color = system_color
  184.       x = 0
  185.       self.contents.draw_text(0, 32*7, width - 8, 32, "属性:")
  186.       for i in skill.element_set
  187.         element_name = $data_system.elements[i]
  188.         self.contents.font.color = normal_color
  189.         self.contents.draw_text(0, 32*7, width - 8, 32, element_name, 1)
  190.         x += 32
  191.       end
  192.       if element_name == nil
  193.         self.contents.font.color = normal_color
  194.         self.contents.draw_text(0, 32*7, width - 8, 32, "无", 1)
  195.       end
  196.       #——————————plus_state_set
  197.       self.contents.font.color = system_color
  198.       x = 0
  199.       self.contents.draw_text(0, 32*8, width - 8, 32, "附加状态:")
  200.       for i in skill.plus_state_set
  201.         state_name = $data_states[i].name
  202.         self.contents.font.color = normal_color
  203.         self.contents.draw_text(0, 32*8, width - 8, 32, state_name, 1)
  204.         x += 32
  205.       end
  206.       if state_name == nil
  207.         self.contents.font.color = normal_color
  208.         self.contents.draw_text(0, 32*8, width - 8, 32, "无", 1)
  209.       end
  210.       #——————————minus_state_set
  211.       self.contents.font.color = system_color
  212.       x = 0
  213.       self.contents.draw_text(0, 32*9, width - 8, 32, "解除状态:")
  214.       for i in skill.minus_state_set
  215.         state_name_2 = $data_states[i].name
  216.         self.contents.font.color = normal_color
  217.         self.contents.draw_text(x, 32*9, width - 8, 32, state_name_2, 1)
  218.         x += 32
  219.       end
  220.       if state_name_2 == nil
  221.         self.contents.font.color = normal_color
  222.         self.contents.draw_text(0, 32*9, width - 8, 32, "无", 1)
  223.       end
  224.       #——————————F
  225.       f = ""
  226.       if skill.atk_f > 0
  227.         f<<"攻击力"<<skill.atk_f.to_s<<"/"
  228.       end
  229.       if skill.eva_f > 0
  230.         f<<"回避"<<skill.eva_f.to_s<<"/"
  231.       end
  232.       if skill.str_f > 0
  233.         f<<"力量"<<skill.str_f.to_s<<"/"
  234.       end
  235.       if skill.dex_f > 0
  236.         f<<"灵巧"<<skill.dex_f.to_s<<"/"
  237.       end
  238.       if skill.agi_f > 0
  239.         f<<"速度"<<skill.agi_f.to_s<<"/"
  240.       end
  241.       if skill.int_f > 0
  242.         f<<"魔力"<<skill.int_f.to_s<<"/"
  243.       end
  244.       if skill.pdef_f > 0
  245.         f<<"物防"<<skill.pdef_f.to_s<<"/"
  246.       end
  247.       if skill.mdef_f > 0
  248.         f<<"魔防"<<skill.mdef_f.to_s<<"."
  249.       end
  250.       self.contents.font.color = system_color
  251.       self.contents.draw_text(
  252.       0, 32*10, width - 8, 32, "受角色能力影响系数:")
  253.       self.contents.font.color = normal_color
  254.       self.contents.draw_text(0, 32*11, width - 8, 32, f)
  255.       @x = x
  256.       @y = y
  257.       [url=home.php?mod=space&uid=260100]@skill[/url] = skill
  258.       @actor = nil
  259.     end
  260.     self.visible = true
  261.   end
  262. end
  263. # 设置模块
  264. module Skill_Lv
  265.   ITEM = {}
  266. end
  267. # 直接把默认技能窗口复制来的
  268. class Window_Skill_Lv < Window_Selectable
  269.   #--------------------------------------------------------------------------
  270.   # ● 初始化对像
  271.   #     actor : 角色
  272.   #--------------------------------------------------------------------------
  273.   def initialize(actor)
  274.     super(0, 128, 320, 352)
  275.     self.opacity = 160
  276.     @actor = actor
  277.     @column_max = 1
  278.     refresh
  279.     self.index = 0
  280.     # 战斗中的情况下将窗口移至中央并将其半透明化
  281.     #if $game_temp.in_battle
  282.     #  self.y = 64
  283.     #  self.height = 256
  284.     #  self.back_opacity = 160
  285.     #end
  286.   end
  287.   #--------------------------------------------------------------------------
  288.   # ● 获取特技
  289.   #--------------------------------------------------------------------------
  290.   def skill
  291.     return @data[self.index]
  292.   end
  293.   #--------------------------------------------------------------------------
  294.   # ● 刷新
  295.   #--------------------------------------------------------------------------
  296.   def refresh
  297.     if self.contents != nil
  298.       self.contents.dispose
  299.       self.contents = nil
  300.     end
  301.     @data = []
  302.     for i in [email]0...@actor.skills.size[/email]
  303.       skill = $data_skills[@actor.skills[i]]
  304.       if skill != nil
  305.         @data.push(skill)
  306.       end
  307.     end
  308.     # 如果项目数不是 0 就生成位图、重新描绘全部项目
  309.     @item_max = @data.size
  310.     if @item_max > 0
  311.       self.contents = Bitmap.new(width - 32, row_max * 32)
  312.       for i in 0...@item_max
  313.         draw_item(i)
  314.       end
  315.     end
  316.   end
  317.   #--------------------------------------------------------------------------
  318.   # ● 描绘项目
  319.   #     index : 项目编号
  320.   #--------------------------------------------------------------------------
  321.   def draw_item(index)
  322.     skill = @data[index]
  323.     #if @actor.skill_can_use?(skill.id)
  324.       self.contents.font.color = normal_color
  325.     #else
  326.     #  self.contents.font.color = disabled_color
  327.     #end
  328.     x = 4 + index % @column_max * (288 + 32)
  329.     y = index / @column_max * 32
  330.     #rect = Rect.new(x, y, self.width / @column_max - 32, 32)
  331.     #self.contents.fill_rect(rect, Color.new(0, 0, 0, 0))
  332.     bitmap = RPG::Cache.icon(skill.icon_name)
  333.     #opacity = self.contents.font.color == normal_color ? 255 : 128
  334.     self.contents.blt(x, y + 4, bitmap, Rect.new(0, 0, 24, 24))#, opacity
  335.     self.contents.draw_text(x + 28, y, 204, 32, skill.name, 0)
  336.     #self.contents.draw_text(x + 232, y, 48, 32, skill.sp_cost.to_s, 2)
  337.   end
  338.   #--------------------------------------------------------------------------
  339.   # ● 刷新帮助文本
  340.   #--------------------------------------------------------------------------
  341.   def update_help
  342.     if self.index != @old_index
  343.     @help_window.set_text(150, 50, self.skill == nil ? "" : self.skill)
  344.     @old_index = self.index
  345.     end
  346.   end
  347. end
  348. class Scene_LvSkill
  349.   def initialize(id)
  350.     @actor = $game_actors[id]
  351.   end
  352.   def main
  353.     map = Spriteset_Map.new
  354.     @skill_window = Window_Skill_Lv.new(@actor)
  355.     @skill_help = Window_HelpSkillLv.new
  356.     @skill_window.help_window = @skill_help
  357.     Graphics.transition
  358.     loop do
  359.       Graphics.update
  360.       Input.update
  361.       update
  362.       if $scene != self
  363.         break
  364.       end
  365.     end
  366.     Graphics.freeze
  367.     map.dispose
  368.     @skill_window.dispose
  369.     @skill_help.dispose
  370.   end
  371.   def update
  372.     @skill_window.update
  373.   end
  374. end

360截图20161206022944903.jpg (111.98 KB, 下载次数: 1)

360截图20161206022944903.jpg

点评

原脚本 也没有 退出功能 能不能 看看  发表于 2016-12-6 13:19
好像是和其他脚本一起用的  发表于 2016-12-6 10:09
按图片上说 点进去就不能退出了5555  发表于 2016-12-6 02:25
------落尽红樱君不见,轻绘梨花泪沾衣。~~~

Lv2.观梦者

梦石
0
星屑
596
在线时间
797 小时
注册时间
2014-7-1
帖子
578

开拓者

2
发表于 2016-12-7 19:28:32 | 只看该作者
本帖最后由 jiushiainilip19 于 2016-12-7 19:35 编辑

348-374行 def update 后面好像没有设定退出, 比如说这样的
  1.    
  2. if Input.trigger?(Input::B)
  3.       # 演奏取消 SE
  4.       $game_system.se_play($data_system.cancel_se)
  5.       # 切换的地图画面
  6.       $scene = Scene_Map.new
  7.       return
  8.     end
复制代码

额。。。好像这脚本不全吧!

点评

不清楚,,,因为这个脚本看起来蛮漂亮的使用起来很萌哒哒  发表于 2016-12-7 22:07

评分

参与人数 2星屑 +215 收起 理由
RyanBern + 200 认可答案
j296196585 + 15 嘿嘿 你可以用用 很好看的

查看全部评分

学习使我疲劳,打工使我疲惫,恋爱使我伤身,吸烟伤我肺腑,饮酒损我形象,旅游使我破费,月底不见铜板,只有在论坛里面看看各种大佬才能使我进去
回复 支持 反对

使用道具 举报

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

本版积分规则

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

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

GMT+8, 2025-4-22 08:24

Powered by Discuz! X3.1

© 2001-2013 Comsenz Inc.

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