Make help window dim background instead of normal window

Tiptank

Villager
Member
Joined
Aug 26, 2018
Messages
23
Reaction score
1
First Language
German
Primarily Uses
RMVXA
May someone help me to edit this script so that the help message will show not as normal window box, but as dim background message box?

Code:
#=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
#             Help Window for Choices
#             Version: 2.0
#             Authors: DiamondandPlatinum3
#             Date: December 4, 2012  (Original)
#                   December 14, 2013 (Updated)
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#  Description:
#
#    This script adds on to the default choice system, allowing you to have a
#    help window at the top of the screen to assist players in the choices they
#    have to make
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#------------------------------------------------------------------------------
#  Instructions:
#
#   {Note to previous users of this script: This script has updated the way you
#    Insert data. Fear not, for the old way to insert data is still available;
#    so you will not have to redo anything, however read up on the new way to
#    insert data}
# 
#
#
#   ~ To use this script, just before using a choice event, use the following
#     script call to begin adding text to the help window:
#             add_command_list_help_text
#
#     Now using Show Text Windows, insert the text to be displayed.
#     Once the desired information is inserted, close the link with
#     the following script call:
#             end_command_list_help_text
#
#     Continue using that same pattern until all of your choices have
#     descriptions.
#
# 
#   ~ The Position of the Help Window depends on what position you gave the
#     Show Text window.
#
#
#     # Example Screen Can Be Found Here:
#           http://i.imgur.com/XAkhNEf.png
#
#
#=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
#                  THERE IS NO EDITABLE REGION TO THIS SCRIPT
#=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=





#==============================================================================
# ** Game_Message
#------------------------------------------------------------------------------
#  This class handles the state of the message window that displays text or
# selections, etc. The instance of this class is referenced by $game_message.
#==============================================================================

class Game_Message
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  # *= Alias Listings
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  alias_method(:dp3_gamemessage_initialize_235ufnh,               :initialize)
  alias_method(:dp3_gamemessage_clear_235ufnh,                    :clear     )
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  # * New Public Instance Variables
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  attr_accessor :choice_help_text              # Help Text for choices (Hash)
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  # * Aliased Method: Object Initialization
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  def initialize()
    dp3_gamemessage_initialize_235ufnh() # Call Original Method
    @choice_help_text = Hash.new()
  end
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  # * Aliased Method: Clear
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  def clear()
    dp3_gamemessage_clear_235ufnh() # Call Original Method
    @choice_help_text = Hash.new()
  end
end








#==============================================================================
# ** DP3_Choice_Window_Help
#------------------------------------------------------------------------------
#  This window displays help text for the choices inside of a choice window
#==============================================================================

class DP3_Choice_Window_Help < Window_Help
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  # * New Method: Object Initialization
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  def initialize(text, position)
    super( [text.split("\n").size, 4].max )
    self.y = position * (Graphics.height - self.height) / 2
    self.openness = 0
    set_text(text)
  end
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  # * New Method: Immediately Open
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  def immediately_open()
    self.openness = 255
  end
end








#==============================================================================
# ** Window_ChoiceList
#------------------------------------------------------------------------------
#  This window is used for the event command [Show Choices].
#==============================================================================

class Window_ChoiceList < Window_Command
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  # *= Alias Listings
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  alias_method(:dp3_windowchoicelist_update_235ufnh,            :update     )
  alias_method(:dp3_windowchoicelist_select_235ufnh,            :select     )
  alias_method(:dp3_windowchoicelist_cursordown_235ufnh,        :cursor_down)
  alias_method(:dp3_windowchoicelist_cursorup_235ufnh,          :cursor_up  )
  alias_method(:dp3_windowchoicelist_open_235ufnh,              :open       )
  alias_method(:dp3_windowchoicelist_close_235ufnh,             :close      )
  alias_method(:dp3_windowchoicelist_dispose_235ufnh,           :dispose    )
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  # * Aliased Method: Update
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  def update(*args)
    dp3_windowchoicelist_update_235ufnh(*args)
    @choicehelp_helpwindow.update() unless @choicehelp_helpwindow.nil?
  end
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  # * Aliased Method: Select Item
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  def select(*args)
    dp3_windowchoicelist_select_235ufnh(*args)
    dp3_dispose_choicehelp_window()
    unless dp3_get_current_choice_windowinfo[0].nil?
      @choicehelp_helpwindow = DP3_Choice_Window_Help.new(*dp3_get_current_choice_windowinfo)
    end
  end
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  # * Aliased Method: Move Cursor Down
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  def cursor_down(*args)
    dp3_windowchoicelist_cursordown_235ufnh(*args)
    @choicehelp_helpwindow.immediately_open() unless @choicehelp_helpwindow.nil?
  end
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  # * Aliased Method: Move Cursor Up
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  def cursor_up(*args)
    dp3_windowchoicelist_cursorup_235ufnh(*args)
    @choicehelp_helpwindow.immediately_open() unless @choicehelp_helpwindow.nil?
  end
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  # * Aliased Method: Open
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  def open(*args)
    dp3_windowchoicelist_open_235ufnh(*args) # Call Original Method
    @choicehelp_helpwindow.open() unless @choicehelp_helpwindow.nil?
  end
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  # * Aliased Method: Close
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  def close(*args)
    @choicehelp_helpwindow.close() unless @choicehelp_helpwindow.nil?
    dp3_windowchoicelist_close_235ufnh(*args) # Call Original Method
  end
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  # * Aliased Method: Dispose
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  def dispose(*args)
    dp3_windowchoicelist_dispose_235ufnh(*args) # Call Original Method
    dp3_dispose_choicehelp_window()
  end
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  # * New Method: Dispose ChoiceHelp Window
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  def dp3_dispose_choicehelp_window()
    @choicehelp_helpwindow.dispose unless @choicehelp_helpwindow.nil? || @choicehelp_helpwindow.disposed?
    @choicehelp_helpwindow = nil
  end
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  # * New Method: Get Required Info for the Window Choice
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  def dp3_get_current_choice_windowinfo()
    return [nil] if $game_message.choice_help_text[self.index].nil?
    return [$game_message.choice_help_text[self.index][:text],
            $game_message.choice_help_text[self.index][:position] ]
  end
