Blizz ABS/Zelda HUD: Gold Display?

Started by shintashi, October 18, 2012, 09:24:32 pm

Previous topic - Next topic

shintashi

I'm trying to get something like "(icon) X 99" to display in the top right of my screen in the Blizz ABS battle system, and I have no idea how to do it successfully. I've tried placing the following


  def draw_gold
self.contents.clear
    self.contents.font.color = normal_color
    self.contents.draw_text(124, 20, 124, 32, $game_party.gold.to_s, 2)
    self.contents.font.color = normal_color
    self.contents.draw_text(120, 20, 50, 32, "X", 2)
   
    b1 = RPG::Cache.picture(BlizzCFG::Z_SKILL_BACK)
    @hotkey_sprite.bitmap.fill_rect(0, 0, b1.width, b1.height, Color.new(0, 0, 0, 0))
    bitmap = RPG::Cache.icon($data_skills[50].icon_name) #set icon to Crystal   
    @hotkey_sprite.bitmap.blt(112, 20, bitmap, Rect.new(0, 0, 24, 24))

end


in strategic places in both the 3rd section of Blizz ABS (below the script for "draw_lskill"), and tried a similar tactic in the ZELDA HUD script, but could not get anything to appear at all. I even created a crystal icon (crystal are my currency) and created a skill to store the icon to try to speed up the process, but I think I screwed up somewhere. I'm just trying to get a tiny icon, and some white text that says "X (gold total)"

So if you had 37 "crystals", it would have '(crystal icon) x 37" in the top right corner of the screen, and if you bought something, that number would update and go down. Standard 8 bit stuff.

KK20

Quote from: shintashi on October 18, 2012, 09:24:32 pm
I'm trying to get something like "(icon) X 99" to display in the top right of my screen in the Blizz ABS battle system, and I have no idea how to do it successfully. I've tried placing the following -code- in strategic places in both the 3rd section of Blizz ABS (below the script for "draw_lskill"), and tried a similar tactic in the ZELDA HUD script, but could not get anything to appear at all.
Probably because the method isn't even getting called AT ALL? Just because you have the method in your game, that doesn't mean it's automatically going to run it. My recommendation is to put that method in Scene_Map and in the class's update call your method draw_gold.

Also, this
bitmap = RPG::Cache.icon($data_skills[50].icon_name)
is pretty bad practice. You use the name of the icon file, like so
bitmap = RPG::Cache.icon("035-Item04")


Also, welcome back. I take it you gave up on that Class-Actor-Skill hybrid that you had me working on for weeks?  :P

Other Projects
RPG Maker XP Ace  Upgrade RMXP to RMVXA performance!
XPA Tilemap  Tilemap rewrite with many features, including custom resolution!

Nintendo Switch Friend Code: 8310-1917-5318
Discord: KK20 Tyler#8901

Join the CP Discord Server!

shintashi

October 19, 2012, 02:11:53 am #2 Last Edit: October 19, 2012, 02:18:22 am by shintashi
Quote from: Ezel Berbier on October 18, 2012, 11:13:14 pm
Quote from: shintashi on October 18, 2012, 09:24:32 pm
I'm trying to get something like "(icon) X 99" to display in the top right of my screen in the Blizz ABS battle system, and I have no idea how to do it successfully. I've tried placing the following -code- in strategic places in both the 3rd section of Blizz ABS (below the script for "draw_lskill"), and tried a similar tactic in the ZELDA HUD script, but could not get anything to appear at all.
Probably because the method isn't even getting called AT ALL? Just because you have the method in your game, that doesn't mean it's automatically going to run it. My recommendation is to put that method in Scene_Map and in the class's update call your method draw_gold.

Also, this
bitmap = RPG::Cache.icon($data_skills[50].icon_name)
is pretty bad practice. You use the name of the icon file, like so
bitmap = RPG::Cache.icon("035-Item04")


Also, welcome back. I take it you gave up on that Class-Actor-Skill hybrid that you had me working on for weeks?  :P


The uber program? I basically moved a year ago and my hard drive crashed.  The last bloated parts I worked on included the afterlife and Power Armor.

As to the current dilemma, I tried putting it in, but i keep getting no method errors with the self.contents commands.

KK20

I can't guarantee anything as I have nothing to work with here. Add the draw_gold to the class Hud. In the Hud update method, put draw_gold in there. Change 'contents' to 'bitmap' in your code (contents is the name Window classes use).

You can play around with it after that.

Other Projects
RPG Maker XP Ace  Upgrade RMXP to RMVXA performance!
XPA Tilemap  Tilemap rewrite with many features, including custom resolution!

Nintendo Switch Friend Code: 8310-1917-5318
Discord: KK20 Tyler#8901

Join the CP Discord Server!

shintashi

October 19, 2012, 03:14:05 am #4 Last Edit: October 19, 2012, 03:26:15 am by shintashi
Quote from: Ezel Berbier on October 19, 2012, 02:29:34 am
I can't guarantee anything as I have nothing to work with here. Add the draw_gold to the class Hud. In the Hud update method, put draw_gold in there. Change 'contents' to 'bitmap' in your code (contents is the name Window classes use).

You can play around with it after that.


This is what I've got so far as a rewrite:


 def draw_gold
   @gold = $game_party.gold
   b1 = RPG::Cache.picture(BlizzCFG::Z_SKILL_BACK)
   @hotkey_sprite.bitmap.fill_rect(0, 0, b1.width, b1.height, Color.new(0, 0, 0, 0))
   @hotkey_sprite.bitmap.blt(0, 0, b1, Rect.new(0, 0, b1.width, b1.height))
   if @gold != 0
     bitmap = RPG::Cache.icon("crystal_icon")
     x, y = (b1.width - 24) / 2, (b1.height - 24) / 2
     @hotkey_sprite.bitmap.blt(x, y, bitmap, Rect.new(0, 0, 24, 24))
   end

 end  
 


but so far, i can't even get the crystal to appear.

here's the full zelda hud with my snippet

Spoiler: ShowHide

