Making Yanfly's Combat Log Display scrollable?

Tiptank

Villager
Member
Joined
Aug 26, 2018
Messages
23
Reaction score
1
First Language
German
Primarily Uses
RMVXA
Can someone help me with making Yanfly's Combat Log Display appear to be scrollable? I want the log to scroll up and down by using the up/down-keys. Sadly, he wrote it with Window_Selectable so you've to scroll down every single line.

Hope ya'll know what I mean.

Would be grateful for some help with this issue because a scroll function for this script would be way more comfortable for the player.
 

Heirukichi

Veteran
Veteran
Joined
Sep 24, 2015
Messages
1,421
Reaction score
596
First Language
Italian
Primarily Uses
RMVXA
By scrollable do you mean something that scrolls using the mouse wheel?
 

Tiptank

Villager
Member
Joined
Aug 26, 2018
Messages
23
Reaction score
1
First Language
German
Primarily Uses
RMVXA
It should scroll using the arrow up and arrow down keys.
 

Heirukichi

Veteran
Veteran
Joined
Sep 24, 2015
Messages
1,421
Reaction score
596
First Language
Italian
Primarily Uses
RMVXA
Then do you just want it to scroll faster than just 1 line each time? Because Window_Selectable automatically scrolls when you press the down/up arrow key if you are at the bottom/top part of the window. If you just want it to go faster Window_Selectable already has that feature. If you press PageUp/PageDown it goes up and down much faster.

EDIT1:
If you want to just use up/down instead of PageUp/PageDown and scroll faster you could use this. I didn't test it but what it does is basically overwrite the inherited method to move cursor up and down for Window_CombatLog. Even if untested it should work because it is a very simple edit. Change the CUSTOM_LINES constant to fir your needs.
Code:
module HYC
 
  CUSTOM_LINES = 3 # Change this to be the number of lines you want to scroll when an arrow key (up/down) is pressed.
 
end

class Window_CombatLog < Window_Selectable
 
  #--------------------------------------------------------------------------
  # * Move Cursor Down
  #--------------------------------------------------------------------------
  def cursor_down(wrap = false)
    if index < item_max - col_max || (wrap && col_max == 1)
      select((index + HYC::CUSTOM_LINES) % item_max)
    end
  end
  #--------------------------------------------------------------------------
  # * Move Cursor Up
  #--------------------------------------------------------------------------
  def cursor_up(wrap = false)
    if index >= col_max || (wrap && col_max == 1)
      select((index - HYC::CUSTOM_LINES + item_max) % item_max)
    end
  end
 
end

EDIT2:
Probably I understood what you mean. You want the player to be able to scroll without having to actually reach the top/bottom line to start scrolling. If that is what you want then use this one.
Code:
module HYC

  # Change the following value to be the number of lines you want to scroll each
  # time an arrow key (up/down) is pressed. WARNING: value higher than 1 might
  # make reading the top/last line impossible without using PgUP/PgDOWN.
  CUSTOM_LINES = 1

end

class Window_CombatLog < Window_Selectable

  #--------------------------------------------------------------------------
  # * Move Cursor Down
  #--------------------------------------------------------------------------
  def cursor_down(wrap = false)
    if index < item_max - col_max || (wrap && col_max == 1)
      select((self.bottom_row + HYC::CUSTOM_LINES) % item_max)
    end
  end
  #--------------------------------------------------------------------------
  # * Move Cursor Up
  #--------------------------------------------------------------------------
  def cursor_up(wrap = false)
    if index >= col_max || (wrap && col_max == 1)
      select((top_row - HYC::CUSTOM_LINES) % item_max)
    end
  end
  #--------------------------------------------------------------------------
  # * Make Cursor Invisible
  #--------------------------------------------------------------------------
  def update_cursor
    if @cursor_all
      self.top_row = 0
    elsif @index < 0
    else
      ensure_cursor_visible
    end
  #--------------------------------------------------------------------------
  # * Stop Removing
  #--------------------------------------------------------------------------
  end

end
In this last one I had to make the cursor invisible. Having the cursor immediately jumping to the last position when scrolling down (or to the top position when scrolling up) was really disturbing in my opinion. If you do not find it disturbing I can easily adjust it to make the cursor visible.
 
Last edited:

Kes

Veteran
Veteran
Joined
Aug 3, 2012
Messages
22,299
Reaction score
11,713
First Language
English
Primarily Uses
RMVXA
[move]RGSSx Script Support[/move]
 

Tiptank

Villager
Member
Joined
Aug 26, 2018
Messages
23
Reaction score
1
First Language
German
Primarily Uses
RMVXA
@Heirukichi: The second one is exactly what I wanted. It's so much better with the cursor invisible, though. Thank you very much.
 

Heirukichi

Veteran
Veteran
Joined
Sep 24, 2015
Messages
1,421
Reaction score
596
First Language
Italian
Primarily Uses
RMVXA
I am glad it was the solution to your problem.
It's so much better with the cursor invisible
I know, this is exactly why I removed it. It was quite disturbing having it and not using it to select lines.
 

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

Latest Threads

Latest Profile Posts

Day 9 of giveaways! 8 prizes today :D
He mad, but he cute :kaopride:

Our latest feature is an interview with... me?!

People4_2 (Capelet off and on) added!

Just beat the last of us 2 last night and starting jedi: fallen order right now, both use unreal engine & when I say i knew 80% of jedi's buttons right away because they were the same buttons as TLOU2 its ridiculous, even the same narrow hallway crawl and barely-made-it jump they do. Unreal Engine is just big budget RPG Maker the way they make games nearly identical at its core lol.

Forum statistics

Threads
106,040
Messages
1,018,479
Members
137,824
Latest member
dobratemporal
Top