Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
n00b CMS
#1
n00b CMS
by Darklord3652
Version: 1.0
Dec 16 2006

This is a locked, single-post thread from Creation Asylum. Archived here to prevent its loss.
No support is given. If you are the owner of the thread, please contact administration.


Introduction
Just a CMS, nothing more to say tongue.gif


Features
Just a simple CMS Tongue sticking out


Script
Code:
#==============================================================================
# n00b CMS 1.0
#------------------------------------------------------------------------------
#  By The_Darklord, Requested by Joey_N00b
#==============================================================================

#==============================================================================
# ** Scene_Menu
#------------------------------------------------------------------------------
#  This class performs menu screen processing.
#==============================================================================
$mapname = load_data('Data/MapInfos.rxdata')
class Window_Gold1 < Window_Base
  def initialize
    super(0, 0, 480, 108)
    self.contents = Bitmap.new(width - 32, height - 32)
    refresh
  end
  def refresh
    self.contents.clear
    cx = contents.text_size($data_system.words.gold).width
    cxh = contents.text_size($game_party.gold.to_s).width
    cs = contents.text_size($game_party.steps.to_s).width
    self.contents.font.color = normal_color
    self.contents.draw_text(cx, 0, cx + cxh, 32, $game_party.gold.to_s, 2)
    self.contents.font.color = system_color
    self.contents.draw_text(4, 0, cx + 5, 32, $data_system.words.gold + ":", 2)
    self.contents.font.color = system_color
    self.contents.draw_text(180, 0, 150, 32, "Number of Steps")
    self.contents.font.color = normal_color
    self.contents.draw_text(400, 0, cs, 32, $game_party.steps.to_s, 2)
    self.contents.font.color = system_color
    self.contents.draw_text(4, 37, 120, 32, 'Location:')
    self.contents.font.color = normal_color
    name = $mapname[$game_map.map_id].name
    mn = contents.text_size(name).width
    self.contents.draw_text(100, 37, mn, 32, name)
  end
end
#==============================================================================
# ** Window_MenuStatus
#------------------------------------------------------------------------------
#  This window displays party member status on the menu screen.
#==============================================================================

class Window_MenuStatus < Window_Selectable
  #--------------------------------------------------------------------------
  # * Object Initialization
  #--------------------------------------------------------------------------
  def initialize
    super(0, 0, 480, 372)
    self.contents = Bitmap.new(width - 32, height - 32)
    refresh
    self.active = false
    self.index = -1
  end
  #--------------------------------------------------------------------------
  # * Refresh
  #--------------------------------------------------------------------------
  def refresh
    self.contents.clear
    @item_max = $game_party.actors.size
    for i in 0...$game_party.actors.size
      x = 64
      y = i * 91
      actor = $game_party.actors[i]
      draw_actor_graphic(actor, x-40, y+54)
      draw_actor_name(actor, x, y)
      draw_actor_class(actor, x + 120, y)
      draw_actor_level(actor, x, y + 30)
      draw_actor_state(actor, x + 120, y + 30)
      draw_actor_hp(actor, x + 236, y)
      draw_actor_sp(actor, x + 236, y + 30)
    end
  end
  #--------------------------------------------------------------------------
  # * Cursor Rectangle Update
  #--------------------------------------------------------------------------
  def update_cursor_rect
    if @index < 0
      self.cursor_rect.empty
    else
      self.cursor_rect.set(0, @index * 54, self.width - 32, 96)
    end
  end
end
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
    @spriteset = Spriteset_Map.new
    # Make command window
    s1 = $data_system.words.item
    s2 = $data_system.words.skill
    s3 = $data_system.words.equip
    s4 = "Status"
    s5 = "Save"
    s6 = "End Game"
    @command_window = Window_Command.new(160, [s1, s2, s3, s4, s5, s6])
    @command_window.index = @menu_index
    @command_window.x = 480
    @gold_window = Window_Gold1.new
    if $game_party.actors.size == 1
      @commands = [$game_party.actors[0].name]
    elsif $game_party.actors.size == 2
      @commands = [$game_party.actors[0].name, $game_party.actors[1].name]
    elsif $game_party.actors.size == 3
      @commands = [$game_party.actors[0].name, $game_party.actors[1].name, $game_party.actors[2].name]
    elsif $game_party.actors.size == 4
      @commands = [$game_party.actors[0].name, $game_party.actors[1].name, $game_party.actors[2].name, $game_party.actors[3].name]
    end
    @select_window = Window_Command.new(160, @commands)
    @select_window.x = 480
    @select_window.y = 223
    @select_window.active = false
    @select_window.visible = false
    # 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
    @status_window = Window_MenuStatus.new
    @status_window.x = 0
    @status_window.y = 108
    # 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
    @gold_window.dispose
    @select_window.dispose
    @status_window.dispose
  end
  #--------------------------------------------------------------------------
  # * Frame Update
  #--------------------------------------------------------------------------
  def update
    # Update windows
    @command_window.update
    @gold_window.update
    @select_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 @select_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)
        # Make status window active
        @command_window.active = false
        @select_window.active = true
        @select_window.index = 0
        @select_window.visible = true
      when 2  # equipment
        # Play decision SE
        $game_system.se_play($data_system.decision_se)
        # Make status window active
        @command_window.active = false
        @select_window.active = true
        @select_window.index = 0
        @select_window.visible = true
      when 3  # status
        # Play decision SE
        $game_system.se_play($data_system.decision_se)
        # Make status window active
        @command_window.active = false
        @select_window.active = true
        @select_window.index = 0
        @select_window.visible = true
      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
  #--------------------------------------------------------------------------
  # * Frame Update (when status window is active)
  #--------------------------------------------------------------------------
  def update_status
    # If B button was pressed
    if Input.trigger?(Input::B)
      # Play cancel SE
      $game_system.se_play($data_system.cancel_se)
      # Make command window active
      @command_window.active = true
      @select_window.active = false
      @select_window.index = -1
      @select_window.visible = false
      return
    end
    # If C button was pressed
    if Input.trigger?(Input::C)
      # Branch by command window cursor position
      case @select_window.index
      when 1  # skill
        # If this actor's action limit is 2 or more
        if $game_party.actors[@status_window.index].restriction >= 2
          # 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 skill screen
        $scene = Scene_Skill.new(@status_window.index)
      when 2  # equipment
        # Play decision SE
        $game_system.se_play($data_system.decision_se)
        # Switch to equipment screen
        $scene = Scene_Equip.new(@status_window.index)
      when 3  # status
        # Play decision SE
        $game_system.se_play($data_system.decision_se)
        # Switch to status screen
        $scene = Scene_Status.new(@status_window.index)
      end
      return
    end
  end
end


Instructions
Post above main, below everything else


Compatibility
Incompatible with any other Menu System tongue.gif


Credits and Thanks
Credit: Darklord
Thanks to Joey_N00b for requesting
}




Users browsing this thread: