zeroscares

Veteran
Veteran
Joined
Oct 17, 2020
Messages
98
Reaction score
19
First Language
português
Primarily Uses
RMVXA
Couldn't you rename disable/enable it by calling different types of windows via a switch in Window_Message class, in def input_choice?? So if a condition switch is true, use default choice window. if false, use circular choice window.

Would take a lot of editing though, if you have a lot of choice-window scripts... :D
 

Tw0Face

Master Strategist
Veteran
Joined
Nov 12, 2018
Messages
471
Reaction score
385
First Language
German
Primarily Uses
RMVXA
It would be enough to have something like...

if $game_switches[x] == true
use circular choices
else
use normal choices

... this. Something like that.
 

Roninator2

Gamer
Veteran
Joined
May 22, 2016
Messages
2,910
Reaction score
643
First Language
English
Primarily Uses
RMVXA
calling different types of windows via a switch in Window_Message class,
That could work, but then every script that has any relation to choicelist would have to have the adjustment as well. Like the previous post on DP3 Choice help. class Window_ChoiceList << Window_Command and class Window_ChoiceList_Ring << Window_Command
The easiest way is a method that doesn't exist/can't be done.
if $game_switches[switch] == true
class Window_ChoiceList << Window_Command
...stuff for ring menu
end
else
class Window_ChoiceList << Window_Command
...stuff without ring menu
end
end
This gives an error.
1610746989271.png
The 'if $game_switches[]' has to be in a method not a class. No idea how to do it another way.

I tried to modify the code so that all the pieces for the ring menu would only run when the switch is on, but the best result I got was no icons for the ring menu and only one choice visible for the original method.
Ruby:
  def start
    @cx = $game_player.screen_x - 16
    @cy = $game_player.screen_y - 28
    @icons = []
    @choices = []
    make_command_list if $game_switches[5] == true
    make_choice_list if $game_switches[5] == true
    select(0)
    open
    activate
    create_background if $game_switches[5] == true
    refresh
  end

*UPDATE - tried to do what Zeroscares suggested and it doesn't work.
I don't know how to make it dispose the choice window and create the new one when the switch is on. My attempts so far don't work.

*UPDATE2
Figured it out. Had to find a method in Window_Message that would only process once but everytime the window is called.

@Tw0Face try this
Ruby:
# ╔═════════════════════════════════════╦════════════════════╗
# ║ Title: Syvkal Choice Ring           ║  Version: 1.04     ║
# ║ Author: Roninator2                  ║                    ║
# ╠═════════════════════════════════════╬════════════════════╣
# ║ Function:                           ║   Date Created     ║
# ║    Add ring menu to choice window   ╠════════════════════╣
# ║ Adjusts to choice size              ║    31 Dec 2020     ║
# ╚═════════════════════════════════════╩════════════════════╝
# ╔══════════════════════════════════════════════════════════╗
# ║ Script will automatically place icons for each choice    ║
# ║ option that is provided. Requires Syvkal's Ring Menu     ║
# ║ Tested with Hime Large choices                           ║
# ║ Icons are placed in the pictures folder.                 ║
# ║ Icons must be in the format of ''choice' + space + icon' ║
# ║ example                                                  ║
# ║ 'yes icon'.png or 'no icon'.png  - without quotes        ║
# ╚══════════════════════════════════════════════════════════╝
# ╔══════════════════════════════════════════════════════════╗
# ║ Updates:                                                 ║
# ║ 1.01 - 01 Jan 2021 - Added Background blur               ║
# ║ 1.02 - 02 Jan 2021 - Changed to overwrite ChoiceList     ║
# ║ 1.03 - 02 Jan 2021 - Centered ChoiceList on Player       ║
# ║ 1.04 - 15 Jan 2021 - Added switch control to turn off    ║
# ╚══════════════════════════════════════════════════════════╝
# ╔═════════════════════════════════════╗
# ║ Terms of use:                       ║
# ║ Follow the Original Authors terms   ║
# ╚═════════════════════════════════════╝

#==============================================================================
# ** Roninator2 Ring Choice
#------------------------------------------------------------------------------
#  Module added for switch control.
#==============================================================================
module R2_Ring_Choice
  Switch = 5
end

#==============================================================================
# ** Ring_Menu Module
#------------------------------------------------------------------------------
#  Module designed to rewrite methods defined in the desired Superclass.
#==============================================================================
module Ring_Menu
  #--------------------------------------------------------------------------
  # * Object Initialization
  #--------------------------------------------------------------------------
  def initialize(*args)
    super(*args)
    @cx = $game_player.screen_x - 16
    @cy = $game_player.screen_y - 28
    self.opacity = 0
    @startup = STARTUP_FRAMES
    @icons = []
    @mode = :start
    @steps = @startup
  end
end

#==============================================================================
# ** Window_MenuCommand
#------------------------------------------------------------------------------
#  This command window appears on the menu screen.
#==============================================================================
class Window_MenuCommand < Window_Command
  #--------------------------------------------------------------------------
  # * Refresh
  #--------------------------------------------------------------------------
  def refresh
    super
    @cx = $game_player.screen_x - 16
    @cy = $game_player.screen_y - 28
    rect = Rect.new(@cx - 254, @cy, self.contents.width, line_height)
    draw_text(rect, command_name(index), 1)
  end
end

#==============================================================================
# ** Window_Message
#------------------------------------------------------------------------------
#  This message window is used to display text.
#==============================================================================
class Window_Message < Window_Base
  #--------------------------------------------------------------------------
  # * Udate Background - used to change choice window
  #--------------------------------------------------------------------------
  def update_background
    if $game_switches[R2_Ring_Choice::Switch] == true
      @choice_window.dispose
      @choice_window = Window_ChoiceList_Ring.new(self)
    else
      @choice_window.dispose
      @choice_window = Window_ChoiceList.new(self)
    end
    @background = $game_message.background
    self.opacity = @background == 0 ? 255 : 0
  end
end

#==============================================================================
# ** Window_ChoiceList_Ring
#------------------------------------------------------------------------------
#  This window is used for the event command [Show Choices].
#==============================================================================
class Window_ChoiceList_Ring < Window_Command
  #--------------------------------------------------------------------------
  # * Includes The Ring_Menu Module
  #--------------------------------------------------------------------------
  include Ring_Menu
  #--------------------------------------------------------------------------
  # * Object Initialization
  #--------------------------------------------------------------------------
  def initialize(message_window)
    @message_window = message_window
    super(0, 0)
    self.openness = 0
    deactivate
    @mode = :wait
  end
  #--------------------------------------------------------------------------
  # * Start Input Processing
  #--------------------------------------------------------------------------
  def start
    @icons = []
    @choices = []
    make_choice_list
    select(0)
    open
    activate
    create_background
    refresh
  end
  #--------------------------------------------------------------------------
  # * Make_choice_list
  #--------------------------------------------------------------------------
  def make_choice_list
    $game_message.choices.each_with_index do |choice, i|
      @icons.push(Cache::picture(choice + ' Icon'))
      @choices.push(choice)
      @cx = $game_player.screen_x - 16
      @cy = $game_player.screen_y - 28
      rect = Rect.new(@cx, @cy, @icons[i].width / 2, @icons[i].height / 2)
      draw_item(rect.x, rect.y, i)
    end
  end
  #--------------------------------------------------------------------------
  # * Refresh
  #--------------------------------------------------------------------------
  def refresh
    super
    @cx = $game_player.screen_x - 16
    @cy = $game_player.screen_y - 28
    rect = Rect.new(@cx - 254, @cy, self.contents.width, line_height)
    draw_text(rect, choice_name(index), 1)
  end
  #--------------------------------------------------------------------------
  # * Make_command_list
  #--------------------------------------------------------------------------
  def make_command_list
    $game_message.choices.each do |choice|
      add_command(choice, :choice)
    end
  end
  #--------------------------------------------------------------------------
  # * Get Window Width
  #--------------------------------------------------------------------------
  def window_width
    return Graphics.width
  end
  #--------------------------------------------------------------------------
  # * Get Window Height
  #--------------------------------------------------------------------------
  def window_height
    return Graphics.height
  end
  #--------------------------------------------------------------------------
  # * Get Maximum Width of Choices
  #--------------------------------------------------------------------------
  def max_choice_width
    Graphics.width
  end
  #--------------------------------------------------------------------------
  # * Calculate Height of Window Contents
  #--------------------------------------------------------------------------
  def contents_height
    Graphics.height
  end
  #--------------------------------------------------------------------------
  # * Get Activation State of Cancel Processing
  #--------------------------------------------------------------------------
  def cancel_enabled?
    $game_message.choice_cancel_type > 0
  end
  #--------------------------------------------------------------------------
  # * Get Choice Name
  #--------------------------------------------------------------------------
  def choice_name(index)
    return if @choices == nil
    @choices[index]
  end
  #--------------------------------------------------------------------------
  # * Call OK Handler
  #--------------------------------------------------------------------------
  def call_ok_handler
    $game_message.choice_proc.call(index)
    close
    clean_choices
  end
  #--------------------------------------------------------------------------
  # * Call Cancel Handler
  #--------------------------------------------------------------------------
  def call_cancel_handler
    $game_message.choice_proc.call($game_message.choice_cancel_type - 1)
    close
    clean_choices
  end
  #--------------------------------------------------------------------------
  # * Clear choice lists
  #--------------------------------------------------------------------------
  def clean_choices
    $game_message.choices.clear
    @list.clear
    dispose_background
  end
  #--------------------------------------------------------------------------
  # * Draw Item
  #     x     : draw spot x-coordinate
  #     y     : draw spot y-coordinate
  #     i     : item number
  #--------------------------------------------------------------------------
  def draw_item(x, y, i)
    rect = Rect.new(0, 0, @icons[i].width, @icons[i].height)
    if i == index
      self.contents.blt(x - rect.width/2, y - rect.height/2, @icons[i], rect )
      unless command_enabled?(index)
        self.contents.blt(x - rect.width/2, y - rect.height/2, ICON_DISABLE, rect )
      end
    else
      self.contents.blt(x - rect.width/2, y - rect.height/2, @icons[i], rect, 128 )
    end
  end
  #--------------------------------------------------------------------------
  # * Create Background
  #--------------------------------------------------------------------------
  def create_background
    @background_sprite = Sprite.new
    SceneManager.snapshot_for_background
    @background_sprite.bitmap = SceneManager.background_bitmap
    @background_sprite.color.set(16, 16, 16, 128)
  end
  #--------------------------------------------------------------------------
  # * Free Background
  #--------------------------------------------------------------------------
  def dispose_background
    @background_sprite.dispose
  end