class Hud
 
 attr_reader :hotkey_sprite
 
 alias init_zhud_later initialize
 def initialize(viewport = nil)
   init_hotkey_sprite(viewport)
   init_zhud_later(viewport)
   self.x, self.y = 4, 4
   @hotkey_sprite.z = self.z
   if BlizzCFG::Z_HUD_BACKGROUND != ''
     @zhud_back = Sprite.new
     @zhud_back.bitmap = RPG::Cache.picture(BlizzCFG::Z_HUD_BACKGROUND)
     @zhud_back.z = self.z - 1
   end
 end
 
 alias create_positions_zhud_later create_positions
 def create_positions
   create_positions_zhud_later
   b1 = RPG::Cache.picture(BlizzCFG::Z_HP_FILE)
   b2 = RPG::Cache.picture(BlizzCFG::Z_SP_FILE)
   if BlizzCFG::Z_HP_TILING
     w = b1.width * BlizzCFG::Z_HP_TILE_COLUMNS
   else
     w = b1.width
   end
   @hud_width = w if @hud_width < w
   if BlizzCFG::Z_SP_TILING
     w = b2.width * BlizzCFG::Z_SP_TILE_COLUMNS
   else
     w = b2.width
   end
   @hud_width = w if @hud_width < w
   @hud_height = BlizzCFG::Z_HUD_HEIGHT
   @hp_x, @hp_y, @sp_x, @sp_y = 0, 0, 0, b1.height + 4
   update_sp_y
   b = RPG::Cache.picture(BlizzCFG::Z_ITEM_BACK)
   @left_x = b.width
   @left_y = b.height
   @hot_x = b.width
 end
 
 def draw_basic
 end
 
 def draw_empty
 end
 
 #shintashi
 def draw_gold
   @gold = $game_party.gold
   b1 = RPG::Cache.picture(BlizzCFG::Z_SKILL_BACK)
   @hotkey_sprite.bitmap.fill_rect(0, 0, b1.width, b1.height, Color.new(0, 0, 0, 0))
   @hotkey_sprite.bitmap.blt(0, 0, b1, Rect.new(0, 0, b1.width, b1.height))
   if @gold != 0
     bitmap = RPG::Cache.icon("crystal_icon")
     x, y = (b1.width - 24) / 2, (b1.height - 24) / 2
     @hotkey_sprite.bitmap.blt(x, y, bitmap, Rect.new(0, 0, 24, 24))
   end

 end  
 
 
 
 def draw_name
 end
 
 def draw_level
 end
 
 def draw_hp
   @hp, @maxhp = actor.hp, actor.maxhp
   rate = (@maxhp > 0 ? @hp.to_f / @maxhp : 0)
   b1 = RPG::Cache.picture(BlizzCFG::Z_HP_FILE)
   b2 = RPG::Cache.picture(BlizzCFG::Z_HP_FILE_EMPTY)
   if BlizzCFG::Z_HP_TILING
     tiles = @maxhp / BlizzCFG::Z_HP_PER_TILE
     rows = (tiles.to_f / BlizzCFG::Z_HP_TILE_COLUMNS).ceil
     w, h = b1.width, b1.height
     self.bitmap.fill_rect(@hp_x, @hp_y, w * BlizzCFG::Z_HP_TILE_COLUMNS,
         h * rows, Color.new(0, 0, 0, 0))
     full_tiles = (rate * tiles).to_i
     semi_full = ((rate * tiles != full_tiles) ? 1 : 0)
     (0...full_tiles).each {|i|
         x = @hp_x + (i % BlizzCFG::Z_HP_TILE_COLUMNS) * w
         y = @hp_y + (i / BlizzCFG::Z_HP_TILE_COLUMNS) * h
         self.bitmap.blt(x, y, b1, Rect.new(0, 0, w, h))}
     if semi_full > 0
       x = @hp_x + (full_tiles % BlizzCFG::Z_HP_TILE_COLUMNS) * w
       y = @hp_y + (full_tiles / BlizzCFG::Z_HP_TILE_COLUMNS) * h
       if BlizzCFG::Z_HP_FILL_UP
         h2 = ((1 - rate * tiles + full_tiles) * h).to_i
         self.bitmap.blt(x, y, b2, Rect.new(0, 0, w, h2))
         self.bitmap.blt(x, y + h2, b1, Rect.new(0, h2, w, h - h2))
       else
         w2 = ((rate * tiles - full_tiles) * w).to_i
         self.bitmap.blt(x, y, b1, Rect.new(0, 0, w2, h))
         self.bitmap.blt(x + w2, y, b2, Rect.new(w2, 0, w - w2, h))
       end
     end
     ((full_tiles + semi_full)...tiles).each {|i|
         x = @hp_x + (i % BlizzCFG::Z_HP_TILE_COLUMNS) * w
         y = @hp_y + (i / BlizzCFG::Z_HP_TILE_COLUMNS) * h
         self.bitmap.blt(x, y, b2, Rect.new(0, 0, w, h))}
   else
     w1 = (b1.width * rate).to_i
     w2 = b2.width - w1
     self.bitmap.fill_rect(@hp_x, @hp_y, b1.width, b1.height, Color.new(0, 0, 0, 0))
     self.bitmap.blt(@hp_x, @hp_y, b1, Rect.new(0, 0, w1, b1.height))
     self.bitmap.blt(@hp_x + w1, @hp_y, b2, Rect.new(w1, 0, w2, b2.height))
   end
   draw_sp
   draw_gold
 end
 
 def draw_sp
   @sp, @maxsp = actor.sp, actor.maxsp
   rate = (@maxsp > 0 ? @sp.to_f / @maxsp : 0)
   b1 = RPG::Cache.picture(BlizzCFG::Z_SP_FILE)
   b2 = RPG::Cache.picture(BlizzCFG::Z_SP_FILE_EMPTY)
   if BlizzCFG::Z_SP_TILING
     tiles = @maxsp / BlizzCFG::Z_SP_PER_TILE
     rows = (tiles.to_f / BlizzCFG::Z_SP_TILE_COLUMNS).ceil
     w, h = b1.width, b1.height
     self.bitmap.fill_rect(@sp_x, @sp_y, w * BlizzCFG::Z_SP_TILE_COLUMNS,
         h * rows, Color.new(0, 0, 0, 0))
     full_tiles = (rate * tiles).to_i
     semi_full = ((rate * tiles != full_tiles) ? 1 : 0)
     (0...full_tiles).each {|i|
         x = @sp_x + (i % BlizzCFG::Z_SP_TILE_COLUMNS) * w
         y = @sp_y + (i / BlizzCFG::Z_SP_TILE_COLUMNS) * h
         self.bitmap.blt(x, y, b1, Rect.new(0, 0, w, h))}
     if semi_full > 0
       x = @sp_x + (full_tiles % BlizzCFG::Z_SP_TILE_COLUMNS) * w
       y = @sp_y + (full_tiles / BlizzCFG::Z_SP_TILE_COLUMNS) * h
       if BlizzCFG::Z_SP_FILL_UP
         h2 = ((1 - rate * tiles + full_tiles) * h).to_i
         self.bitmap.blt(x, y, b2, Rect.new(0, 0, w, h2))
         self.bitmap.blt(x, y + h2, b1, Rect.new(0, h2, w, h - h2))
       else
         w2 = ((rate * tiles - full_tiles) * w).to_i
         self.bitmap.blt(x, y, b1, Rect.new(0, 0, w2, h))
         self.bitmap.blt(x + w2, y, b2, Rect.new(w2, 0, w - w2, h))
       end
     end
     ((full_tiles + semi_full)...tiles).each {|i|
         x = @sp_x + (i % BlizzCFG::Z_SP_TILE_COLUMNS) * w
         y = @sp_y + (i / BlizzCFG::Z_SP_TILE_COLUMNS) * h
         self.bitmap.blt(x, y, b2, Rect.new(0, 0, w, h))}
   else
     w1 = (b1.width * rate).to_i
     w2 = b2.width - w1
     self.bitmap.fill_rect(@sp_x, @sp_y, b1.width, b1.height, Color.new(0, 0, 0, 0))
     self.bitmap.blt(@sp_x, @sp_y, b1, Rect.new(0, 0, w1, b1.height))
     self.bitmap.blt(@sp_x + w1, @sp_y, b2, Rect.new(w1, 0, w2, b2.height))
   end
 end
 
 def draw_hskill
   @skill = actor.skill
   b1 = RPG::Cache.picture(BlizzCFG::Z_SKILL_BACK)
   @hotkey_sprite.bitmap.fill_rect(0, 0, b1.width, b1.height, Color.new(0, 0, 0, 0))
   @hotkey_sprite.bitmap.blt(0, 0, b1, Rect.new(0, 0, b1.width, b1.height))
   if @skill != 0
     bitmap = RPG::Cache.icon($data_skills[@skill].icon_name)
     x, y = (b1.width - 24) / 2, (b1.height - 24) / 2
     @hotkey_sprite.bitmap.blt(x, y, bitmap, Rect.new(0, 0, 24, 24))
   end
   draw_lskill
 end
 
 def draw_lskill
   @hotkey_sprite.bitmap.fill_rect(0, @left_y + 4, @left_x, 16, Color.new(0, 0, 0, 0))
   @skills_left = get_skills_left
   if @skill != nil && @skill > 0
     if @skills_left >= 0
       if @skills_left == 0
         @hotkey_sprite.bitmap.font.color = Color.new(255, 0, 0)
       elsif @skills_left <= 5
         @hotkey_sprite.bitmap.font.color = Color.new(255, 255, 0)
       else
         @hotkey_sprite.bitmap.font.color = normal_color
       end
       @hotkey_sprite.bitmap.font.size -= 2
       @hotkey_sprite.bitmap.draw_text_full(0, @left_y, @left_x, 20, @skills_left.to_s, 1)
       @hotkey_sprite.bitmap.font.size += 2
     elsif @skills_left == -1
       @hotkey_sprite.bitmap.font.color = Color.new(0, 255, 0)
       @hotkey_sprite.bitmap.font.size += 4
       @hotkey_sprite.bitmap.draw_text_full(0, @left_y, @left_x, 20, '∞', 1)
       @hotkey_sprite.bitmap.font.size -= 4
     end
   end
 end
 
 
 def draw_hitem
   @item = actor.item
   b1 = RPG::Cache.picture(BlizzCFG::Z_SKILL_BACK)
   b2 = RPG::Cache.picture(BlizzCFG::Z_ITEM_BACK)
   x = b1.width + 4
   @hotkey_sprite.bitmap.fill_rect(x, 0, b2.width, b2.height, Color.new(0, 0, 0, 0))
   @hotkey_sprite.bitmap.blt(x, 0, b2, Rect.new(0, 0, b2.width, b2.height))
   if @item != 0
     bitmap = RPG::Cache.icon($data_items[@item].icon_name)
     x, y = b1.width + 4 + (b2.width - 24) / 2, (b2.height - 24) / 2
     @hotkey_sprite.bitmap.blt(x, y, bitmap, Rect.new(0, 0, 24, 24))
   end
   draw_litem
 end
 
 def draw_litem
   @items_left = $game_party.item_number(@item)
   @hotkey_sprite.bitmap.fill_rect(@left_x + 4, @left_y + 4, @left_x, 16, Color.new(0, 0, 0, 0))
   if @item != nil && @item > 0
     if $data_items[@item] != nil && !$data_items[@item].consumable
       @hotkey_sprite.bitmap.font.color = Color.new(0, 255, 0)
       @hotkey_sprite.bitmap.font.size += 4
       @hotkey_sprite.bitmap.draw_text_full(@left_x + 4, @left_y, @left_x, 20, '∞', 1)
       @hotkey_sprite.bitmap.font.size -= 4
     else
       if @items_left == 0
         @hotkey_sprite.bitmap.font.color = Color.new(255, 0, 0)
       elsif @items_left <= 10
         @hotkey_sprite.bitmap.font.color = Color.new(255, 255, 0)
       else
         @hotkey_sprite.bitmap.font.color = normal_color
       end
       @hotkey_sprite.bitmap.font.size -= 2
       @hotkey_sprite.bitmap.draw_text_full(@left_x + 4, @left_y, @left_x, 20, @items_left.to_s, 1)
       @hotkey_sprite.bitmap.font.size += 2
     end
   end
 end
 
 alias update_zhud_later update
 def update
   update_sp_y if actor != nil
   update_zhud_later
 end
 
 def update_sp_y
   return if !BlizzCFG::Z_HP_TILING
   b1 = RPG::Cache.picture(BlizzCFG::Z_HP_FILE)
   tiles = actor.maxhp / BlizzCFG::Z_HP_PER_TILE
   @sp_y = (tiles.to_f / BlizzCFG::Z_HP_TILE_COLUMNS).ceil * b1.height
 end
 
 alias dispose_zhud_later dispose
 def dispose
   @hotkey_sprite.dispose if @hotkey_sprite != nil
   @hotkey_sprite = nil
   @zhud_back.dispose if @zhud_back != nil
   @zhud_back = nil
   dispose_zhud_later
 end
 
 def init_hotkey_sprite(viewport)
   b1 = RPG::Cache.picture(BlizzCFG::Z_ITEM_BACK)
   b2 = RPG::Cache.picture(BlizzCFG::Z_SKILL_BACK)
   width = b1.width + b2.width
   @hotkey_sprite = Sprite.new(viewport)
   @hotkey_sprite.x = 632 - width
   @hotkey_sprite.y = 4
   @hotkey_sprite.bitmap = Bitmap.new(width + 4, b1.height + 24)
   @hotkey_sprite.bitmap.font.name = 'Arial'
   @hotkey_sprite.bitmap.font.size = 16
   @hotkey_sprite.bitmap.font.bold = true
 end
   
end

#==============================================================================
# Hotkey_Assignment
#==============================================================================

class Hotkey_Assignment
 
 def initialize(viewport = nil)
   super
   self.bitmap = Bitmap.new(32, 320)
   self.bitmap.font.bold = true
   self.bitmap.font.size -= 8
   self.bitmap.font.color = system_color
   self.x, self.y, self.z = 0, 160, 1100
   @skills = BlizzABS::Cache::EmptyKeys
   @items = BlizzABS::Cache::EmptyKeys
   update
 end
 
 def draw(index = nil)
   back = RPG::Cache.picture(BlizzCFG::Z_HOTKEYS_BACK)
   w, h = back.width, back.height
   ow, oh = (w - 24) / 2, (h - 24) / 2
   (index == nil ? BlizzABS::Cache::HotkeyRange : [index]).each {|i|
       if $game_player.skill_hotkeys[i%10] != 0
         object = $data_skills[$game_player.skill_hotkeys[i%10]]
       elsif $game_player.item_hotkeys[i%10] != 0
         object = $data_items[$game_player.item_hotkeys[i%10]]
       end
       if @items[i%10] != $game_player.item_hotkeys[i%10] ||
           @skills[i%10] != $game_player.skill_hotkeys[i%10]
         self.bitmap.fill_rect(0, h*(i-1), w, h, Color.new(0, 0, 0, 0))
         self.bitmap.blt(0, h*(i-1), back, Rect.new(0, 0, w, h))
         if object != nil
           bitmap = RPG::Cache.icon(object.icon_name)
           self.bitmap.blt(ow, h*(i-1)+oh, bitmap, Rect.new(0, 0, 24, 24))
         end
         self.bitmap.draw_text_full(0, h*(i-1)+10, w-2, 32, (i%10).to_s, 2)
       end}
   @items = $game_player.item_hotkeys.clone
   @skills = $game_player.skill_hotkeys.clone
 end
 
end

#==============================================================================
# Minimap
#==============================================================================

class Minimap
 
 alias update_zhud_later update
 def update(override = false)
   update_zhud_later(override)
   update_minimap_back
 end
 
 def update_minimap_back
   if $game_system.minimap == 1
     if @minimap_back == nil
       @minimap_back = Sprite.new
       @minimap_back.bitmap = RPG::Cache.picture(BlizzCFG::Z_MINIMAP_BACK)
       @minimap_back.x = self.vx - (@minimap_back.bitmap.width - self.vw) / 2
       @minimap_back.y = self.vy - (@minimap_back.bitmap.height - self.vh) / 2
       @minimap_back.z = self.z + 1
       @minimap_back.opacity = self.opacity
     end
   elsif @minimap_back != nil
     @minimap_back.dispose
     @minimap_back = nil
   end
 end
 
 alias opacity_is_zhud_later opacity=
 def opacity=(value)
   opacity_is_zhud_later(value)
   @minimap_back.opacity = value if @minimap_back != nil
 end
 
 alias dispose_zhud_later dispose
 def dispose
   dispose_zhud_later
   @minimap_back.dispose if @minimap_back != nil
   @minimap_back = nil
 end
 
end
 
#==============================================================================
# Scene_Map
#==============================================================================

class Scene_Map
 
 alias hud_update_zhud_later hud_update
 def hud_update
   hud_update_zhud_later
   if @hud != nil
     s = @hud.hotkey_sprite
     s.update
     if $game_player.screen_x < s.vx + s.vw + 16 &&
         $game_player.screen_y < s.vy + s.vh + 48 &&
         $game_player.screen_x > s.vx && $game_player.screen_y > s.vy
       s.opacity -= 25 if s.opacity > 80
     elsif s.opacity <= 255
       s.opacity += 25
     end
   end
 end
 
end

#==============================================================================
# Window_Skill_Hotkey
#==============================================================================

class Window_Skill_Hotkey < Window_Skill
 
 def initialize(actor)
   super
   @column_max = 1
   self.width, self.height = 288, 480
   self.x, self.y, self.z = 64, 64, 21000
   self.cursor_rect.empty
   self.active = false
   refresh
 end
 
 def draw_item(i)
   if @data[i] == nil
     self.contents.font.color = normal_color
     self.contents.draw_text(32, i*32, 204, 32, '<Remove>')
   else
     if @actor.skill_can_use?(@data[i].id)
       self.contents.font.color = normal_color
     else
       self.contents.font.color = disabled_color
     end
     self.contents.fill_rect(Rect.new(4, i*32, 256, 32), Color.new(0, 0, 0, 0))
     bitmap = RPG::Cache.icon(@data[i].icon_name)
     opacity = self.contents.font.color == normal_color ? 255 : 128
     self.contents.blt(4, 4+i*32, bitmap, Rect.new(0, 0, 24, 24), opacity)
     text = @data[i].name
     if @actor.skills.include?(@data[i].id) &&
         $tons_version != nil && $tons_version >= 3.7 &&
         TONS_OF_ADDONS::EQUAP_SKILLS && DISPLAY_AP_REQ
       aps = BlizzCFG.maxap(@data[i].id)
       text = "#{text} (#{@actor.ap(@data[i].id)}/#{aps})" if aps != 0
     end
     self.contents.draw_text(32, i*32, 204, 32, text)
     sp_cost = @data[i].sp_cost
     if $tons_version != nil && $tons_version >= 6.54 &&
         $game_system.SP_COST_MOD
       sp_cost = BlizzCFG.get_cost_mod(@actor.states, sp_cost)
     end
     self.contents.draw_text(204, i*32, 48, 32, sp_cost.to_s, 2)
   end
 end
 
end

#==============================================================================
# Window_Item_Hotkey
#==============================================================================

class Window_Item_Hotkey < Window_Item
 
 def initialize
   super
   @column_max = 1
   self.width, self.height = 288, 480
   self.x, self.y, self.z = 352, 64, 21000
   self.cursor_rect.empty
   self.active = false
   refresh
 end
 
 def draw_item(i)
   if @data[i] == nil
     self.contents.font.color = normal_color
     self.contents.draw_text(32, i*32, 212, 32, '<Remove>')
   else
     number = $game_party.item_number(@data[i].id)
     if $game_party.item_can_use?(@data[i].id)
       self.contents.font.color = normal_color
     else
       self.contents.font.color = disabled_color
     end
     self.contents.fill_rect(Rect.new(4, i*32, 256, 32), Color.new(0, 0, 0, 0))
     bitmap = RPG::Cache.icon(@data[i].icon_name)
     opacity = self.contents.font.color == normal_color ? 255 : 128
     self.contents.blt(4, 4+i*32, bitmap, Rect.new(0, 0, 24, 24), opacity)
     self.contents.draw_text(32, i*32, 212, 32, @data[i].name)
     self.contents.draw_text(212, i*32, 16, 32, ':', 1)
     self.contents.draw_text(228, i*32, 24, 32, number.to_s, 2)
   end
 end
 
end

#==============================================================================
# Scene_Hotkeys
#==============================================================================

class Scene_Hotkeys
 
 def main
   @spriteset = Spriteset_Map.new
   @view = Viewport.new(0, 0, 640, 480)
   @view.tone = @tone.clone
   @hud = Hud.new if BlizzABS::Config::HUD_ENABLED && $game_system.hud
   if BlizzABS::Config::HOTKEYS
     @hotkeys = Hotkey_Assignment.new
     @hotkeys.z = 5000
   end
   if BlizzABS::Config::MINIMAP && $game_system.minimap > 0
     @minimap = Minimap.new
   end
   @choice = Sprite.new
   @choice.bitmap = $BlizzABS.cache.image('menu_arrow')
   @choice.x, @choice.y, @choice.z, @choice.opacity = 40, 192, 500, 128
   @choice.angle = 90
   @choice.ox = -8
   @active = true
   @index = 0
   @up_mode = true
   @skill_window = Window_Skill_Hotkey.new($game_player.battler)
   @item_window = Window_Item_Hotkey.new
   @last_active = true
   Graphics.transition
   loop do
     Graphics.update
     Input.update
     update
     break if $scene != self
   end
   Graphics.freeze
   @spriteset.dispose
   [@hud, @hotkeys, @minimap].each {|s| s.dispose if s != nil}
   @choice.dispose
   @skill_window.dispose
   @item_window.dispose
   @view.dispose
   while @party_leader != $game_party.actors[0]
     $BlizzABS.player.switch_leader
   end
 end
 
 def update
   @choice.update
   @skill_window.update
   @item_window.update
   @hotkeys.update if @hotkeys != nil
   @choice.oy += (@up_mode ? (@active ? 2 : 1) : (@active ? -2 : -1))
   @up_mode = (@up_mode ? (@choice.oy < 8) : (@choice.oy <= -8))
   if $game_system.select_button && Input.trigger?(Input::Select)
     $game_system.se_play($data_system.cursor_se)
     $BlizzABS.player.switch_leader
     @skill_window.switch_actor
     @hud.update if @hud != nil
     @hotkeys.update if @hotkeys != nil
   elsif @active
     @choice.oy = @choice.oy / 2 * 2
     update_choice
   elsif @skill_window.active
     update_skill
   elsif @item_window.active
     update_item
   end
 end
 
 def update_choice
   @choice.y = 192 + @index * 32
   if Input.trigger?(Input::B)
     $game_system.se_play($data_system.cancel_se)
     $scene = Scene_Map.new
   elsif Input.trigger?(Input::C)
     $game_system.se_play($data_system.decision_se)
     @active = false
     @skill_window.active = @last_active
     @item_window.active = (!@last_active)
   elsif Input.repeat?(Input::DOWN)
     if Input.trigger?(Input::DOWN) || @index < 9
       $game_system.se_play($data_system.cursor_se)
       @index = (@index + 1) % 10
     end
   elsif Input.repeat?(Input::UP)
     if Input.trigger?(Input::UP) || @index >= 1
       $game_system.se_play($data_system.cursor_se)
       @index = (@index + 9) % 10
     end
   end
 end
 
end


my stuff appears on line 154-166 and again on line 218 "draw_gold" obviously I don't know what I am doing.

edit: this version actually does something!
when i take damage (my hit points change) it displays gems if I have any, but it doesn't display a number, as far as I can tell. Still, that's way better than nothing.

KK20

October 19, 2012, 03:18:08 am #5 Last Edit: October 19, 2012, 03:19:31 am by Ezel Berbier
You didn't add your code to be called in the update method:
  alias update_zhud_later update
  def update
    update_sp_y if actor != nil
    draw_gold
    update_zhud_later
  end
If you can't even understand what you're doing, I'd advise throwing in comments for each line of code saying specifically what each thing should do. At least then I can understand the idea you have and point to you what should be done instead.

Other Projects
RPG Maker XP Ace  Upgrade RMXP to RMVXA performance!
XPA Tilemap  Tilemap rewrite with many features, including custom resolution!

Nintendo Switch Friend Code: 8310-1917-5318
Discord: KK20 Tyler#8901

Join the CP Discord Server!

shintashi

October 19, 2012, 03:30:06 am #6 Last Edit: October 19, 2012, 05:26:15 pm by shintashi
Quote from: Ezel Berbier on October 19, 2012, 03:18:08 am
You didn't add your code to be called in the update method:
  alias update_zhud_later update
 def update
   update_sp_y if actor != nil
   draw_gold
   update_zhud_later
 end
If you can't even understand what you're doing, I'd advise throwing in comments for each line of code saying specifically what each thing should do. At least then I can understand the idea you have and point to you what should be done instead.


ah, that works much faster than taking damage for the update. Now if I can just figure out how to get some white text to display a number, like x99 or whatever. I'm going to try self.contents type stuff to see if I can get something on there.

shintashi

October 19, 2012, 05:55:13 pm #7 Last Edit: October 19, 2012, 05:59:35 pm by shintashi
undefined method 'contents' for #<HUD:0x8f3a848>


What the heck? Since when can you not insert a self.contents.blah blah in XP? What's going on? I can't even state the font color without it exploding.


 def draw_gold
   @gold = $game_party.gold
   b1 = RPG::Cache.picture(BlizzCFG::Z_SKILL_BACK)
   @hotkey_sprite.bitmap.fill_rect(0, 0, b1.width, b1.height, Color.new(0, 0, 0, 0))
   @hotkey_sprite.bitmap.blt(0, 0, b1, Rect.new(0, 0, b1.width, b1.height))
   if @gold != 0
     bitmap = RPG::Cache.icon("crystal_icon")
     x, y = (b1.width - 24) / 2, (b1.height + 24) / 2
     @hotkey_sprite.bitmap.blt(x, y, bitmap, Rect.new(0, 0, 24, 24))
   end
   
   self.contents.fill_rect(Rect.new(4, 32, 256, 32), Color.new(0, 0, 0, 0)) #crashes
    self.contents.font.color = normal_color #crashes
    self.contents.draw_text(x, y, 120, 32, $game_party.gold) #crashes
        
   
   
 end  



