Class: GamePlay::QuestUI

Inherits:
BaseCleanUpdate::FrameBalanced show all
Defined in:
scripts/01450 Systems/08000 Quest/00003 GamePlay_Quest/00001 Main.rb,
scripts/01450 Systems/08000 Quest/00003 GamePlay_Quest/00002 Logic.rb,
scripts/01450 Systems/08000 Quest/00003 GamePlay_Quest/00004 Mouse.rb,
scripts/01450 Systems/08000 Quest/00003 GamePlay_Quest/00003 Inputs.rb

Constant Summary collapse

CATEGORIES =

List of the categories of the quests

Returns:

  • (Array<Symbol>)
%i[primary secondary finished]
ACTIONS =

List of action the mouse can perform with ctrl button

%i[action_a action_x action_y action_b]
AIU_KEY2METHOD =

List of method called by automatic_input_update when pressing on a key

{
  A: :action_a, X: :action_x, Y: :action_y, B: :action_b,
  LEFT: :action_left, RIGHT: :action_right
}

Constants inherited from Base

Base::DEFAULT_TRANSITION, Base::DEFAULT_TRANSITION_PARAMETER

Constants included from Input

Input::ALIAS_KEYS, Input::AXIS_MAPPING, Input::AXIS_SENSITIVITY, Input::DEAD_ZONE, Input::Keyboard, Input::Keys, Input::NON_TRIGGER_ZONE, Input::REPEAT_COOLDOWN, Input::REPEAT_SPACE

Constants included from DisplayMessage

DisplayMessage::MESSAGE_ERROR, DisplayMessage::MESSAGE_PROCESS_ERROR

Instance Attribute Summary

Attributes inherited from Base

#__last_scene, #__result_process, #running, #viewport

Attributes included from DisplayMessage

#message_window

Instance Method Summary collapse

Methods inherited from BaseCleanUpdate::FrameBalanced

#update

Methods included from Graphics::FPSBalancer::Marker

#frame_balanced?

Methods inherited from BaseCleanUpdate

#automatic_input_update, #update

Methods inherited from Base

#add_disposable, #call_scene, #dispose, #find_parent, #main, #return_to_scene, #snap_to_bitmap, #update, #visible, #visible=

Methods included from Input

dir4, dir8, get_text, joy_axis_position, press?, register_events, released?, repeat?, swap_states, trigger?

Methods included from DisplayMessage

#can_display_message_be_called?, #close_message_window, #display_message, #display_message_and_wait, #message_class, #message_processing?, #message_visible, #message_visible=

Constructor Details

#initialize(quests = PFM.game_state.quests) ⇒ QuestUI

Initialize the whole Quest UI

Parameters:

  • quests (PFM::Quests) (defaults to: PFM.game_state.quests)

    the quests to send to the Quest UI



8
9
10
11
12
13
14
15
16
# File 'scripts/01450 Systems/08000 Quest/00003 GamePlay_Quest/00001 Main.rb', line 8

def initialize(quests = PFM.game_state.quests)
  super()
  @category = :primary # Possible categories are, in order, :primary, :secondary, :finished
  @quest_deployed = :compact
  @deployed_mode = :descr # Possible modes are :descr, :rewards and :objectives
  @last_key = nil
  @key_counter = 0
  @quests = quests
end

Instance Method Details

#update_graphics



18
19
20
21
# File 'scripts/01450 Systems/08000 Quest/00003 GamePlay_Quest/00001 Main.rb', line 18

def update_graphics
  @base_ui.update_background_animation
  @composition.update
end

#update_inputs

Update the input of the scene



10
11
12
13
14
# File 'scripts/01450 Systems/08000 Quest/00003 GamePlay_Quest/00003 Inputs.rb', line 10

def update_inputs
  return false unless @composition.done?
  return false unless automatic_input_update(AIU_KEY2METHOD)
  return false unless check_up_down_keys
end

#update_mouse(moved) ⇒ Boolean

Update the mouse interactions

Parameters:

  • moved (Boolean)

    if the mouse moved durring the frame

Returns:

  • (Boolean)

    if the thing after can update



8
9
10
11
12
13
14
# File 'scripts/01450 Systems/08000 Quest/00003 GamePlay_Quest/00004 Mouse.rb', line 8

def update_mouse(moved)
  unless deployed?
    return update_mouse_index if Mouse.wheel != 0
    return false if moved
  end
  return update_ctrl_button_mouse
end