Regda

Villager
Member
Joined
Jul 30, 2022
Messages
16
Reaction score
2
First Language
German
Primarily Uses
Other
Hi,

i need some way to show the item description to the user while the user is selecting an Item from a big list (so that the list is scrollable is important).
It has to work while in normal Map view (not Battle or shop view).
In general i need something where the user can see parts of the Map, a list of Items and the description of the selected item. Thats why i came up with the idea to have a Message-Window (position: top) which lists Items and a Message-Window (position: bottom) which shows the item description.

So the Select Item Window does list Key-Items scrollable which is fine but it hides the description.
I found the plugin "Choice Move Handlers" from Tsukihime which does execute a method on cursor move which is also nice, but sadly it does it only for "choice handlers" and for some reason it doesn't work when i wrap $game_message.add(text) to show a Message-Window.

Can somebody help me and tell if it's possible to use this plugin in key item selection instead of choice lists and for showing text in Message-Window instead of gabs?
(or another way to achive my goal?)

best regards,
Regda
 

Bex

Veteran
Veteran
Joined
Aug 2, 2013
Messages
1,953
Reaction score
756
First Language
German
Primarily Uses
RMMZ
Here is the Link to the MV one:

There was also one for VX-Ace, i lost the one i had some time ago, i made a search attempt but
was not able to find it again. Maybe someone else knows more.
 

kyonides

Reforged is laughable
Veteran
Joined
Nov 17, 2019
Messages
1,158
Reaction score
546
First Language
English
Primarily Uses
RMXP
Hi,

i need some way to show the item description to the user while the user is selecting an Item from a big list (so that the list is scrollable is important).
It has to work while in normal Map view (not Battle or shop view).
In general i need something where the user can see parts of the Map, a list of Items and the description of the selected item. Thats why i came up with the idea to have a Message-Window (position: top) which lists Items and a Message-Window (position: bottom) which shows the item description.

So the Select Item Window does list Key-Items scrollable which is fine but it hides the description.
I found the plugin "Choice Move Handlers" from Tsukihime which does execute a method on cursor move which is also nice, but sadly it does it only for "choice handlers" and for some reason it doesn't work when i wrap $game_message.add(text) to show a Message-Window.

Can somebody help me and tell if it's possible to use this plugin in key item selection instead of choice lists and for showing text in Message-Window instead of gabs?
(or another way to achive my goal?)

best regards,
Regda

Since this seems to be VX Ace related, why don't you ask a moderator to move this threat to RGSS3 Script Requests subforum?
 

Regda

Villager
Member
Joined
Jul 30, 2022
Messages
16
Reaction score
2
First Language
German
Primarily Uses
Other
Since this seems to be VX Ace related, why don't you ask a moderator to move this threat to RGSS3 Script Requests subforum?
because i was hoping somebody could tell me how to use the "Choice Move Handlers" instead of having to rewrite everything from scratch, in general i dont really know where this kind of question should belong...
 

Roninator2

Gamer
Veteran
Joined
May 22, 2016
Messages
4,830
Reaction score
1,373
First Language
English
Primarily Uses
RMVXA
Try this mod of Theoallens Choice Help script
Ruby:
# =============================================================================
# TheoAllen - Choice Helps
# Version : 1.1
# Contact : Discord @ Theo#3034
# =============================================================================
($imported ||= {})[:Theo_ChoiceHelp] = true
# =============================================================================
# Change Logs:
# -----------------------------------------------------------------------------
# 2013.11.14 - Finished script
# =============================================================================
=begin

  ----------------------------------------------------------------------------
Introduction :
  This script allows you to display help on choice.
  
  -------------------------------------------------- --------------------------
  How to use :
  Install this script under material but above Main
  Use a script call like the following to determine the help
  
  choice_helps[0] = "blablabla"
  choice_helps[1] = "dasdasdasd"
  choice_helps[2] = "lorem ipsum"
  choice_helps[3] = "another sample text"
  
  Place the script call just above the show text before the command
  choice. Index choice starts from 0. If there is 4 choice, then each index
  is 0-1-2-3
  
  Don't forget to clean the remnants of the help with a script call like
  this is at the end of choice (unless you set AutoClear to true)
  
  $game_message.clear_helps
  
  -------------------------------------------------- --------------------------
  Terms of use:
  Credit, TheoAllen. If for example you edit the script and it becomes more
  cool, whatever. I'm good with that. Just as long as you don't claim it.
  If you want it like that. For commercial use, don't forget, I get the game for free.

