Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- =begin
- Default cursor icon to selectable window
- &beta
- =end
- Ligni.register(:dsi_cursor, "dax", 0.1, [[:dsi, "dax"]]) {
- # [sprite]
- class Sprite_DSCursor < Sprite
- # [pos]
- attr_accessor :pos
- # [init]
- def initialize
- super("S: #{DS::SETUP[:MENU][:CURSOR][:PICTURE]}")
- @move = false
- @x = 0.0
- @pos = 0.position
- self.visible = false
- end
- # [update]
- def update
- return unless visible
- super
- unless @move
- @x += DS::SETUP[:MENU][:CURSOR][:SPEED] unless @x >= 5.0
- @move = true if @x >= 5.0
- else
- @x -= DS::SETUP[:MENU][:CURSOR][:SPEED] unless @x <= 0.0
- @move = false if @x <= 0.0
- end
- self.x = (@pos.x + @x) + DS::SETUP[:MENU][:CURSOR][:POS][0]
- self.y = @pos.y + DS::SETUP[:MENU][:CURSOR][:POS][1]
- end
- end
- # [window_selectable]
- class Window_Selectable < Window_Base
- # sprite_cursor
- attr_accessor :sprite_cursor
- # start
- alias :dsi_cursor_init :initialize
- def initialize(*args, &block)
- dsi_cursor_init(*args, &block)
- @sprite_cursor = Sprite_DSCursor.new
- end
- # dispose
- alias :dsi_cursor_dis :dispose
- def dispose
- dsi_cursor_dis
- @sprite_cursor.dispose
- end
- # update
- alias :dsi_cursor_upt :update
- def update
- dsi_cursor_upt
- @sprite_cursor.visible = self.active && self.visible
- uptsc
- end
- # [uptsc]
- def uptsc
- return unless @sprite_cursor.visible
- @sprite_cursor.pos.x = self.x + self.cursor_rect.x
- _y = cursor_rect.y - self.oy
- @sprite_cursor.pos.y = self.y + _y + (@sprite_cursor.height)
- @sprite_cursor.update
- @sprite_cursor.z = self.z
- end
- end
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement