Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- =begin
- ===============================================================================
- Reorder Skills
- Author: Zero_G
- Version: RGSS3
- ===============================================================================
- == Description ==
- This script will let you reorder skills acording to priority. The higer the
- priority the higher in the skill list a skill will appear.
- Use by setting <Sort Priority: X> on a skill note tag
- ex: <Sort Priority: 2>
- A skill that has no priority set will behave the same as normal
- == Terms of Use ==
- - Free for use in non-commercial projects with credits
- - Free for use in commercial projects
- - Please provide credits to Zero_G
- == Usage ==
- Just add the plugin before main.
- -------------------------------------------------------------------------------
- =end
- module ZERO_SKILL_PRIORITY
- # Set a custom text before a skill name for a specific priority
- MODIFY = true
- PRIORITY = "2"
- TEXT = "[W] "
- def self.getPriority(item)
- regExp = /<Sort\s*Priority\s*:\s*(\d+)\s*>/i
- return $1 if regExp =~ item.note
- return 0
- end
- end
- if ZERO_SKILL_PRIORITY::MODIFY
- module DataManager
- class << self
- alias :zero_load_database :load_database
- def load_database
- zero_load_database
- $data_skills.each { |item|
- next if item.nil?
- if ZERO_SKILL_PRIORITY.getPriority(item) == ZERO_SKILL_PRIORITY::PRIORITY
- item.name = ZERO_SKILL_PRIORITY::TEXT + item.name
- end
- }
- end
- end
- end
- end
- class Window_SkillList < Window_Selectable
- alias zero_make_item_list make_item_list
- def make_item_list
- zero_make_item_list
- @data.sort! { |a,b|
- ZERO_SKILL_PRIORITY.getPriority(b).to_i <=> ZERO_SKILL_PRIORITY.getPriority(a).to_i
- }
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement