赞 | 0 |
VIP | 15 |
好人卡 | 21 |
积分 | 7 |
经验 | 24727 |
最后登录 | 2021-10-29 |
在线时间 | 2184 小时 |
- 梦石
- 0
- 星屑
- 672
- 在线时间
- 2184 小时
- 注册时间
- 2009-12-6
- 帖子
- 607

|
本帖最后由 ML4455739 于 2012-4-14 20:02 编辑 ; t+ {& K0 r# y: u9 w
) [5 f; l/ f* M7 j% F( y8 V( _, r
在Extra Skill里按1~5是设置
1 ?: d$ l, \: T设置好后回到地图按1~5就是……切换。
) p$ X0 D9 S; I {: t# S8 e7 [# L4 v4 k8 D0 e2 [
请问是要改成直接使用吗?5 I! Q ], E. _) `% G
2 _" a) g4 u0 a3 D2 B
那就用这个吧、记得改XAS_HUDDISABLE_HUD_SWITCH。3 W! w. C9 E8 ]" I0 W
#=============================================================================== # XAS - Hot Key HUD #=============================================================================== # By Mr_Wiggles # Version 1.3 # 7/6/10 #------------------------------------------------------------------------------- # Instructions: # Fill in the constants bellow, paste this script above main and bellow XAS in # your script data base. BE SURE TO SET TO THE RIGHT XAS VERSION!! # # Place the "Hot_Keys_HUD" picture file into your game directory # Graphics/Pictures folder. #------------------------------------------------------------------------------- # Directions of Use: # Simple just press a number key (1 - 5) when the quick skill or item menu is # Showing. #=============================================================================== HUD_X = 0 # X pos of HUD HUD_Y = 0 # Y pos of HUD XAS_HUDDISABLE_HUD_SWITCH = 1 # Set true if XAS 3.7f # set false if XAS 3.6 XASVER_37 = true #=============================================================================== # Numkeys Module #=============================================================================== module Input Numkey = {1 => 1049, 2 => 1050, 3 => 1051, 4 => 1052, 5 => 1053} class << self Key = Win32API.new('user32','GetAsyncKeyState',['i'],'i') def testkey(key) Key.call(key) & 0x01 == 1 end alias hud_key_update update def update hud_key_update @pressed = [] for key in Numkey.values key -= 1000 @pressed.push(key) if testkey(key) end end def pressed?(key) key -= 1000 @pressed = [] if @pressed.nil? return true if @pressed.include?(key) return false end alias hud_key_press? press? def press?(key) return pressed?(key) if key.to_f > 1000 hud_key_press?(key) end end end #=============================================================================== # Game Player #=============================================================================== class Game_Player < Game_Character attr_accessor :hud_equip attr_accessor :hud_item_id attr_accessor :hud_skill_id alias hot_key_hud_init initialize def initialize hot_key_hud_init @hud_equip = [] @hud_item_id = [] @hud_skill_id = [] end def equip_item_to_hud(n, item) if item.nil? $game_system.se_play($data_system.buzzer_se) return end $game_system.se_play($data_system.decision_se) @hud_equip[@hud_equip.index(item)] = nil if @hud_equip.include?(item) @hud_equip[n] = item @hud_item_id[n] = XAS::XASITEM_ID[item.id] @hud_skill_id[n] = item.id end end #=============================================================================== # Quick Skill Window #=============================================================================== if XASVER_37 == false class Xas_Scene_Skill alias hud_quick_menu_main main def main @hot_key_hud = Hot_Key_HUD.new hud_quick_menu_main @hot_key_hud.dispose end alias hotkey_hud_qucik_menu_update update def update hotkey_hud_qucik_menu_update # Hot Key num 1 if Input.press?(Input::Numkey[1]) $game_player.equip_item_to_hud(0, @skill_window.skill) # Hot Key num 2 elsif Input.press?(Input::Numkey[2]) $game_player.equip_item_to_hud(1, @skill_window.skill) # Hot Key num 3 elsif Input.press?(Input::Numkey[3]) $game_player.equip_item_to_hud(2, @skill_window.skill) # Hot Key num 4 elsif Input.press?(Input::Numkey[4]) $game_player.equip_item_to_hud(3, @skill_window.skill) # Hot Key num 5 elsif Input.press?(Input::Numkey[5]) $game_player.equip_item_to_hud(4, @skill_window.skill) end @hot_key_hud.update end end else class Quick_Menu_Skill alias hud_quick_menu_main main def main @hot_key_hud = Hot_Key_HUD.new hud_quick_menu_main @hot_key_hud.dispose end alias hotkey_hud_qucik_menu_update update def update hotkey_hud_qucik_menu_update # Hot Key num 1 if Input.press?(Input::Numkey[1]) $game_player.equip_item_to_hud(0, @skill_window.skill) # Hot Key num 2 elsif Input.press?(Input::Numkey[2]) $game_player.equip_item_to_hud(1, @skill_window.skill) # Hot Key num 3 elsif Input.press?(Input::Numkey[3]) $game_player.equip_item_to_hud(2, @skill_window.skill) # Hot Key num 4 elsif Input.press?(Input::Numkey[4]) $game_player.equip_item_to_hud(3, @skill_window.skill) # Hot Key num 5 elsif Input.press?(Input::Numkey[5]) $game_player.equip_item_to_hud(4, @skill_window.skill) end @hot_key_hud.update end end end #=============================================================================== # Quick Item Window #=============================================================================== if XASVER_37 == false class Xas_Scene_Item alias hud_quick_menu_main main def main @hot_key_hud = Hot_Key_HUD.new hud_quick_menu_main @hot_key_hud.dispose end alias hud_key_update update def update hud_key_update # Hot Key num 1 if Input.press?(Input::Numkey[1]) $game_player.equip_item_to_hud(0, @item_window.item) # Hot Key num 2 elsif Input.press?(Input::Numkey[2]) $game_player.equip_item_to_hud(1, @item_window.item) # Hot Key num 3 elsif Input.press?(Input::Numkey[3]) $game_player.equip_item_to_hud(2, @item_window.item) # Hot Key num 4 elsif Input.press?(Input::Numkey[4]) $game_player.equip_item_to_hud(3, @item_window.item) # Hot Key num 5 elsif Input.press?(Input::Numkey[5]) $game_player.equip_item_to_hud(4, @item_window.item) end @hot_key_hud.update end end else class Quick_Menu_Item alias hud_quick_menu_main main def main @hot_key_hud = Hot_Key_HUD.new hud_quick_menu_main @hot_key_hud.dispose end alias hud_key_update update def update hud_key_update # Hot Key num 1 if Input.press?(Input::Numkey[1]) $game_player.equip_item_to_hud(0, @item_window.item) # Hot Key num 2 elsif Input.press?(Input::Numkey[2]) $game_player.equip_item_to_hud(1, @item_window.item) # Hot Key num 3 elsif Input.press?(Input::Numkey[3]) $game_player.equip_item_to_hud(2, @item_window.item) # Hot Key num 4 elsif Input.press?(Input::Numkey[4]) $game_player.equip_item_to_hud(3, @item_window.item) # Hot Key num 5 elsif Input.press?(Input::Numkey[5]) $game_player.equip_item_to_hud(4, @item_window.item) end @hot_key_hud.update end end end #=============================================================================== # HUD Window #=============================================================================== class Hot_Key_HUD < Window_Base def initialize(x = HUD_X - 10, y = HUD_Y - 15) super(x, y, 220, 80) self.contents = Bitmap.new(width - 32, height - 32) self.opacity = 0 @actor = $game_party.actors[0] refresh end def refresh self.contents.clear bitmap = RPG::Cache.picture("Hot_Keys_HUD") self.contents.blt(0, 0, bitmap, Rect.new(0, 0, 160, 32)) for i in 0..4 x = 32 * i + 4 item = $game_player.hud_equip[i] next if item.nil? if item.is_a?(RPG::Weapon) item = nil if $game_party.weapon_number(item.id) == 0 and @actor.weapon_id != item.id elsif item.is_a?(RPG::Armor) item = nil if $game_party.armor_number(item.id) == 0 and @actor.armor1_id != item.id elsif item.is_a?(RPG::Item) item = nil if $game_party.item_number(item.id) == 0 or !$game_party.item_can_use?(item.id) end bitmap = RPG::Cache.icon(item.icon_name) self.contents.blt(x, 4, bitmap, Rect.new(0, 0, 24, 24)) end end def equip(item) if item.nil? $game_system.se_play($data_system.buzzer_se) return end if item.is_a?(RPG::Skill) if !@actor.skill_can_use?(item.id) $game_system.se_play($data_system.buzzer_se) return end #$game_system.xas_skill_id = item.id @item_type = false elsif item.is_a?(RPG::Weapon) @actor.equip(0, item.id) elsif item.is_a?(RPG::Armor) @actor.equip(1, item.id) elsif item.is_a?(RPG::Item) item_tool_id = XAS::XASITEM_ID[item.id] if item_tool_id != nil unless $game_party.item_can_use?(item.id) $game_system.se_play($data_system.buzzer_se) return end #$game_system.xas_item_id = item.id @item_type = true end end #$game_system.se_play($data_system.equip_se) end def use_hud_item(i) if @item_type $game_temp.force_action_id = $game_player.hud_item_id[i] else $game_temp.force_action_id = $game_player.hud_skill_id[i] end end def update @actor = $game_party.actors[0] @hot_keys = $game_player.hud_equip refresh return if !$scene.is_a?(Scene_Map) if Input.press?(Input::Numkey[1]) equip($game_player.hud_equip[0]) use_hud_item(0) elsif Input.press?(Input::Numkey[2]) equip($game_player.hud_equip[1]) use_hud_item(1) elsif Input.press?(Input::Numkey[3]) equip($game_player.hud_equip[2]) use_hud_item(2) elsif Input.press?(Input::Numkey[4]) equip($game_player.hud_equip[3]) use_hud_item(3) elsif Input.press?(Input::Numkey[5]) equip($game_player.hud_equip[4]) use_hud_item(4) end end end #=============================================================================== # Scene Map #=============================================================================== class Scene_Map alias hot_key_hud_init main def main @hot_key_hud = Hot_Key_HUD.new @hot_key_hud.visible = !$game_switches[XAS_HUDDISABLE_HUD_SWITCH] hot_key_hud_init @hot_key_hud.dispose end alias hot_key_hud_update update def update hot_key_hud_update @hot_key_hud.update @hot_key_hud.visible = !$game_switches[XAS_HUDDISABLE_HUD_SWITCH] @hot_key_hud.update if !$game_switches[XAS_HUDDISABLE_HUD_SWITCH] end end
#===============================================================================
8 p e1 }) X3 l% x! m# XAS - Hot Key HUD
4 T6 h' s$ C8 {* e" w' N#=============================================================================== 9 B8 ]/ r; m7 t9 {" \+ h
# By Mr_Wiggles 2 }" Z7 t* G) O' F& o, H* ?* p9 m
# Version 1.3
3 j J, N- n7 E( l. R9 I6 [# 7/6/10 1 [' I% ^* I1 b2 [( o$ [1 K0 w
#-------------------------------------------------------------------------------
/ O. r4 g; f, }1 I0 K! l' p# Instructions: 8 C% _" D- Y" y6 k3 F! n* ^" q8 J9 H
# Fill in the constants bellow, paste this script above main and bellow XAS in 0 D3 d6 ^* A' {
# your script data base. BE SURE TO SET TO THE RIGHT XAS VERSION!! - d: u0 c+ w) Y( G, m1 u! x
# + T2 o9 E, H2 v& F/ K1 H
# Place the "Hot_Keys_HUD" picture file into your game directory
0 e o- C8 G L# Graphics/Pictures folder. ; q7 C. q$ x, ^8 U. {/ X+ P
#-------------------------------------------------------------------------------
: r# {# I+ ^0 m4 l# Directions of Use:
0 u" w! g5 Y' Z( j" K# Simple just press a number key (1 - 5) when the quick skill or item menu is 1 @( m1 d9 c* f# N, ^; K
# Showing.
2 q! w! P7 w/ ]' s0 u4 o#=============================================================================== # s* G) X# _, h# \/ _
HUD_X = 0 # X pos of HUD
7 ^% y. N! t& aHUD_Y = 0 # Y pos of HUD
4 |+ F7 t" O: Z8 u4 P! DXAS_HUDDISABLE_HUD_SWITCH = 1 0 w/ a, k: @# X- r, q V) G
- {3 {! w! o, e! D+ K# Set true if XAS 3.7f t$ T1 g- Z+ Y% h( W5 \% U/ H+ ], w
# set false if XAS 3.6 ' [! \$ k+ [ E
XASVER_37 = true * I% I. z3 }& n9 m1 l0 t: h& p
, K: m6 s. y6 {0 {#=============================================================================== 5 f- B( C1 \% `, H$ ~
# Numkeys Module 8 o! R2 V) v, z4 X
#===============================================================================
6 j- o2 w6 G; s" Z6 ?8 S# omodule Input
4 c+ t/ x L' h4 W6 u Numkey = {1 => 1049, 2 => 1050, 3 => 1051, 4 => 1052, 5 => 1053}
& a0 D3 F8 Q- v$ I* s% t6 l3 \ class << self / Q' q2 `# Y4 d# Y9 _$ G+ H
Key = Win32API.new('user32','GetAsyncKeyState',['i'],'i') - m( Q& O s( U$ ~7 k$ z3 @( j
& f/ G& `1 g! q3 S' Z3 y% ]5 \
def testkey(key) ) Q/ d- O' L' O
Key.call(key) & 0x01 == 1
; F3 f* y- n3 c; v0 C$ Y2 b2 ]5 H end
; j( y. I( u! x3 t1 U 5 u' L/ x' @- S* w! W' R# M2 t) M
alias hud_key_update update D8 m+ P& _" O0 T% p
def update
* X; j$ ~$ V4 q9 B! X hud_key_update
5 T! [0 r% Z& A, J) Y t @pressed = []
' T: r, Y( |2 i# p, h for key in Numkey.values
1 A, f# x J$ U5 y; T6 d0 |( y key -= 1000
6 `4 N1 h. |# D U( m) k% F% u# y @pressed.push(key) if testkey(key) 3 y+ m7 ^, A6 y- J
end " B5 @3 m8 r; X; d3 O C3 `( E% M
end # {2 K1 Z) u4 H- \
) r5 B! J. ?! s) j( P- U* {
def pressed?(key) ; I, y* ^* ?0 n7 O' Y. i
key -= 1000 ; I4 H7 \# Y0 Y
@pressed = [] if @pressed.nil? ' J# m5 Z! a/ c p" S
return true if @pressed.include?(key) ' f$ Z% T! e' g4 j6 H; h" M
return false
0 B: X8 b+ a; \0 y3 j end
4 P( u& M% v/ I5 d; n0 z# I! J
' [* a1 [3 T: T7 j" ] alias hud_key_press? press?
; z8 L6 U2 d1 p( N) D) J def press?(key) . B' W+ u9 Q. T' \
return pressed?(key) if key.to_f > 1000 * q _+ \# ]& d% I- ]
hud_key_press?(key) 0 o# T6 _, U& n' y
end * q2 z4 ~0 `- k& }" l4 V! x
end
" k- x8 W) p- mend & p' A3 m7 n: o2 b) o; V! ]* {' R
- k4 c$ ~9 \) V8 J4 _3 \$ t0 E#===============================================================================
' D2 r* n4 o) b2 j# Game Player
5 \* b1 x4 F) i7 ?4 y5 B$ c#===============================================================================
5 W% N. w* p" n& D! f% dclass Game_Player < Game_Character
5 g/ X: S: h' j% V6 f attr_accessor :hud_equip
1 I) V% z/ L( ]+ Y t& v( _ attr_accessor :hud_item_id
1 _/ R3 F/ ~( [1 n attr_accessor :hud_skill_id
" E G% L* g/ R5 v
5 a0 Q9 C- T0 p alias hot_key_hud_init initialize
) i) n0 D! f; w2 l def initialize 1 j/ \6 {; T$ h" ?# X
hot_key_hud_init
2 e$ E+ h: d" {# z- l5 N# W7 F# M @hud_equip = []
# E8 V9 H6 h; f/ J3 x* }( W, L @hud_item_id = []
& M0 e7 P8 B# r# K @hud_skill_id = []
: R* O3 S. @/ y+ {) a2 f6 N end
0 E% q4 x: \/ @ G% t4 j2 S + L* l8 J: l1 H4 M
def equip_item_to_hud(n, item)
. b: |9 K. G: Q1 ?& c if item.nil? ! i$ j$ K4 s3 y4 t. V& u
$game_system.se_play($data_system.buzzer_se)
1 @$ ^% q- S @4 ?' k7 Q5 M) F return ( v# p, D/ v) x
end W+ `! P! s; j* ?6 L6 ]# D
$game_system.se_play($data_system.decision_se)
' r( d+ F' y% {9 P9 n @hud_equip[@hud_equip.index(item)] = nil if @hud_equip.include?(item)
& Z$ e2 o/ A; F9 a( t0 J, f @hud_equip[n] = item
, j, D" t! K p( f2 G3 C3 b @hud_item_id[n] = XAS::XASITEM_ID[item.id] 3 [% L( L6 Z, y$ i- p5 j
@hud_skill_id[n] = item.id ) Q' a6 B# X: G. r
end
7 s% v1 d7 f. n+ ^' c# p8 w7 Eend
* N, B+ s$ \* h) q! f* e' n1 q+ ^
( X- {. J; E; p' o0 |#===============================================================================
p" ~! I c' v6 M' E$ L# Quick Skill Window 2 ~9 }& r" F. {; R5 a( T( K
#=============================================================================== $ i3 z' m9 ?- U7 L; p
if XASVER_37 == false
9 y$ T( `; W8 Z# o class Xas_Scene_Skill
+ N: y. c. L& z- f* J8 r% X, ` alias hud_quick_menu_main main 6 m9 k2 S. [& G% |6 R
def main 3 g6 T& G( d* q8 b, `4 e& ?, }/ _
@hot_key_hud = Hot_Key_HUD.new $ K* G6 v3 D8 t* E, P) T
hud_quick_menu_main
& {2 z6 p8 b7 |1 t* B9 s) v' h3 S2 g$ m/ Q @hot_key_hud.dispose ! Z) N& b: S# N( X" o+ d4 w
end
3 }: M* i* i/ x2 x ! c! X+ Y" z4 \7 I0 Z5 G' ?
alias hotkey_hud_qucik_menu_update update
. e) w! I. l: t5 f6 [ def update
9 I0 [0 Y8 t: N) u# f hotkey_hud_qucik_menu_update
- }3 X( z2 l+ [2 _3 ?0 O # Hot Key num 1
* }' e& ? D# Z! v% d2 W& ^ if Input.press?(Input::Numkey[1]) - J& k) }3 Y2 P, `. t7 n
$game_player.equip_item_to_hud(0, @skill_window.skill)
( I) x4 B2 e5 @, v0 P # Hot Key num 2
, A' ^- p7 W) r elsif Input.press?(Input::Numkey[2])
) x4 O2 J6 u! y3 v, w+ U% P $game_player.equip_item_to_hud(1, @skill_window.skill) ( R; d9 s' K# P, Y$ ^6 X) D! n
# Hot Key num 3 % e, L U2 ]) @- `4 p( j
elsif Input.press?(Input::Numkey[3])
' c; W$ X1 s# i( \( ^ $game_player.equip_item_to_hud(2, @skill_window.skill) 1 b- O! X2 U# p0 ^& t: @
# Hot Key num 4
t: p* `+ T+ B' R0 Y# ] elsif Input.press?(Input::Numkey[4]) 4 M0 L. n) z3 z% k
$game_player.equip_item_to_hud(3, @skill_window.skill) ( A- A% @) k+ ~% b
# Hot Key num 5 ( a& ~& V) W* K/ V( F5 K+ n8 ]6 O+ t
elsif Input.press?(Input::Numkey[5]) ' f* Z- P* h/ s
$game_player.equip_item_to_hud(4, @skill_window.skill)
8 d# m* t6 U- A8 j end
7 B% F; f4 X k" O8 I7 A @hot_key_hud.update # @. J, c$ k# x7 d, O
end 8 ^5 y6 Y2 ]# f1 ]1 |+ u- Z
end
$ Y; V- }' q o9 A) ^, Nelse $ S( P1 O# _6 `. h
class Quick_Menu_Skill
$ U7 f' F6 [/ n" r$ L, v alias hud_quick_menu_main main
( P$ ~1 V0 x9 F! n) G( T9 G1 F3 P def main
2 t% W# r1 {+ b% u ? ~; M @hot_key_hud = Hot_Key_HUD.new 9 E6 o) I% z& j" e6 K0 F
hud_quick_menu_main % D& L$ f+ u/ u
@hot_key_hud.dispose ; k. d: t: n+ ~0 o: T
end 5 x0 N- g6 W( m6 `
. b% ]4 s" E, f, O# n% O alias hotkey_hud_qucik_menu_update update : q% ^ }" ^( i4 `
def update
$ j7 s( ?$ q6 `9 v hotkey_hud_qucik_menu_update . G- e# U7 q9 u' F6 s0 ^
# Hot Key num 1
! m( H0 m0 M, c. d5 {8 D if Input.press?(Input::Numkey[1]) & q: n# n7 t4 U$ Q1 d
$game_player.equip_item_to_hud(0, @skill_window.skill) / O' g( ?0 U. Z+ B. J8 Q5 S* l
# Hot Key num 2
' z& p5 k0 ?! l; q4 U' s; t elsif Input.press?(Input::Numkey[2])
) P3 a# z3 {4 ^ $game_player.equip_item_to_hud(1, @skill_window.skill)
' R0 e3 R6 ?4 }2 d0 {- ~! [ # Hot Key num 3
2 r- U1 k8 [8 ^$ O. s elsif Input.press?(Input::Numkey[3])
2 N' r2 }& ~. S9 Q) X/ a( b0 O. ^ $game_player.equip_item_to_hud(2, @skill_window.skill) / k% f6 R# Y' o9 D9 }
# Hot Key num 4 & c4 B- |3 ]/ w; y! V! J, y& o
elsif Input.press?(Input::Numkey[4])
( s9 l) u# @- F. c $game_player.equip_item_to_hud(3, @skill_window.skill)
5 e' D- x( b b; n, O" W # Hot Key num 5 % g: q3 s- c6 s' k
elsif Input.press?(Input::Numkey[5])
, y7 n# m. ^% |6 h0 W* T9 X $game_player.equip_item_to_hud(4, @skill_window.skill)
8 j: ?) b. F7 ~/ u4 | end
9 L/ ]$ G0 C% I) S: `( L$ P @hot_key_hud.update * \, t; R5 O& `" i- k7 U7 }
end ( c! l/ G8 ]) k1 N& ^$ A9 Q
end 3 B" N6 A% D u& P; f+ O3 G) N
end ' K0 M+ Q' w' Q* k. M
, e! w, S/ R0 H7 N$ c" {& p5 W
#=============================================================================== & v; T1 y# U/ ` g
# Quick Item Window / y, X5 D O0 C' K) F$ S, _8 ^
#===============================================================================
+ v* T) c7 n; m Rif XASVER_37 == false % M9 e! v& ?( }' }
class Xas_Scene_Item
$ Q9 X, Z1 e1 D( { I alias hud_quick_menu_main main
- K6 C4 A) h+ b3 z' E- ?3 `" n def main
- I* s3 ?' z# Z5 {3 { @hot_key_hud = Hot_Key_HUD.new # i$ A9 f# ~9 N# L# e
hud_quick_menu_main
5 W3 o% _* O1 i, C; n$ a @hot_key_hud.dispose
) R/ c2 V9 N, i end
% [; ~, d, j5 { ) x' l( W3 C) q. N. F+ M _% K5 |
alias hud_key_update update
" w1 K$ j6 K7 p def update 3 N: c; c D$ O* R: X" S3 `. o2 R) ~
hud_key_update & o! U. V- z$ a! B$ E% t, ~# o- r
# Hot Key num 1 # {/ p* Q+ }# M
if Input.press?(Input::Numkey[1]) : ?8 U' Q# D" M4 n1 b. |6 x/ j, I
$game_player.equip_item_to_hud(0, @item_window.item) % F/ [2 Q" ^ \% V
# Hot Key num 2 ^' a1 p9 D2 x/ w6 S8 P" E
elsif Input.press?(Input::Numkey[2]) 9 Y3 v7 b- Q1 X/ }! F2 c6 }
$game_player.equip_item_to_hud(1, @item_window.item)
0 J, Q0 a" V% Y) y f8 |. Z$ v # Hot Key num 3 ; x8 U* I4 s- i
elsif Input.press?(Input::Numkey[3])
+ Q8 j$ M2 W/ Y5 G/ O/ D, y) W $game_player.equip_item_to_hud(2, @item_window.item) 7 w/ j4 r; l% G3 d4 m% q3 \8 ?
# Hot Key num 4
9 n' x! O& r) X3 d- ~) S' _ elsif Input.press?(Input::Numkey[4])
% O; d/ v S* i+ \ $game_player.equip_item_to_hud(3, @item_window.item)
! d& W9 y) k) n m # Hot Key num 5 " O/ Q* h1 c D/ ]
elsif Input.press?(Input::Numkey[5])
4 p* T: W! L6 `5 a9 y $game_player.equip_item_to_hud(4, @item_window.item) 1 ~3 K# O! D: ~% T0 _( C$ L4 U1 m
end
9 [# }3 `' V0 h( _# E* i7 [ @hot_key_hud.update ; g$ I6 c+ e9 I x7 u0 v% g+ w
end
6 R: Z3 Y2 J$ V3 n% m1 y0 L9 A end ( g/ D V2 Q) N! r7 j; }
else 2 z; ~4 Z9 m% ]8 `4 G: F0 O+ a+ a
class Quick_Menu_Item % ]. u; F5 q% _2 G6 Y/ [
alias hud_quick_menu_main main % Q X( w8 h$ N* x6 D
def main
8 ` ^0 u0 }" |' J# f @hot_key_hud = Hot_Key_HUD.new + H# o7 ^$ {4 u6 J1 s; ~( B
hud_quick_menu_main
; [- o& l; t2 V5 d/ H$ ? @hot_key_hud.dispose
5 l5 b; N* F* ~ end
! U% {( K3 w( s6 r 7 s$ T' ^ f' q! ^
alias hud_key_update update 8 g3 G6 M' s: {# A3 f( h& y. F
def update ; a9 V3 L+ x# k
hud_key_update 7 @4 }1 L' u( b
# Hot Key num 1
0 t% g+ H1 [6 s6 Q# A1 b. f, h if Input.press?(Input::Numkey[1])
) X+ @9 y" R# O, n! ~5 ^4 R $game_player.equip_item_to_hud(0, @item_window.item)
( ]7 d3 |) Y4 [+ r2 o- i # Hot Key num 2 + ]9 O+ J" d+ { l
elsif Input.press?(Input::Numkey[2]) 1 |9 ], ], j! @. v% q5 @ @$ y
$game_player.equip_item_to_hud(1, @item_window.item) ) I+ A1 i2 \. E9 x) B2 z- P
# Hot Key num 3
5 y5 P9 c% I- H4 M a6 a! } elsif Input.press?(Input::Numkey[3]) ; ?8 M( ?2 Q: b/ f1 W6 r7 Q. L
$game_player.equip_item_to_hud(2, @item_window.item)
& B+ m F- j' D: v! z, s/ {( d, L # Hot Key num 4
# U$ T# F4 Q6 f) X$ S elsif Input.press?(Input::Numkey[4])
- v! \3 a4 C% O/ W $game_player.equip_item_to_hud(3, @item_window.item) 8 x' l0 }9 ?" H. ~
# Hot Key num 5
& L& j7 J9 S$ a3 N5 I elsif Input.press?(Input::Numkey[5]) + b# ?) A3 B: K- F" Q3 I
$game_player.equip_item_to_hud(4, @item_window.item) 1 q4 ?- E. h$ Z" b
end ) S3 ^2 t- s5 }1 P7 U" D: w% |3 P
@hot_key_hud.update
! P+ \& y) ?, O( {5 k. i end
/ R3 k; O$ \; P k, C. @ end
# S. b# v$ g* nend ! o4 y0 Z9 H8 U1 W3 r
! u+ }, \1 ?* P
#===============================================================================
, a% _3 O6 l; U" O7 o+ p# HUD Window 2 n# p' b9 ]. J! F7 v3 @
#=============================================================================== , o- V$ J/ Y+ i( `
class Hot_Key_HUD < Window_Base . k2 `" ?) Z1 Q4 _2 v5 K
def initialize(x = HUD_X - 10, y = HUD_Y - 15) ( s) F* @4 @" r( ]. L
super(x, y, 220, 80) * I, J/ `- K2 D# e9 f! L
self.contents = Bitmap.new(width - 32, height - 32)
) G) {. W [# T# B6 l self.opacity = 0 " Z8 a/ p0 U- G9 a$ W& z5 l: A+ `3 A1 p
@actor = $game_party.actors[0] ' T4 [3 O1 S; u5 ]; _1 Q& i
refresh
0 J$ X) t# ~5 r end
m% |- w2 n2 L8 m& O 2 u4 N4 J3 H( c$ J
def refresh ( q5 n" c) O7 ?+ }
self.contents.clear : l/ W! m) |: O
bitmap = RPG::Cache.picture("Hot_Keys_HUD") ) `6 t- [1 X' i/ p+ m; Y" t
self.contents.blt(0, 0, bitmap, Rect.new(0, 0, 160, 32))
" ^- Z* U! ?5 p+ m for i in 0..4 ' k* y. z! U2 k
x = 32 * i + 4 * v4 F& X( c9 Q1 E/ K* w3 W
item = $game_player.hud_equip[i] & Q1 ^2 g0 C" A5 J+ u
next if item.nil? 7 i- w7 K% a: S" p# N
if item.is_a?(RPG::Weapon)
2 Y: F% E4 i9 U# g- i item = nil if $game_party.weapon_number(item.id) == 0 and 8 Y, ]/ F# G* s0 c2 c" D- O: m, |- M
@actor.weapon_id != item.id
$ N: d: J5 |2 P( a" Y elsif item.is_a?(RPG::Armor)
. `8 l9 u- C0 [3 b- ]& \, _ item = nil if $game_party.armor_number(item.id) == 0 and
8 g' s, c4 _- @0 f7 \ @actor.armor1_id != item.id
+ [: s* P+ p( [: J elsif item.is_a?(RPG::Item)
! V( I5 ^( t( {$ d# m! G3 C( Z item = nil if $game_party.item_number(item.id) == 0 or
# b4 m7 S( B4 | n7 g !$game_party.item_can_use?(item.id)
# F" U* n' E. M3 u4 K. d2 K6 b end * t) R0 E3 ^: P/ t
bitmap = RPG::Cache.icon(item.icon_name)
; r9 v8 k" p6 v4 ]* v0 D4 x self.contents.blt(x, 4, bitmap, Rect.new(0, 0, 24, 24))
) B6 v! N! w; j* n$ O end : F2 L! L% s z1 D& u
end
3 c/ M4 ]% O9 e
: ?% c$ _4 r% j. _4 t def equip(item)
V. U4 I5 P" o( ^! x) ?+ I if item.nil? 8 Z5 V+ u! a6 L5 e7 \8 e
$game_system.se_play($data_system.buzzer_se)
# A5 W: g5 A( R( Z return - @# s5 w6 C$ n3 l# ^+ D( Z
end 4 z' H- d9 k, O( Q. j+ Y: b
if item.is_a?(RPG::Skill)
4 o. l. q4 K4 U& W# f if !@actor.skill_can_use?(item.id) ; N7 F9 ^9 h% S2 |* c1 I" u: X" `$ Z* J
$game_system.se_play($data_system.buzzer_se) 4 ~/ x1 r* u+ R& x
return
8 f; h1 J/ C2 [3 Y end : u4 B- K1 C( a1 J- P. r8 B! k8 `
#$game_system.xas_skill_id = item.id $ v) V9 z" G1 ~! y( R
@item_type = false
& \1 n m& B; y) i elsif item.is_a?(RPG::Weapon)
- @% y6 J1 n$ v$ V* I4 u( G( | @actor.equip(0, item.id)
! r4 `% {4 I) K2 w! A/ p# L" T elsif item.is_a?(RPG::Armor)
/ X. P' U, B: r# h m @actor.equip(1, item.id) 8 a4 G: o% v& f) t" c
elsif item.is_a?(RPG::Item) 8 c/ n1 a0 M+ o
item_tool_id = XAS::XASITEM_ID[item.id] / y; o" Z" K- n
if item_tool_id != nil ( t H7 x$ V5 E+ G- z) Z% W/ N
unless $game_party.item_can_use?(item.id) ; g* {5 Q! j/ q0 ]* S( A1 }
$game_system.se_play($data_system.buzzer_se)
% H, E7 Y- \9 Q return % a! q, H* S0 Z+ m
end
, J3 V1 i7 y& a9 ? #$game_system.xas_item_id = item.id
4 A" u+ V- H G9 u b% { @item_type = true - Y% {% [3 ]4 W: U+ ~
end 5 h, F! q3 n6 n& H/ L' P2 q
end ) d0 ~) Q: p* j. q$ t/ S A/ }
#$game_system.se_play($data_system.equip_se)
9 g( M- t, W6 g5 S5 L) K# f: |' a end # |) |! @& H' l
; \0 g; Y0 I* D7 R
def use_hud_item(i)
$ K+ s+ p) A f; f$ B: r9 m if @item_type
9 T+ C7 k6 w, F. h2 g& M* w $game_temp.force_action_id = $game_player.hud_item_id[i] / c7 t, S5 r( M, t9 b- H* ~
else 9 F1 |) g, T% A, _
$game_temp.force_action_id = $game_player.hud_skill_id[i]
. {! c% v5 ~1 Q# G end 5 h, k: y& K5 p
end
5 v) `; Y& u) }$ [5 e. s
6 @& |; o* A0 k7 f, Z [ def update
/ C5 T4 Q, \: m$ T1 p @actor = $game_party.actors[0] , Z- Y0 n+ f0 H2 e
@hot_keys = $game_player.hud_equip
. b, `# g1 E* E refresh
6 q. b' `$ p3 H- T2 Q return if !$scene.is_a?(Scene_Map) + t" [4 D: I. `. ^# m. ]
if Input.press?(Input::Numkey[1]) 8 k/ h$ w; S0 ?
equip($game_player.hud_equip[0]) & q. h1 u% B5 y% ~, X
use_hud_item(0)
6 w& c+ c* l) v1 D elsif Input.press?(Input::Numkey[2]) ' @7 q" a: J( y4 L" K; A
equip($game_player.hud_equip[1]) ) F0 m1 w3 J% e2 P
use_hud_item(1)
9 e6 H5 S" p4 t9 o elsif Input.press?(Input::Numkey[3]) 6 W9 A' x) c: z
equip($game_player.hud_equip[2])
4 |8 I2 k* s8 I9 n2 g use_hud_item(2)
8 B: H: v+ ]' _1 D elsif Input.press?(Input::Numkey[4]) ( e7 t. L, Q- v; u0 c* i. F
equip($game_player.hud_equip[3])
1 }# g; Z6 L# ~% D) [4 a1 \# Z4 d" _/ x use_hud_item(3) 9 f7 H1 A+ |. g9 x
elsif Input.press?(Input::Numkey[5]) " w, \. q5 X& s7 L( d& Z# g, `
equip($game_player.hud_equip[4])
8 U8 i3 |4 {1 w5 w& b1 E! J use_hud_item(4) ! l A$ ^& p- ?' x; M
end 8 y! ~- B5 l: j: }4 p
end
0 U9 E% c7 T/ i, U1 s- j3 @6 vend $ B, w; e! u: v3 T
+ A7 u3 e$ O Y$ ^# ?% H. e! w7 }#===============================================================================
3 Y( f3 Q7 x8 t! V$ m3 z$ w# Scene Map
7 p: P* O+ u# u' j) [#===============================================================================
4 m2 N/ M* f. \3 M% a! mclass Scene_Map 5 I: ]3 [( y( a3 f j6 Y
alias hot_key_hud_init main 2 ~7 e# S' z7 @! n D* I7 t
def main
& Z' b4 ?' k/ z( v1 D @hot_key_hud = Hot_Key_HUD.new
m$ }( r$ C5 n) }+ L @hot_key_hud.visible = !$game_switches[XAS_HUDDISABLE_HUD_SWITCH] 5 }7 u6 t9 A6 K2 H& `3 y
hot_key_hud_init
: l1 z5 Z& n6 [" _+ M% U- X! @# o6 P @hot_key_hud.dispose
7 d7 K' q k/ G$ D/ f1 h* g5 f6 S end ! l: V% y; f% O- }5 G, B
1 Y0 [5 m2 u1 x2 N alias hot_key_hud_update update : ~& o$ l/ C+ e
def update 2 u/ o4 v- ^# e0 g1 a
hot_key_hud_update / o& |0 s/ u& r/ R0 W j( q
@hot_key_hud.update 2 |. {" B0 Y. W3 |
@hot_key_hud.visible = !$game_switches[XAS_HUDDISABLE_HUD_SWITCH]
4 i' d& w: q H4 ^4 w/ L @hot_key_hud.update if !$game_switches[XAS_HUDDISABLE_HUD_SWITCH]
" Y) X+ i: E- V& x9 e! f end 1 e/ E5 L" n+ U' n8 Q1 D& m1 f' `
end
8 v; A* ~# a( I5 U; `+ s0 W7 h! O8 m0 o
|
|