//insert expletives here//

KK20

Quote from: Ezel Berbier on October 19, 2012, 02:29:34 am
Change 'contents' to 'bitmap' in your code (contents is the name Window classes use).
RMXP's Window class uses contents as a reference to a Bitmap class (read the help file). In other words:
class Window
  attr_accessor :contents
  def initialize
   #Some code here
    @contents = Bitmap.new
   #and other code here
  end
end
In the Z-HUD script, it uses bitmap to call upon a Bitmap class. You can even see it being called in some of the other methods within the Z-HUD script (take a look at the method draw_hp and you will see something like:
self.bitmap.blt(x, y, b1, Rect.new(0, 0, w, h))


TL;DR: Use contents when drawing stuff in windows. This isn't a window. Therefore, don't use contents.

Other Projects
RPG Maker XP Ace  Upgrade RMXP to RMVXA performance!
XPA Tilemap  Tilemap rewrite with many features, including custom resolution!

Nintendo Switch Friend Code: 8310-1917-5318
Discord: KK20 Tyler#8901

Join the CP Discord Server!

shintashi

October 19, 2012, 09:49:11 pm #9 Last Edit: October 19, 2012, 09:50:44 pm by shintashi
this is what I've been able to get so far:


 #shintashi
 def draw_gold
   @gold = $game_party.gold
   b1 = RPG::Cache.picture(BlizzCFG::Z_SKILL_BACK)
   @hotkey_sprite.bitmap.fill_rect(0, 0, b1.width, b1.height, Color.new(0, 0, 0, 0))
   @hotkey_sprite.bitmap.blt(0, 0, b1, Rect.new(0, 0, b1.width, b1.height))
   if @gold != 0
     bitmap = RPG::Cache.icon("crystal_icon")
     x, y = (b1.width - 24) / 2, (b1.height + 24) / 2
     @hotkey_sprite.bitmap.blt(x, y, bitmap, Rect.new(0, 0, 24, 24))
   end
   draw_my_gold
 end  
 
 
 def draw_my_gold
   self.bitmap.clear
   self.bitmap.font.color = normal_color
   self.bitmap.font.size = 20
  self.bitmap.draw_text(84, 68, 120, 32, $game_party.gold.to_s)
 end



the self.bitmap.clear is also clearing some icons i dont want cleared like hit points and spell points, but at least it updates the number. The Number itself appears in a tight zone and my attempts to change the location by more than 30-ish pixels along the X or Y coordinate results in the number being partially, or fully masked. The original destination I set was 48x 48y, just so I could find it, but attempts to set something like

  self.bitmap.draw_text(480, 100, 120, 32, $game_party.gold.to_s)

failed to display.

KK20

Hmmm...I guess it's probably best to use @hotkey_sprite.bitmap instead. You're going to have to adjust its bitmap width and height accordingly in init_hotkey_sprite. If I had the demo, I could knock this out in a few minutes.

Other Projects
RPG Maker XP Ace  Upgrade RMXP to RMVXA performance!
XPA Tilemap  Tilemap rewrite with many features, including custom resolution!

Nintendo Switch Friend Code: 8310-1917-5318
Discord: KK20 Tyler#8901

Join the CP Discord Server!

shintashi

the only thing I've got running in this system is the Blizz ABS with the Zelda HUD. Do you know where I can go to upload a demo?

Blizzard

Check out Daygames and our games:

King of Booze 2      King of Booze: Never Ever
Drinking Game for Android      Never have I ever for Android
Drinking Game for iOS      Never have I ever for iOS


Quote from: winkioI do not speak to bricks, either as individuals or in wall form.

Quote from: Barney StinsonWhen I get sad, I stop being sad and be awesome instead. True story.

KK20

True, but I need the graphics for your project as well. If I have no graphics to work with, what can I possibly do?

Other Projects
RPG Maker XP Ace  Upgrade RMXP to RMVXA performance!
XPA Tilemap  Tilemap rewrite with many features, including custom resolution!

Nintendo Switch Friend Code: 8310-1917-5318
Discord: KK20 Tyler#8901

Join the CP Discord Server!

shintashi

Quote from: KK20 on October 23, 2012, 07:08:44 pm
True, but I need the graphics for your project as well. If I have no graphics to work with, what can I possibly do?



here's the file. I cannot make any further progress with this system until the money display is functional.
http://www.sendspace.com/file/wqxjp6

KK20

Spoiler: ShowHide
#:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=
# Z-HUD for Blizz-ABS by Blizzard
# Version: 1.2b
# Type: Blizz-ABS Add-on
# Date: 29.7.2009
# Date v1.0b: 30.7.2009
# Date v1.01b: 17.12.2009
# Date v1.02b: 23.2.2010
# Date v1.2b: 18.2.2012
#:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=
#
#  This script is to be distributed under the same terms and conditions like
#  the script it was created for: Blizz-ABS.
#
#:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=
#
# Information:
#
#   This script must be placed below Blizz-ABS and requires Blizz-ABS v2.7 or
#   higher to work properly. It will add a completely new HUD system for
#   Blizz-ABS.
#   
# Notes:
#   
#   Images are placed in the Graphics/Pictures folder. Be sure to set up the
#   HUD height properly. Usually it is enough if it is the sum of the heights
#   of the HP and the SP image. If you use tiling, you need to calculate the
#   maximum possible height the HUD can be and then use that value. It is not
#   recommended to use extremely high values as your HUD will cover too much of
#   the screen and increase lag.
#
#
# If you find any bugs, please report them here:
# http://forum.chaos-project.com
#:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=

if !$BlizzABS || BlizzABS::VERSION < 2.7
  raise 'ERROR: The "Z-HUD" requires Blizz-ABS 2.7 or higher.'
end

#==============================================================================
# module BlizzCFG
#==============================================================================

module BlizzCFG

#::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
# START Configuration
#::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
 
  # maximum height of the HUD
  Z_HUD_HEIGHT = 96
  # background image for whole HUD (leave empty for none)
  Z_HUD_BACKGROUND = ''
 
  # tiling HP images
  Z_HP_TILING = true
  # displays as if the images are filled up (only when tiling)
  Z_HP_FILL_UP = false
  # how many columns are used for the tile in one row (only when tiling)
  Z_HP_TILE_COLUMNS = 10
  # how many HP per column (only when tiling)
  Z_HP_PER_TILE = 100
  # full image file
  Z_HP_FILE = 'hud_HP'
  # empty image file
  Z_HP_FILE_EMPTY = 'hud_HP_empty'
 
  # tiling SP images
  Z_SP_TILING = true
  # displays as if the images are filled up (only when tiling)
  Z_SP_FILL_UP = false
  # how many columns are used for the tile in one row (only when tiling)
  Z_SP_TILE_COLUMNS = 10
  # how many SP per column (only when tiling)
  Z_SP_PER_TILE = 100 #tiling needs to be true, but need smaller tile image
  # full image file
  Z_SP_FILE = 'hud_SP'
  # empty image file
  Z_SP_FILE_EMPTY = 'hud_SP_empty'
 
  # item hotkey background
  Z_ITEM_BACK = 'item'
  # skill hotkey background
  Z_SKILL_BACK = 'skill'
  # gold icon
  Z_GOLD_ICON = 'crystal_icon'
 
  # hotkeys display background
  Z_HOTKEYS_BACK = 'hotkey'
 
  # minimap background
  Z_MINIMAP_BACK = 'minimap'
 
#::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
# END Configuration
#::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
 
  $blizzabs_z_hud = 1.2
 
end

#==============================================================================
# Hud
#==============================================================================

class Hud
 
  attr_reader :hotkey_sprite
 
  alias init_zhud_later initialize
  def initialize(viewport = nil)
    init_hotkey_sprite(viewport)
    init_zhud_later(viewport)
    self.x, self.y = 4, 4
    @hotkey_sprite.z = self.z
    if BlizzCFG::Z_HUD_BACKGROUND != ''
      @zhud_back = Sprite.new
      @zhud_back.bitmap = RPG::Cache.picture(BlizzCFG::Z_HUD_BACKGROUND)
      @zhud_back.z = self.z - 1
    end
    draw_gold #KK20
  end
 
  alias create_positions_zhud_later create_positions
  def create_positions
    create_positions_zhud_later
    b1 = RPG::Cache.picture(BlizzCFG::Z_HP_FILE)
    b2 = RPG::Cache.picture(BlizzCFG::Z_SP_FILE)
    if BlizzCFG::Z_HP_TILING
      w = b1.width * BlizzCFG::Z_HP_TILE_COLUMNS
    else
      w = b1.width
    end
    @hud_width = w if @hud_width < w
    if BlizzCFG::Z_SP_TILING
      w = b2.width * BlizzCFG::Z_SP_TILE_COLUMNS
    else
      w = b2.width
    end
    @hud_width = w if @hud_width < w
    @hud_height = BlizzCFG::Z_HUD_HEIGHT
    @hp_x, @hp_y, @sp_x, @sp_y = 0, 0, 0, b1.height + 4
    update_sp_y
    b = RPG::Cache.picture(BlizzCFG::Z_ITEM_BACK)
    @left_x = b.width
    @left_y = b.height
    @hot_x = b.width
  end
 
  def draw_basic
  end
 
  def draw_empty
  end
 
  def draw_name
  end
 
  def draw_level
  end
 
  def draw_hp
    @hp, @maxhp = actor.hp, actor.maxhp
    rate = (@maxhp > 0 ? @hp.to_f / @maxhp : 0)
    b1 = RPG::Cache.picture(BlizzCFG::Z_HP_FILE)
    b2 = RPG::Cache.picture(BlizzCFG::Z_HP_FILE_EMPTY)
    if BlizzCFG::Z_HP_TILING
      tiles = @maxhp / BlizzCFG::Z_HP_PER_TILE
      rows = (tiles.to_f / BlizzCFG::Z_HP_TILE_COLUMNS).ceil
      w, h = b1.width, b1.height
      self.bitmap.fill_rect(@hp_x, @hp_y, w * BlizzCFG::Z_HP_TILE_COLUMNS,
          h * rows, Color.new(0, 0, 0, 0))
      full_tiles = (rate * tiles).to_i
      semi_full = ((rate * tiles != full_tiles) ? 1 : 0)
      (0...full_tiles).each {|i|
          x = @hp_x + (i % BlizzCFG::Z_HP_TILE_COLUMNS) * w
          y = @hp_y + (i / BlizzCFG::Z_HP_TILE_COLUMNS) * h
          self.bitmap.blt(x, y, b1, Rect.new(0, 0, w, h))}
      if semi_full > 0
        x = @hp_x + (full_tiles % BlizzCFG::Z_HP_TILE_COLUMNS) * w
        y = @hp_y + (full_tiles / BlizzCFG::Z_HP_TILE_COLUMNS) * h
        if BlizzCFG::Z_HP_FILL_UP
          h2 = ((1 - rate * tiles + full_tiles) * h).to_i
          self.bitmap.blt(x, y, b2, Rect.new(0, 0, w, h2))
          self.bitmap.blt(x, y + h2, b1, Rect.new(0, h2, w, h - h2))
        else
          w2 = ((rate * tiles - full_tiles) * w).to_i
          self.bitmap.blt(x, y, b1, Rect.new(0, 0, w2, h))
          self.bitmap.blt(x + w2, y, b2, Rect.new(w2, 0, w - w2, h))
        end
      end
      ((full_tiles + semi_full)...tiles).each {|i|
          x = @hp_x + (i % BlizzCFG::Z_HP_TILE_COLUMNS) * w
          y = @hp_y + (i / BlizzCFG::Z_HP_TILE_COLUMNS) * h
          self.bitmap.blt(x, y, b2, Rect.new(0, 0, w, h))}
    else
      w1 = (b1.width * rate).to_i
      w2 = b2.width - w1
      self.bitmap.fill_rect(@hp_x, @hp_y, b1.width, b1.height, Color.new(0, 0, 0, 0))
      self.bitmap.blt(@hp_x, @hp_y, b1, Rect.new(0, 0, w1, b1.height))
      self.bitmap.blt(@hp_x + w1, @hp_y, b2, Rect.new(w1, 0, w2, b2.height))
    end
    draw_sp
  end
 
  def draw_sp
    @sp, @maxsp = actor.sp, actor.maxsp
    rate = (@maxsp > 0 ? @sp.to_f / @maxsp : 0)
    b1 = RPG::Cache.picture(BlizzCFG::Z_SP_FILE)
    b2 = RPG::Cache.picture(BlizzCFG::Z_SP_FILE_EMPTY)
    if BlizzCFG::Z_SP_TILING
      tiles = @maxsp / BlizzCFG::Z_SP_PER_TILE
      rows = (tiles.to_f / BlizzCFG::Z_SP_TILE_COLUMNS).ceil
      w, h = b1.width, b1.height
      self.bitmap.fill_rect(@sp_x, @sp_y, w * BlizzCFG::Z_SP_TILE_COLUMNS,
          h * rows, Color.new(0, 0, 0, 0))
      full_tiles = (rate * tiles).to_i
      semi_full = ((rate * tiles != full_tiles) ? 1 : 0)
      (0...full_tiles).each {|i|
          x = @sp_x + (i % BlizzCFG::Z_SP_TILE_COLUMNS) * w
          y = @sp_y + (i / BlizzCFG::Z_SP_TILE_COLUMNS) * h
          self.bitmap.blt(x, y, b1, Rect.new(0, 0, w, h))}
      if semi_full > 0
        x = @sp_x + (full_tiles % BlizzCFG::Z_SP_TILE_COLUMNS) * w
        y = @sp_y + (full_tiles / BlizzCFG::Z_SP_TILE_COLUMNS) * h
        if BlizzCFG::Z_SP_FILL_UP
          h2 = ((1 - rate * tiles + full_tiles) * h).to_i
          self.bitmap.blt(x, y, b2, Rect.new(0, 0, w, h2))
          self.bitmap.blt(x, y + h2, b1, Rect.new(0, h2, w, h - h2))
        else
          w2 = ((rate * tiles - full_tiles) * w).to_i
          self.bitmap.blt(x, y, b1, Rect.new(0, 0, w2, h))
          self.bitmap.blt(x + w2, y, b2, Rect.new(w2, 0, w - w2, h))
        end
      end
      ((full_tiles + semi_full)...tiles).each {|i|
          x = @sp_x + (i % BlizzCFG::Z_SP_TILE_COLUMNS) * w
          y = @sp_y + (i / BlizzCFG::Z_SP_TILE_COLUMNS) * h
          self.bitmap.blt(x, y, b2, Rect.new(0, 0, w, h))}
    else
      w1 = (b1.width * rate).to_i
      w2 = b2.width - w1
      self.bitmap.fill_rect(@sp_x, @sp_y, b1.width, b1.height, Color.new(0, 0, 0, 0))
      self.bitmap.blt(@sp_x, @sp_y, b1, Rect.new(0, 0, w1, b1.height))
      self.bitmap.blt(@sp_x + w1, @sp_y, b2, Rect.new(w1, 0, w2, b2.height))
    end
  end
 
  def draw_hskill
    @skill = actor.skill
    b1 = RPG::Cache.picture(BlizzCFG::Z_SKILL_BACK)
    @hotkey_sprite.bitmap.fill_rect(0, 0, b1.width, b1.height, Color.new(0, 0, 0, 0))
    @hotkey_sprite.bitmap.blt(0, 0, b1, Rect.new(0, 0, b1.width, b1.height))
    if @skill != 0
      bitmap = RPG::Cache.icon($data_skills[@skill].icon_name)
      x, y = (b1.width - 24) / 2, (b1.height - 24) / 2
      @hotkey_sprite.bitmap.blt(x, y, bitmap, Rect.new(0, 0, 24, 24))
    end
    draw_lskill
  end
 
  def draw_lskill
    @hotkey_sprite.bitmap.fill_rect(0, @left_y + 4, @left_x, 16, Color.new(0, 0, 0, 0))
    @skills_left = get_skills_left
    if @skill != nil && @skill > 0
      if @skills_left >= 0
        if @skills_left == 0
          @hotkey_sprite.bitmap.font.color = Color.new(255, 0, 0)
        elsif @skills_left <= 5
          @hotkey_sprite.bitmap.font.color = Color.new(255, 255, 0)
        else
          @hotkey_sprite.bitmap.font.color = normal_color
        end
        @hotkey_sprite.bitmap.font.size -= 2
        @hotkey_sprite.bitmap.draw_text_full(0, @left_y, @left_x, 20, @skills_left.to_s, 1)
        @hotkey_sprite.bitmap.font.size += 2
      elsif @skills_left == -1
        @hotkey_sprite.bitmap.font.color = Color.new(0, 255, 0)
        @hotkey_sprite.bitmap.font.size += 4
        @hotkey_sprite.bitmap.draw_text_full(0, @left_y, @left_x, 20, '∞', 1)
        @hotkey_sprite.bitmap.font.size -= 4
      end
    end
  end
 
 
  def draw_hitem
    @item = actor.item
    b1 = RPG::Cache.picture(BlizzCFG::Z_SKILL_BACK)
    b2 = RPG::Cache.picture(BlizzCFG::Z_ITEM_BACK)
    x = b1.width + 4
    @hotkey_sprite.bitmap.fill_rect(x, 0, b2.width, b2.height, Color.new(0, 0, 0, 0))
    @hotkey_sprite.bitmap.blt(x, 0, b2, Rect.new(0, 0, b2.width, b2.height))
    if @item != 0
      bitmap = RPG::Cache.icon($data_items[@item].icon_name)
      x, y = b1.width + 4 + (b2.width - 24) / 2, (b2.height - 24) / 2
      @hotkey_sprite.bitmap.blt(x, y, bitmap, Rect.new(0, 0, 24, 24))
    end
    draw_litem
  end
 
  def draw_litem
    @items_left = $game_party.item_number(@item)
    @hotkey_sprite.bitmap.fill_rect(@left_x + 4, @left_y + 4, @left_x, 16, Color.new(0, 0, 0, 0))
    if @item != nil && @item > 0
      if $data_items[@item] != nil && !$data_items[@item].consumable
        @hotkey_sprite.bitmap.font.color = Color.new(0, 255, 0)
        @hotkey_sprite.bitmap.font.size += 4
        @hotkey_sprite.bitmap.draw_text_full(@left_x + 4, @left_y, @left_x, 20, '∞', 1)
        @hotkey_sprite.bitmap.font.size -= 4
      else
        if @items_left == 0
          @hotkey_sprite.bitmap.font.color = Color.new(255, 0, 0)
        elsif @items_left <= 10
          @hotkey_sprite.bitmap.font.color = Color.new(255, 255, 0)
        else
          @hotkey_sprite.bitmap.font.color = normal_color
        end
        @hotkey_sprite.bitmap.font.size -= 2
        @hotkey_sprite.bitmap.draw_text_full(@left_x + 4, @left_y, @left_x, 20, @items_left.to_s, 1)
        @hotkey_sprite.bitmap.font.size += 2
      end
    end
  end
 
  def draw_gold #KK20
    @skill = actor.skill
    b1 = RPG::Cache.icon(BlizzCFG::Z_GOLD_ICON)
    y = @hotkey_sprite.bitmap.height - 24
    @hotkey_sprite.bitmap.fill_rect(0, y, b1.width, b1.height, Color.new(0, 0, 0, 0))
    @hotkey_sprite.bitmap.blt(0, y, b1, Rect.new(0, 0, b1.width, b1.height))
    draw_goldamount
  end
 
  def draw_goldamount #KK20
    y = @hotkey_sprite.bitmap.height - 20
    @hotkey_sprite.bitmap.fill_rect(24, y, @hotkey_sprite.bitmap.width, 16, Color.new(0, 0, 0, 0))
    @hotkey_sprite.bitmap.font.color = normal_color
    @hotkey_sprite.bitmap.font.size -= 2
    w1 = @hotkey_sprite.bitmap.text_size("x").width
    @hotkey_sprite.bitmap.draw_text_full(25, y, w1, 20, "x")
    str = $game_party.gold
    w2 = @hotkey_sprite.bitmap.text_size(str.to_s).width
    @hotkey_sprite.bitmap.draw_text_full(25+w1+2, y, w2, 20, str.to_s)
    @hotkey_sprite.bitmap.font.size += 2
  end
 
  alias update_zhud_later update
  def update
    update_sp_y if actor != nil
    draw_goldamount #KK20
    update_zhud_later
  end
 
  def update_sp_y
    return if !BlizzCFG::Z_HP_TILING
    b1 = RPG::Cache.picture(BlizzCFG::Z_HP_FILE)
    tiles = actor.maxhp / BlizzCFG::Z_HP_PER_TILE
    @sp_y = (tiles.to_f / BlizzCFG::Z_HP_TILE_COLUMNS).ceil * b1.height
  end
 
  alias dispose_zhud_later dispose
  def dispose
    @hotkey_sprite.dispose if @hotkey_sprite != nil
    @hotkey_sprite = nil
    @zhud_back.dispose if @zhud_back != nil
    @zhud_back = nil
    dispose_zhud_later
  end
 
  def init_hotkey_sprite(viewport)
    b1 = RPG::Cache.picture(BlizzCFG::Z_ITEM_BACK)
    b2 = RPG::Cache.picture(BlizzCFG::Z_SKILL_BACK)
    width = b1.width + b2.width
    @hotkey_sprite = Sprite.new(viewport)
    @hotkey_sprite.x = 632 - width
    @hotkey_sprite.y = 4
    @hotkey_sprite.bitmap = Bitmap.new(width + 4, b1.height + 48) #24 #KK20
    @hotkey_sprite.bitmap.font.name = 'Arial'
    @hotkey_sprite.bitmap.font.size = 16
    @hotkey_sprite.bitmap.font.bold = true
  end
   
end

#==============================================================================
# Hotkey_Assignment
#==============================================================================

class Hotkey_Assignment
 
  def initialize(viewport = nil)
    super
    self.bitmap = Bitmap.new(32, 320)
    self.bitmap.font.bold = true
    self.bitmap.font.size -= 8
    self.bitmap.font.color = system_color
    self.x, self.y, self.z = 0, 160, 1100
    @skills = BlizzABS::Cache::EmptyKeys
    @items = BlizzABS::Cache::EmptyKeys
    update
  end
 
  def draw(index = nil)
    back = RPG::Cache.picture(BlizzCFG::Z_HOTKEYS_BACK)
    w, h = back.width, back.height
    ow, oh = (w - 24) / 2, (h - 24) / 2
    (index == nil ? BlizzABS::Cache::HotkeyRange : [index]).each {|i|
        if $game_player.skill_hotkeys[i%10] != 0
          object = $data_skills[$game_player.skill_hotkeys[i%10]]
        elsif $game_player.item_hotkeys[i%10] != 0
          object = $data_items[$game_player.item_hotkeys[i%10]]
        end
        if @items[i%10] != $game_player.item_hotkeys[i%10] ||
            @skills[i%10] != $game_player.skill_hotkeys[i%10]
          self.bitmap.fill_rect(0, h*(i-1), w, h, Color.new(0, 0, 0, 0))
          self.bitmap.blt(0, h*(i-1), back, Rect.new(0, 0, w, h))
          if object != nil
            bitmap = RPG::Cache.icon(object.icon_name)
            self.bitmap.blt(ow, h*(i-1)+oh, bitmap, Rect.new(0, 0, 24, 24))
          end
          self.bitmap.draw_text_full(0, h*(i-1)+10, w-2, 32, (i%10).to_s, 2)
        end}
    @items = $game_player.item_hotkeys.clone
    @skills = $game_player.skill_hotkeys.clone
  end
 
end

#==============================================================================
# Minimap
#==============================================================================

class Minimap
 
  alias update_zhud_later update
  def update(override = false)
    update_zhud_later(override)
    update_minimap_back
  end
 
  def update_minimap_back
    if $game_system.minimap == 1
      if @minimap_back == nil
        @minimap_back = Sprite.new
        @minimap_back.bitmap = RPG::Cache.picture(BlizzCFG::Z_MINIMAP_BACK)
        @minimap_back.x = self.vx - (@minimap_back.bitmap.width - self.vw) / 2
        @minimap_back.y = self.vy - (@minimap_back.bitmap.height - self.vh) / 2
        @minimap_back.z = self.z + 1
        @minimap_back.opacity = self.opacity
      end
    elsif @minimap_back != nil
      @minimap_back.dispose
      @minimap_back = nil
    end
  end
 
  alias opacity_is_zhud_later opacity=
  def opacity=(value)
    opacity_is_zhud_later(value)
    @minimap_back.opacity = value if @minimap_back != nil
  end
 
  alias dispose_zhud_later dispose
  def dispose
    dispose_zhud_later
    @minimap_back.dispose if @minimap_back != nil
    @minimap_back = nil
  end
 
end
 
#==============================================================================
# Scene_Map
#==============================================================================

class Scene_Map
 
  alias hud_update_zhud_later hud_update
  def hud_update
    hud_update_zhud_later
    if @hud != nil
      s = @hud.hotkey_sprite
      s.update
      if $game_player.screen_x < s.vx + s.vw + 16 &&
          $game_player.screen_y < s.vy + s.vh + 48 &&
          $game_player.screen_x > s.vx && $game_player.screen_y > s.vy
        s.opacity -= 25 if s.opacity > 80
      elsif s.opacity <= 255
        s.opacity += 25
      end
    end
  end
 
end

#==============================================================================
# Window_Skill_Hotkey
#==============================================================================

class Window_Skill_Hotkey < Window_Skill
 
  def initialize(actor)
    super
    @column_max = 1
    self.width, self.height = 288, 480
    self.x, self.y, self.z = 64, 64, 21000
    self.cursor_rect.empty
    self.active = false
    refresh
  end
 
  def draw_item(i)
    if @data[i] == nil
      self.contents.font.color = normal_color
      self.contents.draw_text(32, i*32, 204, 32, '<Remove>')
    else
      if @actor.skill_can_use?(@data[i].id)
        self.contents.font.color = normal_color
      else
        self.contents.font.color = disabled_color
      end
      self.contents.fill_rect(Rect.new(4, i*32, 256, 32), Color.new(0, 0, 0, 0))
      bitmap = RPG::Cache.icon(@data[i].icon_name)
      opacity = self.contents.font.color == normal_color ? 255 : 128
      self.contents.blt(4, 4+i*32, bitmap, Rect.new(0, 0, 24, 24), opacity)
      text = @data[i].name
      if @actor.skills.include?(@data[i].id) &&
          $tons_version != nil && $tons_version >= 3.7 &&
          TONS_OF_ADDONS::EQUAP_SKILLS && DISPLAY_AP_REQ
        aps = BlizzCFG.maxap(@data[i].id)
        text = "#{text} (#{@actor.ap(@data[i].id)}/#{aps})" if aps != 0
      end
      self.contents.draw_text(32, i*32, 204, 32, text)
      sp_cost = @data[i].sp_cost
      if $tons_version != nil && $tons_version >= 6.54 &&
          $game_system.SP_COST_MOD
        sp_cost = BlizzCFG.get_cost_mod(@actor.states, sp_cost)
      end
      self.contents.draw_text(204, i*32, 48, 32, sp_cost.to_s, 2)
    end
  end
 
end

#==============================================================================
# Window_Item_Hotkey
#==============================================================================

class Window_Item_Hotkey < Window_Item
 
  def initialize
    super
    @column_max = 1
    self.width, self.height = 288, 480
    self.x, self.y, self.z = 352, 64, 21000
    self.cursor_rect.empty
    self.active = false
    refresh
  end
 
  def draw_item(i)
    if @data[i] == nil
      self.contents.font.color = normal_color
      self.contents.draw_text(32, i*32, 212, 32, '<Remove>')
    else
      number = $game_party.item_number(@data[i].id)
      if $game_party.item_can_use?(@data[i].id)
        self.contents.font.color = normal_color
      else
        self.contents.font.color = disabled_color
      end
      self.contents.fill_rect(Rect.new(4, i*32, 256, 32), Color.new(0, 0, 0, 0))
      bitmap = RPG::Cache.icon(@data[i].icon_name)
      opacity = self.contents.font.color == normal_color ? 255 : 128
      self.contents.blt(4, 4+i*32, bitmap, Rect.new(0, 0, 24, 24), opacity)
      self.contents.draw_text(32, i*32, 212, 32, @data[i].name)
      self.contents.draw_text(212, i*32, 16, 32, ':', 1)
      self.contents.draw_text(228, i*32, 24, 32, number.to_s, 2)
    end
  end
 
end

#==============================================================================
# Scene_Hotkeys
#==============================================================================

class Scene_Hotkeys
 
  def main
    @spriteset = Spriteset_Map.new
    @view = Viewport.new(0, 0, 640, 480)
    @view.tone = @tone.clone
    @hud = Hud.new if BlizzABS::Config::HUD_ENABLED && $game_system.hud
    if BlizzABS::Config::HOTKEYS
      @hotkeys = Hotkey_Assignment.new
      @hotkeys.z = 5000
    end
    if BlizzABS::Config::MINIMAP && $game_system.minimap > 0
      @minimap = Minimap.new
    end
    @choice = Sprite.new
    @choice.bitmap = $BlizzABS.cache.image('menu_arrow')
    @choice.x, @choice.y, @choice.z, @choice.opacity = 40, 192, 500, 128
    @choice.angle = 90
    @choice.ox = -8
    @active = true
    @index = 0
    @up_mode = true
    @skill_window = Window_Skill_Hotkey.new($game_player.battler)
    @item_window = Window_Item_Hotkey.new
    @last_active = true
    Graphics.transition
    loop do
      Graphics.update
      Input.update
      update
      break if $scene != self
    end
    Graphics.freeze
    @spriteset.dispose
    [@hud, @hotkeys, @minimap].each {|s| s.dispose if s != nil}
    @choice.dispose
    @skill_window.dispose
    @item_window.dispose
    @view.dispose
    while @party_leader != $game_party.actors[0]
      $BlizzABS.player.switch_leader
    end
  end
 
  def update
    @choice.update
    @skill_window.update
    @item_window.update
    @hotkeys.update if @hotkeys != nil
    @choice.oy += (@up_mode ? (@active ? 2 : 1) : (@active ? -2 : -1))
    @up_mode = (@up_mode ? (@choice.oy < 8) : (@choice.oy <= -8))
    if $game_system.select_button && Input.trigger?(Input::Select)
      $game_system.se_play($data_system.cursor_se)
      $BlizzABS.player.switch_leader
      @skill_window.switch_actor
      @hud.update if @hud != nil
      @hotkeys.update if @hotkeys != nil
    elsif @active
      @choice.oy = @choice.oy / 2 * 2
      update_choice
    elsif @skill_window.active
      update_skill
    elsif @item_window.active
      update_item
    end
  end
 
  def update_choice
    @choice.y = 192 + @index * 32
    if Input.trigger?(Input::B)
      $game_system.se_play($data_system.cancel_se)
      $scene = Scene_Map.new
    elsif Input.trigger?(Input::C)
      $game_system.se_play($data_system.decision_se)
      @active = false
      @skill_window.active = @last_active
      @item_window.active = (!@last_active)
    elsif Input.repeat?(Input::DOWN)
      if Input.trigger?(Input::DOWN) || @index < 9
        $game_system.se_play($data_system.cursor_se)
        @index = (@index + 1) % 10
      end
    elsif Input.repeat?(Input::UP)
      if Input.trigger?(Input::UP) || @index >= 1
        $game_system.se_play($data_system.cursor_se)
        @index = (@index + 9) % 10
      end
    end
  end
 
end

Quickly done and probably could have been done better, but I'm tired and busy with school.  :<_<:

Other Projects
RPG Maker XP Ace  Upgrade RMXP to RMVXA performance!
XPA Tilemap  Tilemap rewrite with many features, including custom resolution!

Nintendo Switch Friend Code: 8310-1917-5318
Discord: KK20 Tyler#8901

Join the CP Discord Server!