=end
# =============================================================================
# Start of configuration
# =============================================================================
module Theo
  module Choice
    
    AutoClear = true
  # Clean the help text after choice. (recommendation: true)
 
    LineNumber = 2
  # Number of rows in the help window
 
  end
end
# =============================================================================
# End of configuration
# =============================================================================
class Game_Interpreter
  # --------------------------------------------------------------------------
  # Script call
  # --------------------------------------------------------------------------
  def choice_helps
    $game_message.choice_helps
  end
 
end

class Game_Message
  attr_reader :choice_helps
 
  alias theo_choiceh_init initialize
  def initialize
    theo_choiceh_init
    clear_helps
  end
 
  def clear_helps
    @choice_helps = []
  end
end

class Window_ChoiceHelp < Window_Help
 
  def initialize(msg_window, choice_window)
    super(Theo::Choice::LineNumber)
    @msg_window = msg_window
    @choice_window = choice_window
    @choice_window.help_window = self
    self.openness = 0
    update
  end
 
  def update
    super
    update_placement
    update_openness
    update_visible
  end
 
  def position=(value = 0)
    @position = value
  end
 
  def update_placement
    self.y = 0 if @msg_window.y > 0
    self.y = Graphics.height - height if @msg_window.y <= 0
    self.y = Graphics.height - height if @position == 0
  end
 
  def update_openness
    self.openness = @choice_window.openness unless vx_choice?
  end
 
  def update_visible
    self.visible = !$game_message.choice_helps.compact.empty?
  end
 
  def choice_window=(window)
    @choice_window = window
    @choice_window.help_window = self
  end
 
  def vx_choice?
    $imported[:Theo_VXStyleChoices] && $game_message.vx_choice
  end
 
end

class Window_ChoiceList < Window_Command
 
  def update_help
    @help_window.set_text($game_message.choice_helps[index])
  end
 
  alias theo_choiceh_call_ok call_ok_handler
  def call_ok_handler
    theo_choiceh_call_ok
    clear_helps
  end
 
  alias theo_choiceh_call_cancel call_cancel_handler
  def call_cancel_handler
    theo_choiceh_call_cancel
    clear_helps
  end
 
  def clear_helps
    return unless Theo::Choice::AutoClear
    $game_message.clear_helps
  end
 
end

class Window_KeyItem < Window_ItemList

  def update_help
    @help_window.set_text($game_message.choice_helps[index])
  end
 
  alias theo_itemh_call_ok call_ok_handler
  def call_ok_handler
    theo_itemh_call_ok
    clear_helps
  end
 
  alias theo_itemh_call_cancel call_cancel_handler
  def call_cancel_handler
    theo_itemh_call_cancel
    clear_helps
  end
 
  def clear_helps
    return unless Theo::Choice::AutoClear
    $game_message.clear_helps
  end
 
end

class Window_Message < Window_Base
 
  alias theo_choiceh_init initialize
  def initialize
    theo_choiceh_init
    create_choice_help
  end
 
  def create_choice_help
    @choice_help = Window_ChoiceHelp.new(self, @choice_window)
    @item_help = Window_ChoiceHelp.new(self, @item_window)
    @item_help.position = 0
  end
 
  alias theo_choiceh_update update
  def update
    theo_choiceh_update
    @choice_help.update
    @item_help.update
  end
 
  alias theo_choiceh_dispose_all dispose_all_windows
  def dispose_all_windows
    theo_choiceh_dispose_all
    @choice_help.dispose
    @item_help.dispose
  end
 
  if $imported[:Theo_MessageBallon]
  alias theo_choiceh_recreate_choice recreate_choice
  def recreate_choice
    theo_choiceh_recreate_choice
    @choice_help.choice_window = @choice_window
    @item_help.choice_window = @item_window
  end
  end
 
end
 

Regda

Villager
Member
Joined
Jul 30, 2022
Messages
16
Reaction score
2
First Language
German
Primarily Uses
Other
I was more thinking about something like this (its not working, just illustration):
where the bottom message window shows the description text of the selected key item above.
(the message window should update its content on cursor move)

example.png
 

Shaz

Keeper of the Nuts
Global Mod
Joined
Mar 2, 2012
Messages
46,038
Reaction score
16,850
First Language
English
Primarily Uses
RMMV

I've moved this thread to RGSS3 Script Requests. Thank you.

 

Roninator2

Gamer
Veteran
Joined
May 22, 2016
Messages
4,830
Reaction score
1,373
First Language
English
Primarily Uses
RMVXA
Ruby:
#==============================================================================
# ** Window_Help
#==============================================================================

class Window_KeyHelp < Window_Base
  #--------------------------------------------------------------------------
  # * Object Initialization
  #--------------------------------------------------------------------------
  def initialize(line_number = 2)
    super(0, 0, Graphics.width, fitting_height(line_number))
  end
  #--------------------------------------------------------------------------
  # * Set Text
  #--------------------------------------------------------------------------
  def set_text(text)
    if text != @text
      @text = text
      refresh
    end
  end
  #--------------------------------------------------------------------------
  # * Clear
  #--------------------------------------------------------------------------
  def clear
    set_text("")
  end
  #--------------------------------------------------------------------------
  # * Set Item
  #     item : Skills and items etc.
  #--------------------------------------------------------------------------
  def set_item(item)
    set_text(item ? item.description : "")
  end
  #--------------------------------------------------------------------------
  # * Refresh
  #--------------------------------------------------------------------------
  def refresh
    contents.clear
    draw_text_ex(4, 0, @text)
  end
end
#==============================================================================
# ** Window_KeyItem
#==============================================================================

class Window_KeyItem < Window_ItemList
  #--------------------------------------------------------------------------
  # * Object Initialization
  #--------------------------------------------------------------------------
  def initialize(message_window)
    @message_window = message_window
    super(0, 0, Graphics.width, fitting_height(4))
    self.openness = 0
    deactivate
    set_handler(:ok,     method(:on_ok))
    set_handler(:cancel, method(:on_cancel))
    create_help_window
  end
  #--------------------------------------------------------------------------
  # * Create Help Window
  #--------------------------------------------------------------------------
  def create_help_window
    @help_window = Window_KeyHelp.new
    @help_window.viewport = @viewport
    @help_window.openness = 0
  end
  #--------------------------------------------------------------------------
  # * Start Input Processing
  #--------------------------------------------------------------------------
  def start
    @help_window.openness = 255
    self.category = :key_item
    update_placement
    refresh
    select(0)
    open
    activate
  end
  #--------------------------------------------------------------------------
  # * Update Window Position
  #--------------------------------------------------------------------------
  def update_placement
    if @message_window.y >= Graphics.height / 2
      self.y = 0
      @help_window.y = Graphics.height - fitting_height(2)
    else
      self.y = Graphics.height - height
      @help_window.y = 0
    end
  end
  #--------------------------------------------------------------------------
  # * Processing at OK
  #--------------------------------------------------------------------------
  def on_ok
    result = item ? item.id : 0
    $game_variables[$game_message.item_choice_variable_id] = result
    @help_window.openness = 0
    close
  end
  #--------------------------------------------------------------------------
  # * Processing at Cancel
  #--------------------------------------------------------------------------
  def on_cancel
    $game_variables[$game_message.item_choice_variable_id] = 0
    @help_window.openness = 0
    close
  end
end
 

Bex

Veteran
Veteran
Joined
Aug 2, 2013
Messages
1,953
Reaction score
756
First Language
German
Primarily Uses
RMMZ
It seems a solution had allready been posted.

I found also one, and just wanted to Link it:

I found it in a old thread in which i failed to understand the problem.
It also contains a second Script posted by @MeowFace.
 

Regda

Villager
Member
Joined
Jul 30, 2022
Messages
16
Reaction score
2
First Language
German
Primarily Uses
Other
Ruby:
#==============================================================================
# ** Window_Help
#==============================================================================

