This will allow you to create a Command Window that uses a cursor (or pointer whatever you want to call it) instead of a selector around the text. Of course you can also create a normal menu using this as well.
First of all, import this into the icons folder. (make the background transparent...)
Then place this with all the other Window Scripts
# ==============================
# * Cursor Command *
# ------------------------------
# Version 1
# 01.07.06
# ------------------------------
# Tsunokiette (Give credit)
# ==============================
class Cursor_Command < Window_Base
def initialize(width, commands, pointer = false)
super(0, 0, width, commands.size * 32 + 32)
@item_max = commands.size
@commands = commands
@pointer = pointer
self.contents = Bitmap.new(width - 32, @item_max * 32)
refresh
self.index = 0
end
def refresh(index = 0)
self.contents.clear
for i in 0...@item_max
draw_item(i, normal_color)
end
if @pointer == true
draw_pointer(index)
end
end
def draw_pointer(index)
rect2 = Rect.new(0, 32 * index + 4, 24, 24)
self.contents.fill_rect(rect2, Color.new(0, 0, 0, 0))
bitmap = RPG::Cache.icon('hand')
self.contents.blt(0, 0, bitmap, rect2)
end
def draw_item(index, color)
self.contents.font.color = color
if @pointer == true
rect1 = Rect.new(24, 32 * index, self.contents.width - 24, 32)
self.contents.fill_rect(rect1, Color.new(0, 0, 0, 0))
self.contents.draw_text(rect1, @commands[index],1)
else
rect1 = Rect.new(0, 32 * index, self.contents.width, 32)
self.contents.fill_rect(rect1, Color.new(0, 0, 0, 0))
self.contents.draw_text(rect1, @commands[index],1)
end
end
def disable_item(index)
draw_item(index, disabled_color)
end
def update_cursor_rect
if @index < 0 or @pointer == true
self.cursor_rect.empty
return
end
x = 0
y = 32 * @index
cursor_width = self.contents.width
self.cursor_rect.set(x, y, cursor_width, 32)
end
alias :original_update :update
def update
if @pointer == true
refresh(@index)
end
original_update
end
end
To create a nomal menu do this-
@menu = Cursor_Command.new(width,[commands])
To create a menu using the pointer (cursor) do this-
@menu = Cursor_Command.new(width,[commands],true)
If you get an error tell me immediately, it's a simple script so if it has any errors, it shouldn't be too hard to fix