• Announcements

    • RagingHobo

      Forum Upgraded!   07/17/2017

      We have successfully upgraded our forum to the latest version! Some things have moved around but don't worry everything is still there, we still need to find updated versions of the plugins we were using previously to restore everything to the way it was. There will be a running topic in the Feedback and Support in case you notice something wrong. Before you do so please clear your browser cache and close your browser completely to rule out a caching issue. Thank you for your patience during the outage and while we get everything back to 150%  
Melosx

MSX - Scene_Menu MOD

37 posts in this topic

MSX - Scene_Menu MOD

 

Version: 2.0 Beta 1

Author: Melosx

Release Date: 6/1/12

 

Introduction

Edit the menu style. Rewrite the bars style in all the game, not only in the menu.

 

Screenshot

The screen is in italian.

 

 

rlx4ec.png

 

 

 

Script

 

#=============================================================================
# ** MSX - Scene_Menu MOD
#=============================================================================
# Author: Melosx
# Version: 2.0 Beta 1
# Release Date: 06-01-2012 => v1.0
#			   13-06-2012 => v2.0 Beta 1
#
#=============================================================================
# * Instructions
#-----------------------------------------------------------------------------
# Copy the script below Materials and above Main.
#
#=============================================================================
# * Rewrite
#-----------------------------------------------------------------------------
#
# Window_Base:
#
#		def draw_character
#		def draw_actor_graphic
#		def draw_gauge
#
#=============================================================================
# * Add
#-----------------------------------------------------------------------------
#
# Window_Base:
#
#		def draw_actor_exp_gauge
#
#==============================================================================



module MSX


#==============================================================================#
#=============================CONFIGURATION START==============================#
#==============================================================================#

 ACTIVE_MEMBERS = 4 # Default -> 4. Number ofactive member in menu.

 USE_GRAPHIC = true # true/false - Use/Not use graphic
 USE_FACE = true	# true/false - Use/Not use face.

 MAIN_X = 50 # General x coordinate
 MAIN_Y = 0 # General y coordinate


 # FACE

 FACE_X = 1 # Actor Face x coordinate
 FACE_Y = 1 # Actor Face y coordinate

 FACE_HEIGHT = 64 # Actor Face height


 # GRAPHIC

 GRAPHIC_X = 24 # Actor Graphic x coordinate
 GRAPHIC_Y = 52 # Actor Graphic y coordinate


 # GAUGE STYLE

 GAUGE_HEIGHT = 6 # HP/MP Gauge width
 GAUGE_BORDER = true # HP/MP Gauge Border


 # HP

 HP_X = 170 # Gauge x coordinate
 HP_Y = 20 # Gauge y coordinate

 HP_WIDTH = 130 # Gauge width

 HP_TYPE = 0 # 0 -> default; 1 -> center; 2 -> inverse;


 # MP

 MP_X = 175 # Gauge x coordinate
 MP_Y = 44 # Gauge y coordinate

 MP_WIDTH = 130 # Gauge width

 MP_TYPE = 0 # 0 -> default; 1 -> center; 2 -> inverse;


 # EXP

 EXP_GAUGE_X = 345 # Gauge x coordinate
 EXP_GAUGE_Y = 44 # Gauge y coordinate

 EXP_GAUGE_WIDTH = 90 # Gauge width
 EXP_GAUGE_HEIGHT = 6 # Gauge height

 EXP_INFO_X = 340 # Exp Info x coordinate
 EXP_INFO_Y = 18 # Exp Info y coordinate


 # NAME

 NAME_X = 0 # Name x coordinate
 NAME_Y = 0 # Name y coordinate


 # NICKNAME

 NICK_X = 0 # Nickname x coordinate
 NICK_Y = 20 # Nickname y coordinate


 # LEVEL

 LVL_X = 290 # Level x coordinate
 LVL_Y = 0 # Level y coordinate


 # CLASS

 CLASS_X = 100 # Class x coordinate
 CLASS_Y = 0 # Class y coordinate


 # STATE

 STATE_X = 50 # State x coordinate
 STATE_Y = 0 # State y coordinate
 STATE_NUMBER = 6 # Number of state


#==============================================================================#
#==============================CONFIGURATION END===============================#
#==============================================================================#
end


#==============================================================================
# ** Game_Party
#==============================================================================

class Game_Party < Game_Unit

 def menu_members
all_members[0, MSX::ACTIVE_MEMBERS].select {|actor| actor.exist? }
 end

end


#==============================================================================
# ** Scene_Menu
#==============================================================================
class Scene_Menu < Scene_MenuBase

 def start
super
create_command_window
create_gold_window
create_status_window
 end

 def create_gold_window
