Blizz-Abs Little Add-on

Started by Moshan, July 28, 2013, 03:41:06 pm

Previous topic - Next topic

Moshan

 Hello!
I've tried to make some changes in the Blizz-Abs Script to display the map name above the Blizz-Abs Minimap...but I failed. I'm thinking of a script that allows me to see the map name only when the player choose that the minimap is displayed. I've put a picture to make me more easy to understand :
Spoiler: ShowHide

I would appreciate if someone could help me with this.

KK20


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!

Moshan

 Thanks for helping! I think it might be useful for more people.

KK20

August 01, 2013, 02:36:46 pm #3 Last Edit: August 03, 2013, 05:32:49 pm by KK20
#==========================================================================
# Minimap w/ Map Name (Blizz-ABS)
# By KK20
#--------------------------------------------------------------------------
# Draws map name above the minimap. Place below Blizz-ABS.
#==========================================================================
$mapinfos = load_data("Data/MapInfos.rxdata")
class Minimap < Sprite
 
 alias init_map_name initialize
 def initialize
   @map_name = Sprite.new
   @map_name.bitmap = Bitmap.new(160, 24)
   @map_name.x, @map_name.y = 476, 332
    @map_name.z = 9001
   @init_name = true
   init_map_name
 end
 
 alias update_map_name update
 def update(override = false)
   if @init_name or @map_id != $game_map.map_id
     @init_name = false
     @map_name.bitmap.font.size = 18
     @map_name.bitmap.fill_rect(0,0,160,32,Color.new(0,0,0,170))
     @map_name.bitmap.draw_text(0, 2, 160, 20, $mapinfos[$game_map.map_id].name, 1)
   end
   if $game_system.minimap >= 2
     @map_name.visible = false
   else
     @map_name.visible = true
   end
   @map_name.update
   update_map_name
 end

 def vy
   if ($game_system.minimap < 2)
     return super - 24
   else
     return super
   end
 end
 
 alias set_map_name_opacity opacity=
 def opacity=(amt)
   @map_name.opacity = amt
   set_map_name_opacity(amt)
 end
 
 alias show_map_name visible=
 def visible=(expr)
   @map_name.visible = expr
   show_map_name(expr)
 end
 
 alias dispose_map_name dispose
 def dispose
   @map_name.dispose
   dispose_map_name
 end  
 
end

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!

Moshan

 Thank you very much! BUT...there's a little problem....the name dosen't display...Take a look at this pictures.
Spoiler: ShowHide

KK20

Whose custom HUD are you using? I wrote this script in a clean Blizz-ABS project.

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!

Moshan


KK20

August 02, 2013, 04:30:48 pm #7 Last Edit: August 03, 2013, 05:33:01 pm by KK20
Same script as I posted but with a modified method from Z-HUD added at the bottom. Thus, place this below Z-HUD.

#==========================================================================
# Minimap w/ Map Name (Blizz-ABS)
# By KK20
#--------------------------------------------------------------------------
# Draws map name above the minimap. Place below Blizz-ABS.
#==========================================================================
$mapinfos = load_data("Data/MapInfos.rxdata")
class Minimap < Sprite
 
  alias init_map_name initialize
  def initialize
    @map_name = Sprite.new
    @map_name.bitmap = Bitmap.new(160, 24)
    @map_name.x, @map_name.y = 476, 332
    @map_name.z = 9001
    @init_name = true
    init_map_name
  end
 
  alias update_map_name update
  def update(override = false)
    if @init_name or @map_id != $game_map.map_id
      @init_name = false
      @map_name.bitmap.font.size = 18
      @map_name.bitmap.fill_rect(0,0,160,32,Color.new(0,0,0,170))
      @map_name.bitmap.draw_text(0, 2, 160, 20, $mapinfos[$game_map.map_id].name, 1)
    end
    if $game_system.minimap >= 2
      @map_name.visible = false
    else
      @map_name.visible = true
    end
    @map_name.update
    update_map_name
  end

  def vy
    if ($game_system.minimap < 2)
      return super - 24
    else
      return super
    end
  end
 
  alias set_map_name_opacity opacity=
  def opacity=(amt)
    @map_name.opacity = amt
    set_map_name_opacity(amt)
  end
 
  alias show_map_name visible=
  def visible=(expr)
    @map_name.visible = expr
    show_map_name(expr)
  end
 
  alias dispose_map_name dispose
  def dispose
    @map_name.dispose
    dispose_map_name
  end 
  #------------------------------------------------------------------------
  # Z-HUD Fix
  #------------------------------------------------------------------------
  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+24) - (@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
 
end

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!

Moshan

 Thank you very much! It works...but it has a minor issue...When I try to acces the menu (Blizz-Abs pre-menu) the map name dissapears and it wont show until I recall the map again.

KK20

It was a z-value issue. Needs just one line added

  alias init_map_name initialize
  def initialize
    @map_name = Sprite.new
    @map_name.bitmap = Bitmap.new(160, 24)
    @map_name.x, @map_name.y = 476, 332
    @map_name.z = 9001                     #<=== ADD THIS LINE
    @init_name = true
    init_map_name
  end

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!

Moshan

 Thank you very much! You're the best!

WhiteRose

Quote from: KK20 on August 03, 2013, 05:32:17 pm
It was a z-value issue. Needs just one line added

  alias init_map_name initialize
  def initialize
    @map_name = Sprite.new
    @map_name.bitmap = Bitmap.new(160, 24)
    @map_name.x, @map_name.y = 476, 332
    @map_name.z = 9001                     #<=== ADD THIS LINE
    @init_name = true
    init_map_name
  end



Hahaha. I see what you did there....

KK20

It's my go-to number whenever I work with z-values. :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!

Zexion

I don't get it... all I see is...
Spoiler: ShowHide
it's over 9000!!