end








#==============================================================================
# ** Game_Interpreter
#------------------------------------------------------------------------------
#  An interpreter for executing event commands. This class is used within the
# Game_Map, Game_Troop, and Game_Event classes.
#==============================================================================

class Game_Interpreter
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  # * New Method: Add Command List Help Text
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  def add_command_list_help_text( text = nil )
    position = 0
   
    # Add Text Argument
    unless text.nil?
      text = text.gsub(/[\n\r]+/, "")
      text = text.gsub(/\\endl/, "\n")
    
    # Add Show Text Command Text Paramters
    else
      text = ""
      while( !@list[@index].nil? )
        @index += 1
        case @list[@index].code
        when 101 # Show Text Window Command
          position = @list[@index].parameters[3]
        when 401 # Show Text Line
          text += @list[@index].parameters[0] + "\n"
        when 355 # Script Command
          script = @list[@index].parameters[0] + "\n"
          while next_event_code == 655
            @index += 1
            script += @list[@index].parameters[0] + "\n"
          end
          break if script.include?("end_command_list_help_text")
        end
      end
    end
   
    # Add to List
    index = $game_message.choice_help_text.size
    $game_message.choice_help_text[index]             = Hash.new()
    $game_message.choice_help_text[index][:position]  = position
    $game_message.choice_help_text[index][:text]      = text
  end
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  # * New Method: End Command List Help Text
  #--------------------------------------------------------------------------
  # Method only exists in case the user actually tries to call it outside of
  # bounds.
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  def end_command_list_help_text()
  end
end
 

Roninator2

Gamer
Veteran
Joined
May 22, 2016
Messages
2,674
Reaction score
566
First Language
English
Primarily Uses
RMVXA
Ah, you had to make a new thread.
I've been trying to figure out the solution but can't find a way to get the window to dispose after the choice is made.

To close your previous thread, you just click on the report link in your message and ask for it to be closed.
 

Tiptank

Villager
Member
Joined
Aug 26, 2018
Messages
23
Reaction score
1
First Language
German
Primarily Uses
RMVXA
Hi Roni,

you mean the window doesn't dispose even in the original script?
 

Roninator2

Gamer
Veteran
Joined
May 22, 2016
Messages
2,674
Reaction score
566
First Language
English
Primarily Uses
RMVXA
Yes to make the background like you want, I tried to create a new sprite and bitmap. I've done this before but that was linked to window_base. This is window_help, it's not allowing a dispose of the image. The effect is that the image does not go away.
which is weird since window_help is linked to window_base.

The original script works fine.
 
Last edited:

Tiptank

Villager
Member
Joined
Aug 26, 2018
Messages
23
Reaction score
1
First Language
German
Primarily Uses
RMVXA
The help window is added by a normal message box with events. You see it's configured as "Normal, Down". I can make it to "Dim Background, Down" by editing the message box, but in the game it is still displayed as "Normal, Down". That's my whole problem. I want the script to accept dim background messages.
 

Attachments

GGZiron

