+- Save-Point (https://www.save-point.org)
+-- Forum: Games Development (https://www.save-point.org/forum-4.html)
+--- Forum: Code Support (https://www.save-point.org/forum-20.html)
+--- Thread: A fourth column in MOG Scene Item Laura V1.2 (/thread-6191.html)
RE: A fourth column in MOG Scene Item Laura V1.2 - Noctis - 11-25-2016
(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.
#==============================================================================
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. 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:
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.
RE: A fourth column in MOG Scene Item Laura V1.2 - DerVVulfman - 11-26-2016
The item system assumes it is for anyone, and does not get the location of a single member of the party. For that, the default item window takes up the entire screen in two columns, unlike the Moghunter system which uses one column.
Likewise, you may not have noticed the SKILL window is the same... so I have an interesting couple of options for you:
RE: A fourth column in MOG Scene Item Laura V1.2 - Noctis - 11-27-2016
(11-26-2016, 04:35 AM)DerVVulfman Wrote: The item system assumes it is for anyone, and does not get the location of a single member of the party. For that, the default item window takes up the entire screen in two columns, unlike the Moghunter system which uses one column.
Likewise, you may not have noticed the SKILL window is the same... so I have an interesting couple of options for you:
Thanks, for the code, I've chosen option 2 because I dont like to edit the battle sytem.
Now, I've two columuns but normally the item window is at the bottom now its in the bottom. Also the window is bigger in height than before.
RE: A fourth column in MOG Scene Item Laura V1.2 - DerVVulfman - 11-27-2016
The code I supplied, as I employed it before relaying it to you, returns the classic RMXP Item Window to the battlesystem. The default system uses two columns and fills the space between the help window above and the battlestatus below. And even after battle, I had returned to the Moggy Item window to ensure the Mog-styled Item window remained the same. From my tests, it is working fine. Mogmenu uses its custom Item window, and the battlesystem uses its default window setup.
Changes to the item (and alternately the Skill) window within battle can be made within the area(s) in the blocks of code I showed you, the ones within the if $game_temp.in_battle condition. It controls height, width, and position in the window, and if you have a 2nd column (the @column_max value). But if you decide to return column max to one, remember that I suggested adding a small block of code in the item_draw method that permits 2 columns in battle... something you would likely take back out.