class Window_KeyHelp < Window_Base
  #--------------------------------------------------------------------------
  # * Object Initialization
  #--------------------------------------------------------------------------
  def initialize(line_number = 2)
    super(0, 0, Graphics.width, fitting_height(line_number))
  end
  #--------------------------------------------------------------------------
  # * Set Text
  #--------------------------------------------------------------------------
  def set_text(text)
    if text != @text
      @text = text
      refresh
    end
  end
  #--------------------------------------------------------------------------
  # * Clear
  #--------------------------------------------------------------------------
  def clear
    set_text("")
  end
  #--------------------------------------------------------------------------
  # * Set Item
  #     item : Skills and items etc.
  #--------------------------------------------------------------------------
  def set_item(item)
    set_text(item ? item.description : "")
  end
  #--------------------------------------------------------------------------
  # * Refresh
  #--------------------------------------------------------------------------
  def refresh
    contents.clear
    draw_text_ex(4, 0, @text)
  end
end
#==============================================================================
# ** Window_KeyItem
#==============================================================================

class Window_KeyItem < Window_ItemList
  #--------------------------------------------------------------------------
  # * Object Initialization
  #--------------------------------------------------------------------------
  def initialize(message_window)
    @message_window = message_window
    super(0, 0, Graphics.width, fitting_height(4))
    self.openness = 0
    deactivate
    set_handler(:ok,     method(:on_ok))
    set_handler(:cancel, method(:on_cancel))
    create_help_window
  end
  #--------------------------------------------------------------------------
  # * Create Help Window
  #--------------------------------------------------------------------------
  def create_help_window
    @help_window = Window_KeyHelp.new
    @help_window.viewport = @viewport
    @help_window.openness = 0
  end
  #--------------------------------------------------------------------------
  # * Start Input Processing
  #--------------------------------------------------------------------------
  def start
    @help_window.openness = 255
    self.category = :key_item
    update_placement
    refresh
    select(0)
    open
    activate
  end
  #--------------------------------------------------------------------------
  # * Update Window Position
  #--------------------------------------------------------------------------
  def update_placement
    if @message_window.y >= Graphics.height / 2
      self.y = 0
      @help_window.y = Graphics.height - fitting_height(2)
    else
      self.y = Graphics.height - height
      @help_window.y = 0
    end
  end
  #--------------------------------------------------------------------------
  # * Processing at OK
  #--------------------------------------------------------------------------
  def on_ok
    result = item ? item.id : 0
    $game_variables[$game_message.item_choice_variable_id] = result
    @help_window.openness = 0
    close
  end
  #--------------------------------------------------------------------------
  # * Processing at Cancel
  #--------------------------------------------------------------------------
  def on_cancel
    $game_variables[$game_message.item_choice_variable_id] = 0
    @help_window.openness = 0
    close
  end
end
Thanks alot, might it be possible to apply the animation from the window base to the bottom message window when opening or closing the key item list? (i noticed that it should change openess by 48 each frame)
im confused by who calls the update method every frame and how to pass it through to Window_KeyHelp class.

also, is there a way to use the draw_face method from window base to show an picture ? :kaophew:

EDIT:
It seems a solution had allready been posted.

I found also one, and just wanted to Link it:

I found it in a old thread in which i failed to understand the problem.
It also contains a second Script posted by @MeowFace.
well the script from MeowFace uses dispose which is good (i assume) but both (Roninator2 and MeowFace) are missing the animation also i would like to have the draw_face method.
 

Roninator2

Gamer
Veteran
Joined
May 22, 2016
Messages
4,830
Reaction score
1,373
First Language
English
Primarily Uses
RMVXA
well the script from MeowFace uses dispose which is good (i assume) but both (Roninator2 and MeowFace) are missing the animation also i would like to have the draw_face method.
Why do you want the draw_face method?
Why draw the actors face in the description window?
Do you actually want to draw the icon instead?
 

Regda

Villager
Member
Joined
Jul 30, 2022
Messages
16
Reaction score
2
First Language
German
Primarily Uses
Other
Why do you want the draw_face method?
Why draw the actors face in the description window?
Do you actually want to draw the icon instead?
"Why do you want the draw_face method?":
Since in my case the keys will be "Cards" i had the idea to create a table where i store relations between keyitems and pictures which are stored as actor faces.

