[XP] One-Man CMS

Started by Rune, June 29, 2008, 05:58:03 pm

Previous topic - Next topic

Rune

June 29, 2008, 05:58:03 pm Last Edit: February 21, 2009, 05:52:30 am by Blizzard
One-Man CMS
Authors: Rune, modern algebra
Version: 1.1
Type: Custom Menu System
Key Term: Custom Menu System



Introduction

This is basically a one-character CMS. Not much more to say really.


Version History

(* marks current version.)

  • <Version 1.0> Command window displayed horizontally at the bottom of the screen with the Status window above it. Playtime and Gold windows displayed in Status window.

  • <Version 1.1> * Command window is now displayed at the side of the Status window.



Planned Future Versions


  • None planned. Although other versions may appear if alterations are suggested or requested




Features


  • HP/SP bars. You will need images for the bars, but I haven't added any, as I'm a n00b at art, and I didn't want everyone's Menu to look identical. You will also need a separate border image for the bars and you can also change the way the bars go down between squashing the image, or cropping parts of it off. Instructions are in the script. (Code by Modern Algebra)

  • Horizontal Command window.

  • Equipment display.

  • No ugly blackness around the windows.

  • One character displayed, but the active character is changeable in-game! Instructions on how to do so are in the script.

  • The height and y co-ordinate of the Command Window changes with the number of commands in the window!




Screenshots

Default six commands
Spoiler: ShowHide


Two extra commands
Spoiler: ShowHide

(Excuse the quality of the HP/SP bars, they were only a quick paint job.)


Demo

None needed.


Script

Spoiler: ShowHide

#==============================================================================
# ** One-Man CMS
#  * by Rune
#------------------------------------------------------------------------------
#  Little configuration required:
#
#  Must have three images in the pictures folder of your project named "HP_bar",
#  "SP_bar" (both of these must be from 100 x 4 to 100 x 10 pixels) and one
#  named "bar_border", this one must be 102 pixels in width and the height of
#  your bars + 2 pixels, and must consist of a one pixel thick border for your
#  HP/SP bars, and may include a darker colour in the centre.
#------------------------------------------------------------------------------
# * Credit:
#   Rune
#   Modern Algebra for the HP/SP bars coding and for the Window_Command edit
#                  (I'm 99.7% sure that was him).
#==============================================================================

#==============================================================================
# * HP/SP bar configuration
#==============================================================================

HP_BAR = RPG::Cache.picture("HP_bar") # Name of your HP bar
SP_BAR = RPG::Cache.picture("SP_bar") # Name of your SP bar
BAR_BORDER = RPG::Cache.picture("bar_border") # Name of your HP/SP bar border
DECREASE_STYLE = 0 # 0 = squash, 1 = crop

#==============================================================================
# * End of HP/SP bar configuration
#==============================================================================

#==============================================================================
# * MenuStatus bar configuration
#==============================================================================

$activecharid = 1 # Change this to match the current active character
                  # The number is the character's ID in the database
                  # I.e. Arshes = 1, Basil = 2, Cyrus = 3, etc...
                  # To change ingame, use a call script command and type:
                  # $activecharid = number

#==============================================================================
# * End of MenuStatus configuration
#==============================================================================

#==============================================================================
# * Window_Base (Edit)
#==============================================================================

class Window_Base
  #--------------------------------------------------------------------------
  # * Draw Battler
  #     actor   : actor
  #     x       : draw spot x-coordinate
  #     y       : draw spot y-coordinate
  #     opacity : opacity
  #--------------------------------------------------------------------------
  def draw_actor_battler(actor, x, y, opacity)
    char = RPG::Cache.battler(actor.battler_name, actor.battler_hue)
    self.contents.blt(x, y, char, char.rect, opacity)
  end
end

#==============================================================================
# * End of Window_Base (Edit)
#==============================================================================

#==============================================================================
# * Window_Command (Rewrite)
#==============================================================================

class Window_Command < Window_Selectable
  #--------------------------------------------------------------------------
  # * Object Initialization
  #--------------------------------------------------------------------------
  def initialize(width, commands, column_max = 1, style = 0, inf_scroll = 1)
    super(0, 0, width, (commands.size * 1.0 / column_max).ceil * 32 + 32)
    @inf_scroll = inf_scroll
    @item_max = commands.size
    @commands = commands
    @column_max = column_max
    @style = style
    self.contents = Bitmap.new(width - 32, (@item_max * 1.0 / @column_max).ceil * 32)
    self.contents.font.name = "Tahoma"
    self.contents.font.size = 22
    refresh
    self.index = 0
  end
  #--------------------------------------------------------------------------
  # * Refresh
  #--------------------------------------------------------------------------
  def refresh
    self.contents.clear
    for i in 0...@item_max
      draw_item(i, normal_color)
    end
  end
  #--------------------------------------------------------------------------
  # * Draw_Item
  #--------------------------------------------------------------------------
  def draw_item(index, color)
    self.contents.font.color = color
    rect = Rect.new(index%@column_max * (self.width / @column_max) + 4, 32 * (index/@column_max), self.width / @column_max - 40, 32)
    self.contents.fill_rect(rect, Color.new(0, 0, 0, 0))
    self.contents.draw_text(rect, @commands[index], @style)
  end
  #--------------------------------------------------------------------------
  # * Disable Item
  #--------------------------------------------------------------------------
  def disable_item(index)
    draw_item(index, disabled_color)
  end
  #--------------------------------------------------------------------------
  # * Update Help
  #--------------------------------------------------------------------------
  def update_help
    @help_window.set_actor($game_party.actors[$scene.actor_index])
  end
end

#==============================================================================
# * End of Window_Command (Rewrite)
#==============================================================================

#==============================================================================
# * Window_PlayTime (Edit)
#==============================================================================

class Window_PlayTime
  def refresh
    self.contents.clear
    self.contents.font.color = system_color
    self.contents.draw_text(4, 0, 120, 32, "Play Time", 2)
    @total_sec = Graphics.frame_count / Graphics.frame_rate
    hour = @total_sec / 60 / 60
    min = @total_sec / 60 % 60
    sec = @total_sec % 60
    text = sprintf("%02d:%02d:%02d", hour, min, sec)
    self.contents.font.color = normal_color
    self.contents.draw_text(4, 32, 120, 32, text, 2)
  end
end

#==============================================================================
# * End of Window_PlayTime (Edit)
#==============================================================================

#==============================================================================
# * Window_MenuStatus (Rewrite)
#==============================================================================

class Window_MenuStatus < Window_Base
  #--------------------------------------------------------------------------
  # * Object Initialization
  #--------------------------------------------------------------------------
  def initialize
    super(240, 32, 320, 416)
    self.contents = Bitmap.new(width - 32, height - 32)
    refresh
  end
  #--------------------------------------------------------------------------
  # * Refresh
  #--------------------------------------------------------------------------
  def refresh
    self.contents.clear
    actor = $game_actors[$activecharid]
    draw_actor_battler(actor, 128, 160, 160)
    self.contents.font.size = 32
    self.contents.font.color = Color.new(0, 0, 0, 255)
    self.contents.draw_text(4, 4, 288, 32, actor.name, 1)
    self.contents.font.color = normal_color
    self.contents.draw_text(0, 0, 288, 32, actor.name, 1)
    self.contents.font.size = 22
    draw_actor_class(actor, 16, 160)
    draw_actor_level(actor, 16, 128)
    draw_actor_state(actor, 16, 192)
    draw_actor_exp(actor, 0, 96)
    border = BAR_BORDER
    src_rect = Rect.new(0, 0, 102, 12)
    self.contents.blt(39, 71, border, src_rect)
    self.contents.blt(183, 71, border, src_rect)
    hp = HP_BAR
    sp = SP_BAR
    case DECREASE_STYLE
    when 0
      hp_percent = ((actor.hp.to_f / actor.maxhp.to_f) * 100).to_i
      dest_rect = Rect.new (40, 72, hp_percent, 10)
      self.contents.stretch_blt (dest_rect, hp, hp.rect)
      sp_percent = ((actor.sp.to_f / actor.maxsp.to_f) * 100).to_i
      dest_rect = Rect.new (184, 72, sp_percent, 10)
      self.contents.stretch_blt (dest_rect, sp, sp.rect)
    when 1
      hp_percent = ((actor.hp.to_f / actor.maxhp.to_f) * 100).to_i
      src_rect = Rect.new (0, 0, hp_percent, 10)
      self.contents.blt (40, 72, hp, src_rect)
      sp_percent = ((actor.sp.to_f / actor.maxsp.to_f) * 100).to_i
      src_rect = Rect.new (0, 0, sp_percent, 10)
      self.contents.blt (184, 72, sp, src_rect)
    end
    draw_actor_hp(actor, 0, 48)
    draw_actor_sp(actor, 144, 48)
    draw_item_name($data_weapons[actor.weapon_id], 0, 224)
    draw_item_name($data_armors[actor.armor1_id], 0, 256)
    draw_item_name($data_armors[actor.armor2_id], 0, 288)
    draw_item_name($data_armors[actor.armor3_id], 0, 320)
    draw_item_name($data_armors[actor.armor4_id], 0, 352)
  end
  #--------------------------------------------------------------------------
  # * Dummy
  #--------------------------------------------------------------------------
  def dummy
    self.contents.font.color = system_color
    self.contents.draw_text(0, 112, 96, 32, $data_system.words.weapon)
    self.contents.draw_text(0, 176, 96, 32, $data_system.words.armor1)
    self.contents.draw_text(0, 240, 96, 32, $data_system.words.armor2)
    self.contents.draw_text(0, 304, 96, 32, $data_system.words.armor3)
    self.contents.draw_text(0, 368, 96, 32, $data_system.words.armor4)
    draw_item_name($data_weapons[actor.weapon_id], 0, 144)
    draw_item_name($data_armors[actor.armor1_id], 0, 208)
    draw_item_name($data_armors[actor.armor2_id], 0, 272)
    draw_item_name($data_armors[actor.armor3_id], 0, 336)
    draw_item_name($data_armors[actor.armor4_id], 0, 400)
  end
  #--------------------------------------------------------------------------
  # * Cursor Rectangle Update
  #--------------------------------------------------------------------------
  def update_cursor_rect
    if @index < 0
      self.cursor_rect.empty
    else
      self.cursor_rect.set(0, @index * 116, self.width - 32, 96)
    end
  end
end

#==============================================================================
# * End of Window_MenuStatus (Rewrite)
#==============================================================================

#==============================================================================
# * Scene_Menu
#==============================================================================

class Scene_Menu
  #--------------------------------------------------------------------------
  # * Object Initialization
  #     menu_index : command cursor's initial position
  #--------------------------------------------------------------------------
  def initialize(menu_index = 0)
    @menu_index = menu_index
  end
  #--------------------------------------------------------------------------
  # * Main Processing
  #--------------------------------------------------------------------------
  def main
    # Makes the Map appear in the background
    @spriteset = Spriteset_Map.new
    # Make command window
    s1 = "Inventory"
    s2 = "Abilities"
    s3 = "Equipment"
    s4 = "Status"
    s5 = "Save Game"
    s6 = "Quit Game"
    @command_window = Window_Command.new(160, [s1, s2, s3, s4, s5, s6], 1, 2)
    @command_window.index = @menu_index
    @command_window.y = 240 - @command_window.height / 2
    @command_window.x = 80
    # If number of party members is 0
    if $game_party.actors.size == 0
      # Disable items, skills, equipment, and status
      @command_window.disable_item(0)
      @command_window.disable_item(1)
      @command_window.disable_item(2)
      @command_window.disable_item(3)
    end
    # If save is forbidden
    if $game_system.save_disabled
      # Disable save
      @command_window.disable_item(4)
    end
    # Make status window
    @status_window = Window_MenuStatus.new
    # Make play time window
    @playtime_window = Window_PlayTime.new
    @playtime_window.x = 400
    @playtime_window.y = 160
    @playtime_window.opacity = 0
    # Make gold window
    @gold_window = Window_Gold.new
    @gold_window.x = 400
    @gold_window.y = 224
    @gold_window.opacity = 0
    # 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
    @command_window.dispose
    @playtime_window.dispose
    @spriteset.dispose
    @gold_window.dispose
    @status_window.dispose
  end
  #--------------------------------------------------------------------------
  # * Frame Update
  #--------------------------------------------------------------------------
  def update
    # Update windows
    @command_window.update
    @playtime_window.update
    @spriteset.update
    @gold_window.update
    @status_window.update
    # If command window is active: call update_command
    if @command_window.active
      update_command
      return
    end
    # If status window is active: call update_status
    if @status_window.active
      update_status
      return
    end
  end
  #--------------------------------------------------------------------------
  # * Frame Update (when command window is active)
  #--------------------------------------------------------------------------
  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)
        # Switch to skill screen
        $scene = Scene_Skill.new
      when 2  # equipment
        # Play decision SE
        $game_system.se_play($data_system.decision_se)
        # Switch to equip screen
        $scene = Scene_Equip.new
      when 3  # status
        # Play decision SE
        $game_system.se_play($data_system.decision_se)
        # Switch to status screen
        $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

