Changeset 690


Ignore:
Timestamp:
12/21/10 18:05:57 (9 years ago)
Author:
technomage
Message:

Patch by Aspidites

  • Renamed the 'dialogue_sections' parameter in Dialogue's constructor to 'sections' for clarity, since the 'dialogue_sections' parameter is stored in Dialogue.section;
  • Updated constructor keywords for Dialogue's constructor in dialogueparsers.py;
  • Removed an extraneous 'return' statement in DialogueProcessor?.runDialogueActions;
Location:
trunk/game
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/game/scripts/dialogue.py

    r685 r690  
    3333     
    3434    def __init__(self, npc_name, avatar_path, start_section_id, 
    35                  dialogue_sections=None): 
     35                 sections=None): 
    3636        """ 
    3737        Initialize a new L{Dialogue} instance. 
     
    4545            displayed when the dialogue is first initiated. 
    4646        @type start_section_id: basestring 
    47         @param dialogue_sections: sections of dialogue that make up this 
     47        @param sections: sections of dialogue that make up this 
    4848            L{Dialogue} instance. 
    49         @type dialogue_sections: list of L{DialogueSections<DialogueSection>} 
     49        @type sections: list of L{DialogueSections<DialogueSection>} 
    5050        """ 
    5151        self.npc_name = npc_name 
     
    5353        self.sections = OrderedDict() 
    5454        if (__debug__): 
    55             section_ids = [section.id for section in dialogue_sections] 
    56         if (dialogue_sections is not None): 
     55            section_ids = [section.id for section in sections] 
     56        if (sections is not None): 
    5757            # Sanity check: All DialogueResponses should have next_section_id 
    5858            # attributes that refer to valid DialogueSections in the Dialogue. 
    59             for section in dialogue_sections: 
     59            for section in sections: 
    6060                if (__debug__): 
    6161                    for response in section.responses: 
  • trunk/game/scripts/dialogueparsers.py

    r685 r690  
    337337        dialogue = Dialogue(npc_name=npc_name, avatar_path=avatar_path, 
    338338                            start_section_id=start_section_id, 
    339                             dialogue_sections=sections) 
     339                            sections=sections) 
    340340        return dialogue 
    341341     
     
    489489        dialogue = Dialogue(npc_name=npc_name, avatar_path=avatar_path, 
    490490                            start_section_id=start_section_id, 
    491                             dialogue_sections=sections) 
     491                            sections=sections) 
    492492        return dialogue 
    493493     
  • trunk/game/scripts/dialogueprocessor.py

    r685 r690  
    235235                # TODO Technomage 2010-11-18: Undo previous actions when an 
    236236                #     action fails to execute. 
    237                 return 
    238237            else: 
    239238                self._logger.debug('ran {0} with arguments {1}' 
  • trunk/game/tests/test_dialogueprocessor.py

    r685 r690  
    8383            avatar_path='/some/path', 
    8484            start_section_id='main_section', 
    85             dialogue_sections=[ 
     85            sections=[ 
    8686                DialogueSection( 
    8787                    id='main_section', 
Note: See TracChangeset for help on using the changeset viewer.