Module: GamePlay::DisplayMessage

Included in:
Base
Defined in:
docs/01450_Systems_00004_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:



773
774
775
# File 'docs/01450_Systems_00004_Message.rb', line 773

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)


780
781
# File 'docs/01450_Systems_00004_Message.rb', line 780

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



784
785
# File 'docs/01450_Systems_00004_Message.rb', line 784

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



804
805
# File 'docs/01450_Systems_00004_Message.rb', line 804

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



812
813
# File 'docs/01450_Systems_00004_Message.rb', line 812

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

#message_classClass<UI::Message::Window>

Return the message class used

Returns:



788
789
# File 'docs/01450_Systems_00004_Message.rb', line 788

def message_class
end

#message_processing?Boolean

Prevent the update to process if the message are still processing

Returns:

  • (Boolean)


776
777
# File 'docs/01450_Systems_00004_Message.rb', line 776

def message_processing?
end

#message_visibleBoolean

Get the visibility of message

Returns:

  • (Boolean)


796
797
# File 'docs/01450_Systems_00004_Message.rb', line 796

def message_visible
end

#message_visible=(visible)

Set the visibility of message

Parameters:

  • visible (Boolean)


792
793
# File 'docs/01450_Systems_00004_Message.rb', line 792

def message_visible=(visible)
end