Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #===============================================================================
- # * [ACE] Party Manager Scene Addon
- #===============================================================================
- # * Made by: Sixth (www.rpgmakervxace.net, www.forums.rpgmakerweb.com)
- # * Version: 1.4
- # * Updated: 21/01/2015
- # * Requires: Tsukihime's Party Manager script
- #-------------------------------------------------------------------------------
- # * < Change Log >
- #-------------------------------------------------------------------------------
- # * Version 1.0 (07/12/2014)
- # - Initial release.
- # * Version 1.1 (08/12/2014)
- # - Fixed a starting party selection bug.
- # It was not possible to select a party if it had the maximum mebmers
- # assigned to it.
- # - Added an option to force the player to start with a specific party after
- # the arrangement has been finished instead of always letting the player to
- # select the starting party.
- # * Version 1.2 (09/12/2014)
- # - Added a status window for the scene which can show the basic params and
- # equips of the selected party member. Afterall, nobody likes to put their
- # members blindly anywhere without knowing their stats, right?
- # The status window is fully customizable, of course!
- # - Added windowskin option for each window separately!
- # * Version 1.3 (14/12/2014)
- # - Added a method which was missing and hence caused a crash. Sorry! *-*
- # - Fixed a visual bug with the party selection cursor.
- # The bottom of the cursor for the last party's window disappeared in certain
- # conditions. This won't happen anymore.
- # - Depending on the size of the 'to be created' parties, sometimes a few pixels
- # were left empty at the bottom of the screen. From now on, those empty pixels
- # will be simply added to the last window's height.
- # It looks a bit better this way. This is only effective if you are using the
- # default window divider method.
- # - The windows for the parties are now scrollable. So, if there are more
- # parties than what you can display on the screen, you can scroll up and down
- # to check every parties whenever you want. This enables you to make a lot
- # of parties at once without the need to shrink the party windows too much!
- # New settings are added for this scroll function, so you can limit how many
- # parties you want to be shown maximum on the screen at once.
- # - Added text options for each window!
- # - Added more settings for you to configure!
- # * Version 1.4 (21/01/2015)
- # - Fixed the blinking of the cursor on the 'to be created' party windows.
- #-------------------------------------------------------------------------------
- # * < Installation >
- #-------------------------------------------------------------------------------
- # * In the script editor, place this script below Tsukihime's Party Manager and
- # above Main.
- #-------------------------------------------------------------------------------
- # * < Compatibility Info >
- #-------------------------------------------------------------------------------
- # * No known incompatibilities.
- # * Includes compatibility for the following scripts:
- # - Yanfly's Equip Engine:
- # The status window will show all available equip slots, not just the default
- # ones! You can still hide any slots if you want thou!
- # - Yanfly's Class System:
- # The status window will show the primary and the secondary class names too!
- # - GaryCXJk's Class Extensions System:
- # The status window will show the primary, secondary and the combined class
- # names too!
- # - Blackmorning's Title System:
- # The status window will show the current title of the actor! If this script
- # is not installed, the player's nickname will show up instead where the
- # title would show up!
- #-------------------------------------------------------------------------------
- # * < Description >
- #-------------------------------------------------------------------------------
- # * This script makes a party manager scene to visualise party creations.
- # * Enables the creation of parties with dynamic party members.
- # Define the party ID, minimum required members, maximum party members, the
- # location of the parties, the starting members (locked members), as well as a
- # little custom text for each party to show the player a little information
- # about the parties, and let the player himself/herself choose the members of
- # the parties however they want!
- # * A status window showing the basic parameters and equips of the party members
- # will help the player to choose the actor without guessing what stats they
- # actually have!
- # * Actors can be locked, so the player can not assign them to any parties, and
- # actors can also be locked the other way around, so the player can not remove
- # them from the parties!
- # * When the arrange is finished, the player can choose the starting party as well!
- # * After selecting a starting party, all of the parties will be created at their
- # defined location, and the player gains control over the selected starting
- # party on the map automatically.
- #-------------------------------------------------------------------------------
- # * < Script Calls >
- #-------------------------------------------------------------------------------
- # * For calling the party manager scene, use the following script call:
- #
- # enter_party_scene([info])
- #
- # The 'info' is an array which can contain any number of 'data arrays'.
- # Each 'data_array' should look like this:
- #
- # data_array = [party_id,[starting_members],[map_id,map_x,map_y],[min_members,max_members],"custom_text"]
- #
- # Explanation of each data:
- #
- # party_id = The ID of the "to be created" party.
- # NOTE: Never use the current party ID for this!
- #
- # starting_members = The starting members of the party.
- # These members are automatically assigned to the party
- # and the player can not remove them from the party.
- # NOTE: Use [] if you don't want any starting members!
- #
- # map_id = The ID of the map where the party will spawn after the arrange.
- # map_x = The X position on the map where the party will spawn.
- # map_y = The Y position on the map where the party will spawn.
- # NOTE: map_id, map_x and map_y needs to be put into an array.
- # This array will be the 'location' data array.
- #
- # min_members = The minimum amount of members required for the party.
- # The player can not leave the scene until all of the parties's
- # total members reach their defined minimum amount of members.
- # max_members = The maximum amount of allowed members in the party.
- # The player can not place any actor into a party if the party's
- # total members reached the maximum member capacity.
- # NOTE: You can add more members like usually, but only after
- # exiting the party arrangement scene!
- # NOTE: min_members and max_members needs to be put into an array.
- # This array will be the 'members info' data array.
- #
- # custom_text = A custom string to be shown on the arrangement scene.
- # You can use any valid message codes here!
- # NOTE: custom_text must be put between " " signs!
- #
- # This certainly looks like a lot of info in a small script call, right?
- # Here are a few examples to make it easier to understand all this information:
- #
- # party1 = [2,[],[21,3,4],[3,4],"Location: Dark Cave"]
- # party2 = [3,[2,3],[21,4,4],[4,5],"Location: Detrai Mountains"]
- # info = [party1,party2]
- # enter_party_scene(info)
- #
- # So, we can define each party separately on a new line.
- # Each of these parties can be named however you like.
- # I named them 'party1' and 'party2' in this example.
- # After this, we put these parties into a new array.
- # This new array can also be named however you like.
- # I named it 'info' in this example.
- #
- # On the scene, we will see that with this script call, two parties will be
- # created.
- # The first party will get 2 for it's ID, while the second gets 3 for it's ID.
- # The first party will not have any starting members, while the second will
- # have the actors with ID 2 and 3 already assigned, and they can not be removed
- # before the player exits the arrangements scene.
- # After the arrangement, the first party will be spawned on the map with ID 21
- # at the (3,4) co-ordinates (x,y), while the second party will be spawned
- # right next to the first one (on the same map at the (4,4) co-ordinates).
- # The first party needs at least 3 members assigned and the second party needs
- # at least 4 members assigned before the player can leave the scene.
- # The first party can have a maximum of 4 members assigned, while the second
- # party can have 5.
- # The first party's info text will show "Location: Dark Cave", while the second
- # party's info text will show "Location: Detrai Mountains".
- # These info texts will show up on the top left side of each party window.
- #
- # And this should explain the kinda long script call.
- # Let's take a look at an even longer one:
- #
- # party1 = [2,[],[21,3,4],[3,4],"Location: Grassfields"]
- # party2 = [3,[4],[21,4,4],[3,5],"Location: Prairie Camp"]
- # party3 = [4,[2,1],[21,5,4],[2,3],"Location: Racer's Hideout"]
- # party4 = [5,[],[21,6,4],[2,3],"Location: Lake of Calmness"]
- # info = [party1,party2,party3,party4]
- # enter_party_scene(info)
- #
- # Wow, lotsa parties, indeed!
- # As you can see, it is the same as before, but now with 4 different parties!
- # You can create as many parties as you want!
- #
- # Well, this should explain the script call for the scene!
- #- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- # * For making a certain actor unable to be assigned to any parties, you can use
- # the following script call:
- #
- # pm_lock_actor([actor_ids])
- #
- # Replace 'actor_ids' with any number of actor IDs.
- # Example:
- #
- # pm_lock_actor([1,3,5])
- #
- # This script call would make the actors with ID 1, 3 and 5 unable to be
- # assigned to any parties on the party arrangement scene.
- #
- # Similarly, you can remove this restriction with the following script call:
- #
- # pm_unlock_actor([actor_ids])
- #- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- # * For forcing a starting party, you can use the following script call:
- #
- # pm_starting_party(party_id)
- #
- # Replace 'party_id' with the ID of the party you want for the starting party.
- # Using this script call, the party selection window will not pop up after
- # pressing the "Finish" button. Instead of that, the starting party will be
- # the one you defined with this script call.
- # To enable the manual starting party selection again after using this script
- # call, you can make the same script call and use -1 for the 'party_id'.
- #-------------------------------------------------------------------------------
- # * < Known Issues >
- #-------------------------------------------------------------------------------
- # * No known issues.
- #-------------------------------------------------------------------------------
- # * < Author's Thanks and Credits >
- #-------------------------------------------------------------------------------
- # * I used Blackmorning's method to draw the actor's faces on the scene.
- # Credit and my thanks goes to him for that method!
- #-------------------------------------------------------------------------------
- # * < Terms of Use >
- #-------------------------------------------------------------------------------
- # * Free to use for whatever purposes you want.
- # * Credit me (Sixth) in your game, pretty please! :P
- # * Posting modified versions of this script is allowed as long as you notice me
- # about it with a link to it!
- #===============================================================================
- $imported = {} if $imported.nil?
- $imported["SixthPartyManagerScene"] = true
- #===============================================================================
- # Settings:
- #===============================================================================
- module PM_Scene
- Texty = [] # <-- No touchy-touchy!
- #===============================================================================
- # Window Settings:
- #===============================================================================
- # The properties of the help window.
- # Format: Help_Window = [x,y,width,height,"windowskin"]
- Help_Window = [0,0,140,48,"Window"]
- # The properties of the command window.
- # Format: Command_Window = [x,y,width,height,"windowskin"]
- Command_Window = [0,48,140,72,"Window"]
- # The properties of the current party members window.
- # Format: Members_Window = [x,y,width,height,"windowskin"]
- Members_Window = [0,120,140,Graphics.height-120,"Window"]
- # The properties of the new parties windows.
- # Format: Parties_Window = [x,y,width,height,"windowskin1","windowskin2"]
- # NOTE: The height of this window will be divided by the number of parties you
- # defined in the script call automatically or if there are more parties
- # than what the party window can display, it will be divided by the value
- # set for the 'MaxPartyAtOnce' setting.
- # NOTE: The the windowskin setting here affects two different things:
- # - windowskin1 = This will be the windowskin used for all of the
- # "to be created" party windows.
- # - windowskin2 = This will be the windowskin of the party selection window.
- # Since this window is fully transparent, this setting will
- # only affect the cursor type shown when selecting parties.
- Parties_Window = [140,0,Graphics.width-140,Graphics.height,"Window","Window"]
- # The properties of the status window.
- # Format: Stat_Window = [x,y,width,[height1,height2,height3],"windowskin"]
- # NOTE: The status window can change it's height depending on what is shown
- # in it. If you don't want this feature, simply set the below setting
- # to false! More info on this can be found at the next setting!
- # Here is when each height is effective:
- # - height1 = When the basic parameters are shown.
- # - height2 = When the equip info is shown.
- # - height3 = When no party member is selected (cursor is on an "Empty" place).
- Stat_Window = [Graphics.width-400,0,400,[374,350,96],"Window"]
- # You can disable the status window's dynamic height change feature here.
- # If you do, the height of the status window will always be the higest value
- # set up for the height values of the status window.
- # If the dynamic height is enabled, the status window will be pinned to the
- # bottom of the screen, regardless what value did you set for the status
- # window's Y position! If it is disabled, the Y position will take the value
- # from the above setting for the status window!
- Dynamic_Stat_Height = true
- #===============================================================================
- # Text Settings:
- #===============================================================================
- # Text settings for each window.
- # Format: Name_Font = [["font1","font2","font3"],size]
- # You can use any amount of font types in the font type array.
- # The first on the list will be chosen, but if the system can't find that
- # font type installed, it will move on to the next type listed here.
- # [[ Font Types ],size]
- Help_Font = [["Monotype Corsiva","Arial"], 20]
- Cmnd_Font = [["Monotype Corsiva","Arial"], 20]
- Memb_Font = [["Monotype Corsiva","Arial"], 20]
- Name_Font = [["Monotype Corsiva","Arial"], 20]
- Info_Font = [["Monotype Corsiva","Arial"], 20]
- Stat_Font = [["Monotype Corsiva","Arial"], 20]
- # Text display options:
- Texty[0] = "Arrange" # Used for the arrange command button.
- Texty[1] = "Finish" # Used for the arrange finish command button.
- Texty[2] = "Select a command." # Used in the help window.
- Texty[3] = "Select a member." # Used in the help window.
- Texty[4] = "Select a party." # Used in the help window.
- Texty[5] = "Starting party:" # Used in the help window.
- Texty[6] = "Party " # Used in the party windows.
- Texty[7] = "Status: " # Used in the party windows (max/min member text).
- Texty[8] = "Members Required: " # Used in the party windows (req. member text).
- Texty[9] = "Empty" # Used when a party is empty.
- Texty[10] = "Status" # Used in the status window.
- Texty[11] = "Equips" # Used in the status window.
- Texty[12] = "Empty" # Used in the status window for showing an empty equip slot.
- Texty[13] = "Name" # Used in the status window.
- Texty[14] = "Class" # Used in the status window.
- Texty[15] = "Title" # Used in the status window.
- Texty[16] = "No party member is selected!" # Used in the status window when no member is selected.
- Texty[17] = "General Info" # Used in the status window.
- #===============================================================================
- # Color Settings:
- #===============================================================================
- # Colors used on the scene.
- # These settings use RGBA codes!
- # Text colors:
- Min_Mem_OK = [100,220,100,255] # When the minimum member requirement is OK.
- Min_Mem_NO = [220,100,100,255] # When the minimum member requirement is not OK.
- Status_Col = [100,100,220,255] # Color for the min/max members indicator text.
- Party_Col = [220,220,100,255] # Color for the party identifier text.
- Enable_Mem = [255,255,255,255] # Color for the enabled party members' name text.
- Locked_Mem = [220,150,100,255] # Color for the locked party members' name text.
- No_Member = [220,150,100,255] # Color for the text in the stat window when no member is selected.
- # Color for the text boxes in the status window.
- TextBox_C = [ 0, 0, 0, 80]
- # Color for the visual boxes appearing around the stat and equip info in the
- # status window and for the line shown below the general info text.
- # [[ Outer Color ],[ Inner Color ]] <-- For the boxes.
- # [[ Upper Color ],[ Lower Color ]] <-- For the line.
- Box_Colors = [[100,100,220,250],[ 60, 60, 60,250]]
- #===============================================================================
- # Visual Settings:
- #===============================================================================
- # Max colums (party members) shown on the "to be created" party windows.
- # If the faces and/or the actor names become too crowded, decrease the number
- # of shown columns, so that they have more space to display.
- # If there are more members in a party than the value set here, the cursor can
- # be scrolled to the right, so all of the members are displayable regardless
- # of how many there are in one party.
- Max_Colums = 4
- # The spacing between each party members on the right windows.
- Spacing = 6
- # Size of the face icons used on the scene.
- # The value represents pixels.
- # 96 is the default face image size drawn on default scenes.
- # Lower values than that will result in smaller face images.
- # Higher values than that will result in bigger face images.
- Face_Size = 42
- # The height of the cursor shown on the "to be created" party windows.
- Cursor_Height = 70
- # The Y offset value for the cursor shown on the "to be created" party windows.
- # Positive values will move the cursor down.
- # Negative values will move the cursor up.
- Cursor_Y_Offset = 0
- # The Y offset value for the names shown below the face images.
- # Positive values will move the name display down.
- # Negative values will move the name display up.
- Name_Y_Offset = -6
- # This setting will affect how many parties will be displayed at once at the
- # "to be created" party windows section.
- # The height of the parties window you set up above will be divided by this
- # value when the amount of the parties is more than this value.
- # If it is less, it will use the default dividing method, unless you disable
- # the next option below.
- # If there are more parties, the parties window section becomes scrollable,
- # so it is now really possible to make infinite amount of parties if someone
- # would like... I wonder why would anyone, but the option is there now without
- # the shrinking of the windows to oblivion. :D
- MaxPartyAtOnce = 3
- # If this is enabled, the scene will use the default method of dividing the
- # height of the parties window when there are equal or less parties on the
- # screen than what you have defined in the above setting.
- # If this is disabled, the scene will always divide the height by the number
- # you have defined in the above setting.
- DefaultDivide = true
- # You can set up the up and down indicators here.
- # These will appear when there are more "to be created" parties on the scene
- # than what you have set for the 'MaxPartyAtOnce' settings.
- # In other words, these will operate just like an up and down scroll indicator
- # in a regular selection window when there are more items than what the window
- # can display.
- # Format = ["img_file_name",[x,y]]
- # img_file_name = The name of the picture to be used for the arrow.
- # The picture used must be in the folder: Graphics/System!
- # x = The X position of the picture. If you set this to :center, the picture
- # will be automatically centered within the party windows.
- # Otherwise it will take the direct X position you define here.
- # The direct X position is not relative to the window's X position!
- # So, setting this to 0 means it will appear at the left edge of the game's
- # screen and not at the left edge of the window!
- # y = The Y position offset for the picture.
- # This will act as an offset value, so postive values will move the picture
- # down, while negative ones will move it up.
- # By default, the up scroll picture is stuck at the top of the first party
- # window. This setting will add the defined value to that position.
- # By default, the down scroll picture is stuck at the bottom of the last
- # displayable party window. This setting will add the defined value to that
- # position.
- Arrow_U = ["UpArrow2" ,[:center, 6]] # Setup for the upper scroll indicator.
- Arrow_D = ["DownArrow2",[:center,-6]] # Setup for the lower scroll indicator.
- # The X and Y position of the actor face drawn in the status window.
- Face_X = 10
- Face_Y = 10
- # The properties and position of the base info shown in the status window.
- # The base info includes the name, class and title of the actor and the base
- # info text above them with the line below it.
- Base_Info_X = 132 # X position.
- Base_Info_Y = 33 # Y position.
- Base_Info_W = 230 # Width of the base info.
- # The properties and position of the detailed info shown in the status window.
- # The detailed info includes the base params and equips of the actor and the
- # base info text above them with the boxes around all of this.
- Dtls_Info_X = 21 # X position.
- Dtls_Info_Y = 140 # Y position.
- Dtls_Info_W = 334 # Width of the detailed info.
- # The X offset value for the name of the equipped items shown in the stat window.
- # It might need to be changed for certain font types.
- # Positive values will move the text right, negative values will move it left.
- Item_X_Offset = -5
- # You can set which parameters you want to show for the player in the status
- # window. Put the parameter's IDs which you want to show in the array here.
- # The parameter IDs not included here will not show up in the status window!
- # 0 - MHP, 1 - MMP, 2 - ATT, 3 - DEF, 4 - MAT, 5 - MDF, 6 - AGI, 7 - LUK.
- Include_Params = [0,1,2,3,4,5,6,7]
- # You can set which equip slots you DO NOT want to show here.
- # Any equip slot IDs included here will NOT show up in the status window!
- # Make sure that you do not put any invalid numbers here!
- # The equip info shown in the status window is compatible with Yanfly's Equip
- # Engine, so you can have more equip slot IDs than the default ones!
- # Default IDs:
- # 0 - Weapon, 1 - Shield/2nd Weapon, 2 - Headgear, 3 - Armor, 4 - Accessory.
- Equip_Exclude = [] # Example array: [1,4]
- # Max pages shown in the status window.
- # If you want to disable some pages, you can edit this setting with the below
- # settings. The default is 2, which means it will show the base params of the
- # actor on one page, and the equips of the actor on the other page.
- Max_Page = 2
- # The page setup for the status window.
- # For now, there are 2 things you can set to show:
- # ':params' stands for the basic parameter info page.
- # ':equips' stands for the equip info page.
- # The numbers indicates on which page will they show up.
- # Page numbers start from 1 and they go up to the number of available options
- # here, which means 2 at the moment.
- # Default values:
- # :params => 1,
- # :equips => 2,
- Page_Setup = { # <-- No touchy-touchy!
- :params => 1, # Page number for the base params shown.
- :equips => 2, # Page number for the equips shown.
- } # <-- No touchy-touchy!
- #===============================================================================
- # Audio Settings:
- #===============================================================================
- # Set the sound effects to be played at various actions on the arrangement scene.
- # RPG::SE.new("SE_Name", volume, pitch)
- Member_Add = RPG::SE.new("Chime1" , 80, 100) # When adding members.
- Member_Rem = RPG::SE.new("Buzzer2", 80, 100) # When removing members.
- Arrange_Fin = RPG::SE.new("Chime2" , 80, 100) # When finishing the arrange.
- Stats_Open = RPG::SE.new("Decision1", 80, 100) # When opening the stat window.
- Toggle_Stat = RPG::SE.new("Cursor1", 80, 100) # When toggling the stat window.
- #===============================================================================
- # Button Settings:
- #===============================================================================
- # Button trigger for switching between the current party window and the
- # "to be created" party windows.
- Window_Switch = :A
- # Button trigger for showing/hiding the status window.
- # The status window will only ever show up if the active window is either the
- # current party member window or the "to be created" party window!
- # You can disable the status window feature if you set this to 'nil'.
- Status_Window = :CTRL
- # Button trigger for changing pages on the status window.
- # You can disable the page changing if you set this to 'nil'.
- Status_Toggle = :Z
- end
- #===============================================================================
- # End of Settings! You can modify things below too if you don't mind the risk
- # of flaming potatoes dropping down on your PC...
- #===============================================================================
- #==============================================================================
- # Game_Actor
- #------------------------------------------------------------------------------
- # Adding the locked flag for the actors here.
- #==============================================================================
- class Game_Actor < Game_Battler
- #--------------------------------------------------------------------------
- # New Public Instance Variable
- #--------------------------------------------------------------------------
- attr_accessor :actor_lock_in_party
- #--------------------------------------------------------------------------
- # Alias Method: Initialize
- #--------------------------------------------------------------------------
- alias sixth_actor_lock122 initialize
- def initialize(actor_id)
- sixth_actor_lock122(actor_id)
- @actor_lock_in_party = false
- end
- end
- #==============================================================================
- # Game_System
- #------------------------------------------------------------------------------
- # Adding the party switch enable flag here.
- #==============================================================================
- class Game_System
- #--------------------------------------------------------------------------
- # New Public Instance Variable
- #--------------------------------------------------------------------------
- attr_accessor :starting_party
- #--------------------------------------------------------------------------
- # Alias Method: Initialize
- #--------------------------------------------------------------------------
- alias sixth_party_switcher134 initialize
- def initialize
- sixth_party_switcher134
- @starting_party = -1
- end
- end
- #==============================================================================
- # Game_Interpreter
- #------------------------------------------------------------------------------
- # Adding the new script call here.
- #==============================================================================
- class Game_Interpreter
- #--------------------------------------------------------------------------
- # Party Manager Scene Script Call
- #--------------------------------------------------------------------------
- def enter_party_scene(info=[])
- SceneManager.call(Scene_Party_Manager_S)
- SceneManager.scene.prepare(info)
- end
- #--------------------------------------------------------------------------
- # Actor Lock Script Call
- #--------------------------------------------------------------------------
- def pm_lock_actor(actor_id)
- actor_id.each do |id|
- $game_actors[id].actor_lock_in_party = true
- end
- end
- #--------------------------------------------------------------------------
- # Actor Unlock Script Call
- #--------------------------------------------------------------------------
- def pm_unlock_actor(actor_id)
- actor_id.each do |id|
- $game_actors[id].actor_lock_in_party = false
- end
- end
- #--------------------------------------------------------------------------
- # Starting Party Script Call
- #--------------------------------------------------------------------------
- def pm_starting_party(party_id)
- $game_system.starting_party = party_id
- end
- end
- #==============================================================================
- # Scene_Party_Manager_S
- #------------------------------------------------------------------------------
- # The scene for the party manager.
- #==============================================================================
- class Scene_Party_Manager_S < Scene_Base
- #--------------------------------------------------------------------------
- # Scene Startup
- #--------------------------------------------------------------------------
- def start
- super
- @stat_shower_index = 0
- @party_index = 0
- @pmem_index = 0
- @c_mem_index = 0
- @view_index = 0
- @pm_viewport = Viewport.new
- @pm_viewport.oy = PM_Scene::Parties_Window[1]
- create_all_windows
- create_ud_arrows
- @maxi = [@parties.size,PM_Scene::MaxPartyAtOnce].min
- end
- #--------------------------------------------------------------------------
- # Preparing Info
- #--------------------------------------------------------------------------
- def prepare(info)
- @partiess = Array.new
- @locked_members = Array.new
- info.each do |party| # [party_id,[starting_actor_ids],[map_id, map_x, map_y],[min_mem,max_mem],"custom_text"]
- @locked_members[info.index(party)] = Array.new
- @partiess[info.index(party)] = [party[0],party[1],party[2],party[3],party[4]]
- if party[1].size > 0
- party[1].each do |actor_id|
- if !$game_actors[actor_id].nil? && $game_party.members.include?($game_actors[actor_id])
- $game_party.remove_actor(actor_id)
- @locked_members[info.index(party)].push(actor_id)
- else
- @partiess[info.index(party)][1].delete(actor_id)
- end
- end
- end
- end
- end
- #--------------------------------------------------------------------------
- # Creating All Windows
- #--------------------------------------------------------------------------
- def create_all_windows
- create_help_window
- create_command_window
- create_party_member_window
- create_parties_window
- create_party_select_big
- create_stat_window
- end
- #--------------------------------------------------------------------------
- # Creating the Help Window
- #--------------------------------------------------------------------------
- def create_help_window
- @helpy = PM_Help.new
- end
- #--------------------------------------------------------------------------
- # Creating the Command Window
- #--------------------------------------------------------------------------
- def create_command_window
- @commands = PM_Commands.new(@partiess)
- @commands.set_handler(:on_arrange, method(:arrange_members))
- @commands.set_handler(:on_finish, method(:starting_party_select))
- end
- #--------------------------------------------------------------------------
- # Creating the Current Party Members Window
- #--------------------------------------------------------------------------
- def create_party_member_window
- @members = PM_Members.new
- @members.set_handler(:on_member, method(:member_popup))
- @members.set_handler(:on_cancel, method(:confirm_cancel))
- @members.set_handler(:cancel, method(:confirm_cancel))
- @members.deactivate
- @members.unselect
- end
- #--------------------------------------------------------------------------
- # Creating the Parties Windows
- #--------------------------------------------------------------------------
- def create_parties_window
- @parties = Array.new
- @partiess.each_with_index do |party,i|
- @parties[i] = PM_Parties.new(@partiess[i],i,@partiess.size,@locked_members[i])
- @parties[i].set_handler(:on_member_new, method(:member_remove))
- @parties[i].set_handler(:on_cancel, method(:confirm_cancel_par))
- @parties[i].set_handler(:cancel, method(:confirm_cancel_par))
- @parties[i].viewport = @pm_viewport
- @parties[i].deactivate
- @parties[i].unselect
- end
- end
- #--------------------------------------------------------------------------
- # Creating the Stat Window
- #--------------------------------------------------------------------------
- def create_stat_window
- @stat_win = PM_Stat_Shower.new
- @stat_win.opacity = 0
- @stat_win.contents_opacity = 0
- end
- #--------------------------------------------------------------------------
- # Creating the Party Selection Window
- #--------------------------------------------------------------------------
- def create_party_select_big
- @partybig = PM_Party_Select_Big.new(@partiess)
- @partybig.set_handler(:on_location_ok, method(:select_location))
- @partybig.set_handler(:cancel, method(:confirm_cancel_pop))
- @partybig.viewport = @pm_viewport
- @partybig.unselect
- end
- #--------------------------------------------------------------------------
- # Creating the Arrows
- #--------------------------------------------------------------------------
- def create_ud_arrows
- @uarrow = Sprite.new
- @darrow = Sprite.new
- @uarrow.bitmap = Cache.system(PM_Scene::Arrow_U[0])
- @darrow.bitmap = Cache.system(PM_Scene::Arrow_D[0])
- if PM_Scene::Arrow_U[1][0] == :center
- @ucenter = PM_Scene::Parties_Window[0]+(PM_Scene::Parties_Window[2]-@uarrow.bitmap.width)/2
- @uarrow.x = @ucenter
- else
- @uarrow.x = PM_Scene::Arrow_U[1][0]
- end
- if PM_Scene::Arrow_D[1][0] == :center
- @dcenter = PM_Scene::Parties_Window[0]+(PM_Scene::Parties_Window[2]-@darrow.bitmap.width)/2
- @darrow.x = @dcenter
- else
- @darrow.x = PM_Scene::Arrow_D[1][0]
- end
- @uarrow.y = PM_Scene::Parties_Window[1]+PM_Scene::Arrow_U[1][1]
- @darrow.y = PM_Scene::Parties_Window[1]+PM_Scene::Parties_Window[3]+PM_Scene::Arrow_D[1][1]-@darrow.bitmap.height
- @uarrow.opacity = 0
- if @parties.size > PM_Scene::MaxPartyAtOnce
- @darrow.opacity = 255
- else
- @darrow.opacity = 0
- end
- end
- #--------------------------------------------------------------------------
- # Confirm Method on the Arrange Command
- #--------------------------------------------------------------------------
- def arrange_members
- Sound.play_ok
- @commands.deactivate
- @helpy.refresh(1)
- @members.select(@c_mem_index)
- @members.activate
- end
- #--------------------------------------------------------------------------
- # Starting Party Selection Method
- #--------------------------------------------------------------------------
- def starting_party_select
- Sound.play_ok
- @partybig.finish = true
- @commands.deactivate
- @helpy.refresh(3)
- if $game_system.starting_party == -1
- refresh_every_window
- @partybig.select(@party_index)
- @partybig.activate
- else
- exit_pm_scene
- end
- end
- #--------------------------------------------------------------------------
- # Arrange Finish Method
- #--------------------------------------------------------------------------
- def exit_pm_scene
- PM_Scene::Arrange_Fin.play
- @partiess.each do |party|
- id = party[0]
- members = party[1]
- location = Game_Location.new(party[2][0], party[2][1], party[2][2])
- $game_parties.create_party(id, members, location)
- end
- if $game_system.starting_party == -1
- $game_parties.switch_party(@partiess[@partybig.index][0])
- else
- $game_parties.switch_party($game_system.starting_party)
- end
- return_scene
- end
- #--------------------------------------------------------------------------
- # Disposing the Parties Windows
- #--------------------------------------------------------------------------
- def dispose_stuffs
- @parties.each do |party_win|
- party_win.dispose
- end
- @pm_viewport.dispose
- @uarrow.bitmap.dispose
- @darrow.bitmap.dispose
- @uarrow.dispose
- @darrow.dispose
- end
- #--------------------------------------------------------------------------
- # Confirm Method on the Current Party Members Window
- #--------------------------------------------------------------------------
- def member_popup
- Sound.play_ok
- @stat_win.opacity = 0
- @stat_win.contents_opacity = 0
- @selected_member = @members.current_ext
- @members.deactivate
- @partybig.select(@party_index)
- @partybig.activate
- @helpy.refresh(2)
- refresh_every_window
- end
- #--------------------------------------------------------------------------
- # Confirm Method on the Parties Windows
- #--------------------------------------------------------------------------
- def member_remove
- @selected_member = @parties[@party_index].current_ext
- PM_Scene::Member_Rem.play
- @partiess[@party_index][1].delete(@selected_member)
- $game_party.add_actor(@selected_member)
- refresh_every_window
- @parties[@party_index].activate
- end
- #--------------------------------------------------------------------------
- # Cancel Method on the Current Party Members Window
- #--------------------------------------------------------------------------
- def confirm_cancel
- Sound.play_cancel
- @stat_win.opacity = 0
- @stat_win.contents_opacity = 0
- @c_mem_index = @members.index
- @members.deactivate
- @members.unselect
- @helpy.refresh(0)
- @commands.activate
- end
- #--------------------------------------------------------------------------
- # Confirm Method on the Party Selection Window
- #--------------------------------------------------------------------------
- def select_location
- if @partybig.finish == false
- PM_Scene::Member_Add.play
- $game_party.remove_actor(@selected_member)
- @partiess[@partybig.index][1].push(@selected_member)
- @partybig.unselect
- @partybig.deactivate
- @members.activate
- @helpy.refresh(1)
- refresh_every_window
- else
- exit_pm_scene
- end
- end
- #--------------------------------------------------------------------------
- # * Cancel Method on the Party Selection Window
- #--------------------------------------------------------------------------
- def confirm_cancel_pop
- if @partybig.finish == false
- Sound.play_cancel
- @partybig.unselect
- @partybig.deactivate
- @helpy.refresh(1)
- @members.activate
- else
- Sound.play_cancel
- @partybig.unselect
- @partybig.deactivate
- @helpy.refresh(0)
- @partybig.finish = false
- @commands.activate
- end
- end
- #--------------------------------------------------------------------------
- # Cancel Method on the Parties Windows
- #--------------------------------------------------------------------------
- def confirm_cancel_par
- Sound.play_cancel
- @stat_win.opacity = 0
- @stat_win.contents_opacity = 0
- @parties[@party_index].deactivate
- @parties[@party_index].unselect
- @commands.activate
- end
- #--------------------------------------------------------------------------
- # Refresh Windows
- #--------------------------------------------------------------------------
- def refresh_every_window
- @members.refresh
- @parties[@party_index].refresh
- @partybig.refresh
- @commands.refresh
- end
- #--------------------------------------------------------------------------
- # Dispose All Windows
- #--------------------------------------------------------------------------
- def dispose_all_windows
- dispose_stuffs
- super
- end
- #--------------------------------------------------------------------------
- # Update the party windows
- #--------------------------------------------------------------------------
- def update_parties_windows
- @parties.each do |window|
- window.update if window.is_a?(Window)
- end
- end
- #--------------------------------------------------------------------------
- # Update
- #--------------------------------------------------------------------------
- def update
- super
- update_parties_windows
- if @members.active == true
- if @stat_shower_index != @members.current_ext
- @stat_shower_index = @members.current_ext
- @stat_win.refresh(@stat_shower_index) if @stat_win.opacity == 255
- end
- if Input.trigger?(PM_Scene::Window_Switch)
- @no_more = true
- @c_mem_index = @members.index
- Sound.play_cursor
- while @pmem_index > @parties[@party_index].item_max - 1
- @pmem_index -= 1
- end
- @parties[@party_index].select(@pmem_index)
- @parties[@party_index].activate
- @members.deactivate
- @members.unselect
- end
- end
- if !@parties[@party_index].disposed? && @parties[@party_index].active == true
- if @stat_shower_index != @parties[@party_index].current_ext
- @stat_shower_index = @parties[@party_index].current_ext
- @stat_win.refresh(@stat_shower_index) if @stat_win.opacity == 255
- end
- if Input.trigger?(PM_Scene::Window_Switch) && @no_more == false
- Sound.play_cursor
- @pmem_index = @parties[@party_index].index
- @parties[@party_index].deactivate
- @parties[@party_index].unselect
- @members.select(@c_mem_index)
- @members.activate
- end
- @no_more = false if @no_more == true
- if Input.trigger?(:DOWN) && !Input.trigger?(:UP)
- pressing_down(true)
- end
- if Input.trigger?(:UP) && !Input.trigger?(:DOWN)
- pressing_up(true)
- end
- if Input.trigger?(:ALT)
- @parties[@party_index].select(@parties[@party_index].item_max-1)
- end
- end
- if @partybig.active == true
- if Input.trigger?(:DOWN) && !Input.trigger?(:UP)
- pressing_down
- end
- if Input.trigger?(:UP) && !Input.trigger?(:DOWN)
- pressing_up
- end
- end
- if @commands.active == false && @partybig.active == false
- if Input.trigger?(PM_Scene::Status_Window)
- PM_Scene::Stats_Open.play
- if @stat_win.opacity == 0
- @stat_win.opacity = 255
- @stat_win.contents_opacity = 255
- @stat_win.refresh(@stat_shower_index)
- else
- @stat_win.opacity = 0
- @stat_win.contents_opacity = 0
- end
- end
- if Input.trigger?(PM_Scene::Status_Toggle) && @stat_win.opacity == 255
- PM_Scene::Toggle_Stat.play
- if @stat_win.pm_toggler < PM_Scene::Max_Page - 1
- @stat_win.pm_toggler += 1
- else
- @stat_win.pm_toggler = 0
- end
- @stat_win.refresh(@stat_shower_index)
- end
- end
- end
- #--------------------------------------------------------------------------
- # Pressing down processing
- #--------------------------------------------------------------------------
- def pressing_down(p_win=false)
- @party_last = @party_index
- Sound.play_cursor if p_win == true
- @party_index += 1
- if @party_index > @parties.size - 1
- @party_index = 0
- end
- if @view_index < @maxi
- @view_index += 1
- end
- if p_win == true
- @pmem_index = @parties[@party_last].index
- while @pmem_index > @parties[@party_index].item_max - 1
- @pmem_index -= 1
- end
- @parties[@party_index].select(@pmem_index)
- @parties[@party_index].activate
- @parties[@party_last].deactivate
- @parties[@party_last].unselect
- end
- if @view_index == @maxi
- unless @pm_viewport.oy + @parties[@party_index].height > @parties[@parties.size - @maxi].y ||
- @pm_viewport.oy == @parties[@party_index-(@maxi-1)].y
- @pm_viewport.oy += @parties[@party_index].height
- end
- end
- if @party_index == 0
- @pm_viewport.oy = PM_Scene::Parties_Window[1]
- @view_index = 0
- end
- check_arrow_display
- end
- #--------------------------------------------------------------------------
- # Pressing up processing
- #--------------------------------------------------------------------------
- def pressing_up(p_win=false)
- @party_last = @party_index
- Sound.play_cursor if p_win == true
- @party_index -= 1
- if @party_index < 0
- @party_index = @parties.size - 1
- end
- if @view_index > 0
- @view_index -= 1
- end
- if p_win == true
- @pmem_index = @parties[@party_last].index
- while @pmem_index > @parties[@party_index].item_max - 1
- @pmem_index -= 1
- end
- @parties[@party_index].select(@pmem_index)
- @parties[@party_index].activate
- @parties[@party_last].deactivate
- @parties[@party_last].unselect
- end
- if @view_index == 0
- unless @pm_viewport.oy - @parties[@party_index].height < @parties[0].y ||
- @pm_viewport.oy == @parties[@party_index].y
- @pm_viewport.oy -= @parties[@party_index].height
- end
- end
- if @party_index == @parties.size - 1
- @pm_viewport.oy = @parties[@parties.size - @maxi].y
- @view_index = @maxi
- end
- check_arrow_display
- end
- #--------------------------------------------------------------------------
- # Show/hide up and down arrows method
- #--------------------------------------------------------------------------
- def check_arrow_display
- if @pm_viewport.oy + @parties[@party_index].height > @parties[@parties.size - @maxi].y
- @darrow.opacity = 0
- else
- @darrow.opacity = 255
- end
- if @pm_viewport.oy - @parties[@party_index].height < @parties[0].y
- @uarrow.opacity = 0
- else
- @uarrow.opacity = 255
- end
- end
- end
- #==============================================================================
- # Cache
- #------------------------------------------------------------------------------
- # Adding the face image scaling method here. Credit for Blackmourning for this!
- #==============================================================================
- if !$imported[:bm_base]
- module Cache
- #--------------------------------------------------------------------------
- # Storage Image - by Blackmourning!
- #--------------------------------------------------------------------------
- def self.storage_image(bitmap, name)
- @image_cache ||= {}
- @image_cache[name] = bitmap unless @image_cache.has_key?(name)
- @image_cache[name]
- end
- end
- end
- #==============================================================================
- # Window_Base
- #------------------------------------------------------------------------------
- # Adding the face image scaling method here. Credit for Blackmourning for this!
- #==============================================================================
- class Window_Base < Window
- if !$imported[:bm_base]
- #--------------------------------------------------------------------------
- # Draw Icon Face - by Blackmourning!
- #--------------------------------------------------------------------------
- def draw_icon_face(actor, dest_rect, enabled)
- bitmap = Cache.face(actor.face_name)
- rect = Rect.new(actor.face_index % 4 * 96, actor.face_index / 4 * 96, 96, 96)
- bitmap.blur if dest_rect.width < 96/2
- cache = Bitmap.new(dest_rect.width, dest_rect.height)
- cache.stretch_blt(Rect.new(0,0,dest_rect.width, dest_rect.height), bitmap, rect)
- Cache.storage_image(cache, actor.face_name + actor.face_index.to_s)
- bitmap.dispose
- contents.stretch_blt(dest_rect, cache, Rect.new(0,0,cache.width,cache.height), enabled ? 255 : translucent_alpha)
- end
- end
- #--------------------------------------------------------------------------
- # Draw Text Ex without the font settings reset
- #--------------------------------------------------------------------------
- def draw_text_ex_sixth12333(x, y, text)
- text = convert_escape_characters(text)
- pos = {:x => x, :y => y, :new_x => x, :height => calc_line_height(text)}
- process_character(text.slice!(0, 1), text, pos) until text.empty?
- end
- end
- #==============================================================================
- # PM_Stat_Shower
- #------------------------------------------------------------------------------
- # Stat window for showing the player the stats of the selected actor.
- #==============================================================================
- class PM_Stat_Shower < Window_Base
- #--------------------------------------------------------------------------
- # New Public Instance Variable
- #--------------------------------------------------------------------------
- attr_accessor :pm_toggler
- #--------------------------------------------------------------------------
- # Initialize
- #--------------------------------------------------------------------------
- def initialize
- @pm_toggler = 0
- xs = PM_Scene::Stat_Window[0]
- ys = PM_Scene::Stat_Window[1]
- ws = PM_Scene::Stat_Window[2]
- hs = PM_Scene::Stat_Window[3].max
- super(xs, ys, ws, hs)
- self.windowskin = Cache.system(PM_Scene::Stat_Window[4])
- end
- #--------------------------------------------------------------------------
- # Refresh
- #--------------------------------------------------------------------------
- def refresh(index)
- contents.clear
- if index.nil?
- if PM_Scene::Dynamic_Stat_Height == true
- self.height = PM_Scene::Stat_Window[3][2]
- self.y = Graphics.height - self.height
- create_contents
- end
- contents.font.name = PM_Scene::Stat_Font[0]
- contents.font.size = PM_Scene::Stat_Font[1]
- change_color(Color.new(*PM_Scene::No_Member))
- draw_text(0,0,contents.width,contents.height,PM_Scene::Texty[16],1)
- else
- if PM_Scene::Dynamic_Stat_Height == true
- if @pm_toggler == PM_Scene::Page_Setup[:params]-1
- self.height = PM_Scene::Stat_Window[3][0]
- self.y = Graphics.height - self.height
- elsif @pm_toggler == PM_Scene::Page_Setup[:equips]-1
- self.height = PM_Scene::Stat_Window[3][1]
- self.y = Graphics.height - self.height
- end
- create_contents
- end
- contents.font.name = PM_Scene::Stat_Font[0]
- contents.font.size = PM_Scene::Stat_Font[1]
- @actor = $game_actors[index]
- @color1 = Color.new(*PM_Scene::Box_Colors[0])
- @color2 = Color.new(*PM_Scene::Box_Colors[1])
- @color3 = Color.new(*PM_Scene::TextBox_C)
- draw_actor_face(@actor,PM_Scene::Face_X,PM_Scene::Face_Y,true)
- xb = PM_Scene::Base_Info_X; xi = PM_Scene::Dtls_Info_X
- yb = PM_Scene::Base_Info_Y; yi = PM_Scene::Dtls_Info_Y
- wb = PM_Scene::Base_Info_W; wi = PM_Scene::Dtls_Info_W
- contents.fill_rect(xb-4,yb-10,wb+8,3,@color1)
- contents.fill_rect(xb-4,yb-7,wb+8,2,@color2)
- change_color(system_color)
- draw_text(xb,yb-25,wb,line_height,PM_Scene::Texty[17],1)
- draw_basic_info(xb,yb,wb,line_height)
- draw_top_line(xi,yi,wi,line_height)
- if @pm_toggler == PM_Scene::Page_Setup[:params]-1
- draw_params_att(xi,yi-2,wi,line_height)
- elsif @pm_toggler == PM_Scene::Page_Setup[:equips]-1
- draw_equips_att(xi,yi-2,wi,line_height)
- end
- draw_all_lines(xi,yi,wi,@yy)
- end
- end
- #--------------------------------------------------------------------------
- # Drawing the top line of the box
- #--------------------------------------------------------------------------
- def draw_top_line(x,y,width,height)
- contents.fill_rect(x-15,y-line_height+12,width+30,3,@color1)
- contents.fill_rect(x-15,y-line_height+15,width+30,2,@color2)
- change_color(system_color)
- end
- #--------------------------------------------------------------------------
- # Drawing the rest of the box lines
- #--------------------------------------------------------------------------
- def draw_all_lines(x,y,width,height)
- contents.fill_rect(x-15,y-line_height+14,3,height+15,@color1)
- contents.fill_rect(x-12,y-line_height+17,2,height+10,@color2)
- contents.fill_rect(x+width+12,y-line_height+14,3,height+15,@color1)
- contents.fill_rect(x+width+10,y-line_height+17,2,height+10,@color2)
- contents.fill_rect(x-15,y-line_height+29+height,width+30,3,@color1)
- contents.fill_rect(x-12,y-line_height+27+height,width+24,2,@color2)
- end
- #--------------------------------------------------------------------------
- # Drawing the basic info
- #--------------------------------------------------------------------------
- def draw_basic_info(x,y,width,height)
- @y1 = 0
- 3.times do
- contents.fill_rect(x-4,y+1+@y1,width+8,height-2,@color3)
- @y1 += line_height
- end
- draw_text(x,y,width,line_height,PM_Scene::Texty[13])
- draw_text(x,y+line_height,width,line_height,PM_Scene::Texty[14])
- draw_text(x,y+line_height*2,width,line_height,PM_Scene::Texty[15])
- change_color(normal_color)
- draw_text(x,y,width,line_height,@actor.name,2)
- if $imported[:bm_titles]
- draw_text(x,y+line_height*2,width,line_height,Vocab.titles_name(@actor.title_id),2)
- else
- draw_text(x,y+line_height*2,width,line_height,@actor.nickname,2)
- end
- if $imported["CXJ-ClassExtensions"]
- if @actor.subclass.nil?
- text = @actor.class.name
- elsif !@actor.class.combined_name[@actor.subclass_id].nil?
- text = @actor.class.combined_name[@actor.subclass_id]
- else
- fmt = YEA::CLASS_SYSTEM::SUBCLASS_TEXT
- text = sprintf(fmt, @actor.class.name, @actor.subclass.name)
- end
- elsif $imported["YEA-ClassSystem"]
- fmt = YEA::CLASS_SYSTEM::SUBCLASS_TEXT
- if @actor.subclass
- text = sprintf(fmt, @actor.class.name, @actor.subclass.name)
- else
- text = @actor.class.name
- end
- else
- text = @actor.class.name
- end
- draw_text(x,y+line_height,width,line_height,text,2)
- end
- #--------------------------------------------------------------------------
- # Drawing equip info
- #--------------------------------------------------------------------------
- def draw_equips_att(x,y,width,height)
- change_color(system_color)
- draw_text(x,y-line_height-1,width,line_height,PM_Scene::Texty[11],1)
- @yy = 0
- @actor.equip_slots.each_with_index do |etype, i|
- if !PM_Scene::Equip_Exclude.include?(i)
- equip = @actor.equips[i]
- contents.fill_rect(x-4,y+1+@yy,width+8,height-2,@color3)
- change_color(system_color)
- draw_text(x,y+@yy,width,height,Vocab::etype(etype))
- change_color(normal_color)
- if equip != nil
- xe = width-text_size(equip.name).width+PM_Scene::Item_X_Offset
- draw_item_name(equip,xe,y+@yy,true,width)
- else
- draw_text(x,y+@yy,width,height,PM_Scene::Texty[12],2)
- end
- @yy += line_height
- end
- end
- end
- #--------------------------------------------------------------------------
- # Drawing param info
- #--------------------------------------------------------------------------
- def draw_params_att(x,y,width,height)
- draw_text(x,y-line_height-1,width,line_height,PM_Scene::Texty[10],1)
- @yy = 0
- @id = 0
- $data_system.terms.params.each do |par|
- if PM_Scene::Include_Params.include?(@id)
- contents.fill_rect(x-4,y+1+@yy,width+8,height-2,@color3)
- change_color(system_color)
- draw_text(x,y+@yy,width,height,Vocab::param(@id))
- change_color(normal_color)
- text = sprintf("%d", @actor.param(@id))
- draw_text(x,y+@yy,width,height,text,2)
- @yy += line_height
- end
- @id += 1
- end
- end
- end
- #==============================================================================
- # PM_Help
- #------------------------------------------------------------------------------
- # Help Window for the scene.
- #==============================================================================
- class PM_Help < Window_Base
- #--------------------------------------------------------------------------
- # Initialize
- #--------------------------------------------------------------------------
- def initialize
- xs = PM_Scene::Help_Window[0]
- ys = PM_Scene::Help_Window[1]
- ws = PM_Scene::Help_Window[2]
- hs = PM_Scene::Help_Window[3]
- super(xs, ys, ws, hs)
- self.windowskin = Cache.system(PM_Scene::Help_Window[4])
- contents.font.name = PM_Scene::Help_Font[0]
- contents.font.size = PM_Scene::Help_Font[1]
- refresh(0)
- end
- #--------------------------------------------------------------------------
- # Refresh
- #--------------------------------------------------------------------------
- def refresh(index)
- contents.clear
- case index
- when 0
- text = PM_Scene::Texty[2]
- when 1
- text = PM_Scene::Texty[3]
- when 2
- text = PM_Scene::Texty[4]
- when 3
- text = PM_Scene::Texty[5]
- end
- draw_text(0,0,contents.width,contents.height,text,1)
- end
- end
- #==============================================================================
- # PM_Commands
- #------------------------------------------------------------------------------
- # Command Window for the scene.
- #==============================================================================
- class PM_Commands < Window_Command
- #--------------------------------------------------------------------------
- # Initialize
- #--------------------------------------------------------------------------
- def initialize(parties)
- @parties_c = parties
- xs = PM_Scene::Command_Window[0]
- ys = PM_Scene::Command_Window[1]
- super(xs, ys)
- self.windowskin = Cache.system(PM_Scene::Command_Window[4])
- end
- #--------------------------------------------------------------------------
- # Window Width
- #--------------------------------------------------------------------------
- def window_width
- PM_Scene::Command_Window[2]
- end
- #--------------------------------------------------------------------------
- # Window Height
- #--------------------------------------------------------------------------
- def window_height
- PM_Scene::Command_Window[3]
- end
- #--------------------------------------------------------------------------
- # Alignment
- #--------------------------------------------------------------------------
- def alignment
- return 1
- end
- #--------------------------------------------------------------------------
- # Make Command List
- #--------------------------------------------------------------------------
- def make_command_list
- add_command(PM_Scene::Texty[0],:on_arrange)
- add_command(PM_Scene::Texty[1],:on_finish,can_exit)
- end
- #--------------------------------------------------------------------------
- # Can Exit
- #--------------------------------------------------------------------------
- def can_exit
- @oki = 0
- @parties_c.each do |party|
- if party[1].size >= party[3][0]
- @oki += 1
- end
- end
- if @oki >= @parties_c.size
- return true
- else
- return false
- end
- end
- #--------------------------------------------------------------------------
- # Draw Items
- #--------------------------------------------------------------------------
- def draw_item(index)
- contents.font.name = PM_Scene::Cmnd_Font[0]
- contents.font.size = PM_Scene::Cmnd_Font[1]
- super
- end
- #--------------------------------------------------------------------------
- # Process Ok
- #--------------------------------------------------------------------------
- def process_ok
- if current_item_enabled?
- Input.update
- deactivate
- call_ok_handler
- else
- Sound.play_buzzer
- end
- end
- end
- #==============================================================================
- # PM_Members
- #------------------------------------------------------------------------------
- # Current Party Member Window for the scene.
- #==============================================================================
- class PM_Members < Window_Command
- #--------------------------------------------------------------------------
- # Initialize
- #--------------------------------------------------------------------------
- def initialize
- xs = PM_Scene::Members_Window[0]
- ys = PM_Scene::Members_Window[1]
- super(xs, ys)
- self.windowskin = Cache.system(PM_Scene::Members_Window[4])
- end
- #--------------------------------------------------------------------------
- # Window Width
- #--------------------------------------------------------------------------
- def window_width
- PM_Scene::Members_Window[2]
- end
- #--------------------------------------------------------------------------
- # Window Height
- #--------------------------------------------------------------------------
- def window_height
- PM_Scene::Members_Window[3]
- end
- #--------------------------------------------------------------------------
- # Alignment
- #--------------------------------------------------------------------------
- def alignment
- return 1
- end
- #--------------------------------------------------------------------------
- # Make Command List
- #--------------------------------------------------------------------------
- def make_command_list
- if $game_party.members.size <= 0
- add_command(PM_Scene::Texty[9],nil,false)
- else
- $game_party.members.each do |member|
- add_command(member.name, :on_member, can_assign_member(member), member.id)
- end
- end
- end
- #--------------------------------------------------------------------------
- # Enable/disable the member commands
- #--------------------------------------------------------------------------
- def can_assign_member(member)
- return false if member.actor_lock_in_party == true
- return true
- end
- #--------------------------------------------------------------------------
- # Refresh
- #--------------------------------------------------------------------------
- def refresh
- super
- if col_max > 1
- if index > item_max - 1
- cursor_left(true)
- end
- else
- if index > item_max - 1
- cursor_up(true)
- end
- end
- end
- #--------------------------------------------------------------------------
- # Draw Item
- #--------------------------------------------------------------------------
- def draw_item(index)
- contents.font.name = PM_Scene::Memb_Font[0]
- contents.font.size = PM_Scene::Memb_Font[1]
- super
- end
- #--------------------------------------------------------------------------
- # Process Ok
- #--------------------------------------------------------------------------
- def process_ok
- if current_item_enabled?
- Input.update
- deactivate
- call_ok_handler
- else
- Sound.play_buzzer
- end
- end
- end
- #==============================================================================
- # PM_Parties
- #------------------------------------------------------------------------------
- # Party Window(s) for the scene.
- #==============================================================================
- class PM_Parties < Window_HorzCommand
- #--------------------------------------------------------------------------
- # Initialize
- #--------------------------------------------------------------------------
- def initialize(party,index,size,locked_members)
- @new_party = party
- @index_par = index
- @size = size
- @locked_mems = locked_members
- xs = PM_Scene::Parties_Window[0]
- if @size <= PM_Scene::MaxPartyAtOnce && PM_Scene::DefaultDivide == true
- ys = @index_par * (PM_Scene::Parties_Window[3]/@size)
- else
- ys = @index_par * (PM_Scene::Parties_Window[3]/PM_Scene::MaxPartyAtOnce)
- end
- super(xs, ys)
- self.windowskin = Cache.system(PM_Scene::Parties_Window[4])
- end
- #--------------------------------------------------------------------------
- # * Window Width
- #--------------------------------------------------------------------------
- def window_width
- PM_Scene::Parties_Window[2]
- end
- #--------------------------------------------------------------------------
- # Window Height
- #--------------------------------------------------------------------------
- def window_height
- if @size <= PM_Scene::MaxPartyAtOnce && PM_Scene::DefaultDivide == true
- height = PM_Scene::Parties_Window[3]/@size
- if PM_Scene::Parties_Window[3] % @size != 0
- if @index_par == @size - 1
- height += (PM_Scene::Parties_Window[3] % @size)
- end
- end
- else
- height = PM_Scene::Parties_Window[3]/PM_Scene::MaxPartyAtOnce
- end
- return height
- end
- #--------------------------------------------------------------------------
- # Max Columns
- #--------------------------------------------------------------------------
- def col_max
- PM_Scene::Max_Colums
- end
- #--------------------------------------------------------------------------
- # Max Rows
- #--------------------------------------------------------------------------
- def row_max
- return 1
- end
- #--------------------------------------------------------------------------
- # Standard Padding
- #--------------------------------------------------------------------------
- def standard_padding
- return 0
- end
- #--------------------------------------------------------------------------
- # Bottom Padding
- #--------------------------------------------------------------------------
- def update_padding_bottom
- self.padding_bottom = padding
- end
- #--------------------------------------------------------------------------
- # Spacing
- #--------------------------------------------------------------------------
- def spacing
- return PM_Scene::Spacing
- end
- #--------------------------------------------------------------------------
- # Item Width
- #--------------------------------------------------------------------------
- def item_width
- (width - 24 + spacing) / col_max - spacing
- end
- #--------------------------------------------------------------------------
- # Item Height
- #--------------------------------------------------------------------------
- def item_height
- window_height
- end
- #--------------------------------------------------------------------------
- # Top Col
- #--------------------------------------------------------------------------
- def top_col=(col)
- self.ox = (col < 0 ? 0 : col) * (item_width + spacing)
- end
- #--------------------------------------------------------------------------
- # Item Rect
- #--------------------------------------------------------------------------
- def item_rect(index)
- if @new_party[1].size <= 0
- rect = Rect.new
- rect.width = item_width
- rect.height = PM_Scene::Cursor_Height
- rect.x = (window_width-rect.width)/2
- y_add = ((window_height-standard_padding*2-line_height*2)-rect.height)/2
- rect.y = (index / col_max * item_height) + 48 + y_add + PM_Scene::Cursor_Y_Offset
- rect
- else
- rect = Rect.new
- rect.width = item_width
- rect.height = PM_Scene::Cursor_Height
- rect.x = index * (item_width + spacing) + 12
- y_add = ((window_height-standard_padding*2-line_height*2)-rect.height)/2
- rect.y = 48 + y_add + PM_Scene::Cursor_Y_Offset
- rect
- end
- end
- #--------------------------------------------------------------------------
- # Make Command List
- #--------------------------------------------------------------------------
- def make_command_list
- if @new_party[1].size <= 0
- add_command(PM_Scene::Texty[9],nil,false)
- else
- @new_party[1].each do |id|
- if !$game_actors[id].nil?
- add_command($game_actors[id].name, :on_member_new, member_enabled?(id), id)
- end
- end
- end
- end
- #--------------------------------------------------------------------------
- # Member can be removed?
- #--------------------------------------------------------------------------
- def member_enabled?(id)
- return true if !id.nil? && !@locked_mems.include?(id)
- end
- #--------------------------------------------------------------------------
- # Draw Item
- #--------------------------------------------------------------------------
- def draw_item(index)
- contents.font.name = PM_Scene::Name_Font[0]
- contents.font.size = PM_Scene::Name_Font[1]
- if @new_party[1].size <= 0
- super
- else
- rect = item_rect_for_text(index)
- face_wh = PM_Scene::Face_Size
- rect_face = Rect.new(rect.x+(rect.width-face_wh)/2,rect.y+4,face_wh,face_wh)
- draw_icon_face($game_actors[@list[index][:ext]],rect_face,true)
- if @locked_mems.include?(@list[index][:ext])
- change_color(Color.new(*PM_Scene::Locked_Mem))
- else
- change_color(Color.new(*PM_Scene::Enable_Mem))
- end
- rect.y += (28+PM_Scene::Name_Y_Offset)
- draw_text(rect, command_name(index),1)
- end
- end
- #--------------------------------------------------------------------------
- # Refresh
- #--------------------------------------------------------------------------
- def refresh
- super
- if col_max > 1
- if index > item_max - 1
- cursor_left(true)
- end
- else
- if index > item_max - 1
- cursor_up(true)
- end
- end
- end
- #--------------------------------------------------------------------------
- # Process Ok
- #--------------------------------------------------------------------------
- def process_ok
- if current_item_enabled?
- Input.update
- deactivate
- call_ok_handler
- else
- Sound.play_buzzer
- end
- end
- end
- #==============================================================================
- # PM_Party_Select_Big
- #------------------------------------------------------------------------------
- # Party Selection Window for the scene.
- #==============================================================================
- class PM_Party_Select_Big < Window_Command
- #--------------------------------------------------------------------------
- # New Public Instance Variable
- #--------------------------------------------------------------------------
- attr_accessor :finish
- #--------------------------------------------------------------------------
- # Initialize
- #--------------------------------------------------------------------------
- def initialize(parties)
- @parties_new = parties
- @finish = false
- xs = PM_Scene::Parties_Window[0]
- ys = PM_Scene::Parties_Window[1]
- super(xs, ys)
- self.windowskin = Cache.system(PM_Scene::Parties_Window[5])
- self.opacity = 0
- deactivate
- end
- #--------------------------------------------------------------------------
- # Window Width
- #--------------------------------------------------------------------------
- def window_width
- PM_Scene::Parties_Window[2]
- end
- #--------------------------------------------------------------------------
- # Window Height
- #--------------------------------------------------------------------------
- def window_height
- if @parties_new.size <= PM_Scene::MaxPartyAtOnce && PM_Scene::DefaultDivide == true
- height = @parties_new.size * (PM_Scene::Parties_Window[3]/@parties_new.size) #PM_Scene::Parties_Window[3]
- if PM_Scene::Parties_Window[3] % @parties_new.size != 0
- height += (PM_Scene::Parties_Window[3] % @parties_new.size)
- end
- else
- height = @parties_new.size * (PM_Scene::Parties_Window[3]/PM_Scene::MaxPartyAtOnce)
- end
- return height
- end
- #--------------------------------------------------------------------------
- # Standard Padding
- #--------------------------------------------------------------------------
- def standard_padding
- return 0
- end
- #--------------------------------------------------------------------------
- # Bottom Padding
- #--------------------------------------------------------------------------
- def update_padding_bottom
- self.padding_bottom = padding
- end
- #--------------------------------------------------------------------------
- # * Cursor Movement Processing
- #--------------------------------------------------------------------------
- def process_cursor_move
- return unless cursor_movable?
- last_index = @index
- cursor_down (Input.trigger?(:DOWN)) if Input.trigger?(:DOWN)
- cursor_up (Input.trigger?(:UP)) if Input.trigger?(:UP)
- cursor_right(Input.trigger?(:RIGHT)) if Input.trigger?(:RIGHT)
- cursor_left (Input.trigger?(:LEFT)) if Input.trigger?(:LEFT)
- cursor_pagedown if !handle?(:pagedown) && Input.trigger?(:R)
- cursor_pageup if !handle?(:pageup) && Input.trigger?(:L)
- Sound.play_cursor if @index != last_index
- end
- #--------------------------------------------------------------------------
- # Item Rect
- #--------------------------------------------------------------------------
- def item_rect(index)
- rect = Rect.new
- rect.width = item_width - 24
- rect.height = window_height/item_max - 24
- rect.x = index % col_max * (item_width + spacing) + 12
- rect.y = (index / col_max * (rect.height+24)) + 12
- rect
- end
- #--------------------------------------------------------------------------
- # Make Command List
- #--------------------------------------------------------------------------
- def make_command_list
- @parties_new.each do |party|
- max_mem = party[3][1]
- current_mem = party[1].size
- add_command("",:on_location_ok,can_place(current_mem,max_mem))
- end
- end
- #--------------------------------------------------------------------------
- # Can Place
- #--------------------------------------------------------------------------
- def can_place(current_mem,max_mem)
- if current_mem < max_mem || @finish == true
- return true
- else
- return false
- end
- end
- #--------------------------------------------------------------------------
- # Draw Party Info
- #--------------------------------------------------------------------------
- def draw_item(index)
- rect = item_rect_for_text(index)
- contents.font.name = PM_Scene::Info_Font[0]
- contents.font.size = PM_Scene::Info_Font[1]
- rect.height = line_height
- @pid = @parties_new[index]
- @color_ok = Color.new(*PM_Scene::Min_Mem_OK)
- @color_no = Color.new(*PM_Scene::Min_Mem_NO)
- @color_sy = Color.new(*PM_Scene::Status_Col)
- @color_ye = Color.new(*PM_Scene::Party_Col)
- text1 = PM_Scene::Texty[8] + @pid[3][0].to_s
- text2 = PM_Scene::Texty[7] + @pid[1].size.to_s + " / " + @pid[3][1].to_s
- text3 = @pid[4]
- text4 = PM_Scene::Texty[6] + (index+1).to_s
- #custom text
- draw_text_ex_sixth12333(rect.x,rect.y,text3)
- #party index
- change_color(@color_ye)
- draw_text(rect,text4,1)
- #members required
- if @pid[1].size >= @pid[3][0]
- change_color(@color_ok)
- else
- change_color(@color_no)
- end
- draw_text(rect,text1,2)
- #current fill rate
- if @pid[1].size >= @pid[3][1]
- change_color(@color_no)
- else
- change_color(@color_sy)
- end
- rect.y += line_height
- draw_text(rect,text2,1)
- if @pid[1].size <= 0
- change_color(normal_color)
- contents.font.color.alpha = translucent_alpha
- rect = item_rect(index)
- rect.height -= line_height * 2
- rect.y += line_height*2
- draw_text(rect,PM_Scene::Texty[9],1)
- end
- change_color(normal_color)
- end
- #--------------------------------------------------------------------------
- # Process Ok
- #--------------------------------------------------------------------------
- def process_ok
- if current_item_enabled?
- Input.update
- deactivate
- call_ok_handler
- else
- Sound.play_buzzer
- end
- end
- end
- #==============================================================================
- # !!END OF SCRIPT!!
- #==============================================================================
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement