Class: GamePlay::Shop

Inherits:
BaseCleanUpdate::FrameBalanced show all
Includes:
UI::Shop
Defined in:
docs/4_Systems_203_Shop.rb

Overview

Shop scene

Direct Known Subclasses

Pokemon_Shop

Constant Summary collapse

MOUSE_OVER_ENABLED =

Tell if the mouse over is enabled

false

Constants inherited from BaseCleanUpdate

BaseCleanUpdate::AIU_KEY2METHOD

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(symbol_shop) ⇒ Shop #initialize(symbol_shop, price_overwritten) ⇒ Shop #initialize(list_id_object) ⇒ Shop #initialize(list_id_object, price_overwrite) ⇒ Shop

Create a new Item Shop

Examples:

Opening an already defined shop with limited items

GamePlay::Shop.new(:shop_pewter_city) # Will open the Shop with symbol :shop_pewter_city (the shop must be already defined beforehand)

Opening an already defined shop with limited items but with temporarily overwritten price

GamePlay::Shop.new(:shop_pewter_city, {17: 300, 25: 3000}) # Will open the Shop with symbol :shop_pewter_city while overwritting the price for items with ID 17 or 25

Opening a simple unlimited shop with items, using their original prices

GamePlay::Shop.new([1, 2, 3, 4]) # Will open a Shop selling Master balls, Ultra Balls, Great Balls and Poké Balls at their original price

Opening a simple unlimited shop with items while overwritting temporarily the original price

GamePlay::Shop.new([4, 17], {4: 100, 17: 125}) # Will open a Shop selling Poké Balls at 100 Pokédollars and Potions at 125 Pokédollars

Overloads:

  • #initialize(symbol_shop) ⇒ Shop

    Parameters:

    • symbol_shop (Symbol)

      the symbol of the shop to open

  • #initialize(symbol_shop, price_overwritten) ⇒ Shop

    Parameters:

    • symbol_shop (Symbol)

      the symbol of the shop to open

    • price_overwrite (Hash)

      the hash containing the new price (value) of an item id (key)

  • #initialize(list_id_object) ⇒ Shop

    Parameters:

    • list_id_object (Array<Symbol>)

      the array containing the id of the items to sell

  • #initialize(list_id_object, price_overwrite) ⇒ Shop

    Parameters:

    • list_id_object (Array<Symbol>)

      the array containing the id of the items to sell

    • price_overwrite (Hash)

      the hash containing the new price (value) of an id (key)



474
475
# File 'docs/4_Systems_203_Shop.rb', line 474

def initialize(symbol_or_list, price_overwrite = {}, show_background: true)
end

Instance Method Details

#create_arrow

Create the selection arrow



517
518
# File 'docs/4_Systems_203_Shop.rb', line 517

def create_arrow
end

#create_base_ui

Create the generic background for the UI



499
500
# File 'docs/4_Systems_203_Shop.rb', line 499

def create_base_ui
end

#create_graphics

Create the different graphics for the UI



493
494
# File 'docs/4_Systems_203_Shop.rb', line 493

def create_graphics
end

#create_item_desc_window

Create the item description window



523
524
# File 'docs/4_Systems_203_Shop.rb', line 523

def create_item_desc_window
end

#create_item_list

Create the item list for the items to sell



511
512
# File 'docs/4_Systems_203_Shop.rb', line 511

def create_item_list
end

#create_money_window

Create the money window showing the player money



502
503
# File 'docs/4_Systems_203_Shop.rb', line 502

def create_money_window
end

#create_scrollbar

Create the scrollbar



541
542
# File 'docs/4_Systems_203_Shop.rb', line 541

def create_scrollbar
end

#create_shop_banner

Create the banner spelling “shop” in different languages



508
509
# File 'docs/4_Systems_203_Shop.rb', line 508

def create_shop_banner
end

#update_arrow

Update the selection arrow animation



520
521
# File 'docs/4_Systems_203_Shop.rb', line 520

def update_arrow
end

#update_graphics

Update the graphics every frame



496
497
# File 'docs/4_Systems_203_Shop.rb', line 496

def update_graphics
end

#update_in_stock_item(nb)

Update the number of the actual item currently in stock



538
539
# File 'docs/4_Systems_203_Shop.rb', line 538

def update_in_stock_item(nb)
end

#update_inputs

Update the inputs every frame



548
549
# File 'docs/4_Systems_203_Shop.rb', line 548

def update_inputs
end

#update_item_button_list

Update the item list



514
515
# File 'docs/4_Systems_203_Shop.rb', line 514

def update_item_button_list
end

#update_item_desc

Method that calls all the informations updating method of the description window



526
527
# File 'docs/4_Systems_203_Shop.rb', line 526

def update_item_desc
end

#update_item_desc_name(name)

Update the name of the item currently shown



529
530
# File 'docs/4_Systems_203_Shop.rb', line 529

def update_item_desc_name(name)
end

#update_item_desc_text(text)

Update the description of the item currently shown



532
533
# File 'docs/4_Systems_203_Shop.rb', line 532

def update_item_desc_text(text)
end

#update_money_text

Update the money the player has



505
506
# File 'docs/4_Systems_203_Shop.rb', line 505

def update_money_text
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



621
622
# File 'docs/4_Systems_203_Shop.rb', line 621

def update_mouse(moved)
end

#update_nb_item(nb)

Update the number of the actual item possessed by the player



535
536
# File 'docs/4_Systems_203_Shop.rb', line 535

def update_nb_item(nb)
end

#update_scrollbar

Update the scrollbar’s max index information



544
545
# File 'docs/4_Systems_203_Shop.rb', line 544

def update_scrollbar
end