@gold_window = Window_MenuPlus_Horz.new
@gold_window.x = 0
@gold_window.y = Graphics.height - @gold_window.height
 end

 def create_status_window
@status_window = Window_MenuStatus.new(0, 48)
 end

end


#==============================================================================
# ** Window_MenuCommand
#==============================================================================
class Window_MenuCommand < Window_Command

 def initialize
super(0, 0)
self.contents.font.size = 16
select_last
 end

 def visible_line_number
return 1
 end

 def col_max
return 7
 end

 def spacing
return 4
 end

 def window_width
return 544
 end

 def window_height
return 48
 end

end



#==============================================================================
# ** Window_MenuStatus
#==============================================================================
class Window_MenuStatus < Window_Selectable
 attr_reader   :pending_index

 def initialize(x, y)
super(x, y, window_width, window_height)
self.contents.font.size = 16
@pending_index = -1
refresh
 end

 def window_width
544
 end

 def window_height
320
 end

 def draw_item(index)
actor = $game_party.members[index]
enabled = $game_party.menu_members.include?(actor)
rect = item_rect(index)
draw_item_background(index)
if MSX::USE_FACE
  draw_actor_menu_face(actor, rect.x + MSX::FACE_X, rect.y + MSX::FACE_Y, enabled)
  draw_actor_simple_status(actor, rect.x + MSX::MAIN_X, rect.y + MSX::MAIN_Y)
else
  draw_actor_simple_status(actor, rect.x + MSX::MAIN_X, rect.y + MSX::MAIN_Y)
end
if MSX::USE_GRAPHIC
  draw_actor_graphic(actor, MSX::GRAPHIC_X, rect.y + MSX::GRAPHIC_Y, enabled)
end
 end

 def draw_actor_simple_status(actor, x, y)
draw_actor_name(actor, x + MSX::NAME_X, y + MSX::NAME_Y)
draw_actor_nickname(actor, x + MSX::NICK_X, y + MSX::NICK_Y, 160)
draw_actor_level(actor, x + MSX::LVL_X, y + MSX::LVL_Y)
draw_actor_icons(actor, MSX::STATE_X, MSX::STATE_Y + line_height * 2, MSX::STATE_NUMBER * 24)
draw_actor_class(actor, x + MSX::CLASS_X, y + MSX::CLASS_Y)
draw_actor_hp(actor, x + MSX::HP_X, y + MSX::HP_Y, MSX::HP_WIDTH, MSX::HP_TYPE)
draw_actor_mp(actor, x + MSX::MP_X, y + MSX::MP_Y, MSX::MP_WIDTH, MSX::MP_TYPE)
draw_actor_exp_gauge(actor, x + MSX::EXP_GAUGE_X,  y + MSX::EXP_GAUGE_Y, MSX::EXP_GAUGE_WIDTH)
draw_exp_info(actor, x + MSX::EXP_INFO_X, y + MSX::EXP_INFO_Y)
 end

 def draw_actor_class(actor, x, y, width = 112)
change_color(system_color)
draw_text(x, y, 52, line_height, "Class:")
change_color(normal_color)
draw_text(x + 54, y, width, line_height, actor.class.name)
 end

 def draw_exp_info(actor, x, y)
self.contents.font.color = text_color(0)
if actor.level != 99
  s1 = actor.exp - actor.current_level_exp
  s2 = actor.next_level_exp - actor.current_level_exp
else
  s1 = "-"
  s2 = "-"
end
exp = s1.to_s + " / " + s2.to_s
change_color(system_color)
draw_text(x, y, 100, line_height, "Experience")
change_color(normal_color)
draw_text(x, y + 12, 100, line_height, exp, 2)
 end

end



#==============================================================================
# ** Window_Base
#==============================================================================
class Window_Base < Window

 def draw_menu_face(face_name, face_index, x, y, enabled = true)
bitmap = Cache.face(face_name)
rect = Rect.new(face_index % 4 * 96, face_index / 4 * 96, 96, MSX::FACE_HEIGHT)
contents.blt(x, y, bitmap, rect, enabled ? 255 : translucent_alpha)
bitmap.dispose
 end

 def draw_actor_menu_face(actor, x, y, enabled = true)
draw_menu_face(actor.face_name, actor.face_index, x, y, enabled)
 end

 def draw_character(character_name, character_index, x, y, enabled=true)
return unless character_name
bitmap = Cache.character(character_name)
sign = character_name[/^[\!\$]./]
if sign && sign.include?('$')
  cw = bitmap.width / 3
  ch = bitmap.height / 4
else
  cw = bitmap.width / 12
  ch = bitmap.height / 8
