01-24-2013, 01:00 PM
Compact Status Window
by Cockroach
Jan 24, 2013
This is a really simple edit I made just to practice editing windows and stuff... :P
What it basically does is group in a single scene all the party status' (if you have 4 party members)
In case there are only 2 or 3 empty windows will be drawn.
----------------------------------------------------------------------------------
Script:
----------------------------------------------------------------------------------
Demo:
ATTACHED
Optimized_Menu.zip (Size: 205.91 KB / Downloads: 7)
----------------------------------------------------------------------------------
If you find any dumb coding let me know, I'm an RGSS moron! :P
by Cockroach
Jan 24, 2013
This is a locked, single-post thread from Creation Asylum. Archived here to prevent its loss.
No support is given. If you are the owner of the thread, please contact administration.
No support is given. If you are the owner of the thread, please contact administration.
This is a really simple edit I made just to practice editing windows and stuff... :P
What it basically does is group in a single scene all the party status' (if you have 4 party members)
In case there are only 2 or 3 empty windows will be drawn.
----------------------------------------------------------------------------------
Script:
Scene_Menu
Code:
#==============================================================================
# Scene_Menu Adaptation
#------------------------------------------------------------------------------
# This script adapts the Scene_Menu class to support multiple status windows
#
# Updated methods
# - def update_command
#
#==============================================================================
class Scene_Menu
def update_command
# If B button was pressed
if Input.trigger?(Input::B)
# Play cancel SE
$game_system.se_play($data_system.cancel_se)
# Switch to map screen
$scene = Scene_Map.new
return
end
# If C button was pressed
if Input.trigger?(Input::C)
# If command other than save or end game, and party members = 0
if $game_party.actors.size == 0 and @command_window.index < 4
# Play buzzer SE
$game_system.se_play($data_system.buzzer_se)
return
end
# Branch by command window cursor position
case @command_window.index
when 0 # item
# Play decision SE
$game_system.se_play($data_system.decision_se)
# Switch to item screen
$scene = Scene_Item.new
when 1 # skill
# Play decision SE
$game_system.se_play($data_system.decision_se)
# Make status window active
@command_window.active = false
@status_window.active = true
@status_window.index = 0
when 2 # equipment
# Play decision SE
$game_system.se_play($data_system.decision_se)
# Make status window active
@command_window.active = false
@status_window.active = true
@status_window.index = 0
when 3 # status
# Play decision SE
$game_system.se_play($data_system.decision_se)
# Make status window active
$scene = Scene_Status.new
when 4 # save
# If saving is forbidden
if $game_system.save_disabled
# Play buzzer SE
$game_system.se_play($data_system.buzzer_se)
return
end
# Play decision SE
$game_system.se_play($data_system.decision_se)
# Switch to save screen
$scene = Scene_Save.new
when 5 # end game
# Play decision SE
$game_system.se_play($data_system.decision_se)
# Switch to end game screen
$scene = Scene_End.new
end
return
end
end
end
Scene_Status
Code:
#==============================================================================
# Scene_Status Adaptation
#------------------------------------------------------------------------------
# This script adapts the Scene_Status class to support multiple status windows
#
# Updated methods:
# - def main
# - def update
#
#==============================================================================
class Scene_Status
#--------------------------------------------------------------------------
# * Main Processing
#--------------------------------------------------------------------------
def main
# Get actor
@actor = $game_party.actors[@actor_index]
# Make status window
@status_window1 = Window_NewStatus.new(0)
@status_window2 = Window_NewStatus.new(1)
@status_window3 = Window_NewStatus.new(2)
@status_window4 = Window_NewStatus.new(3)
# Execute transition
Graphics.transition
# Main loop
loop do
# Update game screen
Graphics.update
# Update input information
Input.update
# Frame update
update
# Abort loop if screen is changed
if $scene != self
break
end
end
# Prepare for transition
Graphics.freeze
# Dispose of windows
@status_window1.dispose
@status_window2.dispose
@status_window3.dispose
@status_window4.dispose
end
#--------------------------------------------------------------------------
# * Frame Update
#--------------------------------------------------------------------------
def update
# If B button was pressed
if Input.trigger?(Input::B)
# Play cancel SE
$game_system.se_play($data_system.cancel_se)
# Switch to menu screen
$scene = Scene_Menu.new(3)
return
end
# If R button was pressed
if Input.trigger?(Input::R)
# Play cursor SE
$game_system.se_play($data_system.cursor_se)
# To next actor
@actor_index += 1
@actor_index %= $game_party.actors.size
# Switch to different status screen
$scene = Scene_Status.new(@actor_index)
return
end
# If L button was pressed
if Input.trigger?(Input::L)
# Play cursor SE
$game_system.se_play($data_system.cursor_se)
# To previous actor
@actor_index += $game_party.actors.size - 1
@actor_index %= $game_party.actors.size
# Switch to different status screen
$scene = Scene_Status.new(@actor_index)
return
end
@status_window1.update
@status_window2.update
@status_window3.update
@status_window4.update
end
end
Window_NewStatus
Code:
#==============================================================================
# Window_NewStatus < Window_Base
#------------------------------------------------------------------------------
# Compact status window class
#
# All methods belong to Window_Base and root classes
#==============================================================================
class Window_NewStatus < Window_Base
def initialize(actor_id)
@actor = $game_party.actors[actor_id]
@actor_frame = 0.00
x = actor_id
y = 0
if x > 1
x = x - 2
y = y + 1
end
super(x * 320, y * 240, 320, 240)
self.contents = Bitmap.new(width - 32, height - 32)
update
end
def update
self.contents.clear
if @actor == nil
return
end
#-----------------------------#
# Draw animated character #
#-----------------------------#
bitmap = RPG::Cache.character(@actor.character_name, @actor.character_hue)
i = @actor_frame.floor
cw = bitmap.width / 4
ch = bitmap.height / 4
src_rect = Rect.new(i*cw, 0, cw, ch)
self.contents.blt(48 - cw / 2, 92 - ch, bitmap, src_rect)
@actor_frame = @actor_frame + 0.15
if @actor_frame >= 4.00
@actor_frame -= 4.00
end
#-----------------------------#
# Draw information #
#-----------------------------#
draw_actor_name(@actor, 4, 0)
self.contents.font.color = normal_color
self.contents.draw_text(184, 0, 84, 32, @actor.class_name, 2)
draw_actor_level(@actor, 112, 0)
draw_actor_hp(@actor, 112, 24, 172)
draw_actor_sp(@actor, 112, 42, 172)
draw_actor_parameter(@actor, 112, 66, 0)
draw_actor_parameter(@actor, 112, 84, 1)
draw_actor_parameter(@actor, 112, 102, 2)
draw_actor_parameter(@actor, 112, 120, 3)
draw_actor_parameter(@actor, 112, 138, 4)
draw_actor_parameter(@actor, 112, 156, 5)
draw_actor_parameter(@actor, 112, 174, 6)
#-----------------------------#
# Draw equipment #
#-----------------------------#
self.contents.draw_text(0, 102, 128, 32, "Equipment:", 0)
item = $data_weapons[@actor.weapon_id]
if item != nil
bitmap = RPG::Cache.icon(item.icon_name)
self.contents.blt(8, 176, bitmap, Rect.new(0, 0, 24, 24))
end
item = $data_armors[@actor.armor3_id]
if item != nil
bitmap = RPG::Cache.icon(item.icon_name)
self.contents.blt(36, 176, bitmap, Rect.new(0, 0, 24, 24))
end
item = $data_armors[@actor.armor1_id]
if item != nil
bitmap = RPG::Cache.icon(item.icon_name)
self.contents.blt(64, 176, bitmap, Rect.new(0, 0, 24, 24))
end
item = $data_armors[@actor.armor2_id]
if item != nil
bitmap = RPG::Cache.icon(item.icon_name)
self.contents.blt(36, 146, bitmap, Rect.new(0, 0, 24, 24))
end
item = $data_armors[@actor.armor4_id]
if item != nil
bitmap = RPG::Cache.icon(item.icon_name)
self.contents.blt(64, 146, bitmap, Rect.new(0, 0, 24, 24))
end
end
end
----------------------------------------------------------------------------------
Demo:
ATTACHED
Optimized_Menu.zip (Size: 205.91 KB / Downloads: 7)
----------------------------------------------------------------------------------
If you find any dumb coding let me know, I'm an RGSS moron! :P