"Why draw the actors face in the description window?":
Because i would like to show a picture of the card (keyitem).

"Do you actually want to draw the icon instead?":
no, actorface has a higher resolution.
 

Roninator2

Gamer
Veteran
Joined
May 22, 2016
Messages
4,830
Reaction score
1,373
First Language
English
Primarily Uses
RMVXA
Since in my case the keys will be "Cards" i had the idea to create a table where i store relations between keyitems and pictures which are stored as actor faces.
Then it may be possible to use a note tag on the key item to specify the picture image to use and display the image on the screen. Either in the help window or on top of it.
When you say face image that means your calling in an actor and showing their face. Even if the actors are cards it would show their face and it would not change when you change items.

So you need to be clear on what you want to happen and not suggest solutions, that will up to scripters to figure out.
 

Regda

Villager
Member
Joined
Jul 30, 2022
Messages
16
Reaction score
2
First Language
German
Primarily Uses
Other
well ok, but would it be possible to fix the animation before trying to implement this picture thingy ?
because the animation is more important to me then the picture.
 

Roninator2

Gamer
Veteran
Joined
May 22, 2016
Messages
4,830
Reaction score
1,373
First Language
English
Primarily Uses
RMVXA
well ok, but would it be possible to fix the animation before trying to implement this picture thingy ?
because the animation is more important to me then the picture.
You can see the window frame open up that much that it's a problem? Wow.
It's like almost instantaneously for me.
Ruby:
#==============================================================================
# ** Window_Help
#==============================================================================
class Window_KeyHelp < Window_Base
  #--------------------------------------------------------------------------
  # * Object Initialization
  #--------------------------------------------------------------------------
  def initialize(line_number = 4)
    super(0, 0, Graphics.width, fitting_height(line_number))
    @name = ""
    @icon = 0
    self.openness = 0
  end
  def items(id); $data_items[id].icon_index; end
  #--------------------------------------------------------------------------
  # * Set Text
  #--------------------------------------------------------------------------
  def set_text(text)
    if text != @text
      @text = text
      refresh
    end
  end
  #--------------------------------------------------------------------------
  # * Clear
  #--------------------------------------------------------------------------
  def clear
    set_text("")
  end
  #--------------------------------------------------------------------------
  # * Set Item
  #     item : Skills and items etc.
  #--------------------------------------------------------------------------
  def set_item(item)
    @name = item.name
    @icon = items(item.id)
    set_text(item ? item.description : "")
  end
  #--------------------------------------------------------------------------
  # * Refresh
  #--------------------------------------------------------------------------
  def refresh
    contents.clear
    draw_icon(@icon, 4, 0)
    draw_text_ex(28, 0, @name)
    draw_text_ex(4, 24, @text)
  end

end

#==============================================================================
# ** Window_KeyItem
#==============================================================================

class Window_KeyItem < Window_ItemList
  #--------------------------------------------------------------------------
  # * Object Initialization
  #--------------------------------------------------------------------------
  def initialize(message_window)
    @message_window = message_window
    super(0, 0, Graphics.width, fitting_height(4))
    self.openness = 0
    deactivate
    set_handler(:ok,     method(:on_ok))
    set_handler(:cancel, method(:on_cancel))
    create_help_window
  end
  #--------------------------------------------------------------------------
  # * Create Help Window
  #--------------------------------------------------------------------------
  def create_help_window
    @help_window = Window_KeyHelp.new
  end
  #--------------------------------------------------------------------------
  # * Start Input Processing
  #--------------------------------------------------------------------------
  def start
    self.category = :key_item
    update_placement
    refresh
    select(0)
    open
    @help_window.open
    activate
  end
  #--------------------------------------------------------------------------
  # * Frame Update
  #--------------------------------------------------------------------------
  alias r2_update_help_key_item update
  def update
    r2_update_help_key_item
    @help_window.update
  end
  #--------------------------------------------------------------------------
  # * Update Window Position
  #--------------------------------------------------------------------------
  def update_placement
    if @message_window.y >= Graphics.height / 2
      self.y = 0
      @help_window.y = Graphics.height - fitting_height(4)
    else
      self.y = Graphics.height - height
      @help_window.y = 0
    end
  end
  #--------------------------------------------------------------------------
  # * Processing at OK
  #--------------------------------------------------------------------------
  def on_ok
    result = item ? item.id : 0
    $game_variables[$game_message.item_choice_variable_id] = result
    @help_window.close
    close
  end
  #--------------------------------------------------------------------------
  # * Processing at Cancel
  #--------------------------------------------------------------------------
  def on_cancel
    $game_variables[$game_message.item_choice_variable_id] = 0
    @help_window.close
    close
  end
end
 
Last edited:

Regda

Villager
Member
Joined
Jul 30, 2022
Messages
16
Reaction score
2
First Language
German
Primarily Uses
Other
You can see the window frame open up that much that it's a problem? Wow.
It's like almost instantaneously for me.
Ruby:
#==============================================================================
# ** Window_Help
#==============================================================================
class Window_KeyHelp < Window_Base
  #--------------------------------------------------------------------------
  # * Object Initialization
  #--------------------------------------------------------------------------
  def initialize(line_number = 2)
    super(0, 0, Graphics.width, fitting_height(line_number))
    @name = ""
    @icon = 0
  end
  def items(id); $data_items[id].icon_index; end
  #--------------------------------------------------------------------------
  # * Set Text
  #--------------------------------------------------------------------------
  def set_text(text)
    if text != @text
      @text = text
      refresh
    end
  end
  #--------------------------------------------------------------------------
  # * Clear
  #--------------------------------------------------------------------------
  def clear
    set_text("")
  end
  #--------------------------------------------------------------------------
  # * Set Item
  #     item : Skills and items etc.
  #--------------------------------------------------------------------------
  def set_item(item)
    @name = item.name
    @icon = items(item.id)
    set_text(item ? item.description : "")
  end
  #--------------------------------------------------------------------------
  # * Refresh
  #--------------------------------------------------------------------------
  def refresh
    contents.clear
    draw_icon(@icon, 4, 0)
    draw_text_ex(28, 0, @name)
    draw_text_ex(4, 24, @text)
  end

end

#==============================================================================
# ** Window_KeyItem
#==============================================================================

class Window_KeyItem < Window_ItemList
  #--------------------------------------------------------------------------
  # * Object Initialization
  #--------------------------------------------------------------------------
  def initialize(message_window)
    @message_window = message_window
    super(0, 0, Graphics.width, fitting_height(4))
    self.openness = 0
    deactivate
    set_handler(:ok,     method(:on_ok))
    set_handler(:cancel, method(:on_cancel))
    create_help_window
  end
  #--------------------------------------------------------------------------
  # * Create Help Window
  #--------------------------------------------------------------------------
  def create_help_window
    @help_window = Window_KeyHelp.new
    @help_window.viewport = @viewport
    @help_window.openness = 0
  end
  #--------------------------------------------------------------------------
  # * Start Input Processing
  #--------------------------------------------------------------------------
  def start
    self.category = :key_item
    update_placement
    refresh
    select(0)
    open
    @help_window.open
    until @help_window.openness >= 255
      @help_window.openness += 48
    end
    activate
  end
  #--------------------------------------------------------------------------
  # * Update Window Position
  #--------------------------------------------------------------------------
  def update_placement
    if @message_window.y >= Graphics.height / 2
      self.y = 0
      @help_window.y = Graphics.height - fitting_height(2)
    else
      self.y = Graphics.height - height
      @help_window.y = 0
    end
  end
  #--------------------------------------------------------------------------
  # * Processing at OK
  #--------------------------------------------------------------------------
  def on_ok
    result = item ? item.id : 0
    $game_variables[$game_message.item_choice_variable_id] = result
    until @help_window.openness <= 0
      @help_window.openness -= 48
    end
    @help_window.close
    close
  end
  #--------------------------------------------------------------------------
  # * Processing at Cancel
  #--------------------------------------------------------------------------
  def on_cancel
    $game_variables[$game_message.item_choice_variable_id] = 0
    until @help_window.openness <= 0
      @help_window.openness -= 48
    end
    @help_window.close
    close
  end
end
The animation doesnt work using the script above. :/
 

Roninator2

Gamer
Veteran
Joined
May 22, 2016
Messages
4,830
Reaction score
1,373
First Language
English
Primarily Uses
RMVXA
The animation doesnt work using the script above. :/
Sorry, didn't realize what I was doing wrong. code above updated
 
Last edited:

Regda

Villager
Member
Joined
Jul 30, 2022
Messages
16
Reaction score
2
First Language
German
Primarily Uses
Other
ok that works, thanks for your help. :kaojoy:
so, for simplicity i rewrote the script and marked some lines with # how to wait here ? comments.
Ruby:
#==============================================================================
# ** Window_KeyItem
#==============================================================================
class Window_KeyItem < Window_ItemList
  #--------------------------------------------------------------------------
  # * Object Initialization
  #--------------------------------------------------------------------------
  def initialize(message_window)
    @message_window = message_window
    super(0, 0, Graphics.width, fitting_height(4))
    self.openness = 0
    deactivate
    set_handler(:ok, method(:on_ok))
    set_handler(:cancel, method(:on_cancel))
    @help_window = nil
  end
  #--------------------------------------------------------------------------
  # * Start Input Processing
  #--------------------------------------------------------------------------
  def start
    self.category = :key_item
    @help_window = Window_Help.new
    @help_window.viewport = @viewport
    update_placement
    refresh
    select(0)
    open
    @help_window.open
    @help_window.update
    activate
  end
  #--------------------------------------------------------------------------
  # * Processing at OK
  #--------------------------------------------------------------------------
  def on_ok
    result = item ? item.id : 0
    $game_variables[$game_message.item_choice_variable_id] = result
    @help_window.close
    
    # how to wait here ?
    
    @help_window.dispose
    @help_window = nil
    close
  end
  #--------------------------------------------------------------------------
  # * Processing at Cancel
  #--------------------------------------------------------------------------
  def on_cancel
    $game_variables[$game_message.item_choice_variable_id] = 0
    @help_window.close
    
    # how to wait here ?
    
    #@help_window.dispose
    #@help_window = nil
    close
  end
  #--------------------------------------------------------------------------
  # * Frame Update
  #--------------------------------------------------------------------------
  def update
    super
    @help_window.update unless @help_window.nil?
  end
  #--------------------------------------------------------------------------
  # * Update Window Position
  #--------------------------------------------------------------------------
  def update_placement
    if @message_window.y >= Graphics.height / 2
      self.y = 0
      @help_window.y = Graphics.height - fitting_height(4)
    else
      self.y = Graphics.height - height
      @help_window.y = 0
    end
  end
end
i would like to free the resources instead of keeping the object and reuse it, so i moved the "new" call from "initialize" to "start".
But the "dispose" call is kinda cancelling the animation from "close" call. Ive seen that i might use wait (which i think, i cant here) or maybe use a fiber??
(when i understood something incorrectly pls tell me)
 

Roninator2

Gamer
Veteran
Joined
May 22, 2016
Messages
4,830
Reaction score
1,373
First Language
English
Primarily Uses
RMVXA
i would like to free the resources instead of keeping the object and reuse it, so i moved the "new" call from "initialize" to "start".
What is your prupose? Why do you need to free resources? What resources? This goes a little over my head for programming. Perhaps @kyonides can advise.
 

kyonides

Reforged is laughable
Veteran
Joined
Nov 17, 2019
Messages
1,158
Reaction score
546
First Language
English
Primarily Uses
RMXP
The thing is that the handler system windows use does not expect you to update anything for a couple of frames like you want to do it there. It simply closes or hides the window and that's it. At the end you'd need to overwrite a couple of inherited methods to make it happen.
 

Latest Threads

Latest Profile Posts

Heading to Orlando in six days! It'll be my first time going to Disney's Typhoon Lagoon. And then my dad will pick what we do for Father's Day!
With this, I'm gonna have a good night sleep
Damn. We’ve gotten so close to 0 reports, 0 approvals a few times over the past couple weeks. Does it matter? No. Is it realistic. No? Do I rely on your reports and want everyone to keep posting. Yes. Do I 100% games? …sigh… Yes.

Ah yes, all three of my moods all at once.

Forum statistics

Threads
131,757
Messages
1,223,028
Members
173,521
Latest member
MaverickZero
Top