end
n = character_index
src_rect = Rect.new((n%4*3+1)*cw, (n/4*4)*ch, cw, ch)
contents.blt(x - cw / 2, y - ch, bitmap, src_rect, enabled ? 255 : translucent_alpha)
 end

 def draw_actor_graphic(actor, x, y, enabled=true)
draw_character(actor.character_name, actor.character_index, x, y, enabled)
 end

 def draw_gauge(x, y, width, rate, color1, color2, type = 0)
fill_w = (width * rate).to_i
gauge_y = y + line_height - 8
if MSX::GAUGE_BORDER
  contents.fill_rect(x - 2, gauge_y - 2, width + 4, MSX::GAUGE_HEIGHT + 4, gauge_back_color)
  contents.fill_rect(x - 1, gauge_y - 1, width + 2, MSX::GAUGE_HEIGHT + 2, normal_color)
end
case type
  when 0
	contents.fill_rect(x, gauge_y, width, MSX::GAUGE_HEIGHT, gauge_back_color)
	contents.gradient_fill_rect(x, gauge_y, fill_w, MSX::GAUGE_HEIGHT, color1, color2)
  when 1
	gr_x = x + (width - fill_w) / 2
	contents.fill_rect(x, gauge_y, width, MSX::GAUGE_HEIGHT, gauge_back_color)
	contents.gradient_fill_rect(gr_x, gauge_y, fill_w, MSX::GAUGE_HEIGHT, color1, color2)
  when 2
	gr_x = x + (width - fill_w)
	contents.fill_rect(x, gauge_y, width, MSX::GAUGE_HEIGHT, gauge_back_color)
	contents.gradient_fill_rect(gr_x, gauge_y, fill_w, MSX::GAUGE_HEIGHT, color1, color2)
end
 end

 def draw_actor_hp(actor, x, y, width = 124, type = 0)
draw_gauge(x, y, width, actor.hp_rate, hp_gauge_color1, hp_gauge_color2, type)
change_color(system_color)
draw_text(x, y, 30, line_height, Vocab::hp_a)
draw_current_and_max_values(x, y, width, actor.hp, actor.mhp,
  hp_color(actor), normal_color)
 end

 def draw_actor_mp(actor, x, y, width = 124, type = 0)
draw_gauge(x, y, width, actor.mp_rate, mp_gauge_color1, mp_gauge_color2, type)
change_color(system_color)
draw_text(x, y, 30, line_height, Vocab::mp_a)
draw_current_and_max_values(x, y, width, actor.mp, actor.mmp,
  mp_color(actor), normal_color)
 end

 def draw_actor_exp_gauge(actor, x, y, width = 100)
if actor.level != 99
  s1 = actor.exp - actor.current_level_exp
  s2 = actor.next_level_exp - actor.current_level_exp
  gw = width * s1 / s2
else
  gw = 0
end
gc1 = text_color(14)
gc2 = text_color(6)
self.contents.fill_rect(x - 1, y - 1, width + 4, MSX::EXP_GAUGE_HEIGHT + 4, gauge_back_color)
self.contents.fill_rect(x, y, width + 2, MSX::EXP_GAUGE_HEIGHT + 2, normal_color)
self.contents.fill_rect(x + 1, y + 1, width, MSX::EXP_GAUGE_HEIGHT, gauge_back_color)
self.contents.gradient_fill_rect(x + 1, y + 1, gw, MSX::EXP_GAUGE_HEIGHT, gc1, gc2)
 end

end



#==============================================================================
# ** Window_MenuPlus_Horz
#==============================================================================
class Window_MenuPlus_Horz < Window_Base

 def initialize
super(0, 0, window_width, fitting_height(1))
self.contents.font.size = 16
refresh
 end

 def update
super
sec = (Graphics.frame_count / Graphics.frame_rate) % 60
if sec > @total_sec % 60 or sec == 0
  refresh
end
 end

 def window_width
return 544
 end

 def refresh
contents.clear
draw_currency_value(value, currency_unit, 4, 0, 120)
draw_text(4, 0, 120, line_height, "Gold:", 0)
draw_text(195, 0, 120, line_height, "Steps:", 0)
draw_text(390, 0, 120, line_height, "Time:", 0)
change_color(normal_color)
draw_text(195, 0, 120, line_height, $game_party.steps, 2)
@total_sec = Graphics.frame_count / Graphics.frame_rate
ora = @total_sec / 60 / 60
min = @total_sec / 60 % 60
sec = @total_sec % 60
tempo = sprintf("%02d:%02d:%02d", ora, min, sec)
draw_text(390, 0, 120, line_height, tempo, 2)
 end

 def value
$game_party.gold
 end

 def currency_unit
Vocab::currency_unit
 end

 def open