end
Return DP3 Choice help to original and add this in below it.
Ruby:
class Window_ChoiceList_Ring < Window_Command
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  # *= Alias Listings
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  alias_method(:dp3_windowchoicelist_update_235ufnr,            :update      )
  alias_method(:dp3_windowchoicelist_select_235ufnr,            :select      )
  alias_method(:dp3_windowchoicelist_cursordown_235ufnr,        :cursor_down )
  alias_method(:dp3_windowchoicelist_cursorup_235ufnr,          :cursor_up   )
  alias_method(:dp3_windowchoicelist_cursorright_235ufnr,       :cursor_right)
  alias_method(:dp3_windowchoicelist_cursorleft_235ufnr,        :cursor_left )
  alias_method(:dp3_windowchoicelist_open_235ufnr,              :open        )
  alias_method(:dp3_windowchoicelist_close_235ufnr,             :close       )
  alias_method(:dp3_windowchoicelist_dispose_235ufnr,           :dispose     )
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  # * Aliased Method: Update
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  def update(*args)
    dp3_windowchoicelist_update_235ufnr(*args)
    @choicehelp_helpwindow.update() unless @choicehelp_helpwindow.nil?
  end
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  # * Aliased Method: Select Item
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  def select(*args)
    dp3_windowchoicelist_select_235ufnr(*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 Right
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  def cursor_right(*args)
    dp3_windowchoicelist_cursorright_235ufnr(*args)
    @choicehelp_helpwindow.immediately_open() unless @choicehelp_helpwindow.nil?
  end
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  # * Aliased Method: Move Cursor Left
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  def cursor_left(*args)
    dp3_windowchoicelist_cursorleft_235ufnr(*args)
    @choicehelp_helpwindow.immediately_open() unless @choicehelp_helpwindow.nil?
  end
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  # * Aliased Method: Move Cursor Down
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  def cursor_down(*args)
    dp3_windowchoicelist_cursordown_235ufnr(*args)
    @choicehelp_helpwindow.immediately_open() unless @choicehelp_helpwindow.nil?
  end
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  # * Aliased Method: Move Cursor Up
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  def cursor_up(*args)
    dp3_windowchoicelist_cursorup_235ufnr(*args)
    @choicehelp_helpwindow.immediately_open() unless @choicehelp_helpwindow.nil?
  end
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  # * Aliased Method: Open
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  def open(*args)
    dp3_windowchoicelist_open_235ufnr(*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_235ufnr(*args) # Call Original Method
  end
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  # * Aliased Method: Dispose
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  def dispose(*args)
    dp3_windowchoicelist_dispose_235ufnr(*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
 
Last edited:

Latest Threads

Latest Posts

Latest Profile Posts

Added a modern day fridge sprite to my thread. Empty, full, and rotten versions :) enjoy
I'm on YouTube moderating for an America's Funniest Home Videos livestream. They love having me there and I know spam when I see it. Tonight I had to put 3 different people in time out due to them spamming random letters. Nobody else could chat with their messages in the way!
Mist_new.png
Some WIP of Mist's newest sprites! Tutorials are awesome and very useful!

Forum statistics

Threads
109,120
Messages
1,042,270
Members
141,615
Latest member
Bamionic
Top