mirror of
https://github.com/infinitefusion/infinitefusion-e18.git
synced 2025-12-06 06:01:46 +00:00
Makes it possible to jump up and down 1 colomn lists with the left and right arrows
This commit is contained in:
@@ -848,6 +848,22 @@ class SpriteWindow_Selectable < SpriteWindow_Base
|
|||||||
super
|
super
|
||||||
if self.active && @item_max > 0 && @index >= 0 && !@ignore_input
|
if self.active && @item_max > 0 && @index >= 0 && !@ignore_input
|
||||||
if Input.repeat?(Input::UP)
|
if Input.repeat?(Input::UP)
|
||||||
|
scroll_up()
|
||||||
|
elsif Input.repeat?(Input::DOWN)
|
||||||
|
scroll_down()
|
||||||
|
elsif Input.repeat?(Input::LEFT) && @column_max > 1
|
||||||
|
scroll_left()
|
||||||
|
elsif Input.repeat?(Input::RIGHT) && @column_max > 1
|
||||||
|
scroll_right()
|
||||||
|
elsif Input.repeat?(Input::JUMPUP) || Input.repeat?(Input::LEFT)
|
||||||
|
jump_up()
|
||||||
|
elsif Input.repeat?(Input::JUMPDOWN) || Input.repeat?(Input::RIGHT)
|
||||||
|
jump_down()
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
def scroll_up()
|
||||||
if @index >= @column_max ||
|
if @index >= @column_max ||
|
||||||
(Input.trigger?(Input::UP) && (@item_max % @column_max)==0)
|
(Input.trigger?(Input::UP) && (@item_max % @column_max)==0)
|
||||||
oldindex = @index
|
oldindex = @index
|
||||||
@@ -857,7 +873,9 @@ class SpriteWindow_Selectable < SpriteWindow_Base
|
|||||||
update_cursor_rect
|
update_cursor_rect
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
elsif Input.repeat?(Input::DOWN)
|
end
|
||||||
|
|
||||||
|
def scroll_down()
|
||||||
if @index < @item_max - @column_max ||
|
if @index < @item_max - @column_max ||
|
||||||
(Input.trigger?(Input::DOWN) && (@item_max % @column_max)==0)
|
(Input.trigger?(Input::DOWN) && (@item_max % @column_max)==0)
|
||||||
oldindex = @index
|
oldindex = @index
|
||||||
@@ -867,16 +885,9 @@ class SpriteWindow_Selectable < SpriteWindow_Base
|
|||||||
update_cursor_rect
|
update_cursor_rect
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
elsif Input.repeat?(Input::LEFT)
|
|
||||||
if @column_max >= 2 && @index > 0
|
|
||||||
oldindex = @index
|
|
||||||
@index -= 1
|
|
||||||
if @index!=oldindex
|
|
||||||
pbPlayCursorSE()
|
|
||||||
update_cursor_rect
|
|
||||||
end
|
end
|
||||||
end
|
|
||||||
elsif Input.repeat?(Input::RIGHT)
|
def scroll_left()
|
||||||
if @column_max >= 2 && @index < @item_max - 1
|
if @column_max >= 2 && @index < @item_max - 1
|
||||||
oldindex = @index
|
oldindex = @index
|
||||||
@index += 1
|
@index += 1
|
||||||
@@ -885,7 +896,21 @@ class SpriteWindow_Selectable < SpriteWindow_Base
|
|||||||
update_cursor_rect
|
update_cursor_rect
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
elsif Input.repeat?(Input::JUMPUP)
|
end
|
||||||
|
|
||||||
|
def scroll_right()
|
||||||
|
if @column_max >= 2 && @index > 0
|
||||||
|
oldindex = @index
|
||||||
|
@index -= 1
|
||||||
|
if @index!=oldindex
|
||||||
|
pbPlayCursorSE()
|
||||||
|
update_cursor_rect
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
|
||||||
|
def jump_up()
|
||||||
if @index > 0
|
if @index > 0
|
||||||
oldindex = @index
|
oldindex = @index
|
||||||
@index = [self.index-self.page_item_max, 0].max
|
@index = [self.index-self.page_item_max, 0].max
|
||||||
@@ -895,7 +920,10 @@ class SpriteWindow_Selectable < SpriteWindow_Base
|
|||||||
update_cursor_rect
|
update_cursor_rect
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
elsif Input.repeat?(Input::JUMPDOWN)
|
end
|
||||||
|
|
||||||
|
|
||||||
|
def jump_down()
|
||||||
if @index < @item_max-1
|
if @index < @item_max-1
|
||||||
oldindex = @index
|
oldindex = @index
|
||||||
@index = [self.index+self.page_item_max, @item_max-1].min
|
@index = [self.index+self.page_item_max, @item_max-1].min
|
||||||
@@ -906,8 +934,6 @@ class SpriteWindow_Selectable < SpriteWindow_Base
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
private
|
private
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user