Skip to content

Commit

Permalink
角色头顶显示图标 修复bitmap为nil的bug
Browse files Browse the repository at this point in the history
  • Loading branch information
OneEyedEagle committed Mar 10, 2020
1 parent dd01621 commit 5bbacc7
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
6 changes: 3 additions & 3 deletions Event System/角色头顶显示图标.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#==============================================================================
# ■ 角色头顶显示图标 by 老鹰(http://oneeyedeagle.lofter.com/)
#==============================================================================
# - 2020.2.13.22
# - 2020.3.6.11 修复bitmap无效的bug
#==============================================================================
# - 本插件新增了在地图上角色头顶显示指定图标的功能(仿气泡)
#--------------------------------------------------------------------------
Expand Down Expand Up @@ -50,15 +50,14 @@ def initialize(viewport, character = nil)
@pop_icon = 0
eagle_popicon_init(viewport, character)
@popicon_sprite = ::Sprite.new(viewport)
@popicon_sprite.bitmap = Bitmap.new(24, 24)
end
#--------------------------------------------------------------------------
# ● 释放
#--------------------------------------------------------------------------
alias eagle_popicon_dispose dispose
def dispose
eagle_popicon_dispose
@popicon_sprite.bitmap.dispose
@popicon_sprite.bitmap.dispose if @popicon_sprite.bitmap
@popicon_sprite.dispose
end
#--------------------------------------------------------------------------
Expand Down Expand Up @@ -95,6 +94,7 @@ def reset_popicon
@pop_icon = @character.pop_icon
@character.pop_icon = 0

@popicon_sprite.bitmap ||= Bitmap.new(24, 24)
@popicon_sprite.bitmap.clear
@popicon_sprite.ox = 12
@popicon_sprite.oy = 24
Expand Down
7 changes: 7 additions & 0 deletions TEMP/【学习笔记】.rb
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,13 @@ def getUserName
end
p getUserName

ShellExecute = Win32API.new("shell32.dll", "ShellExecute", "LPPPPI", "I")
def run_text
ShellExecute.call(0, "open", "README.md", nil, nil, 1)
end
run_text
#p Dir.pwd

# 获取某个按键的状态
# 返回:高位为1代表被按下,低位为1代表被激活(如大写)
#@getKeyState = Win32API.new("user32", "GetKeyState", 'i', 'i')
Expand Down

0 comments on commit 5bbacc7

Please sign in to comment.