#==============================================================================
# * End of Scene_Menu
#==============================================================================



Instructions

Instructions are inside the script, at the top. Just read through the green comment lines.


Compatibility

No compatibility issues known.



Credits and Thanks


  • Rune

  • Modern Algebra

  • Thanks to Modern Algebra, for a couple of scriptlets. I'll leave it up to him whether he wants to be credited, but until he says, be sure to credit him anyway.




Author's Notes

There are no restrictions. I don't care how this is used, as long as I get a little credit acknowledgment in your game's credits.
PM me on RMRK or CP if you have any issues, or just post in the topic.
If you have any problems, criticism, praise or queries, I'm right here. ;)

Enjoy.
Signature.

Starrodkirby86

That menu is smexy. Although there's no smooth sleekness that I complained on the other one, the Rainbow Hue Bars are so appealing and nice. My only drawback would the End Game has to be resized and therefore, it is unbearably ugly and unfitting to the other choices...

What's osu!? It's a rhythm game. Thought I should have a signature with a working rank. ;P It's now clickable!
Still Aqua's biggest fan (Or am I?).




Rune

You can just change the "End Game" to "End" or "Quit" if you like.

Also, woo! Quickest reply yet. xD
Signature.

Aqua

It's very clean and nice. 

The only thing I don't like about it is that the options bar is on the bottom, but that's just my opinion.

The drop shadow text for the actor names seems a bit weird to be too... Maybe give it less distance from the white text.

Mmmm dunno what else to say so... *thumbs up*

Hellfire Dragon

Like Aqua I don't like where the options bar is, otherwise it looks nice :)

Rune

July 01, 2008, 12:26:28 pm #5 Last Edit: July 01, 2008, 01:14:38 pm by Rune
I'll work on an update and have it up in a short while ;)

Also, I updated the comments in the script, I kinda missed something out.

~Edit

Updated ;)
Signature.

Phasedscar

Yeah, looks good Rune.

And cool idea on having pictures in a folder for the HP/SP bars.  Something like this would be great for a true Zeldaesque game.
Spoiler: ShowHide
My own game project & My resource workshop! (respectively)
http://forum.chaos-project.com/index.php?topic=608.0 http://forum.chaos-project.com/index.php?topic=682.0



What that is? Affection area for flails. - Blizz-ABS, the ultimate ABS

The pictures in your signature may altogether be no more than 200kB. The height must not exceed 200 px and the width must not exceed 800 px. Altogether they may take up an area of 160000 px2. Every signature not matching this criteria is a subject of the moderator team to remove and leave this rule as message in your signature.

maferath

Hi everyone. First of all, I must say that I like the CMS a'lot. But I have a question and I beg to be answered! How can I make the CMS transparent? (Just like Ryex's Collapsing CMS or Blizz ABS's Pre Menu).

Currently I'm using: Blizz ABS, Tons of Addons, this CMS and the Catergorized Items Menu by albertfish.

WhiteRose

Quote from: maferath on January 12, 2011, 03:03:33 am
Hi everyone. First of all, I must say that I like the CMS a'lot. But I have a question and I beg to be answered! How can I make the CMS transparent? (Just like Ryex's Collapsing CMS or Blizz ABS's Pre Menu).

Currently I'm using: Blizz ABS, Tons of Addons, this CMS and the Catergorized Items Menu by albertfish.


Rune hasn't been active here for almost two years; I doubt he's going to be able to help you. However, as this menu already draws the map behind it, this should be a fairly simple fix provided you know a little bit about RGSS. Find the sections in the script where the windows are drawn, and change the opacity to whatever you want it to be - opacity is the last argument, if I remember correctly. I'd do it myself, but I'm actually down on campus right now and don't have access to my computer or RMXP.

ForeverZer0


class Window_Base

  alias change_opacity_init initialize
  def initialize(*args)
    change_opacity_init(*args)
    if $scene.is_a?(Scene_Menu)
      self.back_opacity = 160
      #self.opacity = 160  # Uncomment and comment the other if you like. They are slightly different.
     end
   end
end

class Scene_Menu

  alias mapback_main main
  def main
    mapback = Spriteset_Map.new
    mapback_main
    mapback.dispose
  end
end

