03-08-2011, 06:30 AM
Ok, it tried a new p command right after my block tests if Shift is pressed and still nothing. that means that my entire class that aliases scene_item is not working...
HP_COLOR = Color.new(128, 255, 128, 255) # Green
# this constant is just here to make it configurable, even though
# it could be just placed below...
class Window_BattleStatus
# I doubt if I even need the alias, as the new refresh method
# directly calls the color edit method.
alias draw_colored_hp draw_actor_hp
def draw_colored_hp(actor, x, y, width = 144)
draw_actor_hp(actor, x, y, width = 144)
self.contents.font.color = HP_COLOR
self.contents.draw_text(x, y, 32, 32, $data_system.words.hp)
# This is to change the color of 'HP' or whatever the game
# calls it. As this is a test, I am just
# trying to see if this is acceptable practice.
end
def refresh
# This method directly calls the color edit method, so I don't
# think I need the alias above. However, if I do not change
# the refresh method to call my method, then mine never gets
# called, alias or not... I don't understand the right way to
# use alias maybe?
self.contents.clear
@item_max = $game_party.actors.size
for i in 0...$game_party.actors.size
actor = $game_party.actors
actor_x = i * 160 + 4
draw_actor_name(actor, actor_x, 0)
draw_colored_hp(actor, actor_x, 32, 120) #changed from draw_actor_hp
draw_actor_sp(actor, actor_x, 64, 120)
if @level_up_flags
self.contents.font.color = normal_color
self.contents.draw_text(actor_x, 96, 120, 32, "LEVEL UP!")
else
draw_actor_state(actor, actor_x, 96)
end
end
end
end
HP_COLOR = Color.new(128, 255, 128, 255) # Green
# this constant is just here to make it configurable, even though
# it could be just placed below...
#==============================================================================
# ** Window_BattleStatus
#------------------------------------------------------------------------------
# This window displays the status of all party members on the battle screen.
#==============================================================================
class Window_BattleStatus < Window_Base
#--------------------------------------------------------------------------
# * Draw HP
# actor : actor
# x : draw spot x-coordinate
# y : draw spot y-coordinate
# width : draw spot width
#--------------------------------------------------------------------------
def draw_actor_hp(actor, x, y, width = 144)
# Draw "HP" text string
self.contents.font.color = HP_COLOR
self.contents.draw_text(x, y, 32, 32, $data_system.words.hp)
# Calculate if there is draw space for MaxHP
if width - 32 >= 108
hp_x = x + width - 108
flag = true
elsif width - 32 >= 48
hp_x = x + width - 48
flag = false
end
# Draw HP
self.contents.font.color = actor.hp == 0 ? knockout_color :
actor.hp <= actor.maxhp / 4 ? crisis_color : normal_color
self.contents.draw_text(hp_x, y, 48, 32, actor.hp.to_s, 2)
# Draw MaxHP
if flag
self.contents.font.color = normal_color
self.contents.draw_text(hp_x + 48, y, 12, 32, "/", 1)
self.contents.draw_text(hp_x + 60, y, 48, 32, actor.maxhp.to_s)
end
end
end
def method_one(x)
return_val = x + 3
return x
end
alias new_method_one method_one
def method_one(x)
value_new = new_method_one(x)
value_new += 40
return value_new
end
class Parent_Class
def method(*args)
#anything
end
end
class Child_Class < Parent_Class
alias old_method method
def method(*args)
old_method(*args)
#anything
end
end
class Parent_Class
def method(*args)
#anything
end
end
class Child_Class < Parent_Class
def method(*args)
super(*args)
#anything
end
end