I've been looking for a way to change the font colors on menu and sub-menu items, but only while the cursor is positioned on it (the pic is for reference). I'm currently using Yami Basic Module, mjshi Non-Combat Menu, and I have looked at some cursor scripts (like Moghunter's and Yanfly's) to see if any could do what I want to no avail, could someone help?
VXAce Change menu font color on hover
RGSSx Script SupportHello,
I coed a very naive script for you, it will replace any text with the default color (white) inside the cell that you select with color TEXT_SELECTED_COLOR_ID (a parameter of the script).
I observed that it does not modify the text color of the save file menu (because its structure is different), do you want this to change?
Also, this will also change the text color of the hp/mp or anything else when you select an actor in the menu or mid-battle (because they use the default color).
This can be quite ugly, if you want something different please tell me (you must be specific about what you want if that is the case as the changes might require a bit more coding and might imply less compatibility with other scripts).
Otherwise, you might want to check this thread where another solution was provided but the formatting is broken.
I coed a very naive script for you, it will replace any text with the default color (white) inside the cell that you select with color TEXT_SELECTED_COLOR_ID (a parameter of the script).
I observed that it does not modify the text color of the save file menu (because its structure is different), do you want this to change?
Also, this will also change the text color of the hp/mp or anything else when you select an actor in the menu or mid-battle (because they use the default color).
This can be quite ugly, if you want something different please tell me (you must be specific about what you want if that is the case as the changes might require a bit more coding and might imply less compatibility with other scripts).
Ruby:
#==============================================================================
# Selection color
#------------------------------------------------------------------------------
# Author: Timtrack
# date: 12/06/2025
# Requires: replaces the default text color with TEXT_SELECTED_COLOR_ID when an
# item is selected in the window
#==============================================================================
#==============================================================================
# SELECT_REDRAW
#==============================================================================
module SELECT_REDRAW
# put the color number from your windowskin that will replace the
# normal color (white) when the item is selected
TEXT_SELECTED_COLOR_ID = 14
end #SELECT_REDRAW
#==============================================================================
# Window_Base
#==============================================================================
class Window_Base < Window
#--------------------------------------------------------------------------
# new method: selected_color
#--------------------------------------------------------------------------
def selected_color; text_color(SELECT_REDRAW::TEXT_SELECTED_COLOR_ID); end
#--------------------------------------------------------------------------
# alias method: change_color -> if normal color is chosen, pick selected color
# instead when @_selected is true
#--------------------------------------------------------------------------
alias redraw_change_color change_color
def change_color(color, enabled = true)
color = selected_color if @_selected && color == normal_color
redraw_change_color(color,enabled)
end
end #Window_Base
#==============================================================================
# Window_Selectable
#==============================================================================
class Window_Selectable < Window_Base
#--------------------------------------------------------------------------
# alias method: index=
#--------------------------------------------------------------------------
alias redraw_set_index index=
def index=(index)
old_index = @index
redraw_set_index(index)
@_selected = false #for color display
redraw_item(old_index)
@_selected = true
redraw_item(index)
@_selected = nil #restore original status
end
end #Window_Selectable
#==============================================================================
# Window_Command
#==============================================================================
class Window_Command< Window_Selectable
#--------------------------------------------------------------------------
# alias method: redraw_item (avoids crashes)
#--------------------------------------------------------------------------
alias selectredraw_redraw_item redraw_item
def redraw_item(index)
selectredraw_redraw_item(index) if @list[index]
end
end #Window_Command
Otherwise, you might want to check this thread where another solution was provided but the formatting is broken.
It's kinda there in the second last post
Ruby:
module COMMAND
COLOR = Color.new(R,G,B,A) #set RGBA to what you want
COLOR_DISABLED = Color.new(R,G,B,A) #set RGBA to what you want
end
class Window_Command
#OVERRIDES draw_item
def draw_item(index)
if current_symbol == @list[index][:symbol]
if command_enabled?(index)
contents.font.color.set(COMMAND::COLOR)
else
contents.font.color.set(COMMAND::COLOR_DISABLED)
end
else
change_color(normal_color, command_enabled?(index))
end
draw_text(item_rect_for_text(index), command_name(index), alignment)
end
def update_cursor
super
refresh
end
end
After testing both options, I can say that this one seems rather limited in its current form, as it only changes some of the text but not the ones that I was looking for. Like in the item menu, were it only affects the categories tab but not the list of items itself.
Now, this one, is actually much closer to what I'm looking for, but... it has a few issues with my current setup:
• Vlue's Option Menu (the volume sliders don't render properly, as they disappear when the cursor hovers on them).
• And mjshi Non-Combat Menu (it doesn't apply the color to the item selected, but only the first time, when you move the cursor it starts working properly).
The issue with the Non-Combat Menu is most certainly related to the fact that I modified it to remove/skip the category tabs (my game only uses one item category), so when you press the "Item" option on the main menu, you go straight to the item list.
Okay, here is a second version which might patch your non-combat menu issue, I suggest you put my script above your other menu scripts in your load order for compatibility:
If your issue with Non-Combat Menu persists, could you provide me the exact code you've changed (if not the whole script) for me to patch it with mine?
For Vlue's script, put this patch below it:
Ruby:
#==============================================================================
# Selection color
#------------------------------------------------------------------------------
# Author: Timtrack
# date: 12/06/2025
# Requires: replaces the default text color with TEXT_SELECTED_COLOR_ID when an
# item is selected in the window
#==============================================================================
#==============================================================================
# SELECT_REDRAW
#==============================================================================
module SELECT_REDRAW
# put the color number from your windowskin that will replace the
# normal color (white) when the item is selected
TEXT_SELECTED_COLOR_ID = 14
end #SELECT_REDRAW
#==============================================================================
# Window_Base
#==============================================================================
class Window_Base < Window
#--------------------------------------------------------------------------
# new method: selected_color
#--------------------------------------------------------------------------
def selected_color; text_color(SELECT_REDRAW::TEXT_SELECTED_COLOR_ID); end
#--------------------------------------------------------------------------
# alias method: change_color -> if normal color is chosen, pick selected color
# instead when @_selected is true
#--------------------------------------------------------------------------
alias redraw_change_color change_color
def change_color(color, enabled = true)
color = selected_color if @_selected && color == normal_color
redraw_change_color(color,enabled)
end
end #Window_Base
#==============================================================================
# Window_Selectable
#==============================================================================
class Window_Selectable < Window_Base
#--------------------------------------------------------------------------
# alias method: index=
#--------------------------------------------------------------------------
alias redraw_set_index index=
def index=(index)
old_index = @index
redraw_set_index(index)
redraw_item(old_index)
redraw_item(index)
end
#--------------------------------------------------------------------------
# new method: draw_item_wrapper -> replace calls to draw_item to this to
# ensure reselection color
#--------------------------------------------------------------------------
def draw_item_wrapper(index)
@_selected = @index == index
draw_item(index)
@_selected = nil
end
#--------------------------------------------------------------------------
# overwrite method: redraw_item
#--------------------------------------------------------------------------
def redraw_item(index)
clear_item(index) if index >= 0
draw_item_wrapper(index) if index >= 0 #replaced
end
#--------------------------------------------------------------------------
# overwrite method: draw_all_items
#--------------------------------------------------------------------------
def draw_all_items
item_max.times {|i| draw_item_wrapper(i) }
end
end #Window_Selectable
#==============================================================================
# Window_Command
#==============================================================================
class Window_Command< Window_Selectable
#--------------------------------------------------------------------------
# alias method: redraw_item (avoids crashes)
#--------------------------------------------------------------------------
alias command_redraw_redraw_item redraw_item
def redraw_item(index)
command_redraw_redraw_item(index) if @list[index]
end
end #Window_Command
If your issue with Non-Combat Menu persists, could you provide me the exact code you've changed (if not the whole script) for me to patch it with mine?
For Vlue's script, put this patch below it:
Ruby:
#==============================================================================
# Window_OBar
#==============================================================================
class Window_OBar < Window_Selectable
#--------------------------------------------------------------------------
# alias method: refresh (adopt similar pattern to original refresh)
#--------------------------------------------------------------------------
alias select_display_patch_refresh refresh
def refresh(temp_value)
@tmp_value = temp_value
super()
end
#--------------------------------------------------------------------------
# overwrite method: draw_item (was empty before) -> does the same as previous
# refresh method
#--------------------------------------------------------------------------
def draw_item(index)
return unless @tmp_value
select_display_patch_refresh(@tmp_value)
end
end #Window_OBar
Original thread: https://forums.rpgmakerweb.com/threads/change-menu-font-color-on-hover.178255/