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_window ⇒ UI::Message::Window? (readonly)

The message window

Returns:



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

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)


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

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



801
802
# File 'docs/4_Systems_004_Message.rb', line 801

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



821
822
# File 'docs/4_Systems_004_Message.rb', line 821

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



829
830
# File 'docs/4_Systems_004_Message.rb', line 829

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

#message_class ⇒ Class<UI::Message::Window>

Return the message class used

Returns:



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

def message_class
end

#message_processing? ⇒ Boolean

Prevent the update to process if the message are still processing

Returns:

  • (Boolean)


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

def message_processing?
end

#message_visible ⇒ Boolean

Get the visibility of message

Returns:

  • (Boolean)


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

def message_visible
end

#message_visible=(visible)

Set the visibility of message

Parameters:

  • visible (Boolean)


809
810
# File 'docs/4_Systems_004_Message.rb', line 809

def message_visible=(visible)
end