赞 0
VIP 15
好人卡 21
积分 7
经验 24727
最后登录 2021-10-29
在线时间 2184 小时
梦石 0
星屑 672
在线时间 2184 小时
注册时间 2009-12-6
帖子 607
本帖最后由 ML4455739 于 2012-4-14 20:02 编辑 2 w4 y8 x6 _$ b6 A4 J
7 J6 B" W) M' X r4 v: e 在Extra Skill里按1~5是设置( M; z! u! u p. x3 R* Z8 J6 g
设置好后回到地图按1~5就是……切换。6 W. p- J; J l% m" R) H x
" F$ [/ l+ A- D, Z" n, w1 Y
请问是要改成直接使用吗?
' k+ w. X( J' c $ b. O* U3 v1 u! c5 J; N6 c1 l# x
那就用这个吧、记得改XAS_HUDDISABLE_HUD_SWITCH。
! A, _* l8 P6 s5 A( s- K+ a #===============================================================================
# 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
#===============================================================================
) \* y1 v4 v. g, C/ q# O# n: u # XAS - Hot Key HUD
' t" M/ a4 j5 {( k
#===============================================================================
4 F1 n- c8 j# i5 c$ y # By Mr_Wiggles
5 w( F& l G# D* C; u" L$ { # Version 1.3
( @; g8 W1 F8 G1 }" a: g # 7/6/10
! a+ }# ?. K8 I" {3 V' Q2 V
#-------------------------------------------------------------------------------
: v3 x! j1 a Z' }5 Y
# Instructions:
1 C( ^6 U U/ I+ \) U4 f# H
# Fill in the constants bellow, paste this script above main and bellow XAS in
& T$ m, x$ U. N! A
# your script data base. BE SURE TO SET TO THE RIGHT XAS VERSION!!
; d. \ N( ]& n1 N7 [1 N9 Z
#
7 `" ^ |( ~1 O; I+ c% v9 G # Place the "Hot_Keys_HUD" picture file into your game directory
i' A* ^% i7 A
# Graphics/Pictures folder.
, `9 |1 E( U- W9 S7 M #-------------------------------------------------------------------------------
) K) l% v8 ~) j2 o% L. a7 F # Directions of Use:
1 P. V+ ]5 u. V$ j+ D8 [* }$ ^# Q # Simple just press a number key (1 - 5) when the quick skill or item menu is
, o- w2 `( C/ H # Showing.
u' a+ L' t0 o; ?
#===============================================================================
+ I$ \1 t: _2 _; b$ u
HUD_X = 0 # X pos of HUD
2 H( I w1 W- V8 U
HUD_Y = 0 # Y pos of HUD
$ T2 l; e; D8 `7 W P8 |" l! Z XAS_HUDDISABLE_HUD_SWITCH = 1
+ {/ r7 W, N$ [% T5 I4 A7 U
! Y, r* r3 G9 D+ n. N( u6 t, s
# Set true if XAS 3.7f
! U# D4 F/ t) H% U& J0 @ # set false if XAS 3.6
7 Z, J R2 f& C/ h7 R7 K$ u$ E, G XASVER_37 = true
; g5 F" A4 b$ I8 B; l3 L0 n
7 v! q- T: B: g2 L7 K; t
#===============================================================================
4 J6 \4 Z h5 ]# d # Numkeys Module
# G! _$ H0 c+ X' E* h3 x2 R
#===============================================================================
- |9 Q& f! G% |6 X% c5 Q$ j9 V% G, t
module Input
6 ]" P* X/ k( H- C; u2 `
Numkey = { 1 => 1049 , 2 => 1050 , 3 => 1051 , 4 => 1052 , 5 => 1053 }
* M# G! P% F# v( }& L$ A class << self
: _) M* S+ A$ C: ?- |. E ^9 @
Key = Win32API.new ( 'user32' ,'GetAsyncKeyState' ,[ 'i' ] ,'i' )
* @, k3 M v' I
1 _! I! u4 D* m0 a7 e/ \1 Y7 c
def testkey( key)
) e3 _" H1 p9 M Key.call ( key) & 0x01 == 1
' [5 W7 M# Y; F9 s* R
end
3 f' }: M( ?/ _* o4 H( O0 l+ v: b" G
1 e1 H6 H: n. t$ j0 ~9 k) o alias hud_key_update update
; U. U: Z5 J9 d: `5 x
def update
. g/ D3 x7 N! f+ H hud_key_update
/ ]' p5 }4 E0 u% @& E+ s! n3 ?
@pressed = [ ]
4 u# v0 `6 r+ t
for key in Numkey.values
: c, ^. l2 ^, s key -= 1000
. ?* Q. P. N: Q5 X) m @pressed .push ( key) if testkey( key)
) c% q) P9 `+ h9 e' |" M4 R0 U end
7 l6 K& e7 m4 `6 {1 A) E" b end
' w8 ^" z$ S3 G
: @7 H) w7 m* c+ g# | def pressed?( key)
, |3 y& O8 y& U2 Z+ z$ s0 V
key -= 1000
" I- l J5 I* I2 p; Q
@pressed = [ ] if @pressed .nil ?
: h% t, w* E* B
return true if @pressed .include ?( key)
: P6 O5 |4 c4 F& |3 `5 `5 _; ^$ L: S
return false
# K) d: r$ r. t! k# s! T& g: f end
# H; x- M1 U+ r; k% m' j" O
l4 }7 F3 j" l ]8 K3 A _
alias hud_key_press? press?
% H6 `# @. \ s$ ~" W/ t- [: v def press?( key)
" d6 O$ o& L! W( B$ j4 K" u
return pressed?( key) if key.to_f > 1000
. T7 M1 y: c; C; s
hud_key_press?( key)
8 h9 L/ X" h5 [, m end
# O4 R* _! A( c8 t2 O end
$ O/ P- X, I$ U5 f- m2 \7 w& S end
0 S7 r5 \! Q; C$ U& z! l X
3 K/ J/ T- j7 x6 z
#===============================================================================
# o1 j/ |0 f7 B4 w6 L8 K
# Game Player
$ V# S9 J( X+ ]- V5 H: m- V" u6 D3 G #===============================================================================
% B& ?; W, o5 V( e class Game_Player < Game_Character
' e) j6 o+ Y3 d5 I! ? attr_accessor :hud_equip
" I' f5 V+ F" |( e7 t attr_accessor :hud_item_id
' q7 Q+ S* L9 I S: q2 |% o$ @ attr_accessor :hud_skill_id
8 g5 z) [: G' M* a6 \
% G- [& N ~/ L5 `( @1 ^: U alias hot_key_hud_init initialize
! V; y4 u- S( ?9 g8 m: s2 J
def initialize
* a8 p2 X0 e- L2 T/ @: m+ C2 ]2 E
hot_key_hud_init
* m5 ^0 F+ D2 S. [. V- [( H* d @hud_equip = [ ]
h, e- b% S s7 W @hud_item_id = [ ]
# a- a) p2 r4 }+ i/ K @hud_skill_id = [ ]
6 V' {' a' h) R" r; ~ \ W end
% S7 P* V! I$ i$ u# U
$ ^& j1 i/ J- H0 I! a5 X# \ def equip_item_to_hud( n, item)
! b" R7 o+ u6 f if item.nil ?
9 O' J9 q* B+ m6 }4 d; O' c$ Z
$game_system .se_play ( $data_system.buzzer_se )
) I8 v0 g5 X& e6 q; j( M3 r# _. u. @7 ?
return
3 g# i( S$ U* X& j/ @; e end
9 i) U8 S/ C/ K; W# R9 g
$game_system .se_play ( $data_system.decision_se )
3 G1 O, w) d' m8 |* J3 ?9 c( `
@hud_equip [ @hud_equip.index ( item) ] = nil if @hud_equip .include ?( item)
' Z2 V: \; D: L5 t. C3 X {8 [4 U @hud_equip [ n] = item
! r5 G9 a! J0 P {% W
@hud_item_id [ n] = XAS::XASITEM_ID [ item.id ]
' J' E, p0 q" I5 e
@hud_skill_id [ n] = item.id
' W* | l$ K9 } end
' C2 _5 E5 z% A- U" g5 c
end
0 L [; e3 T* b# c" u' ?
5 k1 }! Z' N5 L5 i+ f# ` #===============================================================================
3 F F, J, E9 i/ ?/ K0 @; K # Quick Skill Window
! `/ _$ X4 z3 g' E& M2 w% o$ { #===============================================================================
" S: f) P3 \& B if XASVER_37 == false
N# Y9 h8 k; A8 k! q class Xas_Scene_Skill
, \. c& Q* S0 `/ W1 O
alias hud_quick_menu_main main
/ y6 [9 c( t+ B. a4 o7 D$ Q% j
def main
& m0 A. l$ G: A+ T4 u! c
@hot_key_hud = Hot_Key_HUD.new
7 ^/ x6 j& D$ L* a* T9 ^+ U& E
hud_quick_menu_main
7 s, \9 z* B3 X4 ~8 S" w. H" X0 P
@hot_key_hud .dispose
1 F6 M8 \) `! t. A# v* j% B end
% i( Q) N4 z' s/ S$ @& u) f! F
: Z* U X' r* ^4 d$ d2 p; | alias hotkey_hud_qucik_menu_update update
6 X1 G- v& _+ q- m) k def update
* a; b& N0 @6 g4 I: ] hotkey_hud_qucik_menu_update
7 H, |6 T. x" a+ ~) B7 ^2 U9 X # Hot Key num 1
& |+ f" C7 N/ U7 W
if Input.press ?( Input::Numkey [ 1 ] )
/ D0 o/ G2 e! \) B5 b' F $game_player .equip_item_to_hud ( 0 , @skill_window .skill )
. ^9 n: e9 B# F G5 z8 H& W* }
# Hot Key num 2
8 ?8 e) B) z* `( r) U7 }9 _1 K elsif Input.press ?( Input::Numkey [ 2 ] )
) d7 O+ \9 L/ c. }* r9 b $game_player .equip_item_to_hud ( 1 , @skill_window .skill )
1 s# _) N/ p; f1 a7 ? # Hot Key num 3
7 M) @1 k% \! d. T& t
elsif Input.press ?( Input::Numkey [ 3 ] )
+ v' E. M" B* c1 O) c c7 y0 b
$game_player .equip_item_to_hud ( 2 , @skill_window .skill )
6 w! c- W/ F. u {, j
# Hot Key num 4
7 M' F5 a: I. F' j+ l elsif Input.press ?( Input::Numkey [ 4 ] )
: ?8 u) e' n5 S* Q" [ h
$game_player .equip_item_to_hud ( 3 , @skill_window .skill )
+ T N7 b: } g3 {9 M, d' e( x! S # Hot Key num 5
& b6 R6 [7 F& @, ?( L7 G) I W elsif Input.press ?( Input::Numkey [ 5 ] )
3 f2 I+ V5 W, w' n7 B$ U& g5 a( z $game_player .equip_item_to_hud ( 4 , @skill_window .skill )
0 }5 J# ?' ?" X# U( d end
2 q0 T$ k( U7 @) O
@hot_key_hud .update
2 L9 F0 ] g* S# P# b, B& p end
3 n" A4 _4 I! g; u end
) N- L) v- y6 s t$ |6 x/ x else
* ?1 \* ~( z% s. N! E: X
class Quick_Menu_Skill
* x& }$ F: s" n9 y1 ^, o. J
alias hud_quick_menu_main main
- N9 r7 Q- u n# i, B8 g9 u) A def main
. D, ~, ~' M% a) ^* N. |( b @hot_key_hud = Hot_Key_HUD.new
6 ~- C- g, b7 m4 z8 @; ?
hud_quick_menu_main
1 l2 w9 a- |2 D/ y/ I" N4 T
@hot_key_hud .dispose
. o5 j& U: n5 T/ ?, c; ~ end
! V7 Q6 \: i# ?( I! C* |( O
! d% s8 h& W8 A2 j: b1 E alias hotkey_hud_qucik_menu_update update
# D" d% K* y9 \# v/ J& ^' L2 [ def update
3 D8 G, Q( Z& p$ `' G( c
hotkey_hud_qucik_menu_update
9 I" B2 L' B3 F9 M0 |
# Hot Key num 1
, x$ |( _8 H: ?* D) P
if Input.press ?( Input::Numkey [ 1 ] )
8 b& }- R. g$ B. d4 L% l $game_player .equip_item_to_hud ( 0 , @skill_window .skill )
. i( f* l7 C u
# Hot Key num 2
/ [- z7 {9 M& [. q0 r8 F+ w elsif Input.press ?( Input::Numkey [ 2 ] )
: P4 u, {2 H5 K9 i
$game_player .equip_item_to_hud ( 1 , @skill_window .skill )
! E& I8 {$ i! w& I, r
# Hot Key num 3
# `3 u( W& j: A6 x7 |, b. ^0 Z
elsif Input.press ?( Input::Numkey [ 3 ] )
" o# }; T c# ~9 P
$game_player .equip_item_to_hud ( 2 , @skill_window .skill )
' x+ e9 w$ P* ~) z1 t3 J, Q
# Hot Key num 4
& i3 [! ~/ y4 S) u) R2 a# Y& L elsif Input.press ?( Input::Numkey [ 4 ] )
5 d% j+ g1 c6 B' w' t' m0 b, t6 n
$game_player .equip_item_to_hud ( 3 , @skill_window .skill )
- |/ J8 U: r/ p+ S' b # Hot Key num 5
! l6 x$ y" |+ I+ C/ _* \ elsif Input.press ?( Input::Numkey [ 5 ] )
2 I# O5 m) e) `5 q $game_player .equip_item_to_hud ( 4 , @skill_window .skill )
o2 M2 S# c {% d9 c
end
" p; L& d$ \% e" `. c0 M6 i; N @hot_key_hud .update
7 U R5 u- a# D5 |" F0 O7 k end
7 V0 v& ? l2 I, {) [ end
9 }2 T' F D m( P0 D& P" _' S
end
g$ O3 Z m W4 b
7 }. s& C) C8 t$ { #===============================================================================
9 s* b& C6 Z# Y5 j( u2 D8 h+ [7 g # Quick Item Window
6 t- B7 B- `: E r* G6 K0 I #===============================================================================
! X/ x" Z: m f& o, `3 R
if XASVER_37 == false
7 f; k' b- E# o& R9 o
class Xas_Scene_Item
; k; J( L$ p' w5 ] alias hud_quick_menu_main main
! m- d6 t0 M) b* `
def main
& R* j7 Y9 g. c- X! L
@hot_key_hud = Hot_Key_HUD.new
8 ?5 q% I Q p m- U hud_quick_menu_main
' ~, B8 }. U- t& R g3 G4 d& _9 X/ v @hot_key_hud .dispose
$ |7 C% l- Z- B4 v end
G9 w0 g. k* ?. E" r+ a
& K, u. _/ E& d alias hud_key_update update
, v# I6 F5 Y) }! p def update
/ _6 R c, S; p8 e! } hud_key_update
$ m5 {) A+ B# h) S
# Hot Key num 1
* }) I) V* i/ i if Input.press ?( Input::Numkey [ 1 ] )
) l3 H* W4 ~% o$ T. Q. l $game_player .equip_item_to_hud ( 0 , @item_window .item )
6 X) M% [( a* t3 F
# Hot Key num 2
, X; p2 l+ m: u7 ^$ c
elsif Input.press ?( Input::Numkey [ 2 ] )
7 ?* K4 c! e3 \
$game_player .equip_item_to_hud ( 1 , @item_window .item )
% M) I0 D+ R! E' B, T- {
# Hot Key num 3
* G3 T( H" M) _, w* s elsif Input.press ?( Input::Numkey [ 3 ] )
8 v, C0 Q' C e2 V- N $game_player .equip_item_to_hud ( 2 , @item_window .item )
5 Q+ B7 G+ C) g4 k8 n # Hot Key num 4
! R, a2 i4 r, Z* g3 S( O1 L elsif Input.press ?( Input::Numkey [ 4 ] )
+ H; N2 N1 ]+ A& t
$game_player .equip_item_to_hud ( 3 , @item_window .item )
+ ?0 X* ~" Z) R# k5 x1 a: d
# Hot Key num 5
0 ^) k- I6 X9 K# M/ N
elsif Input.press ?( Input::Numkey [ 5 ] )
( R7 M+ S' a" |1 k
$game_player .equip_item_to_hud ( 4 , @item_window .item )
3 n& K. Q! [3 ]! T/ f
end
9 g( j/ M/ z8 @7 Y2 ~& e+ x
@hot_key_hud .update
% o7 e5 m3 \8 U& a2 E+ b
end
( @3 [8 w7 f' D8 b9 P3 ]: m; I% H$ b" t end
: q" C( o* g% G2 l6 { else
3 [) g9 y3 [7 j/ e' m/ \ class Quick_Menu_Item
$ y; R1 @" D1 U3 t
alias hud_quick_menu_main main
* O# I0 \; O( D* h
def main
( B- t/ b9 F. d @hot_key_hud = Hot_Key_HUD.new
; R ?! @) q+ Z$ H4 N( v
hud_quick_menu_main
6 p0 G) p% e1 u5 w% [3 ?6 Q, }# J @hot_key_hud .dispose
9 ~9 ]; m; |, M$ A/ E4 L end
' k( B8 b* S# L5 D1 v" k
; I2 I! s+ n {9 K$ i: D: A5 V0 M
alias hud_key_update update
7 U% L1 ]& D* k( }; Y( z h) z$ ` def update
3 X" }9 C, W: V/ U V* F5 ^ hud_key_update
! X7 b- z4 Z/ _+ H! N
# Hot Key num 1
8 ?9 M! G4 W& H$ C if Input.press ?( Input::Numkey [ 1 ] )
) T) F o0 m# }" v( @5 K $game_player .equip_item_to_hud ( 0 , @item_window .item )
8 d3 j! g5 i- Z0 [' e, Z$ g3 U # Hot Key num 2
1 `. W& e$ c0 J( S0 J elsif Input.press ?( Input::Numkey [ 2 ] )
6 b8 E& m1 g- c+ p' Y" L
$game_player .equip_item_to_hud ( 1 , @item_window .item )
6 q" P8 B: j( V # Hot Key num 3
9 V4 \/ q% D" @; k" V+ ]
elsif Input.press ?( Input::Numkey [ 3 ] )
' y v' L2 ]( u, t5 W( I& f $game_player .equip_item_to_hud ( 2 , @item_window .item )
% W- v' Q% W- [" \: z # Hot Key num 4
$ C+ l) q/ J" w# v' w9 h# S8 N
elsif Input.press ?( Input::Numkey [ 4 ] )
! M/ `3 A/ M b+ J
$game_player .equip_item_to_hud ( 3 , @item_window .item )
+ b C7 D6 R1 J # Hot Key num 5
: t2 Y- T2 R1 J+ j2 t6 t, ?8 `+ D elsif Input.press ?( Input::Numkey [ 5 ] )
# r6 W" ^& G2 N- u* @
$game_player .equip_item_to_hud ( 4 , @item_window .item )
& Y7 G) Y# ]1 C" w5 u0 g9 @" k& W5 `: }! Z end
1 C6 K# ^$ L6 w* t Y- G @hot_key_hud .update
6 I: o- v$ h \1 e! k end
) J x. U2 }0 {* z
end
" I! |7 r6 T' {* @
end
" U* f- x. C" r7 R
( Q/ b' p" i) g# J" g* s' O; E
#===============================================================================
3 V; W* O; _" i" y1 J # HUD Window
" {7 A- E' Z( w, k" Y1 q #===============================================================================
2 @5 ]5 B' c F0 l# x6 c
class Hot_Key_HUD < Window_Base
8 o; x$ U9 o" X3 r* H; ]% q8 \ def initialize( x = HUD_X - 10 , y = HUD_Y - 15 )
0 L* [6 w# W5 ^% o5 m6 P( | super ( x, y, 220 , 80 )
1 N" F# k4 |- C) n
self .contents = Bitmap.new ( width - 32 , height - 32 )
+ p* f2 R0 j% ?/ L4 ?* F$ h self .opacity = 0
$ r2 k8 m6 P M3 \% y, x( _# j @actor = $game_party .actors [ 0 ]
, }, b8 t% J5 h) X( T
refresh
2 {1 e S _/ [
end
: R8 \7 q2 Z' O3 y- I
! o' m& [ M7 u def refresh
; n6 t7 m/ Y( b
self .contents .clear
0 p: C# x# h; q' g( F& _ bitmap = RPG::Cache .picture ( "Hot_Keys_HUD" )
$ W c5 e! Y& v# J1 [ } self .contents .blt ( 0 , 0 , bitmap, Rect.new ( 0 , 0 , 160 , 32 ) )
) N, \: L$ K# L& P7 {+ ` for i in 0 ..4
8 a, I+ h7 O' Q3 h
x = 32 * i + 4
" k' D) s8 ^' T item = $game_player .hud_equip [ i]
f; d/ k( q6 W& S2 D next if item.nil ?
6 Q/ |. [+ S+ Y8 y if item.is_a ?( RPG::Weapon )
- }, T ?# o" Q3 o2 ]1 Y7 c item = nil if $game_party .weapon_number ( item.id ) == 0 and
) [! T/ @3 V( Y) R5 |
@actor .weapon_id != item.id
. B) f1 ]# S E
elsif item.is_a ?( RPG::Armor )
& D5 z9 n/ x# j4 l" a) i
item = nil if $game_party .armor_number ( item.id ) == 0 and
& p% J* E" D; }! o* t @actor .armor1_id != item.id
6 e6 Y& \# {/ `4 i6 r2 | W U elsif item.is_a ?( RPG::Item )
$ k, V# G- B3 P) F, W8 J( `; Z
item = nil if $game_party .item_number ( item.id ) == 0 or
" C P* T1 F5 a8 V
!$game_party.item_can_use ?( item.id )
& E+ I& ]* A ~9 v. H# k; h9 j' K end
$ E5 f9 G2 j9 p1 p. t1 O4 Q" N
bitmap = RPG::Cache .icon ( item.icon_name )
$ A! g% p6 O( T9 E) Z; `
self .contents .blt ( x, 4 , bitmap, Rect.new ( 0 , 0 , 24 , 24 ) )
( t- \8 k' b6 W/ T, n
end
% O1 W8 N$ e: N0 g
end
+ _2 ~3 |3 ?# M/ }
' S1 w% ?* k, n4 p. d( _% g def equip( item)
' i) o+ }+ x/ e! c9 A% ?- ^+ O7 p
if item.nil ?
2 T( g" E- E7 ^' A $game_system .se_play ( $data_system.buzzer_se )
( p4 G' a; D- M return
$ E; Z; ]: u/ {7 w1 \
end
0 m4 E f; {9 P& L( f if item.is_a ?( RPG::Skill )
9 C0 U# \) Q8 @ if !@actor.skill_can_use ?( item.id )
. Q' x( x$ P, R! Q3 v: w: E. s $game_system .se_play ( $data_system.buzzer_se )
: X2 _1 k4 _" |9 L
return
7 t# u4 X* L6 x3 I) M
end
1 v4 Q3 S4 Q, d* q #$game_system.xas_skill_id = item.id
; E# u3 j; H* t( @ @item_type = false
4 r) j7 ?* J' X# t; \' {/ y
elsif item.is_a ?( RPG::Weapon )
o- b: m8 [9 e5 N7 a* \+ G } @actor .equip ( 0 , item.id )
( g$ f& q8 @) u& x
elsif item.is_a ?( RPG::Armor )
% C( G1 [3 H- u% }1 Y. Y d3 A
@actor .equip ( 1 , item.id )
; d: ~5 G# i& }% n. x! N% |
elsif item.is_a ?( RPG::Item )
+ i. B/ m5 Q# A
item_tool_id = XAS::XASITEM_ID [ item.id ]
8 ]; |2 v9 L: L$ \) g! R3 f; Z8 f
if item_tool_id != nil
5 M2 I! s4 u! l0 s8 W; R unless $game_party .item_can_use ?( item.id )
& q! f8 ?8 r0 A& X: h $game_system .se_play ( $data_system.buzzer_se )
% _4 U1 Y) J! Q$ p g& _ return
. h$ V0 u3 ^! [' d( d" a2 h& Y7 X7 a+ ^ end
- {' E) S+ i3 X& Q& k% v #$game_system.xas_item_id = item.id
4 K; R! {: j; C5 k @item_type = true
: x9 x5 r: |! N end
) W, G% V' q' |6 [9 q end
8 J3 a/ q4 i: X7 ~$ Z; r. H
#$game_system.se_play($data_system.equip_se)
' m$ q5 F: Q4 g" @+ a
end
4 {4 I$ ]+ X0 d9 m5 z/ B4 a
0 ^- d) ]/ H* @8 M# R5 g d
def use_hud_item( i)
F2 K' Q/ x$ l; ?. J if @item_type
! S4 c4 A1 \4 g G1 |$ \1 A# K5 C- X $game_temp .force_action_id = $game_player .hud_item_id [ i]
$ |' U. g ?* S' a& U
else
# p( b2 G" f! D0 v* T
$game_temp .force_action_id = $game_player .hud_skill_id [ i]
/ o. K: a$ v+ L9 E/ E8 V end
" }& U! z% Q% h! {6 `6 A
end
$ N/ O1 K+ }) A+ C
, A* H8 U( ?! r+ k! M def update
* H) z0 T3 v P T; [) R, V+ W
@actor = $game_party .actors [ 0 ]
7 |, k# `7 T: q$ F8 L( F2 F @hot_keys = $game_player .hud_equip
- Y# P! n$ j$ ]7 f1 O
refresh
; r# f; o# Y. N" ~% a3 D2 k return if !$scene.is_a ?( Scene_Map)
% Z/ Y4 _$ X& Z6 g. d if Input.press ?( Input::Numkey [ 1 ] )
4 V7 Q/ r3 ]. M, A) L
equip( $game_player.hud_equip [ 0 ] )
) N: \8 M# Q, q8 u use_hud_item( 0 )
; x! v0 j/ E, Y$ N/ I; X8 e elsif Input.press ?( Input::Numkey [ 2 ] )
. | \6 _2 s+ w# h- Z
equip( $game_player.hud_equip [ 1 ] )
. A1 c6 }: m8 P( q) o4 u use_hud_item( 1 )
( A6 ]7 O/ s* N elsif Input.press ?( Input::Numkey [ 3 ] )
& Y9 l) L x! j
equip( $game_player.hud_equip [ 2 ] )
; r. D/ R! G0 L8 O, \. g use_hud_item( 2 )
0 Z& k1 u0 y: `3 }2 z5 J4 K& c/ I elsif Input.press ?( Input::Numkey [ 4 ] )
2 V# S) s: ~5 |; ^: o6 W
equip( $game_player.hud_equip [ 3 ] )
. f4 g' t9 V9 X, ?
use_hud_item( 3 )
8 Y# ?1 b7 |* l4 w# P; o
elsif Input.press ?( Input::Numkey [ 5 ] )
! \9 V" J Q+ r3 a& N equip( $game_player.hud_equip [ 4 ] )
1 ~/ N3 l) s) G3 C& K8 F0 G+ J9 D
use_hud_item( 4 )
2 b. t2 c i/ d) L
end
& G+ y+ _* o1 u' m2 l8 x end
$ a& E- _5 @, t3 e, ` end
1 l* O9 M) f2 ] ]3 u
& a2 {" H+ h( Y' B3 h& R. a
#===============================================================================
, N& p; f8 z( Q4 ?* I1 W' m( \ # Scene Map
9 ]2 |' c7 B& d- w7 o, a5 l #===============================================================================
3 l: y/ V% P L
class Scene_Map
, J, p! I) A* f5 N2 M; y
alias hot_key_hud_init main
2 l, d6 B4 W. {0 ]% O0 k def main
$ O* G1 L$ ]/ i5 g
@hot_key_hud = Hot_Key_HUD.new
( f7 _) ~- T" c' `, Z4 w7 D7 p
@hot_key_hud .visible = !$game_switches[ XAS_HUDDISABLE_HUD_SWITCH]
: v o' t6 g/ t% O, z
hot_key_hud_init
1 p: \) V9 `" [9 u; l" | @hot_key_hud .dispose
8 F1 y$ F0 ~ J( b8 R5 f4 x
end
2 Z& y2 n% ~* x+ z5 q5 y2 v
$ I" L! b0 C8 A5 D: Y0 u+ d2 H
alias hot_key_hud_update update
9 S+ F3 M! @" @$ X2 e w def update
9 F, l2 }8 V! r; e
hot_key_hud_update
9 D& I" |0 T* B$ a @hot_key_hud .update
0 d, {1 C9 q9 \$ K8 Q5 X# h @hot_key_hud .visible = !$game_switches[ XAS_HUDDISABLE_HUD_SWITCH]
) A% `% V! D" ]' c3 j/ h @hot_key_hud .update if !$game_switches[ XAS_HUDDISABLE_HUD_SWITCH]
0 k! R& m# f2 ~$ `# s$ _ end
6 Q* `' `2 y0 G. I& w- W9 H& ~
end
1 F+ |0 D2 e9 m: q