How to make CAMouse Script compatible with two other script.

The two scripts below cut a large window into several small windows.
Therefore, they cannot be used normally with mouse scripts.
Left-clicking and Scrolling on the choice list window and the selection of menu scenes will become invalid and confusing.

I tried to correct MouseCursor:😮BSERVED_SUBJECT_WINDOW already.
But It doesn't make any better.

Can someone help me to improve them? Thanks you!

Galv’s Visual Novel Choices

メニュー画面-改3


CAMouse Script
I just found that it seems that only a small modification to the def update_cursor part is needed to solve my problem. But the modification I tried is not correct, does anyone know how to modify it? Please help me.
I just found that it seems that only a small modification to the def update_cursor part is needed to solve my problem
How did you find that?
How did you find that?
After I commented the def update_cursor part,
when I click on the selection with the mouse,
it will become able to enter the next command as usual.
However, it will make an extra box on the selection.

Like this,
1.png


class xxxxxxx < xxxxxxx

.
.
.
.
.
.

alias galv_choice_call_ok_handler call_ok_handler
def call_ok_handler
galv_choice_call_ok_handler
dispose_bgs
end
alias galv_choice_call_cancel_handler call_cancel_handler
def call_cancel_handler
galv_choice_call_cancel_handler
dispose_bgs
end

#~ def update_cursor
#~ if $game_switches[Galv_Choice:😀ISABLE_SWITCH]
#~ super
#~ else
#~ cursor_rect.empty
#~ return if @cursor_sprite.nil? || @choice_sprite.nil?
#~ if @index < 0
#~ @cursor_sprite.opacity = 0
#~ else
#~ @cursor_sprite.opacity = Galv_Choice::CURSOR_OPACITY
#~ @cursor_sprite.x = @choice_sprite[@index].x + Galv_Choice::CURSOR_X_OFFSET
#~ @cursor_sprite.y = @choice_sprite[@index].y + Galv_Choice::CURSOR_Y_OFFSET
#~ @cursor_sprite.z = self.z - 1
#~ cursor_rect.y = (item_height * @index) + Galv_Choice:😮THER_Y_OFFSET
#~ end
#~ end
#~ end

end # Window_ChoiceList < Window_Command
Well if you are ok with the box. then this will work.

cursor_rect.set(item_rect(@index))

Ruby:
  def update_cursor
    if $game_switches[Galv_Choice::DISABLE_SWITCH]
      super
    else
      cursor_rect.empty
      return if @cursor_sprite.nil? || @choice_sprite.nil?
      if @index < 0
        @cursor_sprite.opacity = 0
      else
        @cursor_sprite.opacity = Galv_Choice::CURSOR_OPACITY
        @cursor_sprite.x = @choice_sprite[@index].x + Galv_Choice::CURSOR_X_OFFSET
        @cursor_sprite.y = @choice_sprite[@index].y + Galv_Choice::CURSOR_Y_OFFSET
        @cursor_sprite.z = self.z - 1
        cursor_rect.y = (item_height * @index) + Galv_Choice::OTHER_Y_OFFSET
      end
      cursor_rect.set(item_rect(@index))
    end
  end
 
end # Window_ChoiceList < Window_Command
Well if you are ok with the box. then this will work.

cursor_rect.set(item_rect(@index))

Ruby:
  def update_cursor
    if $game_switches[Galv_Choice::DISABLE_SWITCH]
      super
    else
      cursor_rect.empty
      return if @cursor_sprite.nil? || @choice_sprite.nil?
      if @index < 0
        @cursor_sprite.opacity = 0
      else
        @cursor_sprite.opacity = Galv_Choice::CURSOR_OPACITY
        @cursor_sprite.x = @choice_sprite[@index].x + Galv_Choice::CURSOR_X_OFFSET
        @cursor_sprite.y = @choice_sprite[@index].y + Galv_Choice::CURSOR_Y_OFFSET
        @cursor_sprite.z = self.z - 1
        cursor_rect.y = (item_height * @index) + Galv_Choice::OTHER_Y_OFFSET
      end
      cursor_rect.set(item_rect(@index))
    end
  end

end # Window_ChoiceList < Window_Command
I am not ok with the box of course.

About your 'cursor_rect.set(item_rect(@index))'. What is it do?
The box will still show after I used it.
I am not ok with the box of course.
A little more tinkering around and I have a solution. Not sure if it is the best but it works.

In Galv's script put after line 293
Code:
cursor_rect.width = item_width

In CAMouse on line 1789, change to
Code:
    return false unless cursor_y <= @mouse_y && @mouse_y < cursor_y + 20

The issue was that the cursor_rect width and height were not set for the mouse script or they are not used in galv's script.
Setting a width works fine, but as soon as you specify a height in galv's script the box shows up.
So putting in a number to simulate a cursor_rect height works.

Original thread: https://forums.rpgmakerweb.com/threads/how-to-make-camouse-script-compatible-with-two-other-script.121888/