Module: GamePlay::DisplayMessage

Included in:
Base
Defined in:
docs/4_Systems_004_Message.rb

Overview

Module responsive of adding the display message functionality to a class

Constant Summary collapse

MESSAGE_ERROR =

Message the displays when a GamePlay scene has been initialized without message processing and try to display a message

'This interface has no MessageWindow, you cannot call display_message'
MESSAGE_PROCESS_ERROR =

Error message when display_message is called from “itself”

'display_message was called inside display_message. Please fix your scene update.'

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#message_windowUI::Message::Window? (readonly)

The message window

Returns:



775
776
777
# File 'docs/4_Systems_004_Message.rb', line 775

def message_window
  @message_window
end

Instance Method Details

#can_display_message_be_called?Boolean

Tell if the display_message function can be called

Returns:

  • (Boolean)


782
783
# File 'docs/4_Systems_004_Message.rb', line 782

def can_display_message_be_called?
end

#close_message_window { ... }

Force the message window to “close” (but does not update scene)

Yields:

  • yield to allow some process before updating the message window



786
787
# File 'docs/4_Systems_004_Message.rb', line 786

def close_message_window
end

#display_message(message, start = 1, *choices, &block) ⇒ Integer?

Display a message with choice or not

Parameters:

  • message (String)

    the message to display

  • start (Integer) (defaults to: 1)

    the start choice index (1..nb_choice)

  • choices (Array<String>)

    the list of choice options

  • block (Proc)

    block to call while message updates

Returns:

  • (Integer, nil)

    the choice result



806
807
# File 'docs/4_Systems_004_Message.rb', line 806

def display_message(message, start = 1, *choices, &block)
end

#display_message_and_wait(message, start = 1, *choices, &block) ⇒ Integer?

Display a message with choice or not. This method will wait the message window to disappear

Parameters:

  • message (String)

    the message to display

  • start (Integer) (defaults to: 1)

    the start choice index (1..nb_choice)

  • choices (Array<String>)

    the list of choice options

  • block (Proc)

    block to call while message updates

Returns:

  • (Integer, nil)

    the choice result



814
815
# File 'docs/4_Systems_004_Message.rb', line 814

def display_message_and_wait(message, start = 1, *choices, &block)
end

#message_classClass<UI::Message::Window>

Return the message class used

Returns:



790
791
# File 'docs/4_Systems_004_Message.rb', line 790

def message_class
end

#message_processing?Boolean

Prevent the update to process if the message are still processing

Returns:

  • (Boolean)


778
779
# File 'docs/4_Systems_004_Message.rb', line 778

def message_processing?
end

#message_visibleBoolean

Get the visibility of message

Returns:

  • (Boolean)


798
799
# File 'docs/4_Systems_004_Message.rb', line 798

def message_visible
end

#message_visible=(visible)

Set the visibility of message

Parameters:

  • visible (Boolean)


794
795
# File 'docs/4_Systems_004_Message.rb', line 794

def message_visible=(visible)
end