Veteran
Veteran
Joined
Nov 6, 2016
Messages
90
Reaction score
32
First Language
Bulgarian
Primarily Uses
RMVXA
Code:
#=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
#             Help Window for Choices
#             Version: 2.0
#             Authors: DiamondandPlatinum3
#             Date: December 4, 2012  (Original)
#                   December 14, 2013 (Updated)
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#  Description:
#
#    This script adds on to the default choice system, allowing you to have a
#    help window at the top of the screen to assist players in the choices they
#    have to make
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#------------------------------------------------------------------------------
#  Instructions:
#
#   {Note to previous users of this script: This script has updated the way you
#    Insert data. Fear not, for the old way to insert data is still available;
#    so you will not have to redo anything, however read up on the new way to
#    insert data}
#
#
#
#   ~ To use this script, just before using a choice event, use the following
#     script call to begin adding text to the help window:
#             add_command_list_help_text
#
#     Now using Show Text Windows, insert the text to be displayed.
#     Once the desired information is inserted, close the link with
#     the following script call:
#             end_command_list_help_text
#
#     Continue using that same pattern until all of your choices have
#     descriptions.
#
#
#   ~ The Position of the Help Window depends on what position you gave the
#     Show Text window.
#
#
#     # Example Screen Can Be Found Here:
#           http://i.imgur.com/XAkhNEf.png
#
#
#=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
#                  THERE IS NO EDITABLE REGION TO THIS SCRIPT
#=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=





#==============================================================================
# ** Game_Message
#------------------------------------------------------------------------------
#  This class handles the state of the message window that displays text or
# selections, etc. The instance of this class is referenced by $game_message.
#==============================================================================

class Game_Message
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  # *= Alias Listings
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  alias_method(:dp3_gamemessage_initialize_235ufnh,               :initialize)
  alias_method(:dp3_gamemessage_clear_235ufnh,                    :clear     )
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  # * New Public Instance Variables
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  attr_accessor :choice_help_text              # Help Text for choices (Hash)
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  # * Aliased Method: Object Initialization
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  def initialize()
    dp3_gamemessage_initialize_235ufnh() # Call Original Method
    @choice_help_text = Hash.new()
  end
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  # * Aliased Method: Clear
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  def clear()
    dp3_gamemessage_clear_235ufnh() # Call Original Method
    @choice_help_text = Hash.new()
  end
end








#==============================================================================
# ** DP3_Choice_Window_Help
#------------------------------------------------------------------------------
#  This window displays help text for the choices inside of a choice window
#==============================================================================

class DP3_Choice_Window_Help < Window_Help
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  # * New Method: Object Initialization
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  def initialize(text, position, background)
    super( [text.split("\n").size, 4].max )
    self.y = position * (Graphics.height - self.height) / 2
    self.openness = 0
    self.opacity = background ==0 ? 255 : 0
    create_back_bitmap
    create_back_sprite
    @back_sprite.visible = true if background == 1
    set_text(text)
  end
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  # * New Method: Immediately Open
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  def immediately_open()
    self.openness = 255
  end
 
  def create_back_bitmap
    @back_bitmap = Bitmap.new(width, height)
    rect1 = Rect.new(0, 0, width, 12)
    rect2 = Rect.new(0, 12, width, height - 24)
    rect3 = Rect.new(0, height - 12, width, 12)
    @back_bitmap.gradient_fill_rect(rect1, back_color2, back_color1, true)
    @back_bitmap.fill_rect(rect2, back_color1)
    @back_bitmap.gradient_fill_rect(rect3, back_color1, back_color2, true)
  end
  #--------------------------------------------------------------------------
  # * Get Background Color 1
  #--------------------------------------------------------------------------
  def back_color1
    Color.new(0, 0, 0, 160)
  end
  #--------------------------------------------------------------------------
  # * Get Background Color 2
  #--------------------------------------------------------------------------
  def back_color2
    Color.new(0, 0, 0, 0)
  end
  #--------------------------------------------------------------------------
  # * Create Background Sprite
  #--------------------------------------------------------------------------
  def create_back_sprite
    @back_sprite = Sprite.new
    @back_sprite.y = self.y
    @back_sprite.bitmap = @back_bitmap
    @back_sprite.visible = false
    @back_sprite.z = z - 1
  end
 
  def dispose
    @back_sprite.dispose
    super
  end
 
end








#==============================================================================
# ** Window_ChoiceList
#------------------------------------------------------------------------------
#  This window is used for the event command [Show Choices].
#==============================================================================