refresh
super
 end

end

 

Edited by Melosx
Jun33, dbchest, Ally and 2 others like this

Share this post


Link to post
Share on other sites

Vey nice script, i love the menu screen :D

By the way, could you make an option to toggle between sprite or face?

Share this post


Link to post
Share on other sites

Hi,

 

I would to know how to change these please :

I want to be able to move the name and the charset also if possible I would like to know how to shrink the exp bar.

I've tried to move x and y but nothing changed.

 

969b0fe0b19d384938de7d7a3d626t.jpg

Share this post


Link to post
Share on other sites

for the name

in

draw_actor_name(actor, x, y)

 

add + n at x and y

draw_actor_name(actor, x + n, y + n)

 

for example

draw_actor_name(actor, x + 56, y + 22)

 

the same for other element

 

 

to shrink the exp bar in

def draw_actor_exp_gauge(actor, x, y, width = 100)

 

change 100...

Share this post


Link to post
Share on other sites

Thank you very much.

I like your menu and hope you will make more or upgrade this one.

 

EDIT :

Is it possible to remove or replace the MP bar when the character doesn't use MP but instead TP ?

Edited by Ruka

Share this post


Link to post
Share on other sites

Nice script but I got a bug.

Can you make a compatible patch with Ace save engine from Yanfly ? Because it makes the game crash if I use it with your menu but his script work fine with the default menu.

His script : link

 

The error I got

f82150d583043ac388cfae803e01dt.jpg

Share this post


Link to post
Share on other sites

Beautiful screen ... comes from your project?

@Chaos17: I've not this problem... Other script for the menu or for the save system cause this problem... Ok I've see this probloem... Now I fix it... ^.^

 

EDIT:

At line 156 of the menu script there is

def draw_actor_graphic(actor, x, y, enabled)

replace the line with

def draw_actor_graphic(actor, x, y, enabled=true)

Edited by Melosx
Chaos17 likes this

Share this post


Link to post
Share on other sites

Hey Melosx! I was wondering if you could help me a little a bit. In this screen:

 

 

2qt8leu.png

 

 

How do I grey-out the character face like the character sprite when not in the party? I can't seem to figure out how to edit it in your script.

Share this post


Link to post
Share on other sites

What can I do to make the faces appear like SuperNurse did ?

Will I have to cut the face to fit in the menu ?

Share this post


Link to post
Share on other sites

how to install this script sorry im new here. please help :(

Copy-paste it between Material and Main.

 

How do you add the faces?

I would like to know it too.

Edited by Chaos17

Share this post


Link to post
Share on other sites

I would like to help with the face but does not seem fair to SuperNurse, who has done this by himself... Observe the code of the window where are the face and find the line that shows the face. Copy the line in the script of the menu and change it. Do not be afraid to make trouble in the script ^.^

Share this post


Link to post
Share on other sites

I would like to help with the face but does not seem fair to SuperNurse, who has done this by himself... Observe the code of the window where are the face and find the line that shows the face. Copy the line in the script of the menu and change it. Do not be afraid to make trouble in the script ^.^

 

Well some people aren't adept at looking at code and just telling them the method would help as well when they are more adept at graphics or something to get back to what they excel at..

Share this post


Link to post
Share on other sites

I've added this in and so far I've seen no errors nor bugs to truly report.

I've also noticed that this works rather well with Yanfly's menu script.

Though I want to know one thing, does this work with say a large party?

IE if you have say 10 members[5 in 5 off]?

Edited by Xigos The Xelor Sandglass

Share this post


Link to post
Share on other sites

I've added this in and so far I've seen no errors nor bugs to truly report.

I've also noticed that this works rather well with Yanfly's menu script.

Though I want to know one thing, does this work with say a large party?

IE if you have say 10 members[5 in 5 off]?

 

Hey there. After fiddling with the script I realized there's a "col_max" definition under "Window_MenuCommand" that defines how many uh... I don't know the technical terms, so i'm going to say "Options" are visible at a time before having to scroll, while looking at the item/equip/quit menu. And when you hit that max, you can then press the down arrow and find the rest. The scrolling works with the actors too, so if you have 5 actors, it will push the top one out and bring up the 5th actor. This is done a bit different than the above window, because if you have 7 "Options" for the items/equip/etc menu, and your col_max is set to 4, then after you hit the down key on your keyboard, you'll replace the first 4 with the remaining 3.

 

I am NOT at all a ruby scripter, but from what I could see, I couldn't see where the 4 party member limit was defined, maybe it's innate RMVXA setting? Don't quote me, i'm probably wrong.

 

Hope this helps at all.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now

  • Recently Browsing   0 members

    No registered users viewing this page.