Changeset 189


Ignore:
Timestamp:
07/08/09 01:31:20 (10 years ago)
Author:
bretzel_parpg
Message:

The examine function now works. Added a 'desc' attribute to all GameObject?'s that contains the detailed
description

Location:
trunk/PARPG/scripts
Files:
1 added
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/PARPG/scripts/engine.py

    r187 r189  
    2020from agents.hero import Hero 
    2121from agents.npc import NPC 
    22 from objLoader import LocalXMLParser 
    2322from saver import Saver 
    2423from gamestate import GameState 
     
    248247                pass 
    249248            else: 
    250                 actions.append(["Examine", "Examine", self.nullFunc, obj]) 
     249                actions.append(["Examine", "Examine", self.view.createExamineBox, obj.name, obj.desc]) 
    251250                # is it a container? 
    252251                if obj.trueAttr("container"): 
  • trunk/PARPG/scripts/objects/base.py

    r187 r189  
    6060    def __init__ (self, ID, gfx = {}, xpos = 0.0, ypos = 0.0, map_id = None,  
    6161                  blocking=True, name="Generic object", text="Item description", 
    62                   **kwargs): 
     62                  desc="Detailed description", **kwargs): 
    6363        """Set the basic values that are shared by all game objects. 
    6464           @type ID: String 
     
    7575           @param name: The display name of this object (e.g. 'Dirty crate') 
    7676           @type text: String 
    77            @param text: A longer description of the item""" 
     77           @param text: A longer description of the item 
     78           @type desc: String 
     79           @param desc: A long description of the item that is displayed when it is examined 
     80           """ 
     81         
    7882        self.ID = ID 
    7983        self.gfx = gfx 
     
    8488        self.name = name 
    8589        self.text = text 
     90        self.desc = desc 
    8691        super(GameObject,self).__init__ (**kwargs) 
    8792         
  • trunk/PARPG/scripts/world.py

    r187 r189  
    2727from settings import Setting 
    2828from scripts import inventory, hud 
    29 from scripts.gui_container import ContainerGUI 
     29from scripts.popups import * 
    3030from scripts.context_menu import ContextMenu 
    3131from pychan.tools import callbackWithArguments as cbwa 
    32 from gamedata import MapDoor 
    3332 
    3433TDS = Setting() 
     
    432431            self.boxCreated = True 
    433432 
     433    def createExamineBox(self, title, desc): 
     434        self.examineBox = ExaminePopup(self.engine, title, desc) 
     435        self.examineBox.showPopUp() 
     436 
    434437    def pump(self): 
    435438        """Routine called during each frame. Our main loop is in ./run.py 
Note: See TracChangeset for help on using the changeset viewer.