class Window_ChoiceList < Window_Command
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  # *= Alias Listings
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  alias_method(:dp3_windowchoicelist_update_235ufnh,            :update     )
  alias_method(:dp3_windowchoicelist_select_235ufnh,            :select     )
  alias_method(:dp3_windowchoicelist_cursordown_235ufnh,        :cursor_down)
  alias_method(:dp3_windowchoicelist_cursorup_235ufnh,          :cursor_up  )
  alias_method(:dp3_windowchoicelist_open_235ufnh,              :open       )
  alias_method(:dp3_windowchoicelist_close_235ufnh,             :close      )
  alias_method(:dp3_windowchoicelist_dispose_235ufnh,           :dispose    )
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  # * Aliased Method: Update
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  def update(*args)
    dp3_windowchoicelist_update_235ufnh(*args)
    @choicehelp_helpwindow.update() unless @choicehelp_helpwindow.nil?
  end
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  # * Aliased Method: Select Item
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  def select(*args)
    dp3_windowchoicelist_select_235ufnh(*args)
    dp3_dispose_choicehelp_window()
    unless dp3_get_current_choice_windowinfo[0].nil?
      @choicehelp_helpwindow = DP3_Choice_Window_Help.new(*dp3_get_current_choice_windowinfo)
    end
  end
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  # * Aliased Method: Move Cursor Down
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  def cursor_down(*args)
    dp3_windowchoicelist_cursordown_235ufnh(*args)
    @choicehelp_helpwindow.immediately_open() unless @choicehelp_helpwindow.nil?
  end
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  # * Aliased Method: Move Cursor Up
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  def cursor_up(*args)
    dp3_windowchoicelist_cursorup_235ufnh(*args)
    @choicehelp_helpwindow.immediately_open() unless @choicehelp_helpwindow.nil?
  end
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  # * Aliased Method: Open
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  def open(*args)
    dp3_windowchoicelist_open_235ufnh(*args) # Call Original Method
    @choicehelp_helpwindow.open() unless @choicehelp_helpwindow.nil?
  end
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  # * Aliased Method: Close
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  def close(*args)
    @choicehelp_helpwindow.close() unless @choicehelp_helpwindow.nil?
    dp3_windowchoicelist_close_235ufnh(*args) # Call Original Method
  end
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  # * Aliased Method: Dispose
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  def dispose(*args)
    dp3_windowchoicelist_dispose_235ufnh(*args) # Call Original Method
    dp3_dispose_choicehelp_window()
  end
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  # * New Method: Dispose ChoiceHelp Window
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  def dp3_dispose_choicehelp_window()
    @choicehelp_helpwindow.dispose unless @choicehelp_helpwindow.nil? || @choicehelp_helpwindow.disposed?
    @choicehelp_helpwindow = nil
  end
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  # * New Method: Get Required Info for the Window Choice
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  def dp3_get_current_choice_windowinfo()
    return [nil] if $game_message.choice_help_text[self.index].nil?
    return [$game_message.choice_help_text[self.index][:text],
            $game_message.choice_help_text[self.index][:position],
            $game_message.choice_help_text[self.index][:background]]
    end
end








#==============================================================================
# ** Game_Interpreter
#------------------------------------------------------------------------------
#  An interpreter for executing event commands. This class is used within the
# Game_Map, Game_Troop, and Game_Event classes.
#==============================================================================

class Game_Interpreter
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  # * New Method: Add Command List Help Text
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  def add_command_list_help_text( text = nil )
    position = 0
    background = 0
    # Add Text Argument
    unless text.nil?
      text = text.gsub(/[\n\r]+/, "")
      text = text.gsub(/\\endl/, "\n")
    
    # Add Show Text Command Text Paramters
    else
      text = ""
      while( !@list[@index].nil? )
        @index += 1
        case @list[@index].code
        when 101 # Show Text Window Command
          background =  @list[@index].parameters[2]
          position = @list[@index].parameters[3]
        when 401 # Show Text Line
          text += @list[@index].parameters[0] + "\n"
        when 355 # Script Command
          script = @list[@index].parameters[0] + "\n"
          while next_event_code == 655
            @index += 1
            script += @list[@index].parameters[0] + "\n"
          end
          break if script.include?("end_command_list_help_text")
        end
      end
    end
  
    
    # Add to List
    index = $game_message.choice_help_text.size
    $game_message.choice_help_text[index]             = Hash.new()
    $game_message.choice_help_text[index][:position]  = position
    $game_message.choice_help_text[index][:text]      = text
    $game_message.choice_help_text[index][:background]= background
  end
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  # * New Method: End Command List Help Text
  #--------------------------------------------------------------------------
  # Method only exists in case the user actually tries to call it outside of
  # bounds.
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  def end_command_list_help_text()
  end
end

I added the methods that create background image for the help window, and edited the dispose method.
The window it is class, that inherit help window, as Roninator2 said. It doesn't matter how you put it
in the event editor, but how the script use that data.
 

Roninator2

Gamer
Veteran
Joined
May 22, 2016
Messages
2,674
Reaction score
566
First Language
English
Primarily Uses
RMVXA
edited the dispose method
That still does not dispose the image.
I'm going to take what you did and see if I can improve what I did.
I got it working, but it's not as simple as what you have.
 

GGZiron

Veteran
Veteran
Joined
Nov 6, 2016
Messages
90
Reaction score
32
First Language
Bulgarian
Primarily Uses
RMVXA
Weird, because to me it works perfectly. It dispose the dim color background without refuse.

