How do I add icons to the menu, like in StormTronics?
This should explain what everything is. Just remember opacity is optional.
self.contents.blt(x, y, src_bitmap, src_rect[, opacity])
If you don't want to set it's opacity, just do it this way.
self.contents.blt(x, y, src_bitmap, src_rect)
For src_bitmap, it would look similar to this
bitmap = RPG::Cache.graphic_type("050-Skill07")
The graphic_type would be the folders inside your project's Graphics folder. For example, RPG::Cache.battler would try to call the graphic you specify from Graphics/Battler.
side note:.blt is a block transfer method inside the Bitmap class.
I'd have replied sooner but I only recently got back from traveling today.
Thanks, I'll try it out in a few minutes to see if it works.
Where do you put those?
I'm using a 3-person CMS made by a friend...
When I put those lines into the script underneath the commands like this:
s2 = "Skills"
self.contents.blt(x, y, src_bitmap, src_rect)
bitmap = RPG::Cache.graphic_type("050-Skill07")
I get this error when I try opening up the menu:
????? 'Scene_Menu' ? 14 ??? NoMethodError ????????
undefined method 'contents' for # <Scene_Menu:0x7125a78>
What am I doing wrong? Is there a problem with the script? Am I putting the lines in the wrong place?
I actually haven't tried it yet (what can I say? I'm a shirker), but I would think that you would put them either below the area for the windows in the menu, or more likely at the bottom of the script.
I don't entirely understand that
If I put them at the bottom of the script i'd have to make another class or something along those lines wouldn't I?
And where's below the area for the windows in the menu?
(I also tried it with the default CMS and it comes up with the same error)
The area for the windows is the first part of the script, where you said you put them before, but below that. I really don't know what to tell ya, I'm just learning to script, and I've only made an edit of the DMS so far.
The script pieces I posted are used inside window's class. Since I've got a little bit of free time, I'll break down how a window works and how to use the script pieces I posted. It's a bit much to take in all at once so you might want to read part of it and then finish the rest later.
This is the standard MenuStatus window from the vanilla(unaltered) database. The only time a window class inherits from Window_Selectable is when the window will be used as an interface, like the actor window in the default menu.
class Window_MenuStatus < Window_Selectable
def initialize
super(0, 0, 480, 480)
self.contents = Bitmap.new(width - 32, height - 32)
self.contents.font.name = $defaultfonttype
self.contents.font.size = $defaultfontsize
refresh
self.active = false
self.index = -1
end
def refresh
self.contents.clear
@item_max = $game_party.actors.size
for i in 0...$game_party.actors.size
x = 64
y = i * 116
actor = $game_party.actors[i]
draw_actor_graphic(actor, x - 40, y + 80)
draw_actor_name(actor, x, y)
draw_actor_class(actor, x + 144, y)
draw_actor_level(actor, x, y + 32)
draw_actor_state(actor, x + 90, y + 32)
draw_actor_exp(actor, x, y + 64)
draw_actor_hp(actor, x + 236, y + 32)
draw_actor_sp(actor, x + 236, y + 64)
end
end
def update_cursor_rect
if @index < 0
self.cursor_rect.empty
else
self.cursor_rect.set(0, @index * 116, self.width - 32, 96)
end
end
end
def initializeObviously, the start of the method.Like the method name suggests, this is what is done when the window is created inside a scene. Read the notes inside here for a bit by bit break down on how the first method works.
super(0, 0, 480, 480)super(x, y, width, height)
self.contents = Bitmap.new(width - 32, height - 32)This creates the bitmap everything is put on. It is one of the FIRST things you should do after using super to set the windows dimensions and such.
self.contents.font.name = $defaultfonttype
self.contents.font.size = $defaultfontsize#Main cause of the "I can't see the text" issue. Any time I do a CMS or project that uses windows, I tend to define $defaultfontsize and $defaultfonttype at the top of the script to ensure that there are no "I can't see text!" issues.
refreshThis calls the method refresh.
self.active = falseIf this isn't the main command window of the scene, then you probably want this set to false. The only time you define this is when the window inherits from Window_Selectable.
self.index = -1#Window_Selectable removes the window selection bracket on this window if the index is -1.
endEnd of the method. When using "if" statements and such, it is wise to leave a comment stating which of your end syntax is used to end what syntax like I did below.
def method_name
if foo == bar
do_something
end#of if foo == bar
endCompletely unrelated but still useful to know. If you are checking to see if two variables are the same or equal to each other, you want to use == instead of = since a lone equal sign is quite often interpreted as "Let's store this variable in this one!" even when it's clearly a conditional branch. I was quite frustrated with conditional branches until someone pointed this out to me.
Remember those script pieces I posted in this thread back in March? This is where they'd go. I don't look at other peoples scripts very often any more but this is where I put EVERYTHING that shows up in a window.
def refreshObviously, defines the method name.
self.contents.clearClears the bitmap of everything.
@item_max = $game_party.actors.sizeStores the number of party members you have in @item_max.
for i in 0...$game_party.actors.sizefor 0(zero) to maximum number of party members you have. For a full party, "i" would be 0, 1, 2, and 3. You'll see what I mean in just a moment. Although...Enterbrain COULD have "for i in 0...@item_max"...
x = 64Stores 64 in x.
y = i * 116y = i * 116 is basically the same as below.
y1 = 0 * 116 #means the same as y1 = 0
y2 = 1 * 116 #means the same as y2 = 116
y3 = 2 * 116 #means the same as y3 = 232
y4 = 3 * 116 #means the same as y4 = 348
The "for" syntax eliminates the need for defining several variables that are used for the same task. You'll plenty more examples of this in a moment and how important what we just stored in y is as well as how i plays into it.
actor = $game_party.actors[i]This stores each actor of the party in the variable actor. This is passed on to the methods in Window_Base that make up the things displayed in a window.
draw_actor_graphic(actor, x - 40, y + 80)
draw_actor_name(actor, x, y)
draw_actor_class(actor, x + 144, y)
draw_actor_level(actor, x, y + 32)
draw_actor_state(actor, x + 90, y + 32)
draw_actor_exp(actor, x, y + 64)
draw_actor_hp(actor, x + 236, y + 32)
draw_actor_sp(actor, x + 236, y + 64)
Would you like to have to call each of those methods four(4) times? No? Well, this is why the "for" syntax is useful. It cuts down on the amount of variables and lines you use. The best way to learn how to use the "for" syntax is by using it. Actually, the the best way to learn anything in RGSS is by trying it out...or so it was for me but every one is different. Just remember that more lines=more lag generated. RGSS isn't a compiled language so it requires a bit more processing power to convert the scripts into a form that the computer can understand and process.
end#of "for i"
end#of refreshRemember what I said about noting your "end" syntax? It helps you remember which "end" syntax is for the other syntax
To use the script pieces I posted way back in March, you'd do something like this. Just remember that the width and height variables are defined in "initialize" the moment you use "super".
class Window < Window_Base
def initialize
super(x, y, width, height)
self.contents = Bitmap.new(width, height)
refresh
end#of initialize
def refresh
self.contents.clear
bitmap = RPG::Cache.icon("034-Item03")
self.contents.blt(100, 4, bitmap, Rect.new(0, 0, 24, 24))
end#of refresh
end#of class
I attached three of the CMS's I've made that I actually like but the All-in-One-Menu I did for Trenzor was a bitch to get working. The menu I did for Chibidestiny requires a small faceset inside a folder called "Faces" inside the Character folder. Just use a black or white picture scaled 66X66. I uploaded the three menus in .txt file format because they're small and quick d/ls even for 56k users as well as easy on my hard drive space. These are for your learning purposes mainly.
Oh, I see now.
I can't get my icons in the right place...
Basically it's a case of the icons going in the wrong window >.<... I think...
Should I post the script I am using and see if you can tell me what do do?
Post the script and tell me what window you want the icons to be in.
[spoiler=Scene_Menu]
This script is originally found on hbgames.org... just thought you ought to know...
#===================
#Dark Ruby's
#CMS
#v1.0
#===================
class Scene_Menu
def initialize(menu_index = 0)
@menu_index = menu_index
end
def main
@spriteset = Spriteset_Map.new
s1 = "Items"
s2 = "Skills"
s3 = "Equip"
s4 = "Status"
s5 = "Bestiary"
s6 = "Party"
s7 = "Save"
s8 = "End Game"
@command_window = Window_Command.new(480, [s1, s2, s3, s4, s5, s6, s7, s8], 4)
@command_window.x = 120
@command_window.y = 32
@command_window.back_opacity = 160
@command_window.index = @menu_index
@status_window = Window_MenuStatus.new
@status_window.y = 128
@status_window.back_opacity = 160
@steps_window = Window_Steps.new
@steps_window.x = 480
@steps_window.y = 128
@steps_window.back_opacity = 160
@playtime_window = Window_PlayTime.new
@playtime_window.y = 224
@playtime_window.x = 480
@playtime_window.back_opacity = 160
@gold_window = Window_Gold.new
@gold_window.x = 480
@gold_window.y = 320
@gold_window.back_opacity = 160
if $game_party.actors.size == 0
@command_window.disable_item(0)
@command_window.disable_item(1)
@command_window.disable_item(2)
@command_window.disable_item(3)
end
if $game_system.save_disabled
@command_window.disable_item(6)
end
Graphics.transition
loop do
Graphics.update
Input.update
update
if $scene != self
break
end
end
Graphics.freeze
@command_window.dispose
@status_window.dispose
@playtime_window.dispose
@steps_window.dispose
@gold_window.dispose
@spriteset.dispose
end
end
def update
@spriteset.update
@command_window.update
@gold_window.update
@steps_window.update
@playtime_window.update
@status_window.update
if @command_window.active
update_command
return
end
if @status_window.active
update_status
return
end
end
def update_command
if Input.trigger?(Input::B)
$game_system.se_play($data_system.cancel_se)
$scene = Scene_Map.new
end
if Input.trigger?(Input::C)
case @command_window.index
when 0
$game_system.se_play($data_system.decision_se)
$scene = Scene_Item.new
when 1
$game_system.se_play($data_system.decision_se)
@command_window.active = false
@status_window.active = true
@status_window.index = 0
when 2
$game_system.se_play($data_system.decision_se)
@command_window.active = false
@status_window.active = true
@status_window.index = 0
when 3
$game_system.se_play($data_system.decision_se)
@command_window.active = false
@status_window.active = true
@status_window.index = 0
when 4
$game_system.se_play($data_system.decision_se)
$scene = Scene_MonsterBook.new
when 5
$game_system.se_play($data_system.decision_se)
$scene = Scene_PartySwitcher.new
when 6
if $game_system.save_disabled
$game_system.se_play($data_system.buzzer_se)
return
end
$game_system.se_play($data_system.decision_se)
$scene = Scene_Savepoint.new
when 7
$game_system.se_play($data_system.decision_se)
$scene = Scene_End.new
end
end
def update_status
if Input.trigger?(Input::B)
$game_system.se_play($data_system.cancel_se)
@command_window.active = true
@status_window.active = false
@status_window.index = -1
return
end
if Input.trigger?(Input::C)
case @command_window.index
when 1
if $game_party.actors[@status_window.index].restriction >= 2
$game_system.se_play($data_system.buzzer_se)
return
end
$game_system.se_play($data_system.decision_se)
$scene = Scene_Skill.new(@status_window.index)
when 2
$game_system.se_play($data_system.decision_se)
$scene = Scene_Equip.new(@status_window.index)
when 3
$game_system.se_play($data_system.decision_se)
$scene = Scene_Status.new(@status_window.index)
end
return
end
end
end
[/spoiler]
I want the icons to appear next to the menu commands left or right
[EDIT]
You need this to get it to work...
[spoiler=Window_Command2]
#==============================================================================
# ¦ Window_Command
#------------------------------------------------------------------------------
# ?????????????????????
#==============================================================================
class Window_Command < Window_Selectable
#--------------------------------------------------------------------------
# ? ?????????
# width : ???????
# commands : ??????????
#--------------------------------------------------------------------------
def initialize(width, commands, column_max = 1, style = 0, inf_scroll = 1)
# ????????????????????
super(0, 0, width, (commands.size * 1.0 / column_max).ceil * 32 + 32)
@inf_scroll = inf_scroll
@item_max = commands.size
@commands = commands
@column_max = column_max
@style = style
self.contents = Bitmap.new(width - 32, (@item_max * 1.0 / @column_max).ceil * 32)
self.contents.font.name = "Arial"
self.contents.font.size = 24
refresh
self.index = 0
end
#--------------------------------------------------------------------------
# ? ??????
#--------------------------------------------------------------------------
def refresh
self.contents.clear
for i in 0...@item_max
draw_item(i, normal_color)
end
end
#--------------------------------------------------------------------------
# ? ?????
# index : ????
# color : ???
#--------------------------------------------------------------------------
def draw_item(index, color)
self.contents.font.color = color
rect = Rect.new(index%@column_max * (self.width / @column_max) + 4, 32 * (index/@column_max), self.width / @column_max - 40, 32)
self.contents.fill_rect(rect, Color.new(0, 0, 0, 0))
self.contents.draw_text(rect, @commands[index], @style)
end
#--------------------------------------------------------------------------
# ? ??????
# index : ????
#--------------------------------------------------------------------------
def disable_item(index)
draw_item(index, disabled_color)
end
def update_help
@help_window.set_actor($game_party.actors[$scene.actor_index])
end
end[/spoiler]
I just took a look at the menu and I'm going to take a guess that the "Bestiary" and "Party" options were added by you because "Bestiary" takes me to the save screen and Party takes me to the end game screen. Menus are a cinch for me to do so I can link the "Bestiary" and "Party" menu commands to the proper scripts if you want me to. It won't take me too long to add icons to the command window either way though.
Hold on for a while... i'm learning how to script and i'm thinking of making my own CMS :-\
I'll post again when i'm done... or when I fail :D
Got ya. Jumping in the puddle feet first is how I learned! ^_^;
I thought i'd wait a bit before I make something from scratch... so I just did a bit of editing :D
It works! :D
[spoiler=Scene_Menu]
#===================
#Dark Ruby's
#CMS
#v1.0
#===================
#++++++++++++++++++#
# Edited by #
# Rune #
#++++++++++++++++++#
class Scene_Menu
def initialize(menu_index = 0)
@menu_index = menu_index
end
def main
@spriteset = Spriteset_Map.new
s1 = $data_system.words.item
s2 = $data_system.words.skill
s3 = $data_system.words.equip
s4 = "Status"
s5 = "Bestiary"
s6 = "Party"
s7 = "Save"
s8 = "End Game"
@command_window = Window_Command.new(160, [s1, s2, s3, s4, s5, s6, s7, s8])
@command_window.x = 480
@command_window.y = 0
@command_window.back_opacity = 255
@command_window.index = @menu_index
@status_window = Window_MenuStatus.new
@status_window.y = 0
@status_window.back_opacity = 255
@steps_window = Window_Steps.new
@steps_window.x = 480
@steps_window.y = 384
@steps_window.back_opacity = 255
@playtime_window = Window_PlayTime.new
@playtime_window.y = 384
@playtime_window.x = 320
@playtime_window.back_opacity = 255
@gold_window = Window_Gold.new
@gold_window.x = 160
@gold_window.y = 416
@gold_window.back_opacity = 255
@healcost_window = Window_HealCost.new
@healcost_window.x = 480
@healcost_window.y = 288
@healcost_window.back_opacity = 255
if $game_party.actors.size == 0
@command_window.disable_item(0)
@command_window.disable_item(1)
@command_window.disable_item(2)
@command_window.disable_item(3)
end
if $game_system.save_disabled
@command_window.disable_item(6)
end
Graphics.transition
loop do
Graphics.update
Input.update
update
if $scene != self
break
end
end
Graphics.freeze
@command_window.dispose
@status_window.dispose
@playtime_window.dispose
@steps_window.dispose
@gold_window.dispose
@spriteset.dispose
@healcost_window.dispose
end
end
def update
@spriteset.update
@command_window.update
@gold_window.update
@steps_window.update
@playtime_window.update
@status_window.update
@healcost_window.update
if @command_window.active
update_command
return
end
if @status_window.active
update_status
return
end
end
def update_command
if Input.trigger?(Input::B)
$game_system.se_play($data_system.cancel_se)
$scene = Scene_Map.new
end
if Input.trigger?(Input::C)
case @command_window.index
when 0
$game_system.se_play($data_system.decision_se)
$scene = Scene_Item.new
when 1
$game_system.se_play($data_system.decision_se)
@command_window.active = false
@status_window.active = true
@status_window.index = 0
when 2
$game_system.se_play($data_system.decision_se)
@command_window.active = false
@status_window.active = true
@status_window.index = 0
when 3
$game_system.se_play($data_system.decision_se)
@command_window.active = false
@status_window.active = true
@status_window.index = 0
when 4
$game_system.se_play($data_system.decision_se)
$scene = Scene_MonsterBook.new
when 5
$game_system.se_play($data_system.decision_se)
$scene = Scene_PartySwitcher.new
when 6
if $game_system.save_disabled
$game_system.se_play($data_system.buzzer_se)
return
end
$game_system.se_play($data_system.decision_se)
$scene = Scene_Save.new
when 7
$game_system.se_play($data_system.decision_se)
$scene = Scene_End.new
end
end
def update_status
if Input.trigger?(Input::B)
$game_system.se_play($data_system.cancel_se)
@command_window.active = true
@status_window.active = false
@status_window.index = -1
return
end
if Input.trigger?(Input::C)
case @command_window.index
when 1
if $game_party.actors[@status_window.index].restriction >= 2
$game_system.se_play($data_system.buzzer_se)
return
end
$game_system.se_play($data_system.decision_se)
$scene = Scene_Skill.new(@status_window.index)
when 2
$game_system.se_play($data_system.decision_se)
$scene = Scene_Equip.new(@status_window.index)
when 3
$game_system.se_play($data_system.decision_se)
$scene = Scene_Status.new(@status_window.index)
end
return
end
end
end[/spoiler]
Quote from: Shinami on May 02, 2007, 04:51:03 AM
I just took a look at the menu and I'm going to take a guess that the "Bestiary" and "Party" options were added by you because "Bestiary" takes me to the save screen and Party takes me to the end game screen. Menus are a cinch for me to do so I can link the "Bestiary" and "Party" menu commands to the proper scripts if you want me to. It won't take me too long to add icons to the command window either way though.
They should already link to the right scenes... well... they do for me...
If you need the scripts then here they are...
[spoiler=Scene_MonsterBook]
This NEEDS to be called Scene_MonsterBook
#????
#
#????????????????(???????????)????????
#?????????????????????????????
#???????????
#??????????????????????????
#(class Scene_Battle ? start_phase5 ????????)
#
#????????????????????????
#???????????????????????(????????)
#Window_MonsterBook_Info ? DROP_ITEM_NEED_ANALYZE ? true ???????
#????????????????????????? false ??????????
#
#??
#????????????????????1??
#???????????????????
#???????
#1.???????????????1??????????????
#2.Game_Enemy_Book ? ?super(1, 0)#???? ??????????
# ????????ID???????
#???????????
#
#2005.2.6 ????
#?????????????
#SHOW_COMPLETE_TYPE ????????
#?????????????????
#$game_party.enemy_book_max ????????(???)
#$game_party.enemy_book_now ?????????(???)
#$game_party.complete_percentage ???????(??????)
#????????
#
#2005.2.17
#complete_percentage???????
#enemy_book_complete_percentage???(?????????????)
#???????????????????????????????????????
#enemy_book_max ????????(???)
#enemy_book_now ?????????(???)
#enemy_book_comp???????(??????)
#
#2005.2.18 ????
#complete_percentage???????
#enemy_book_complete_percentage???????
#complete_percentage???????????(????????????)
#
#2005.7.4 ????
#??????????
#?????????????
#
#2005.7.4 ????
#?????????
module Enemy_Book_Config
#???????????????????????
DROP_ITEM_NEED_ANALYZE = false
#???????
EVA_NAME = "EVA"
#??????????
#0:???? 1:???/??? 2:??? 3:??
SHOW_COMPLETE_TYPE = 3
#?????????????(???????????????)
COMMENT_SYSTEM = false
end
class Game_Temp
attr_accessor :enemy_book_data
alias temp_enemy_book_data_initialize initialize
def initialize
temp_enemy_book_data_initialize
@enemy_book_data = Data_MonsterBook.new
end
end
class Game_Party
attr_accessor :enemy_info # ???????(???)
#--------------------------------------------------------------------------
# ? ?????????
#--------------------------------------------------------------------------
alias book_info_initialize initialize
def initialize
book_info_initialize
@enemy_info = {}
end
#--------------------------------------------------------------------------
# ? ?????????(???)
# type : ??????????? 0:?? 1:????? -1:????
# 0:??? 1:??? 2:??????
#--------------------------------------------------------------------------
def add_enemy_info(enemy_id, type = 0)
case type
when 0
if @enemy_info[enemy_id] == 2
return false
end
@enemy_info[enemy_id] = 1
when 1
@enemy_info[enemy_id] = 2
when -1
@enemy_info[enemy_id] = 0
end
end
#--------------------------------------------------------------------------
# ? ?????????????
#--------------------------------------------------------------------------
def enemy_book_max
return $game_temp.enemy_book_data.id_data.size - 1
end
#--------------------------------------------------------------------------
# ? ?????????????
#--------------------------------------------------------------------------
def enemy_book_now
now_enemy_info = @enemy_info.keys
# ???????ID???
no_add = $game_temp.enemy_book_data.no_add_element
new_enemy_info = []
for i in now_enemy_info
enemy = $data_enemies[i]
next if enemy.name == ""
if enemy.element_ranks[no_add] == 1
next
end
new_enemy_info.push(enemy.id)
end
return new_enemy_info.size
end
#--------------------------------------------------------------------------
# ? ???????????
end
class Interpreter
def enemy_book_max
return $game_party.enemy_book_max
end
def enemy_book_now
return $game_party.enemy_book_now
end
def enemy_book_comp
return $game_party.enemy_book_complete_percentage
end
end
class Scene_Battle
alias add_enemy_info_start_phase5 start_phase5
def start_phase5
for enemy in $game_troop.enemies
# ??????????????
unless enemy.hidden
# ???????
$game_party.add_enemy_info(enemy.id, 0)
end
end
add_enemy_info_start_phase5
end
end
class Window_Base < Window
#--------------------------------------------------------------------------
# ? ?????????????????
#--------------------------------------------------------------------------
def draw_enemy_drop_item(enemy, x, y)
self.contents.font.color = normal_color
treasures = []
if enemy.item_id > 0
treasures.push($data_items[enemy.item_id])
end
if enemy.weapon_id > 0
treasures.push($data_weapons[enemy.weapon_id])
end
if enemy.armor_id > 0
treasures.push($data_armors[enemy.armor_id])
end
# ?????????1?????
if treasures.size > 0
item = treasures[0]
bitmap = RPG::Cache.icon(item.icon_name)
opacity = 255
self.contents.blt(x, y + 4, bitmap, Rect.new(0, 0, 24, 24), opacity)
name = treasures[0].name
else
self.contents.font.color = normal_color
name = "No Item"
end
self.contents.draw_text(x+28, y, 212, 32, name)
end
#--------------------------------------------------------------------------
# ? ???????ID???
#--------------------------------------------------------------------------
def draw_enemy_book_id(enemy, x, y)
self.contents.font.color = normal_color
id = $game_temp.enemy_book_data.id_data.index(enemy.id)
self.contents.draw_text(x, y, 32, 32, id.to_s)
end
#--------------------------------------------------------------------------
# ? ??????????
# enemy : ????
# x : ??? X ??
# y : ??? Y ??
#--------------------------------------------------------------------------
def draw_enemy_name(enemy, x, y)
self.contents.font.color = normal_color
self.contents.draw_text(x, y, 152, 32, enemy.name)
end
#--------------------------------------------------------------------------
# ? ?????????????(?????)
# enemy : ????
# x : ??? X ??
# y : ??? Y ??
#--------------------------------------------------------------------------
def draw_enemy_graphic(enemy, x, y, opacity = 160)
bitmap = RPG::Cache.battler(enemy.battler_name, enemy.battler_hue)
cw = bitmap.width
ch = bitmap.height
src_rect = Rect.new(0, 0, cw, ch)
x = x + (cw / 2 - x) if cw / 2 > x
self.contents.blt(x - cw / 2, y - ch, bitmap, src_rect, opacity)
end
#--------------------------------------------------------------------------
# ? ???????EXP???
# enemy : ????
# x : ??? X ??
# y : ??? Y ??
#--------------------------------------------------------------------------
def draw_enemy_exp(enemy, x, y)
self.contents.font.color = system_color
self.contents.draw_text(x, y, 120, 32, "EXP")
self.contents.font.color = normal_color
self.contents.draw_text(x + 120, y, 36, 32, enemy.exp.to_s, 2)
end
#--------------------------------------------------------------------------
# ? ???????GOLD???
# enemy : ????
# x : ??? X ??
# y : ??? Y ??
#--------------------------------------------------------------------------
def draw_enemy_gold(enemy, x, y)
self.contents.font.color = system_color
self.contents.draw_text(x, y, 120, 32, $data_system.words.gold)
self.contents.font.color = normal_color
self.contents.draw_text(x + 120, y, 36, 32, enemy.gold.to_s, 2)
end
end
class Game_Enemy_Book < Game_Enemy
#--------------------------------------------------------------------------
# ? ?????????
#--------------------------------------------------------------------------
def initialize(enemy_id)
super(1, 0)#???
@enemy_id = enemy_id
enemy = $data_enemies[@enemy_id]
@battler_name = enemy.battler_name
@battler_hue = enemy.battler_hue
@hp = maxhp
@sp = maxsp
end
end
class Data_MonsterBook
attr_reader :id_data
#--------------------------------------------------------------------------
# ? ?????????
#--------------------------------------------------------------------------
def initialize
@id_data = enemy_book_id_set
end
#--------------------------------------------------------------------------
# ? ???????????
#--------------------------------------------------------------------------
def no_add_element
no_add = 0
# ???????ID???
for i in 1...$data_system.elements.size
if $data_system.elements[i] =~ /??????/
no_add = i
break
end
end
return no_add
end
#--------------------------------------------------------------------------
# ? ????ID??
#--------------------------------------------------------------------------
def enemy_book_id_set
data = [0]
no_add = no_add_element
# ???????ID???
for i in 1...$data_enemies.size
enemy = $data_enemies[i]
next if enemy.name == ""
if enemy.element_ranks[no_add] == 1
next
end
data.push(enemy.id)
end
return data
end
end
class Window_MonsterBook < Window_Selectable
attr_reader :data
#--------------------------------------------------------------------------
# ? ?????????
#--------------------------------------------------------------------------
def initialize(index=0)
super(0, 64, 640, 416)
@column_max = 2
@book_data = $game_temp.enemy_book_data
@data = @book_data.id_data.dup
@data.shift
#@data.sort!
@item_max = @data.size
self.index = 0
refresh if @item_max > 0
end
#--------------------------------------------------------------------------
# ? ????????
#--------------------------------------------------------------------------
def data_set
data = $game_party.enemy_info.keys
data.sort!
newdata = []
for i in data
next if $game_party.enemy_info[i] == 0
# ?????????
if book_id(i) != nil
newdata.push(i)
end
end
return newdata
end
#--------------------------------------------------------------------------
# ? ??????
#--------------------------------------------------------------------------
def show?(id)
if $game_party.enemy_info[id] == 0 or $game_party.enemy_info[id] == nil
return false
else
return true
end
end
#--------------------------------------------------------------------------
# ? ???ID??
#--------------------------------------------------------------------------
def book_id(id)
return @book_data.index(id)
end
#--------------------------------------------------------------------------
# ? ??????
#--------------------------------------------------------------------------
def item
return @data[self.index]
end
#--------------------------------------------------------------------------
# ? ??????
#--------------------------------------------------------------------------
def refresh
if self.contents != nil
self.contents.dispose
self.contents = nil
end
self.contents = Bitmap.new(width - 32, row_max * 32)
#???? 0 ??????????????????????
if @item_max > 0
for i in 0...@item_max
draw_item(i)
end
end
end
#--------------------------------------------------------------------------
# ? ?????
# index : ????
#--------------------------------------------------------------------------
def draw_item(index)
enemy = $data_enemies[@data[index]]
return if enemy == nil
x = 4 + index % 2 * (288 + 32)
y = index / 2 * 32
rect = Rect.new(x, y, self.width / @column_max - 32, 32)
self.contents.fill_rect(rect, Color.new(0, 0, 0, 0))
self.contents.font.color = normal_color
draw_enemy_book_id(enemy, x, y)
if show?(enemy.id)
self.contents.draw_text(x + 28+16, y, 212, 32, enemy.name, 0)
else
self.contents.draw_text(x + 28+16, y, 212, 32, "?????", 0)
return
end
if analyze?(@data[index])
self.contents.font.color = text_color(3)
self.contents.draw_text(x + 256, y, 24, 32, "?", 2)
end
end
#--------------------------------------------------------------------------
# ? ??????????
#--------------------------------------------------------------------------
def analyze?(enemy_id)
if $game_party.enemy_info[enemy_id] == 2
return true
else
return false
end
end
end
class Window_MonsterBook_Info < Window_Base
#--------------------------------------------------------------------------
# ? ?????????
#--------------------------------------------------------------------------
def initialize
super(0, 0+64, 640, 480-64)
self.contents = Bitmap.new(width - 32, height - 32)
end
#--------------------------------------------------------------------------
# ? ??????
#--------------------------------------------------------------------------
def refresh(enemy_id)
self.contents.clear
self.contents.font.size = 22
enemy = Game_Enemy_Book.new(enemy_id)
draw_enemy_graphic(enemy, 96, 240+48+64, 200)
draw_enemy_book_id(enemy, 4, 0)
draw_enemy_name(enemy, 48, 0)
draw_actor_hp(enemy, 288, 0)
draw_actor_sp(enemy, 288+160, 0)
draw_actor_parameter(enemy, 288 , 32, 0)
self.contents.font.color = system_color
self.contents.draw_text(288, 256, 120, 32, Enemy_Book_Config::EVA_NAME)
self.contents.font.color = normal_color
self.contents.draw_text(288+ 120, 256, 36, 32, enemy.eva.to_s, 2)
draw_actor_parameter(enemy, 288 , 64, 3)
draw_actor_parameter(enemy, 288 , 96, 4)
draw_actor_parameter(enemy, 288 , 128, 5)
draw_actor_parameter(enemy, 288 , 160, 6)
draw_actor_parameter(enemy, 288 , 192, 1)
draw_actor_parameter(enemy, 288 , 224, 2)
draw_enemy_exp(enemy, 288, 320)
draw_enemy_gold(enemy, 288, 288)
if analyze?(enemy.id) or !Enemy_Book_Config::DROP_ITEM_NEED_ANALYZE
self.contents.font.color = system_color
self.contents.draw_text(288+ 192, 96, 92, 32, "Drop Item")
draw_enemy_drop_item(enemy, 288+ 165, 128)
#draw_element_guard(enemy, 320-32, 160-16+96)
end
end
#--------------------------------------------------------------------------
# ? ??????????
#--------------------------------------------------------------------------
def analyze?(enemy_id)
if $game_party.enemy_info[enemy_id] == 2
return true
else
return false
end
end
end
class Scene_MonsterBook
#--------------------------------------------------------------------------
# ? ?????
#--------------------------------------------------------------------------
def main
$game_temp.enemy_book_data = Data_MonsterBook.new
# ????????
@title_window = Window_Base.new(0, 0, 640, 64)
@title_window.contents = Bitmap.new(640 - 32, 64 - 32)
@title_window.contents.draw_text(4, 0, 320, 32, "Monster Information", 0)
@main_window = Window_MonsterBook.new
@main_window.active = true
# ???????????? (?????????????)
@info_window = Window_MonsterBook_Info.new
@info_window.z = 110
@info_window.visible = false
@info_window.active = false
@visible_index = 0
if Enemy_Book_Config::COMMENT_SYSTEM
# ???????????? (?????????????)
@comment_window = Window_Monster_Book_Comment.new
@comment_window.z = 120
@comment_window.visible = false
@comment_on = false # ???????
end
# ?????????
Graphics.transition
# ??????
loop do
# ????????
Graphics.update
# ???????
Input.update
# ??????
update
# ????????????????
if $scene != self
break
end
end
# ?????????
Graphics.freeze
# ????????
@main_window.dispose
@info_window.dispose
@title_window.dispose
@comment_window.dispose if @comment_window != nil
end
#--------------------------------------------------------------------------
# ? ??????
#--------------------------------------------------------------------------
def update
# ????????
@main_window.update
@info_window.update
if @info_window.active
update_info
return
end
# ?????????????????: update_target ???
if @main_window.active
update_main
return
end
end
#--------------------------------------------------------------------------
# ? ?????? (?????????????????)
#--------------------------------------------------------------------------
def update_main
# B ??????????
if Input.trigger?(Input::B)
# ????? SE ???
$game_system.se_play($data_system.cancel_se)
$scene = Scene_Menu.new(4)
return
end
# C ??????????
if Input.trigger?(Input::C)
if @main_window.item == nil or @main_window.show?(@main_window.item) == false
# ??? SE ???
$game_system.se_play($data_system.buzzer_se)
return
end
# ?? SE ???
$game_system.se_play($data_system.decision_se)
@main_window.active = false
@info_window.active = true
@info_window.visible = true
@visible_index = @main_window.index
@info_window.refresh(@main_window.item)
if @comment_window != nil
@comment_window.refresh(@main_window.item)
if @comment_on
@comment_window.visible = true
else
@comment_window.visible = false
end
end
return
end
end
#--------------------------------------------------------------------------
# ? ?????? (??????????????????)
#--------------------------------------------------------------------------
def update_info
# B ??????????
if Input.trigger?(Input::B)
# ????? SE ???
$game_system.se_play($data_system.cancel_se)
@main_window.active = true
@info_window.active = false
@info_window.visible = false
@comment_window.visible = false if @comment_window != nil
return
end
# C ??????????
if Input.trigger?(Input::C)
if @comment_window != nil
# ?? SE ???
$game_system.se_play($data_system.decision_se)
if @comment_on
@comment_on = false
@comment_window.visible = false
else
@comment_on = true
@comment_window.visible = true
end
return
end
end
if Input.trigger?(Input::L)
# ?? SE ???
$game_system.se_play($data_system.decision_se)
loop_end = false
while loop_end == false
if @visible_index != 0
@visible_index -= 1
else
@visible_index = @main_window.data.size - 1
end
loop_end = true if @main_window.show?(@main_window.data[@visible_index])
end
id = @main_window.data[@visible_index]
@info_window.refresh(id)
@comment_window.refresh(id) if @comment_window != nil
return
end
if Input.trigger?(Input::R)
# ?? SE ???
$game_system.se_play($data_system.decision_se)
loop_end = false
while loop_end == false
if @visible_index != @main_window.data.size - 1
@visible_index += 1
else
@visible_index = 0
end
loop_end = true if @main_window.show?(@main_window.data[@visible_index])
end
id = @main_window.data[@visible_index]
@info_window.refresh(id)
@comment_window.refresh(id) if @comment_window != nil
return
end
end
end[/spoiler]
Sorry for double post... the other script wouldn't fit on the last post XD
[spoiler=Scene_PartySwitcher]
Again NEEDS to be called Scene_PartySwitcher
#==============================================================================
# Easy Party Switcher by Blizzard
# Version 1.7b
# Date: 21.05.2006
# Date v1.1: 25.05.2006
# Date v1.2b: 27.05.2006
# Date v1.5b: 3.11.2006
# Date v1.51b: 29.11.2006
# Date v1.52b: 6.12.2006
# Date v1.7b: 23.2.2007
#
#
# Special Thanks to:
# Zeriab for pointing out a few glitches and shortening the code. =D
#
#
# IMPORTANT NOTE:
#
# Be sure to set the MAX_PARTY to the maximum size of your party.
# There is already a preconfiguration of 4.
#
#
# Compatibility:
#
# 99% chance of full compatibility with SDK, not tested altough. Can cause
# incompatibility with Party Change Systems. WILL corrupt your old savegames.
#
#
# Features:
#
# - set party members for "not _available" (shown transparent in the reserve)
# - remove party members from the reserve list ("disabled_for_party")
# - set party members, who MUST be in the party (shown transparent in the
# current party, "must_be_in_party")
# - option either to wipe the party (for multi-party use) or only remove every
# member (except 1) from the party.
# - easy to use and easy to switch party members
# - also supports small parties (2 or 3 members) and large parties (5 or more)
#
# v1.5b:
#
# - better, shorter and more efficient code (less memory use, less CPU use)
# - fixed potential bugs
#
# v1.7b:
#
# - improved coding
# - facesets now optional
# - no extra bitmap files needed anymore
# - works now with Tons of Add-ons
#
#
# How to use:
#
# To call this script, make a "Call script" command in an event. The syntax is:
#
# $scene = Scene_PartySwitcher.new
# or
# $scene = Scene_PartySwitcher.new(XXX)
# or
# $scene = Scene_PartySwitcher.new(XXX, 1)
# or
# $scene = Scene_PartySwitcher.new(XXX, YYY, ZZZ)
#
# - If you use the first syntax, no extra feature will be applied and you can
# switch the party as you wish.
# - If you use the second syntax, you can replace XXX for 1 to remove all party
# members except one (either one, who must be in the party or a random one), or
# replace XXX with 2, to cause a wipe party. Wiping a party will disable the
# of the current members and a NEW party of the remaining members must be
# formed. If you replace it with 3, the current party configuration will be
# stored for a later fast switch-back.
# - If you use the third sytnax, you can use the XXX as described above or just
# set it to 0 to disable it. Also the "1" in the syntax will reset any
# disabled_for_party and is made to be used after multi-party use.
# - If you use the fourth syntax you can replace ZZZ with 1 to replace the
# party with a stored one AND store the current or replace it with 2 to replace
# the party with a stored one, but without storing the current. USE THIS ONLY
# IF YOU ASSUME TO HAVE A STORED PARTY READY! You can simply test if there is
# a store party by putting this code into the conditional branch script:
#
# $game_system.stored_party != nil
#
# This syntax will not open the Party Switcher and it will override the
# commands XXX and YYY, so you can replace these with any number.
#
# Character faces go into the "Characters" folder and they have the same name
# as the character spritesets have with _face added.
#
# Example:
#
# sprite - Marlen.png
# face - Marlen_face.png
#
#
# Other syntaxes:
# $game_actors[ID].not_available = true/false
# $game_actors[ID].disabled_for_party = true/false
# $game_actors[ID].must_be_in_party = true/false
# OR
# $game_party.actors[POS].not_available = true/false
# $game_party.actors[POS].disabled_for_party = true/false
# $game_party.actors[POS].must_be_in_party = true/false
#
# ID - the actor's ID in the database
# POS - the actor's position in the party (STARTS FROM 0, not 1!)
#
# - not_available will disable the possibility of an already unlocked character
# to be in the current party.
# - disabled for party will cause the character NOT to appear in the party
# switch screen.
# - must_be_in_party will cause the character to be automatically moved into
# the current party, while switching parties and also he cannot be put in the
# reserve.
#
#
# Additional note:
#
# For your own sake, do not apply the attribute "must_be_in_party" to a
# character at the same time with "not_available" or "disabled_for_party" as
# this WILL disrupt your party and party switch system.
#
#
# If you find any bugs, please report them here:
# http://www.chaosproject.co.nr/
# or send me an e-mail:
# boris_blizzard@yahoo.de
#==============================================================================
#::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
# START Conficuration
#::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
# how many party members do you use
MAX_PARTY = 3
# set to true to use facesets instead of spritesets
FACESETS = false
#::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
# END Conficuration
#::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
#==============================================================================
# Game_Actor
#==============================================================================
class Game_Actor < Game_Battler
attr_accessor :must_be_in_party
attr_accessor :disabled_for_party
attr_accessor :not_available
alias setup_eps_later setup
def setup(actor_id)
setup_eps_later(actor_id)
@must_be_in_party = false
@disabled_for_party = false
@not_available = false
end
end
#==============================================================================
# Game_System
#==============================================================================
class Game_System
attr_accessor :stored_party
end
#==============================================================================
# Game_Party
#==============================================================================
class Game_Party
attr_accessor :actors
end
#==============================================================================
# Window_Current
#==============================================================================
class Window_Current < Window_Selectable
def initialize
if MAX_PARTY > 4
super(0, 0, 240 + 32, 480)
else
super(0, 0, 240 + 32, MAX_PARTY * 120)
end
@item_max = MAX_PARTY
self.contents = Bitmap.new(width - 32, 480 - 32 + (@item_max - 4) * 120)
if $fontface != nil
self.contents.font.name = $fontface
elsif $defaultfonttype != nil
self.contents.font.name = $defaultfonttype
end
self.contents.font.size = 24
refresh
self.active = false
self.index = -1
end
def refresh
self.contents.clear
for i in 0...$game_party.actors.size
x = 0
y = i * 120 - 4
actor = $game_party.actors[i]
self.contents.font.color = normal_color
if actor != nil
draw_actor_graphic(actor, x, y + 8)
draw_actor_name(actor, x + 160, y)
draw_actor_level(actor, x + 96, y)
draw_actor_hp(actor, x + 96, y + 32)
draw_actor_sp(actor, x + 96, y + 64)
end
end
end
def setactor(index_1, index_2)
temp = $game_party.actors[index_1]
$game_party.actors[index_1] = $game_party.actors[index_2]
$game_party.actors[index_2] = temp
refresh
end
def getactor(index)
return $game_actors[$game_party.actors[index].id]
end
def update_cursor_rect
if @index < 0
self.cursor_rect.empty
return
end
row = @index / @column_max
if row < self.top_row
self.top_row = row
end
if row > self.top_row + (self.page_row_max - 1)
self.top_row = row - (self.page_row_max - 1)
end
x = 0
y = (@index / @column_max) * 120 - self.oy
self.cursor_rect.set(x, y, self.width - 32, 88)
end
def clone_cursor
row = @index / @column_max
if row < self.top_row
self.top_row = row
end
if row > self.top_row + (self.page_row_max - 1)
self.top_row = row - (self.page_row_max - 1)
end
x = 0
y = (@index / @column_max) * 120
src_rect = Rect.new(0, 0, self.width, 88)
bitmap = Bitmap.new(self.width-32, 88)
bitmap.fill_rect(0, 0, self.width-32, 88, Color.new(255, 255, 255, 192))
bitmap.fill_rect(2, 2, self.width-36, 84, Color.new(255, 255, 255, 80))
self.contents.blt(x, y, bitmap, src_rect, 192)
end
def top_row
return self.oy / 116
end
def top_row=(row)
row = row % row_max
self.oy = row * 120
end
def page_row_max
return (self.height / 120)
end
end
#==============================================================================
# Window_Reserve
#==============================================================================
class Window_Reserve < Window_Selectable
def initialize
super(0, 0, 400 - 32, 320)
setup
@column_max = 3
if (@item_max / @column_max) >= 3
self.contents = Bitmap.new(width - 32, @item_max / @column_max * 96)
else
self.contents = Bitmap.new(width - 32, height - 32)
end
if $fontface != nil
self.contents.font.name = $fontface
elsif $defaultfonttype != nil
self.contents.font.name = $defaultfonttype
end
self.contents.font.size = 24
self.active = false
self.index = -1
refresh
end
def setup
@actors = []
for i in 1...$data_actors.size
unless $game_party.actors.include?($game_actors[i])
unless $game_actors[i] == nil or $game_actors[i].disabled_for_party
@actors.push($game_actors[i])
end
end
end
@item_max = (@actors.size + $game_party.actors.size + 3) / 3 * 3
end
def refresh
self.contents.clear
for i in 0... @actors.size
draw_face(i)
end
end
def draw_face(i)
x = (i % 3) * 112 + 16
y = (i / 3) * 96 - 8
self.contents.font.color = normal_color
draw_actor_graphic(@actors[i], x, y + 18)
end
def getactor(index)
return @actors[index]
end
def setactor(index_1, index_2)
temp = @actors[index_1]
@actors[index_1] = @actors[index_2]
@actors[index_2] = temp
refresh
end
def setparty(index_1, index_2)
temp = @actors[index_1]
@actors[index_1] = $game_party.actors[index_2]
$game_party.actors[index_2] = temp
refresh
end
def update_cursor_rect
if @index < 0
self.cursor_rect.empty
return
end
row = @index / @column_max
if row < self.top_row
self.top_row = row
end
if row > self.top_row + (self.page_row_max - 1)
self.top_row = row - (self.page_row_max - 1)
end
x = (@index % @column_max) * 112 + 8
y = (@index / @column_max) * 96 - self.oy
self.cursor_rect.set(x, y, 96, 96)
end
def clone_cursor
row = @index / @column_max
if row < self.top_row
self.top_row = row
end
if row > self.top_row + (self.page_row_max - 1)
self.top_row = row - (self.page_row_max - 1)
end
x = (@index % @column_max) * 112 + 8
y = (@index / @column_max) * 96
src_rect = Rect.new(0, 0, 96, 96)
bitmap = Bitmap.new(96, 96)
bitmap.fill_rect(0, 0, 96, 96, Color.new(255, 255, 255, 192))
bitmap.fill_rect(2, 2, 92, 92, Color.new(255, 255, 255, 80))
self.contents.blt(x, y, bitmap, src_rect, 192)
end
def top_row
return self.oy / 96
end
def top_row=(row)
row = row % row_max
self.oy = row * 96
end
def page_row_max
return (self.height - 32) / 96
end
end
#==============================================================================
# Window_HelpStatus
#==============================================================================
class Window_HelpStatus < Window_Base
def initialize(gotactor)
super(0, 0, 400 - 32, 160)
self.contents = Bitmap.new(width - 32, height - 32)
if $fontface != nil
self.contents.font.name = $fontface
elsif $defaultfonttype != nil
self.contents.font.name = $defaultfonttype
end
self.contents.font.size = 24
refresh(gotactor)
self.active = false
end
def refresh(actor)
self.contents.clear
if actor != nil
x = 0
y = 0
self.contents.font.color = normal_color
if actor.not_available
self.contents.draw_text(x + 8, y, 160, 32, "not available", 0)
end
draw_actor_graphic(actor, x, y + 40)
draw_actor_name(actor, x + 160, y + 32)
draw_actor_level(actor, x + 96, y + 32)
draw_actor_hp(actor, x + 96, y + 64)
draw_actor_sp(actor, x + 96, y + 96)
end
end
end
#==============================================================================
# Window_Base
#==============================================================================
WINS = [Window_Current, Window_Reserve, Window_HelpStatus]
class Window_Base
alias draw_actor_graphic_eps_later draw_actor_graphic
def draw_actor_graphic(actor, x, y)
if actor != nil and actor.character_name != ""
if FACESETS and WINS.include?(self.class)
draw_actor_face_eps(actor, x, y)
else
if WINS.include?(self.class)
bitmap = RPG::Cache.character(actor.character_name, actor.character_hue)
x += bitmap.width / 8 + 24
y += bitmap.height / 4 + 16
end
draw_actor_graphic_eps_later(actor, x, y)
end
end
end
def draw_actor_face_eps(actor, x, y)
if $tons_version == nil or $tons_version < 3.71 or not FACE_HUE
hue = 0
else
hue = (FACE_HUE ? actor.character_hue : 0)
end
bitmap = RPG::Cache.character("#{actor.character_name}_face", hue)
src_rect = Rect.new(0, 0, bitmap.width, bitmap.height)
if actor.not_available or actor.must_be_in_party
self.contents.blt(x, y, bitmap, src_rect, 128)
else
self.contents.blt(x, y, bitmap, src_rect)
end
end
end
#==============================================================================
# Window_Warning
#==============================================================================
class Window_Warning < Window_Base
def initialize
super(0, 0, 320, 96)
self.visible = false
self.contents = Bitmap.new(width - 32, height - 32)
if $fontface != nil
self.contents.font.name = $fontface
elsif $defaultfonttype != nil
self.contents.font.name = $defaultfonttype
end
self.contents.font.size = 24
self.x = 320 - (width / 2)
self.y = 240 - (height / 2)
self.z = 9999
self.contents.font.color = normal_color
self.contents.draw_text(0, 0, 288, 32, "You cannot remove", 1)
self.contents.draw_text(0, 32, 288, 32, "the last party member!", 1)
end
end
#==============================================================================
# Scene_PartySwitcher
#==============================================================================
class Scene_PartySwitcher
def initialize(wipe_party = 0, reset = 0, store = 0)
@wipe_party = wipe_party
@store = store
@reset = reset
@current_window_temp = 0
@reserve_window_temp = 0
@scene_flag = false
@temp_window = ""
end
def main
if @store != 0
swap_parties
$scene = Scene_Map.new
$game_player.refresh
return
end
case @wipe_party
when 1 then setup_forced_party
when 2 then wipe_party
when 3
$game_system.stored_party = $game_party.actors
wipe_party
end
if @reset == 1
for i in 1...$data_actors.size
$game_actors[i].not_available = false
end
end
@current_window = Window_Current.new
@current_window.index = 0
@current_window.active = true
@reserve_window = Window_Reserve.new
@reserve_window.x = 240 + 32
@reserve_window.y = 160
@warning_window = Window_Warning.new
@help_window = Window_HelpStatus.new(@reserve_window.getactor(0))
@help_window.x = 240 + 32
Graphics.transition
loop do
Graphics.update
Input.update
update
break if $scene != self
end
Graphics.freeze
@current_window.dispose
@reserve_window.dispose
@help_window.dispose
$game_party.actors.compact!
$game_player.refresh
end
def update
check = @reserve_window.index
if @reserve_window.active
reserve_update
@reserve_window.update
end
if check != @reserve_window.index
if @reserve_window.active
actor = @reserve_window.getactor(@reserve_window.index)
elsif @current_window.active
actor = @reserve_window.getactor(@reserve_window_temp)
end
if @temp_window == "Current" or @temp_window == ""
@help_window.refresh(actor)
end
end
if @current_window.active
current_update
@current_window.update
end
if Input.trigger?(Input::B)
$game_system.se_play($data_system.cancel_se)
unless @scene_flag
$scene = Scene_Menu.new(5)
else
@temp_window = ""
@scene_flag = false
if @reserve_window.active
actor = @reserve_window.getactor(@reserve_window.index)
elsif @current_window.active
actor = @reserve_window.getactor(@reserve_window_temp)
end
if @temp_window == "Current" or @temp_window == ""
@help_window.refresh(actor)
end
@current_window.refresh
@reserve_window.refresh
end
return
end
if Input.trigger?(Input::A)
$game_party.actors.compact!
@current_window.refresh
end
end
def current_update
if Input.trigger?(Input::C)
unless @scene_flag
$game_system.se_play($data_system.decision_se)
@scene_flag = true
@temp_actor_index = @current_window.index
@temp_window = "Current"
@current_window.clone_cursor
else
switch_members
end
return
end
if Input.trigger?(Input::RIGHT)
$game_system.se_play($data_system.cursor_se)
@current_window.active = false
@reserve_window.active = true
@current_window_temp = @current_window.index
actor = @reserve_window.getactor(@reserve_window_temp)
@current_window.index = -1
@reserve_window.index = @reserve_window_temp
@help_window.refresh(actor) unless @scene_flag
return
end
end
def reserve_update
if Input.trigger?(Input::C)
unless @scene_flag
$game_system.se_play($data_system.decision_se)
@scene_flag = true
@temp_actor_index = @reserve_window.index
@temp_window = "Reserve"
@reserve_window.clone_cursor
else
switch_members
end
return
end
if (@reserve_window.index % 3) == 0
if Input.repeat?(Input::LEFT)
$game_system.se_play($data_system.cursor_se)
@reserve_window.active = false
@current_window.active = true
@reserve_window_temp = @reserve_window.index
@reserve_window.index = -1
@current_window.index = @current_window_temp
end
end
end
def switch_members
if @temp_window == "Reserve" and @reserve_window.active
@reserve_window.setactor(@temp_actor_index, @reserve_window.index)
actor = @reserve_window.getactor(@reserve_window.index)
@help_window.refresh(actor)
end
if @temp_window == "Current" and @current_window.active
@current_window.setactor(@temp_actor_index, @current_window.index)
end
if @temp_window == "Reserve" and @current_window.active
actor1 = @current_window.getactor(@current_window.index)
actor2 = @reserve_window.getactor(@temp_actor_index)
if call_warning(@current_window.index, actor2)
if actor1 != nil and actor1.must_be_in_party
$game_system.se_play($data_system.buzzer_se)
@scene_flag = false
@temp_window = ""
actor = @reserve_window.getactor(@reserve_window_temp)
@current_window.refresh
@reserve_window.refresh
@help_window.refresh(actor)
return
end
if actor2 != nil and actor2.not_available
$game_system.se_play($data_system.buzzer_se)
@scene_flag = false
@temp_window = ""
actor = @reserve_window.getactor(@reserve_window_temp)
@current_window.refresh
@reserve_window.refresh
@help_window.refresh(actor)
return
end
@reserve_window.setparty(@temp_actor_index, @current_window.index)
@current_window.refresh
actor = @reserve_window.getactor(@reserve_window_temp)
@help_window.refresh(actor)
else
warning
end
end
if @temp_window == "Current" and @reserve_window.active
actor1 = @current_window.getactor(@temp_actor_index)
actor2 = @reserve_window.getactor(@reserve_window.index)
if call_warning(@temp_actor_index, actor2)
if actor1 != nil and actor1.must_be_in_party
$game_system.se_play($data_system.buzzer_se)
@scene_flag = false
@temp_window = ""
actor = @reserve_window.getactor(@reserve_window.index)
@current_window.refresh
@reserve_window.refresh
@help_window.refresh(actor)
return
end
if actor2 != nil and actor2.not_available
$game_system.se_play($data_system.buzzer_se)
@scene_flag = false
@temp_window = ""
actor = @reserve_window.getactor(@reserve_window.index)
@current_window.refresh
@reserve_window.refresh
@help_window.refresh(actor)
return
end
@reserve_window.setparty(@reserve_window.index, @temp_actor_index)
@current_window.refresh
actor = @reserve_window.getactor(@reserve_window.index)
@help_window.refresh(actor)
else
warning
end
end
$game_system.se_play($data_system.decision_se)
@scene_flag = false
@temp_window = ""
return
end
def wipe_party
for i in 0...$game_party.actors.size
$game_party.actors[i].not_available = true if $game_party.actors[i] != nil
end
$game_party.actors = []
for i in 1...$data_actors.size
actor = $game_actors[i]
if actor != nil and actor.must_be_in_party and not actor.not_available
$game_party.actors[$game_party.actors.size] = actor
end
end
if $game_party.actors == []
for i in 1...$data_actors.size
actor = $game_actors[i]
unless actor == nil or actor.not_available or actor.disabled_for_party
$game_party.actors[$game_party.actors.size] = actor
return
end
end
end
end
def setup_forced_party
$game_party.actors = []
for i in 1...$data_actors.size
actor = $game_actors[i]
if actor != nil and actor.must_be_in_party and
not actor.disabled_for_party and not actor.not_available
$game_party.actors[$game_party.actors.size] = actor
end
end
end
def swap_parties
$game_party.actors.compact!
temp_actors = $game_party.actors
for actor in temp_actors
actor.not_available = true
end
$game_system.stored_party.compact!
for actor in $game_system.stored_party
actor.not_available = false
end
$game_party.actors = $game_system.stored_party
$game_system.stored_party = nil
$game_system.stored_party = temp_actors if @store == 1
end
def call_warning(index, actor2)
actor1 = $game_party.actors[index]
if actor1 != nil and actor2 == nil
count = 0
for actor in $game_party.actors
count += 1 unless actor == nil
end
return false if count <= 1
end
return true
end
def warning
$game_system.se_play($data_system.buzzer_se)
@warning_window.visible = true
loop do
Graphics.update
Input.update
if Input.trigger?(Input::C)
@warning_window.visible = false
@current_window.refresh
@reserve_window.refresh
break
end
end
return
end
end
[/spoiler]
[EDIT]
I just remembered... you'll need this too
[spoiler=Window_HealCost]
Must be called Window_HealCost
class Window_HealCost < Window_Base
def initialize
super(420, 288, 160, 96)
self.contents = Bitmap.new(width - 32, height - 32)
refresh
end
def refresh
@price = $game_variables[7]
self.contents.clear
self.contents.font.color = system_color
self.contents.font.size = 24
self.contents.draw_text(0, 0, 128, 32, "Heal Cost: ")
self.contents.font.color = normal_color
self.contents.draw_text(0, 32, 128, 32, @price.to_s, 1)
self.contents.font.color = system_color
self.contents.draw_text(86, 32, 128, 32, $data_system.words.gold)
end
end
[/spoiler]
I made it myself :D
You done yet? :)
Um... sorry if you've already started on that other CMS... i'm using a different one now... sorry >.<'
[spoiler]#+++++++++++++++++++++++++++++++#
# Rune's CMS #
# Ver 0.1 #
#+++++++++++++++++++++++++++++++#
class Scene_Menu
def initialize(menu_index = 0)
@menu_index = menu_index
end
def main
@spriteset = Spriteset_Map.new
s1 = "Items"
s2 = "Skills"
s3 = "Equip"
s4 = "Status"
s5 = "Bestiary"
s6 = "Party"
s7 = "Save"
s8 = "Quit"
@status_window = Window_MenuStatus.new
@status_window.x = 80
@status_window.y = 64
@status_window.opacity = 160
@command_window = Window_Command.new(640, [s1, s2, s3, s4, s5, s6, s7, s8], 8)
@command_window.x = 0
@command_window.y = 0
@command_window.opacity = 255
@command_window.index = @menu_index
@steps_window = Window_Steps.new
@steps_window.x = 0
@steps_window.y = 394
@steps_window.opacity = 255
if $game_party.actors.size == 0
@command_window.disable_item(0)
@command_window.disable_item(1)
@command_window.disable_item(2)
@command_window.disable_item(3)
end
if $game_system.save_disabled
@command_window.disable_item(6)
@command_window.disable_item(5)
end
Graphics.transition
loop do
Graphics.update
Input.update
update
if $scene != self
break
end
end
Graphics.freeze
@command_window.dispose
@status_window.dispose
@steps_window.dispose
@spriteset.dispose
end
end
def update
@spriteset.update
@command_window.update
@status_window.update
@steps_window.update
if @command_window.active
update_command
return
end
if @status_window.active
update_status
return
end
end
def update_command
if Input.trigger?(Input::B)
$game_system.se_play($data_system.cancel_se)
$scene = Scene_Map.new
end
if Input.trigger?(Input::C)
case @command_window.index
when 0
$game_system.se_play($data_system.decision_se)
$scene = Scene_Item.new
when 1
$game_system.se_play($data_system.decision_se)
@command_window.active = false
@status_window.active = true
@status_window.index = 0
when 2
$game_system.se_play($data_system.decision_se)
@command_window.active = false
@status_window.active = true
@status_window.index = 0
when 3
$game_system.se_play($data_system.decision_se)
@command_window.active = false
@status_window.active = true
@status_window.index = 0
when 4
$game_system.se_play($data_system.decision_se)
$scene = Scene_MonsterBook.new
when 5
if $game_system.save_disabled
$game_system.se_play($data_system.buzzer_se)
return
end
$game_system.se_play($data_system.decision_se)
$scene = Scene_PartySwitcher.new
when 6
if $game_system.save_disabled
$game_system.se_play($data_system.buzzer_se)
return
end
$game_system.se_play($data_system.decision_se)
$scene = Scene_Savepoint.new
when 7
$game_system.se_play($data_system.decision_se)
$scene = Scene_End.new
end
end
def update_status
if Input.trigger?(Input::B)
$game_system.se_play($data_system.cancel_se)
@command_window.active = true
@status_window.active = false
@status_window.index = -1
return
end
if Input.trigger?(Input::C)
case @command_window.index
when 1
if $game_party.actors[@status_window.index].restriction >= 2
$game_system.se_play($data_system.buzzer_se)
return
end
$game_system.se_play($data_system.decision_se)
$scene = Scene_Skill.new(@status_window.index)
when 2
$game_system.se_play($data_system.decision_se)
$scene = Scene_Equip.new(@status_window.index)
when 3
$game_system.se_play($data_system.decision_se)
$scene = Scene_Status.new(@status_window.index)
end
return
end
end
end
[/spoiler]