A fourth column in MOG Scene Item Laura V1.2
#11
(11-25-2016, 06:09 AM)DerVVulfman Wrote: Well, it's still a bit sloppy by my standard, but here's a patch for the revised version of Scene Item Laura V1.2 - Revised version.

Sloppy by my standard as I left his inner mechanics untouched.  I should have broken the menus into smaller modules so other scripters could more easily write new code and  patches.



Code:
#==============================================================================
# Extra ITEM for MOG_Scene_Item Revised
#     an edit of MOG_Scene_Item V1.3 by Moghunter  
#                http://www.atelier-rgss.com
#==============================================================================
#  Patch by DerVVulfman
#  
#  NOTE:  Requires the end user to rework their "Item_com" graphics to allow
#         for a 4th category, the 'Special' item type.  The format is:
#     Item_com01.png ... To have 4 items, the 1st window "Item" highlighted
#     Item_com02.png ... To have 4 items, the 2nd window "Weapon" highlighted
#     Item_com03.png ... To have 4 items, the 3rd window "Armor" highlighted
#     Item_com04.png ... To have 4 items, the 4th window "Special" highlighted
#
#   Special Items are items not visible in the normal Item bag, but are loca-
#   ted in the 4th category in the item window.  ONLY within the 4th window
#   will these items be found.
#
#   To define special items, place the IDs of these items within the
#   SpecialSelect array inside the MOG module.
#  
#   Setting the name of the new 4th slot graphic is also within the
#   MOG module
#  
#==============================================================================

module MOG
 
 # BASIC MENU CONFIGURATION
   # Item Menu Graphics Used
     ITEM_TYPE_4       = "Item_com02"      # Selection graphic (Secondary Item)

     
 # ITEM Values
   # The list of Items
     SpecialSelect     = [1,2,3]           # List if items by Item ID
 
end



#==============================================================================
# ** Window_Type
#------------------------------------------------------------------------------
#   A hidden window used to switch between the 4 item groups in the menu.
#==============================================================================

class Window_Type < Type_Sel
 #--------------------------------------------------------------------------
 # * Object Initialization
 #--------------------------------------------------------------------------  
 def initialize
   super(0, 0, 0, 0)
   @item_max = 4
   self.index = 0
 end
end



#==============================================================================
# ** Window_Item
#------------------------------------------------------------------------------
#  This window displays items in possession on the item and battle screens.
#==============================================================================

class Window_Item < Window_Selectable
 #--------------------------------------------------------------------------
 # * Object Initialization
 #--------------------------------------------------------------------------    
 alias scene_laura_extraslot_init initialize
 #--------------------------------------------------------------------------
 # * Object Initialization
 #--------------------------------------------------------------------------  
 def initialize(special=false)
   # Add a new value into the item window
   @special = special
   # The original call
   scene_laura_extraslot_init
 end
 #--------------------------------------------------------------------------
 # * Refresh
 #--------------------------------------------------------------------------    
 def refresh
   if self.contents != nil
     self.contents.dispose
     self.contents = nil
   end
   @data = []
   for i in 1...$data_items.size
     if $game_party.item_number(i) > 0
       # If special data, push only special IDs
       if @special == true
         @data.push($data_items[i]) if MOG::SpecialSelect.include?(i)
       # Otherwise, only push IDs that aren't special
       else
         @data.push($data_items[i]) unless MOG::SpecialSelect.include?(i)
       end
     end
   end
   @item_max = @data.size
   if @item_max > 0
     self.contents = Bitmap.new(width - 32, row_max * 32)
     for i in 0...@item_max
       draw_item(i)
     end
   end
 end  
end



#==============================================================================
# ** Scene_Item
#------------------------------------------------------------------------------
#  This class performs item screen processing.
#==============================================================================

class Scene_Item
 #--------------------------------------------------------------------------
 # * Main Processing
 #--------------------------------------------------------------------------  
 def main
   unless MOG::ITEM_FX == 2
     @back = Plane.new
     @back.bitmap = RPG::Cache.picture(MOG::ITEM_BACKGROUND)
     @back.z = 100
   else
     @spriteset = Spriteset_Map.new
   end
   @item_lay = Sprite.new
   @item_lay.bitmap = RPG::Cache.picture(MOG::ITEM_LAYOUT)
   @item_lay.z = 100
   @item_com = Sprite.new
   @item_com.bitmap = RPG::Cache.picture(MOG::ITEM_TYPE_1)
   @item_com.z = 100
   @type = Window_Type.new
   @type.opacity  = 0
   @type.visible = false    
   @help_window = Window_Help.new
   @help_window.y = 405
   @item_window = Window_Item.new
   @item_window.help_window = @help_window
   @item_window.visible = true
   @item_window.active = true
   @weapon_window = Window_Weapon.new
   @weapon_window.help_window = @help_window
   @weapon_window.visible = false
   @weapon_window.active = true
   @armor_window = Window_Armor.new
   @armor_window.help_window = @help_window
   @armor_window.visible = false
   @armor_window.active = true    
   @item2_window = Window_Item.new(true)
   @item2_window.help_window = @help_window
   @item2_window.visible = false
   @item2_window.active = true    
   @target_window = Window_Target_Item.new
   @target_window.x = -300
   @target_window.active = false
   @help_window.opacity = 0
   @help_window.x = -200
   @help_window.contents_opacity = 0    
   @item_window.opacity = 0
   @item2_window.opacity = 0
   @weapon_window.opacity = 0
   @armor_window.opacity = 0
   @target_window.opacity = 0    
   @weapon_window.x = 640
   @armor_window.x = 640
   @item2_window.x = 640
   @item_window.x = 640  
   @weapon_window.contents_opacity = 0
   @armor_window.contents_opacity = 0
   @item2_window.contents_opacity = 0  
   @item_window.contents_opacity = 0  
   unless MOG::ITEM_FX == 2
     Graphics.transition(MOG::ITEM_TRAN_TIME, "Graphics/Transitions/" +
       MOG::ITEM_TRAN_TYPE)
   else
     Graphics.transition
   end
   loop do
     Graphics.update
     Input.update
     update
     if $scene != self
       break
     end
   end
   for i in 0..30
     @weapon_window.x += 20
     @armor_window.x += 20
     @item2_window.x += 20  
     @item_window.x += 20  
     @weapon_window.contents_opacity -= 15
     @armor_window.contents_opacity -= 15
     @item2_window.contents_opacity -= 15    
     @item_window.contents_opacity -= 15    
     @item_com.opacity -= 15
     @item_lay.opacity -= 15
     @help_window.contents_opacity -= 15
     @item_lay.zoom_x += 0.2
     @item_com.zoom_y += 0.2
     @target_window.x -= 15
     @back.ox += 1 if MOG::ITEM_FX == 0
     Graphics.update  
   end  
   Graphics.freeze
   @help_window.dispose
   @item_window.dispose
   @item2_window.dispose
   @weapon_window.dispose
   @armor_window.dispose
   @target_window.dispose
   @item_lay.dispose
   @back.dispose       if MOG::ITEM_FX == 0
   @back.dispose       if MOG::ITEM_FX == 1
   @spriteset.dispose  if MOG::ITEM_FX == 2
   @item_com.dispose
   @type.dispose
 end
 #--------------------------------------------------------------------------
 # * Frame Update
 #--------------------------------------------------------------------------  
 def update
   if @target_window.active == true
      @target_window.visible = true
     if @target_window.x < 0
        @target_window.x += 20
     elsif @target_window.x >= 0
        @target_window.x = 0      
     end  
   else
     if @target_window.x > -300
        @target_window.x -= 20
     elsif @target_window.x >= -300
        @target_window.x = -300
        @target_window.visible = false
     end
   end    
   if @help_window.x < 0
     @help_window.x += 10
     @help_window.contents_opacity += 15    
   elsif @help_window.x >= 0
     @help_window.x = 0
     @help_window.contents_opacity = 255    
   end
   if @item_window.x > 250
     @weapon_window.x -= 20
     @armor_window.x -= 20
     @item2_window.x -= 20  
     @item_window.x -= 20  
     @weapon_window.contents_opacity += 15
     @armor_window.contents_opacity += 15
     @item2_window.contents_opacity += 15    
     @item_window.contents_opacity += 15    
   elsif  @item_window.x <= 250
     @weapon_window.x = 250
     @armor_window.x = 250
     @item2_window.x = 250  
     @item_window.x = 250  
     @weapon_window.contents_opacity = 250
     @armor_window.contents_opacity = 250
     @item2_window.contents_opacity = 250    
     @item_window.contents_opacity = 250    
   end
   if @target_window.active == false
     if Input.trigger?(Input::RIGHT) or Input.trigger?(Input::LEFT) or
        Input.press?(Input::RIGHT) or  Input.press?(Input::LEFT)
       @weapon_window.x = 640
       @armor_window.x = 640
       @item2_window.x = 640      
       @item_window.x = 640      
       @weapon_window.contents_opacity = 0
       @armor_window.contents_opacity = 0
       @item2_window.contents_opacity = 0      
       @item_window.contents_opacity = 0      
     end
     if Input.trigger?(Input.dir4) or Input.trigger?(Input.dir4) or
        Input.trigger?(Input::L) or Input.trigger?(Input::R)      
       @help_window.x = -200
       @help_window.contents_opacity = 0
     end  
   end
   @back.ox += 1 if MOG::ITEM_FX == 0
   @help_window.update
   @item_window.update
   @item2_window.update
   @weapon_window.update
   @armor_window.update
   @target_window.update
   @type.update
   case @type.index
   when 0
     @item_com.bitmap = RPG::Cache.picture(MOG::ITEM_TYPE_1)
     if @target_window.active == true
       update_target
       @item_window.active = false  
       @type.active = false
       return
     else  
       @item_window.active = true
       @type.active = true
     end    
     @item2_window.active    = false
     @weapon_window.active   = false
     @armor_window.active    = false
     @item_window.visible    = true
     @item2_window.visible   = false
     @weapon_window.visible  = false
     @armor_window.visible   = false    
   when 1
     @item_com.bitmap        = RPG::Cache.picture(MOG::ITEM_TYPE_2)
     @item_window.active     = false
     @item2_window.active    = false
     @weapon_window.active   = true
     @armor_window.active    = false
     @item_window.visible    = false
     @item2_window.visible   = false
     @weapon_window.visible  = true
     @armor_window.visible   = false    
   when 2
     @item_com.bitmap        = RPG::Cache.picture(MOG::ITEM_TYPE_3)
     @item_window.active     = false
     @item2_window.active    = false
     @weapon_window.active   = false
     @armor_window.active    = true
     @item_window.visible    = false
     @item2_window.visible   = false
     @weapon_window.visible  = false
     @armor_window.visible   = true
   when 3
     @item_com.bitmap = RPG::Cache.picture(MOG::ITEM_TYPE_4)
     if @target_window.active == true
       update_target
       @item2_window.active = false  
       @type.active = false
       return
     else  
       @item2_window.active = true
       @type.active = true
     end    
     @item_window.active     = false
     @weapon_window.active   = false
     @armor_window.active    = false
     @item2_window.visible   = true
     @item_window.visible    = false
     @weapon_window.visible  = false
     @armor_window.visible   = false    
   end
   return update_item    if @item_window.active
   return update_weapon  if @weapon_window.active
   return update_armor   if @armor_window.active
   return update_item2   if @item2_window.active
 end
 #--------------------------------------------------------------------------
 # * Frame Update (when item window is active)
 #--------------------------------------------------------------------------  
 def update_item2
   if Input.trigger?(Input::B)
     $game_system.se_play($data_system.cancel_se)
     $scene = Scene_Menu.new(0)
     return
   end
   if Input.trigger?(Input::C)
     @item = @item_window.item
     unless @item.is_a?(RPG::Item)
       $game_system.se_play($data_system.buzzer_se)
       return
     end
     unless $game_party.item_can_use?(@item.id)
       $game_system.se_play($data_system.buzzer_se)
       return
     end
     $game_system.se_play($data_system.decision_se)
     if @item.scope >= 3
       @item_window.active = false
       @target_window.x = (@item_window.index + 1) % 1 * 304
       @target_window.active = true
       @target_window.x = -350              
       if @item.scope == 4 || @item.scope == 6
         @target_window.index = -1
       else
         @target_window.index = 0
       end
     else
       if @item.common_event_id > 0
         $game_temp.common_event_id = @item.common_event_id
         $game_system.se_play(@item.menu_se)
         if @item.consumable
           $game_party.lose_item(@item.id, 1)
           @item_window.draw_item(@item_window.index)
         end
         $scene = Scene_Map.new
         return
       end
     end
     return
   end
 end
end

Oh... it is 'purist' in that it assumes the windows will slide into the default position as the original script.  For your change, look to lines 249 to 266 which YOU can edit.  Ya had it going fine yourself.  Winking  I'm just leaving it 'pure' so to speak.

Thank you.
In order to make the slection row go a little bit to the right, you need to go to line 249 - 266 and change it with this:

Code:
if @item_window.x > 269

      @weapon_window.x -= 20
      @armor_window.x -= 20
      @item2_window.x -= 20   
      @item_window.x -= 20   
      @weapon_window.contents_opacity += 15
      @armor_window.contents_opacity += 15
      @item2_window.contents_opacity += 15    
      @item_window.contents_opacity += 15    
    elsif  @item_window.x <= 269
      @weapon_window.x = 269
      @armor_window.x = 269
      @item2_window.x = 269   
      @item_window.x = 269   
      @weapon_window.contents_opacity = 250
      @armor_window.contents_opacity = 250
      @item2_window.contents_opacity = 250    
      @item_window.contents_opacity = 250    

Then, you're done. 
Btw. just found out that your revised versions changes the item slection menu in battle.
Tried putting it above and under the battle system but, it still changes it.
Reply }


Messages In This Thread
RE: A fourth column in MOG Scene Item Laura V1.2 - by Noctis - 11-25-2016, 06:19 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
   Plugin or Script help with Item menu, SKill menu, and Equip menu JayRay 2 63 Yesterday, 03:09 AM
Last Post: JayRay
   I want to merge item classification and description extensions. zlsl 7 9,595 11-25-2019, 06:46 AM
Last Post: kyonides
   Handling very long Item Names Mel 4 8,238 09-24-2018, 06:37 PM
Last Post: Mel
   Need help with my menu - Current issue is item grid layout LilyFrog 41 39,316 09-24-2018, 02:03 AM
Last Post: LilyFrog
   using $scene during battles Keeroh 5 8,870 01-17-2018, 04:31 PM
Last Post: Keeroh
Sad  Equip bug (1-scene CMS) Whisper 2 5,501 01-23-2017, 09:20 AM
Last Post: Whisper
Bug Help with a Scene Equip Iqus 7 8,291 03-05-2014, 05:40 PM
Last Post: MechanicalPen
Exclamation  FF7s Hyper/Tranquilizer Item Script Petition Iqus 2 5,081 06-18-2013, 01:26 AM
Last Post: Iqus
   Cold's Bestiary and Item Book Vengan 0 3,569 05-27-2010, 08:59 AM
Last Post: Vengan
   Using animations in a scene (unrelated to battles and maps) PK8 4 9,025 11-17-2009, 10:54 AM
Last Post: PK8



Users browsing this thread: 3 Guest(s)