Edit: Is there any chance you talk about different image, not the dim color?
Second edit: Ah i see what you mean now.
 
Last edited:

Tiptank

Villager
Member
Joined
Aug 26, 2018
Messages
23
Reaction score
1
First Language
German
Primarily Uses
RMVXA
GGZiron: I like your solution, because now I have the original dim background window. Anyway, the window doesn't seem to hide when a message is displayed right after clicking a choice. I want to show both the message window and the help window on the bottom of the screen. If I click a choice and a message appears after that, both windows overlap. Maybe you can fix it, so that the window disappears when another message shows up?
 
Last edited:

GGZiron

Veteran
Veteran
Joined
Nov 6, 2016
Messages
90
Reaction score
32
First Language
Bulgarian
Primarily Uses
RMVXA
Code:
#=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
#             Help Window for Choices
#             Version: 2.0
#             Authors: DiamondandPlatinum3
#             Date: December 4, 2012  (Original)
#                   December 14, 2013 (Updated)
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#  Description:
#
#    This script adds on to the default choice system, allowing you to have a
#    help window at the top of the screen to assist players in the choices they
#    have to make
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#------------------------------------------------------------------------------
#  Instructions:
#
#   {Note to previous users of this script: This script has updated the way you
#    Insert data. Fear not, for the old way to insert data is still available;
#    so you will not have to redo anything, however read up on the new way to
#    insert data}
#
#
#
#   ~ To use this script, just before using a choice event, use the following
#     script call to begin adding text to the help window:
#             add_command_list_help_text
#
#     Now using Show Text Windows, insert the text to be displayed.
#     Once the desired information is inserted, close the link with
#     the following script call:
#             end_command_list_help_text
#
#     Continue using that same pattern until all of your choices have
#     descriptions.
#
#
#   ~ The Position of the Help Window depends on what position you gave the
#     Show Text window.
#
#
#     # Example Screen Can Be Found Here:
#           http://i.imgur.com/XAkhNEf.png
#
#
#=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
#                  THERE IS NO EDITABLE REGION TO THIS SCRIPT
#=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=





#==============================================================================
# ** Game_Message
#------------------------------------------------------------------------------
#  This class handles the state of the message window that displays text or
# selections, etc. The instance of this class is referenced by $game_message.
#==============================================================================

class Game_Message
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  # *= Alias Listings
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  alias_method(:dp3_gamemessage_initialize_235ufnh,               :initialize)
  alias_method(:dp3_gamemessage_clear_235ufnh,                    :clear     )
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  # * New Public Instance Variables
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  attr_accessor :choice_help_text              # Help Text for choices (Hash)
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  # * Aliased Method: Object Initialization
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  def initialize()
    dp3_gamemessage_initialize_235ufnh() # Call Original Method
    @choice_help_text = Hash.new()
  end
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  # * Aliased Method: Clear
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  def clear()
    dp3_gamemessage_clear_235ufnh() # Call Original Method
    @choice_help_text = Hash.new()
  end
end








#==============================================================================
# ** DP3_Choice_Window_Help
#------------------------------------------------------------------------------
#  This window displays help text for the choices inside of a choice window
#==============================================================================

class DP3_Choice_Window_Help < Window_Help
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  # * New Method: Object Initialization
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  def initialize(text, position, background)
    super( [text.split("\n").size, 4].max )
    self.y = position * (Graphics.height - self.height) / 2
    self.openness = 0
    self.opacity = background ==0 ? 255 : 0
    create_back_bitmap
    create_back_sprite
    @back_sprite.visible = true if background == 1
    set_text(text)
  end
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  # * New Method: Immediately Open
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  def immediately_open()
    self.openness = 255
  end
 
  def create_back_bitmap
    @back_bitmap = Bitmap.new(width, height)
    rect1 = Rect.new(0, 0, width, 12)
    rect2 = Rect.new(0, 12, width, height - 24)
    rect3 = Rect.new(0, height - 12, width, 12)
    @back_bitmap.gradient_fill_rect(rect1, back_color2, back_color1, true)
    @back_bitmap.fill_rect(rect2, back_color1)
    @back_bitmap.gradient_fill_rect(rect3, back_color1, back_color2, true)
  end
  #--------------------------------------------------------------------------
  # * Get Background Color 1
  #--------------------------------------------------------------------------
  def back_color1
    Color.new(0, 0, 0, 160)
  end
  #--------------------------------------------------------------------------
  # * Get Background Color 2
  #--------------------------------------------------------------------------
  def back_color2
    Color.new(0, 0, 0, 0)
  end
  #--------------------------------------------------------------------------
  # * Create Background Sprite
  #--------------------------------------------------------------------------
  def create_back_sprite
    @back_sprite = Sprite.new
    @back_sprite.y = self.y
    @back_sprite.bitmap = @back_bitmap
    @back_sprite.visible = false
    @back_sprite.z = z - 1
  end
 
  def dispose
    @back_sprite.dispose
    super
  end
 
end








#==============================================================================
# ** Window_ChoiceList
#------------------------------------------------------------------------------
#  This window is used for the event command [Show Choices].
#==============================================================================

class Window_ChoiceList < Window_Command
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  # *= Alias Listings
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  alias_method(:dp3_windowchoicelist_update_235ufnh,            :update     )
  alias_method(:dp3_windowchoicelist_select_235ufnh,            :select     )
  alias_method(:dp3_windowchoicelist_cursordown_235ufnh,        :cursor_down)
  alias_method(:dp3_windowchoicelist_cursorup_235ufnh,          :cursor_up  )
  alias_method(:dp3_windowchoicelist_open_235ufnh,              :open       )
  alias_method(:dp3_windowchoicelist_close_235ufnh,             :close      )
  alias_method(:dp3_windowchoicelist_dispose_235ufnh,           :dispose    )
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  # * Aliased Method: Update
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  def update(*args)
    dp3_windowchoicelist_update_235ufnh(*args)
    @choicehelp_helpwindow.update() unless @choicehelp_helpwindow.nil?
  end
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  # * Aliased Method: Select Item
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  def select(*args)
    dp3_windowchoicelist_select_235ufnh(*args)
    dp3_dispose_choicehelp_window()
    unless dp3_get_current_choice_windowinfo[0].nil?
      @choicehelp_helpwindow = DP3_Choice_Window_Help.new(*dp3_get_current_choice_windowinfo)
    end
  end
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  # * Aliased Method: Move Cursor Down
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  def cursor_down(*args)
    dp3_windowchoicelist_cursordown_235ufnh(*args)
    @choicehelp_helpwindow.immediately_open() unless @choicehelp_helpwindow.nil?
  end
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  # * Aliased Method: Move Cursor Up
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  def cursor_up(*args)
    dp3_windowchoicelist_cursorup_235ufnh(*args)
    @choicehelp_helpwindow.immediately_open() unless @choicehelp_helpwindow.nil?
  end
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  # * Aliased Method: Open
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  def open(*args)
    dp3_windowchoicelist_open_235ufnh(*args) # Call Original Method
    @choicehelp_helpwindow.open() unless @choicehelp_helpwindow.nil?
  end
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  # * Aliased Method: Close
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  def close(*args)
    @choicehelp_helpwindow.close() unless @choicehelp_helpwindow.nil?
    dp3_windowchoicelist_close_235ufnh(*args) # Call Original Method
    dp3_dispose_choicehelp_window()
  end
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  # * Aliased Method: Dispose
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  def dispose(*args)
    dp3_windowchoicelist_dispose_235ufnh(*args) # Call Original Method
    dp3_dispose_choicehelp_window()
  end
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  # * New Method: Dispose ChoiceHelp Window
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  def dp3_dispose_choicehelp_window()
    @choicehelp_helpwindow.dispose unless @choicehelp_helpwindow.nil? || @choicehelp_helpwindow.disposed?
    @choicehelp_helpwindow = nil
  end
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  # * New Method: Get Required Info for the Window Choice
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  def dp3_get_current_choice_windowinfo()
    return [nil] if $game_message.choice_help_text[self.index].nil?
    return [$game_message.choice_help_text[self.index][:text],
            $game_message.choice_help_text[self.index][:position],
            $game_message.choice_help_text[self.index][:background]]
    end
end








#==============================================================================
# ** Game_Interpreter
#------------------------------------------------------------------------------
#  An interpreter for executing event commands. This class is used within the
# Game_Map, Game_Troop, and Game_Event classes.
#==============================================================================

class Game_Interpreter
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  # * New Method: Add Command List Help Text
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  def add_command_list_help_text( text = nil )
    position = 0
    background = 0
    # Add Text Argument
    unless text.nil?
      text = text.gsub(/[\n\r]+/, "")
      text = text.gsub(/\\endl/, "\n")
 
    # Add Show Text Command Text Paramters
    else
      text = ""
      while( !@list[@index].nil? )
        @index += 1
        case @list[@index].code
        when 101 # Show Text Window Command
          background =  @list[@index].parameters[2]
          position = @list[@index].parameters[3]
        when 401 # Show Text Line
          text += @list[@index].parameters[0] + "\n"
        when 355 # Script Command
          script = @list[@index].parameters[0] + "\n"
          while next_event_code == 655
            @index += 1
            script += @list[@index].parameters[0] + "\n"
          end
          break if script.include?("end_command_list_help_text")
        end
      end
    end
 
 
    # Add to List
    index = $game_message.choice_help_text.size
    $game_message.choice_help_text[index]             = Hash.new()
    $game_message.choice_help_text[index][:position]  = position
    $game_message.choice_help_text[index][:text]      = text
    $game_message.choice_help_text[index][:background]= background
  end
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  # * New Method: End Command List Help Text
  #--------------------------------------------------------------------------
  # Method only exists in case the user actually tries to call it outside of
  # bounds.
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  def end_command_list_help_text()
  end