I am done scripting for RMXP. I will likely not offer support for even my own scripts anymore, but feel free to ask on the forum, there are plenty of other talented scripters that can help you.

maferath

I'm sorry, I don't know how to script RGSS. But based on ForeverZer0's reply, I've changed the CMS script to this:

Spoiler: ShowHide
#==============================================================================
# ** One-Man CMS
#  * by Rune
#------------------------------------------------------------------------------
#  Little configuration required:
#
#  Must have three images in the pictures folder of your project named "HP_bar",
#  "SP_bar" (both of these must be from 100 x 4 to 100 x 10 pixels) and one
#  named "bar_border", this one must be 102 pixels in width and the height of
#  your bars + 2 pixels, and must consist of a one pixel thick border for your
#  HP/SP bars, and may include a darker colour in the centre.
#------------------------------------------------------------------------------
# * Credit:
#   Rune
#   Modern Algebra for the HP/SP bars coding and for the Window_Command edit
#                  (I'm 99.7% sure that was him).
#==============================================================================

#==============================================================================
# * HP/SP bar configuration
#==============================================================================

HP_BAR = RPG::Cache.picture("HP_bar") # Name of your HP bar
SP_BAR = RPG::Cache.picture("SP_bar") # Name of your SP bar
BAR_BORDER = RPG::Cache.picture("bar_border") # Name of your HP/SP bar border
DECREASE_STYLE = 0 # 0 = squash, 1 = crop

#==============================================================================
# * End of HP/SP bar configuration
#==============================================================================

#==============================================================================
# * MenuStatus bar configuration
#==============================================================================

$activecharid = 1 # Change this to match the current active character
                  # The number is the character's ID in the database
                  # I.e. Arshes = 1, Basil = 2, Cyrus = 3, etc...
                  # To change ingame, use a call script command and type:
                  # $activecharid = number

#==============================================================================
# * End of MenuStatus configuration
#==============================================================================

#==============================================================================
# * Window_Base (Edit)
#==============================================================================

class Window_Base

  alias change_opacity_init initialize
  def initialize(*args)
    change_opacity_init(*args)
    if $scene.is_a?(Scene_Menu)
      self.back_opacity = 160
      #self.opacity = 160  # Uncomment and comment the other if you like. They are slightly different.
     end
   end
end

#==============================================================================
# * End of Window_Base (Edit)
#==============================================================================

#==============================================================================
# * Window_Command (Rewrite)
#==============================================================================

class Window_Command < Window_Selectable
  #--------------------------------------------------------------------------
  # * Object Initialization
  #--------------------------------------------------------------------------
  def initialize(width, commands, column_max = 1, style = 0, inf_scroll = 1)
    super(0, 0, width, (commands.size * 1.0 / column_max).ceil * 32 + 32)
    @inf_scroll = inf_scroll
    @item_max = commands.size
    @commands = commands
    @column_max = column_max
    @style = style
    self.contents = Bitmap.new(width - 32, (@item_max * 1.0 / @column_max).ceil * 32)
    self.contents.font.name = "Tahoma"
    self.contents.font.size = 22
    refresh
    self.index = 0
  end
  #--------------------------------------------------------------------------
  # * Refresh
  #--------------------------------------------------------------------------
  def refresh
    self.contents.clear
    for i in 0...@item_max
      draw_item(i, normal_color)
    end
  end
  #--------------------------------------------------------------------------
  # * Draw_Item
  #--------------------------------------------------------------------------
  def draw_item(index, color)
    self.contents.font.color = color
    rect = Rect.new(index%@column_max * (self.width / @column_max) + 4, 32 * (index/@column_max), self.width / @column_max - 40, 32)
    self.contents.fill_rect(rect, Color.new(0, 0, 0, 0))
    self.contents.draw_text(rect, @commands[index], @style)
  end
  #--------------------------------------------------------------------------
  # * Disable Item
  #--------------------------------------------------------------------------
  def disable_item(index)
    draw_item(index, disabled_color)
  end
  #--------------------------------------------------------------------------
  # * Update Help
  #--------------------------------------------------------------------------
  def update_help
    @help_window.set_actor($game_party.actors[$scene.actor_index])
  end
end

#==============================================================================
# * End of Window_Command (Rewrite)
#==============================================================================

#==============================================================================
# * Window_PlayTime (Edit)
#==============================================================================