end

Not sure the best thing, but basicaly I made when the handler close the window, that also to call the dispose method
for the help window. Now it seems to work, unless something else occures xD. Report if so.

Roninator: My dispose method didn't work only because nothing called it when choice window cancel or ok handler activates.
 
Last edited:

Roninator2

Gamer
Veteran
Joined
May 22, 2016
Messages
2,674
Reaction score
566
First Language
English
Primarily Uses
RMVXA
when choice window cancel or ok handler activates.
I see there is a lot there that I didn't do.
I was only trying to modify the Window_Help part, nothing else and I didn't realize I could add in a background to the initialize. Never thought about changing that.
I'm just used to leaving things as they are and working with them.

I played with your code and streamlined it, if you don't mind.
No changes to the original code is required.
Code:
class DP3_Choice_Window_Help < Window_Help
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  # * New Method: Object Initialization
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  def initialize(text, position)
    super( [text.split("\n").size, 4].max )
    self.y = position * (Graphics.height - self.height) / 2
    self.openness = 255
    @background = 1
    self.opacity = @background == 0 ? 255 : 0
    create_back_bitmap
    create_back_sprite
    @back_sprite.visible = true if @background == 1
    set_text(text)
  end
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  # * New Method: Immediately Open
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  def immediately_open()
    self.openness = 255
  end
 
  def create_back_bitmap
    @back_bitmap = Bitmap.new(width, height)
    rect1 = Rect.new(0, 0, width, 12)
    rect2 = Rect.new(0, 12, width, height - 24)
    rect3 = Rect.new(0, height - 12, width, 12)
    @back_bitmap.gradient_fill_rect(rect1, back_color2, back_color1, true)
    @back_bitmap.fill_rect(rect2, back_color1)
    @back_bitmap.gradient_fill_rect(rect3, back_color1, back_color2, true)
  end
  #--------------------------------------------------------------------------
  # * Get Background Color 1
  #--------------------------------------------------------------------------
  def back_color1
    Color.new(0, 0, 0, 160)
  end
  #--------------------------------------------------------------------------
  # * Get Background Color 2
  #--------------------------------------------------------------------------
  def back_color2
    Color.new(0, 0, 0, 0)
  end
  #--------------------------------------------------------------------------
  # * Create Background Sprite
  #--------------------------------------------------------------------------
  def create_back_sprite
    @back_sprite = Sprite.new
    @back_sprite.y = self.y
    @back_sprite.bitmap = @back_bitmap
    @back_sprite.visible = false
    @back_sprite.z = z - 1
  end
 
  def dispose
    @back_sprite.dispose
    super
  end
 
end

class Window_ChoiceList < Window_Command
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  # * Aliased Method: Close
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  def close(*args)
    @choicehelp_helpwindow.close() unless @choicehelp_helpwindow.nil?
    dp3_windowchoicelist_close_235ufnh(*args) # Call Original Method
    dp3_dispose_choicehelp_window()
  end
end
 
Last edited:

GGZiron

Veteran
Veteran
Joined
Nov 6, 2016
Messages
90
Reaction score
32
First Language
Bulgarian
Primarily Uses
RMVXA
No, not a prob :).
Anything you want to happen with the class creation, you put in initialize.
Btw, you removed my condition for
Code:
@back_sprite.visible = true
.
The condition is there, because if developer wants transparent window, the background image will still show, if the condition is removed.

I am not sure my impletation is very good too. I would like to use message window instead the help window, so I don't have to copy paste same methods across different classes, but my attemps so far failed xD.
 
Last edited:

Roninator2

Gamer
Veteran
Joined
May 22, 2016
Messages
2,674
Reaction score
566
First Language
English
Primarily Uses
RMVXA
you removed my condition
Yes, because I forced the condition. Dim window for this script, nothing else.
But I see what you mean. I'll fix that in the post
But I took what you did and added a part onto my attempt and now it works well.
Code:
#=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
#             Help Window for Choices
#             Version: 2.1
#             Authors: DiamondandPlatinum3
#             Addon:   Roninator2
#             Date: December 4, 2012  (Original)
#                   December 14, 2013 (Updated)
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#  Description:
#
#    This script adds on to the default choice system, allowing you to have a
#    help window at the top of the screen to assist players in the choices they
#    have to make
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

=begin
##    *Addition by Roninator2
##    Displays a dim background instead of default window
##  
##    Only setting is the opacity of the window
##    Values from 0-255
##  
##    Adjust position depending on where you place the message. E.g. top or bottom
##    0 for top, (depending on your screen resolution) 400 for bottom
=end