class Window_PlayTime
  def refresh
    self.contents.clear
    self.contents.font.color = system_color
    self.contents.draw_text(4, 0, 120, 32, "Play Time", 2)
    @total_sec = Graphics.frame_count / Graphics.frame_rate
    hour = @total_sec / 60 / 60
    min = @total_sec / 60 % 60
    sec = @total_sec % 60
    text = sprintf("%02d:%02d:%02d", hour, min, sec)
    self.contents.font.color = normal_color
    self.contents.draw_text(4, 32, 120, 32, text, 2)
  end
end

#==============================================================================
# * End of Window_PlayTime (Edit)
#==============================================================================

#==============================================================================
# * Window_MenuStatus (Rewrite)
#==============================================================================

class Window_MenuStatus < Window_Base
  #--------------------------------------------------------------------------
  # * Object Initialization
  #--------------------------------------------------------------------------
  def initialize
    super(240, 32, 320, 416)
    self.contents = Bitmap.new(width - 32, height - 32)
    refresh
  end
  #--------------------------------------------------------------------------
  # * Refresh
  #--------------------------------------------------------------------------
  def refresh
    self.contents.clear
    actor = $game_actors[$activecharid]
    draw_actor_battler(actor, 128, 160, 160)
    self.contents.font.size = 32
    self.contents.font.color = Color.new(0, 0, 0, 255)
    self.contents.draw_text(4, 4, 288, 32, actor.name, 1)
    self.contents.font.color = normal_color
    self.contents.draw_text(0, 0, 288, 32, actor.name, 1)
    self.contents.font.size = 22
    draw_actor_class(actor, 16, 160)
    draw_actor_level(actor, 16, 128)
    draw_actor_state(actor, 16, 192)
    draw_actor_exp(actor, 0, 96)
    border = BAR_BORDER
    src_rect = Rect.new(0, 0, 102, 12)
    self.contents.blt(39, 71, border, src_rect)
    self.contents.blt(183, 71, border, src_rect)
    hp = HP_BAR
    sp = SP_BAR
    case DECREASE_STYLE
    when 0
      hp_percent = ((actor.hp.to_f / actor.maxhp.to_f) * 100).to_i
      dest_rect = Rect.new (40, 72, hp_percent, 10)
      self.contents.stretch_blt (dest_rect, hp, hp.rect)
      sp_percent = ((actor.sp.to_f / actor.maxsp.to_f) * 100).to_i
      dest_rect = Rect.new (184, 72, sp_percent, 10)
      self.contents.stretch_blt (dest_rect, sp, sp.rect)
    when 1
      hp_percent = ((actor.hp.to_f / actor.maxhp.to_f) * 100).to_i
      src_rect = Rect.new (0, 0, hp_percent, 10)
      self.contents.blt (40, 72, hp, src_rect)
      sp_percent = ((actor.sp.to_f / actor.maxsp.to_f) * 100).to_i
      src_rect = Rect.new (0, 0, sp_percent, 10)
      self.contents.blt (184, 72, sp, src_rect)
    end
    draw_actor_hp(actor, 0, 48)
    draw_actor_sp(actor, 144, 48)
    draw_item_name($data_weapons[actor.weapon_id], 0, 224)
    draw_item_name($data_armors[actor.armor1_id], 0, 256)
    draw_item_name($data_armors[actor.armor2_id], 0, 288)
    draw_item_name($data_armors[actor.armor3_id], 0, 320)
    draw_item_name($data_armors[actor.armor4_id], 0, 352)
  end
  #--------------------------------------------------------------------------
  # * Dummy
  #--------------------------------------------------------------------------
  def dummy
    self.contents.font.color = system_color
    self.contents.draw_text(0, 112, 96, 32, $data_system.words.weapon)
    self.contents.draw_text(0, 176, 96, 32, $data_system.words.armor1)
    self.contents.draw_text(0, 240, 96, 32, $data_system.words.armor2)
    self.contents.draw_text(0, 304, 96, 32, $data_system.words.armor3)
    self.contents.draw_text(0, 368, 96, 32, $data_system.words.armor4)
    draw_item_name($data_weapons[actor.weapon_id], 0, 144)
    draw_item_name($data_armors[actor.armor1_id], 0, 208)
    draw_item_name($data_armors[actor.armor2_id], 0, 272)
    draw_item_name($data_armors[actor.armor3_id], 0, 336)
    draw_item_name($data_armors[actor.armor4_id], 0, 400)
  end
  #--------------------------------------------------------------------------
  # * Cursor Rectangle Update
  #--------------------------------------------------------------------------
  def update_cursor_rect
    if @index < 0
      self.cursor_rect.empty
    else
      self.cursor_rect.set(0, @index * 116, self.width - 32, 96)
    end
  end
end

#==============================================================================
# * End of Window_MenuStatus (Rewrite)
#==============================================================================

#==============================================================================
# * Scene_Menu
#==============================================================================

class Scene_Menu

  alias mapback_main main
  def main
    mapback = Spriteset_Map.new
    mapback_main
    mapback.dispose
  end
end
  #--------------------------------------------------------------------------
  # * Main Processing
  #--------------------------------------------------------------------------
  def main
    # Makes the Map appear in the background
    @spriteset = Spriteset_Map.new
    # Make command window
    s1 = "Inventory"
    s2 = "Abilities"
    s3 = "Equipment"
    s4 = "Status"
    s5 = "Save Game"
    s6 = "Quit Game"
    @command_window = Window_Command.new(160, [s1, s2, s3, s4, s5, s6], 1, 2)
    @command_window.index = @menu_index
    @command_window.y = 240 - @command_window.height / 2
    @command_window.x = 80
    # If number of party members is 0
    if $game_party.actors.size == 0
      # Disable items, skills, equipment, and status
      @command_window.disable_item(0)
      @command_window.disable_item(1)
      @command_window.disable_item(2)
      @command_window.disable_item(3)
    end
    # If save is forbidden
    if $game_system.save_disabled
      # Disable save
      @command_window.disable_item(4)
    end
    # Make status window
    @status_window = Window_MenuStatus.new
    # Make play time window
    @playtime_window = Window_PlayTime.new
    @playtime_window.x = 400
    @playtime_window.y = 160
    @playtime_window.opacity = 0
    # Make gold window
    @gold_window = Window_Gold.new
    @gold_window.x = 400
    @gold_window.y = 224
    @gold_window.opacity = 0
    # 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
    @command_window.dispose
    @playtime_window.dispose
    @spriteset.dispose
    @gold_window.dispose
    @status_window.dispose
  end
  #--------------------------------------------------------------------------
  # * Frame Update
  #--------------------------------------------------------------------------
  def update
    # Update windows
    @command_window.update
    @playtime_window.update
    @spriteset.update
    @gold_window.update
    @status_window.update
    # If command window is active: call update_command
    if @command_window.active
      update_command
      return
    end
    # If status window is active: call update_status
    if @status_window.active
      update_status
      return
    end
  end
  #--------------------------------------------------------------------------
  # * Frame Update (when command window is active)
  #--------------------------------------------------------------------------
  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)
        # Switch to skill screen
        $scene = Scene_Skill.new
      when 2  # equipment
        # Play decision SE
        $game_system.se_play($data_system.decision_se)
        # Switch to equip screen
        $scene = Scene_Equip.new
      when 3  # status
        # Play decision SE
        $game_system.se_play($data_system.decision_se)
        # Switch to status screen
        $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

#==============================================================================
# * End of Scene_Menu
#==============================================================================


But it doesn't work. It says: Script '+ CMS' line 400: SyntaxError occured.
Also, is there a way to make albertfish's Categorized Inventory transparent as-well?

Thanks in advance
M,

Ryex

no no, use the original script and add F0's snipit below it. then it will work. thing is that this will make ALL your windows transparent no matter where they are
I no longer keep up with posts in the forum very well. If you have a question or comment, about my work, or in general I welcome PM's. if you make a post in one of my threads and I don't reply with in a day or two feel free to PM me and point it out to me.<br /><br />DropBox, the best free file syncing service there is.<br />

ForeverZer0

Quote from: Ryex on January 12, 2011, 04:11:12 pm
thing is that this will make ALL your windows transparent no matter where they are


Note the "if $scene.is_a?(Scene_Menu)".

It will only affect the windows in the menu if left how it is. Not every window in the game.
I am done scripting for RMXP. I will likely not offer support for even my own scripts anymore, but feel free to ask on the forum, there are plenty of other talented scripters that can help you.

Ryex

I no longer keep up with posts in the forum very well. If you have a question or comment, about my work, or in general I welcome PM's. if you make a post in one of my threads and I don't reply with in a day or two feel free to PM me and point it out to me.<br /><br />DropBox, the best free file syncing service there is.<br />