#==============================================================================
# Setting
#==============================================================================
module R2DP3CH

  #Help Window Opacity 0-255
  View = 180
 
  #Help Window Y position
  WinY = 400
end

#==============================================================================
# Addon Script
#==============================================================================
class DP3_Choice_Window_Help < Window_Help
   
  def initialize(text, position)
    super( [text.split("\n").size, 2].max )
    self.y = position * (Graphics.height - self.height) / 2
    self.openness = 255
    set_text(text)
    self.windowskin = Cache.system("Window_blank")
    self.opacity = R2DP3CH::View
    create_back_bitmap_CH
    create_back_sprite_CH
    refresh
  end
  #--------------------------------------------------------------------------
  # * Create Background Bitmap
  #--------------------------------------------------------------------------
  def create_back_bitmap_CH
    @back_bitmap_CH = Bitmap.new(width, height) if @back_bitmap_CH.nil?
    rect1 = Rect.new(0, 0, width, 12)
    rect2 = Rect.new(0, 12, width, height - 24)
    rect3 = Rect.new(0, height - 12, width, 12)
    @back_bitmap_CH.gradient_fill_rect(rect1, back_color2, back_color1, true)
    @back_bitmap_CH.fill_rect(rect2, back_color1)
    @back_bitmap_CH.gradient_fill_rect(rect3, back_color1, back_color2, true)
  end
  #--------------------------------------------------------------------------
  # * Get Background Color 1
  #--------------------------------------------------------------------------
  def back_color1
    Color.new(0, 0, 0, R2DP3CH::View)
  end
  #--------------------------------------------------------------------------
  # * Get Background Color 2
  #--------------------------------------------------------------------------
  def back_color2
    Color.new(0, 0, 0, R2DP3CH::View - 80)
  end
  #--------------------------------------------------------------------------
  # * Create Background Sprite
  #--------------------------------------------------------------------------
  def create_back_sprite_CH
    @back_sprite_CH = Sprite.new if @back_sprite_CH.nil?
    @back_sprite_CH.bitmap = @back_bitmap_CH
    @back_sprite_CH.z = z - 1
  end
  #--------------------------------------------------------------------------
  # * Frame Update
  #--------------------------------------------------------------------------
  def update
    super
    update_back_sprite_CH
  end
  #--------------------------------------------------------------------------
  # * Free
  #--------------------------------------------------------------------------
  def dispose
    super
    dispose_back_bitmap_CH
    dispose_back_sprite_CH
  end
  #--------------------------------------------------------------------------
  # * Update Background Sprite
  #--------------------------------------------------------------------------
  def update_back_sprite_CH
    @back_sprite_CH.opacity = R2DP3CH::View
    @back_sprite_CH.y = R2DP3CH::WinY
    @back_sprite_CH.update
  end
  #--------------------------------------------------------------------------
  # * Free Background Bitmap
  #--------------------------------------------------------------------------
  def dispose_back_bitmap_CH
    @back_bitmap_CH.dispose
  end
  #--------------------------------------------------------------------------
  # * Free Background Sprite
  #--------------------------------------------------------------------------
  def dispose_back_sprite_CH
    @back_sprite_CH.dispose
  end

end


class Window_ChoiceList < Window_Command
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  # * Aliased Method: Close
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  def close(*args)
    @choicehelp_helpwindow.close() unless @choicehelp_helpwindow.nil?
    dp3_windowchoicelist_close_235ufnh(*args) # Call Original Method
    dp3_dispose_choicehelp_window()
  end
end
Might be a lot of stuff in there that's not good but just my long winded way of getting it done.
Doesn't seem to cause errors or have memory leaks, so...
 

Tiptank

Villager
Member
Joined
Aug 26, 2018
Messages
23
Reaction score
1
First Language
German
Primarily Uses
RMVXA
I'm very thankful for you guys but now I am completely confused. Which script should I take now? Which is the best? I want this with the dim background like GGZiron did. But his script seems to have some issues which Ronis didn't. But he used the window_blank file which I don't want to use. Maybe we can combine both?
 

GGZiron

Veteran
Veteran
Joined
Nov 6, 2016
Messages
90
Reaction score
32
First Language
Bulgarian
Primarily Uses
RMVXA
You tried my second one? I think you wont encounter issues on it, i find it not best implemented, but working.
Keep in mind, mine is not addon, but dirrect edit, while his is addon, you put beneath original script.
Try both and you decide.
 

Tiptank

Villager
Member
Joined
Aug 26, 2018
Messages
23
Reaction score
1
First Language
German
Primarily Uses
RMVXA
@GGZiron Thank you, this is working well. Just tested it (I've overseen your 2nd edit. I'm sorry for that.)

I'll credit both you and Roni for helping me so much with this.
 

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

Latest Threads

Latest Posts

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,470
Members
137,821
Latest member
Capterson
Top