Ignore:
Timestamp:
02/21/11 22:51:42 (8 years ago)
Author:
aspidites
Message:

Patch by Aspidites:

  • renamed scripts package to parpg
  • renamed parpg module to application
  • removed packaging and other related files (kept locally for reference, will reintroduce similar scripts to resolve bug #275
  • updated all import statements to respect changes above
Location:
branches/active/character_customization/game/parpg
Files:
5 added
54 moved

Legend:

Unmodified
Added
Removed
  • branches/active/character_customization/game/parpg/application.py

    r734 r736  
    2121from fife.extensions.basicapplication import ApplicationBase 
    2222 
    23 from scripts.gamemodel import GameModel 
    24 from scripts.mainmenuview import MainMenuView 
    25 from scripts import console 
    26 from scripts.mainmenucontroller import MainMenuController 
    27 from scripts.common.listeners.event_listener import EventListener 
    28 from scripts.common.listeners.key_listener import KeyListener 
    29 from scripts.common.listeners.mouse_listener import MouseListener 
    30 from scripts.common.listeners.command_listener import CommandListener 
    31 from scripts.common.listeners.console_executor import ConsoleExecuter 
    32 from scripts.common.listeners.widget_listener import WidgetListener 
     23from parpg.gamemodel import GameModel 
     24from parpg.mainmenuview import MainMenuView 
     25from parpg import console 
     26from parpg.mainmenucontroller import MainMenuController 
     27from parpg.common.listeners.event_listener import EventListener 
     28from parpg.common.listeners.key_listener import KeyListener 
     29from parpg.common.listeners.mouse_listener import MouseListener 
     30from parpg.common.listeners.command_listener import CommandListener 
     31from parpg.common.listeners.console_executor import ConsoleExecuter 
     32from parpg.common.listeners.widget_listener import WidgetListener 
    3333 
    3434class KeyFilter(fife.IKeyFilter): 
  • branches/active/character_customization/game/parpg/controllerbase.py

    r734 r736  
    1717from fife import fife 
    1818 
    19 from scripts.common.listeners.key_listener import KeyListener 
    20 from scripts.common.listeners.mouse_listener import MouseListener 
    21 from scripts.common.listeners.command_listener import CommandListener 
     19from parpg.common.listeners.key_listener import KeyListener 
     20from parpg.common.listeners.mouse_listener import MouseListener 
     21from parpg.common.listeners.command_listener import CommandListener 
    2222 
    2323class ControllerBase(KeyListener, MouseListener, CommandListener): 
     
    3333        @type engine: fife.Engine 
    3434        @param view: Instance of a GameSceneView 
    35         @param type: scripts.GameSceneView 
     35        @param type: parpg.GameSceneView 
    3636        @param model: The model that has the current gamestate 
    37         @type model: scripts.GameModel 
     37        @type model: parpg.GameModel 
    3838        @param application: The application that created this controller 
    39         @type application: scripts.PARPGApplication 
     39        @type application: parpg.PARPGApplication 
    4040        @param settings: The current settings of the application 
    4141        @type settings: fife.extensions.fife_settings.Setting 
  • branches/active/character_customization/game/parpg/dialogue.py

    r734 r736  
    2323except ImportError: 
    2424    # Python version 2.4-2.6 doesn't have the OrderedDict 
    25     from scripts.common.ordereddict import OrderedDict 
     25    from parpg.common.ordereddict import OrderedDict 
    2626 
    2727class Dialogue(object): 
  • branches/active/character_customization/game/parpg/dialoguecontroller.py

    r734 r736  
    2929        @type engine: fife.Engine 
    3030        @param view: Instance of a GameSceneView 
    31         @param type: scripts.GameSceneView 
     31        @param type: parpg.GameSceneView 
    3232        @param model: The model that has the current gamestate 
    33         @type model: scripts.GameModel 
     33        @type model: parpg.GameModel 
    3434        @param application: The application that created this controller 
    35         @type application: scripts.PARPGApplication 
     35        @type application: parpg.PARPGApplication 
    3636        @param settings: The current settings of the application 
    3737        @type settings: fife.extensions.fife_settings.Setting 
  • branches/active/character_customization/game/parpg/dialogueparsers.py

    r734 r736  
    3737except ImportError: 
    3838    # Python version 2.4-2.6 doesn't have the OrderedDict 
    39     from scripts.common.ordereddict import OrderedDict 
     39    from parpg.common.ordereddict import OrderedDict 
    4040import re 
    4141import textwrap 
     
    4343import yaml 
    4444 
    45 from scripts import COPYRIGHT_HEADER 
    46 from scripts.dialogue import (Dialogue, DialogueSection, DialogueResponse, 
     45from parpg import COPYRIGHT_HEADER 
     46from parpg.dialogue import (Dialogue, DialogueSection, DialogueResponse, 
    4747    DialogueGreeting) 
    48 from scripts.dialogueactions import DialogueAction 
     48from parpg.dialogueactions import DialogueAction 
    4949 
    5050def setup_logging(): 
  • branches/active/character_customization/game/parpg/dialogueprocessor.py

    r734 r736  
    2121import logging 
    2222 
    23 from scripts.common.utils import dedent_chomp 
     23from parpg.common.utils import dedent_chomp 
    2424 
    2525if (__debug__): 
    2626    from collections import Sequence, MutableMapping 
    27     from scripts.dialogue import Dialogue 
     27    from parpg.dialogue import Dialogue 
    2828 
    2929def setupLogging(): 
  • branches/active/character_customization/game/parpg/gamemap.py

    r734 r736  
    1919 
    2020from fife.extensions.loaders import loadMapFile 
    21 from scripts.common.utils import loadSettings 
     21from parpg.common.utils import loadSettings 
    2222 
    2323 
  • branches/active/character_customization/game/parpg/gamemodel.py

    r734 r736  
    3232from common.utils import parseBool 
    3333from inventory import Inventory 
    34 from scripts.dialogueparsers import YamlDialogueParser, DialogueFormatError 
     34from parpg.dialogueparsers import YamlDialogueParser, DialogueFormatError 
    3535 
    3636try: 
  • branches/active/character_customization/game/parpg/gamescenecontroller.py

    r734 r736  
    2828 
    2929from controllerbase import ControllerBase 
    30 from scripts.gui.hud import Hud 
    31 from scripts.gui import drag_drop_data as data_drag 
     30from parpg.gui.hud import Hud 
     31from parpg.gui import drag_drop_data as data_drag 
    3232from objects.action import ChangeMapAction, ExamineAction, OpenBoxAction, \ 
    3333                           UnlockBoxAction, LockBoxAction, TalkAction, \ 
     
    5454        @type engine: fife.Engine 
    5555        @param view: Instance of a GameSceneView 
    56         @param type: scripts.GameSceneView 
     56        @param type: parpg.GameSceneView 
    5757        @param model: The model that has the current gamestate 
    58         @type model: scripts.GameModel 
     58        @type model: parpg.GameModel 
    5959        @param application: The application that created this controller 
    60         @type application: scripts.PARPGApplication 
     60        @type application: parpg.PARPGApplication 
    6161        @param settings: The current settings of the application 
    6262        @type settings: fife.extensions.fife_settings.Setting 
  • branches/active/character_customization/game/parpg/gamestate.py

    r734 r736  
    1616#   along with PARPG.  If not, see <http://www.gnu.org/licenses/>. 
    1717 
    18 from scripts.quest_engine import QuestEngine 
     18from parpg.quest_engine import QuestEngine 
    1919 
    2020class GameState(object): 
  • branches/active/character_customization/game/parpg/gui/containergui.py

    r734 r736  
    1515from fife.extensions.pychan.tools import callbackWithArguments as cbwa 
    1616 
    17 from scripts.gui.containergui_base import ContainerGUIBase 
    18 from scripts.gui import drag_drop_data as data_drag 
    19 from scripts.objects.base import Container 
     17from parpg.gui.containergui_base import ContainerGUIBase 
     18from parpg.gui import drag_drop_data as data_drag 
     19from parpg.objects.base import Container 
    2020 
    2121class ContainerGUI(ContainerGUIBase): 
  • branches/active/character_customization/game/parpg/gui/containergui_base.py

    r734 r736  
    1717from fife.extensions import pychan 
    1818 
    19 from scripts.gui import drag_drop_data as data_drag 
    20 from scripts.objects.action import ACTIONS 
     19from parpg.gui import drag_drop_data as data_drag 
     20from parpg.objects.action import ACTIONS 
    2121from copy import deepcopy 
    2222 
     
    117117        """Executes the items action 
    118118        @param action: The action to run 
    119         @type action: Class derived from scripts.objects.action.Action 
     119        @type action: Class derived from parpg.objects.action.Action 
    120120        """ 
    121121        action.execute() 
  • branches/active/character_customization/game/parpg/gui/dialoguegui.py

    r734 r736  
    2121from fife.extensions.pychan import widgets 
    2222 
    23 from scripts.dialogueprocessor import DialogueProcessor 
     23from parpg.dialogueprocessor import DialogueProcessor 
    2424 
    2525def setupLogging(): 
  • branches/active/character_customization/game/parpg/gui/hud.py

    r734 r736  
    1919from fife.extensions.pychan.tools import callbackWithArguments as cbwa 
    2020 
    21 from scripts.gui.filebrowser import FileBrowser 
    22 from scripts.gui.context_menu import ContextMenu 
    23 from scripts.gui import inventorygui 
    24 from scripts.gui.popups import ExaminePopup 
    25 from scripts.gui.containergui import ContainerGUI 
    26 from scripts.gui.dialoguegui import DialogueGUI 
    27 from scripts.gui import drag_drop_data as data_drag 
     21from parpg.gui.filebrowser import FileBrowser 
     22from parpg.gui.context_menu import ContextMenu 
     23from parpg.gui import inventorygui 
     24from parpg.gui.popups import ExaminePopup 
     25from parpg.gui.containergui import ContainerGUI 
     26from parpg.gui.dialoguegui import DialogueGUI 
     27from parpg.gui import drag_drop_data as data_drag 
    2828from actionsbox import ActionsBox 
    2929 
  • branches/active/character_customization/game/parpg/gui/inventorygui.py

    r734 r736  
    2020from fife.extensions.pychan.attrs import UnicodeAttr 
    2121 
    22 from scripts.gui import drag_drop_data as data_drag 
    23 from scripts.objects.base import Container 
    24 from scripts.gui.containergui_base import ContainerGUIBase 
    25 from scripts.objects.action import ACTIONS 
     22from parpg.gui import drag_drop_data as data_drag 
     23from parpg.objects.base import Container 
     24from parpg.gui.containergui_base import ContainerGUIBase 
     25from parpg.objects.action import ACTIONS 
    2626 
    2727class EquipmentSlot(pychan.VBox): 
  • branches/active/character_customization/game/parpg/inventory.py

    r734 r736  
    1414# along with PARPG.  If not, see <http://www.gnu.org/licenses/>. 
    1515 
    16 from scripts.objects.base import Container 
    17 from scripts.objects.composed import SingleItemContainer as Slot 
     16from parpg.objects.base import Container 
     17from parpg.objects.composed import SingleItemContainer as Slot 
    1818 
    1919import copy 
  • branches/active/character_customization/game/parpg/mainmenucontroller.py

    r734 r736  
    2424#For debugging/code analysis 
    2525if False: 
    26     from scripts.mainmenuview import MainMenuView 
     26    from parpg.mainmenuview import MainMenuView 
    2727    from fife import fife 
    2828    from gamemodel import GameModel 
  • branches/active/character_customization/game/parpg/mainmenuview.py

    r734 r736  
    1919 
    2020from viewbase import ViewBase 
    21 from scripts.gui.filebrowser import FileBrowser 
     21from parpg.gui.filebrowser import FileBrowser 
    2222 
    2323class MainMenuView(ViewBase): 
  • branches/active/character_customization/game/parpg/objects/action.py

    r734 r736  
    1717#exceptions 
    1818 
    19 from scripts.gui import drag_drop_data as data_drag 
     19from parpg.gui import drag_drop_data as data_drag 
    2020 
    2121class NoSuchQuestException(Exception): 
     
    3232        """Basic action constructor 
    3333        @param controller: A reference to the GameSceneController. 
    34         @type controller: scripts.GameSceneController 
     34        @type controller: parpg.GameSceneController 
    3535        @param commands: Special commands that are executed 
    3636        @type commands: Dictionary  
     
    6565        possibly flagging a new map to be loaded. 
    6666        @param controller: A reference to the GameSceneController. 
    67         @type controller: scripts.GameSceneController 
    68         @param commands: Special commands that are executed 
    69         @type commands: Dictionary  
    70         @type view: class derived from scripts.ViewBase 
     67        @type controller: parpg.GameSceneController 
     68        @param commands: Special commands that are executed 
     69        @type commands: Dictionary  
     70        @type view: class derived from parpg.ViewBase 
    7171        @param view: The view 
    7272        @type target_map_name: String 
     
    9191        """ 
    9292        @param controller: A reference to the GameSceneController. 
    93         @type controller: scripts.GameSceneController 
    94         @param commands: Special commands that are executed 
    95         @type commands: Dictionary  
    96         @type view: class derived from scripts.ViewBase 
     93        @type controller: parpg.GameSceneController 
     94        @param commands: Special commands that are executed 
     95        @type commands: Dictionary  
     96        @type view: class derived from parpg.ViewBase 
    9797        @param view: The view 
    9898        @param container: A reference to the container 
     
    113113        """ 
    114114        @param controller: A reference to the GameSceneController. 
    115         @type controller: scripts.GameSceneController 
    116         @param commands: Special commands that are executed 
    117         @type commands: Dictionary  
    118         @type view: class derived from scripts.ViewBase 
     115        @type controller: parpg.GameSceneController 
     116        @param commands: Special commands that are executed 
     117        @type commands: Dictionary  
     118        @type view: class derived from parpg.ViewBase 
    119119        @param view: The view 
    120120        @param container: A reference to the container 
     
    139139        """ 
    140140        @param controller: A reference to the GameSceneController. 
    141         @type controller: scripts.GameSceneController 
     141        @type controller: parpg.GameSceneController 
    142142        @param commands: Special commands that are executed 
    143143        @type commands: Dictionary  
     
    157157        """ 
    158158        @param controller: A reference to the GameSceneController. 
    159         @type controller: scripts.GameSceneController 
     159        @type controller: parpg.GameSceneController 
    160160        @param commands: Special commands that are executed 
    161161        @type commands: Dictionary  
     
    176176        """ 
    177177        @param controller: A reference to the GameSceneController. 
    178         @type controller: scripts.GameSceneController 
     178        @type controller: parpg.GameSceneController 
    179179        @param examine_id: An object id 
    180180        @type examine_id: integer 
     
    185185        @param commands: Special commands that are executed 
    186186        @type commands: Dictionary  
    187         @type view: class derived from scripts.ViewBase 
     187        @type view: class derived from parpg.ViewBase 
    188188        @param view: The view 
    189189         
     
    214214        """ 
    215215        @param controller: A reference to the GameSceneController. 
    216         @type controller: scripts.GameSceneController 
    217         @param commands: Special commands that are executed 
    218         @type commands: Dictionary  
    219         @type view: class derived from scripts.ViewBase 
     216        @type controller: parpg.GameSceneController 
     217        @param commands: Special commands that are executed 
     218        @type commands: Dictionary  
     219        @type view: class derived from parpg.ViewBase 
    220220        @param view: The view 
    221221        @type examine_name: String 
     
    240240        """ 
    241241        @param controller: A reference to the GameSceneController. 
    242         @type controller: scripts.GameSceneController 
    243         @param commands: Special commands that are executed 
    244         @type commands: Dictionary  
    245         @param view: The view 
    246         @type view: class derived from scripts.ViewBase 
     242        @type controller: parpg.GameSceneController 
     243        @param commands: Special commands that are executed 
     244        @type commands: Dictionary  
     245        @param view: The view 
     246        @type view: class derived from parpg.ViewBase 
    247247        @param text_name: Name of the object containing the text 
    248248        @type text_name: String 
     
    268268        """ 
    269269        @param controller: A reference to the GameSceneController. 
    270         @type controller: scripts.GameSceneController 
    271         @param commands: Special commands that are executed 
    272         @type commands: Dictionary  
    273         @type view: class derived from scripts.ViewBase 
     270        @type controller: parpg.GameSceneController 
     271        @param commands: Special commands that are executed 
     272        @type commands: Dictionary  
     273        @type view: class derived from parpg.ViewBase 
    274274        @param view: The view 
    275275        @type npc: NonPlayerCharacter 
     
    283283        """Talk with the NPC when close enough, otherwise move closer. 
    284284           @return: None""" 
    285         from scripts.dialoguecontroller import DialogueController 
     285        from parpg.dialoguecontroller import DialogueController 
    286286         
    287287        player_char = self.model.game_state.player_character 
     
    328328        """ 
    329329        @param controller: A reference to the GameSceneController. 
    330         @type controller: scripts.GameSceneController 
     330        @type controller: parpg.GameSceneController 
    331331        @param item: Item on which the action is called 
    332332        @type item: CarryableItem 
  • branches/active/character_customization/game/parpg/objects/actors.py

    r734 r736  
    2323from base import GameObject, Living, Scriptable, CharStats 
    2424from composed import CarryableItem 
    25 from scripts.inventory import Inventory 
    26 from scripts.common.utils import loadSettings 
     25from parpg.inventory import Inventory 
     26from parpg.common.utils import loadSettings 
    2727 
    2828"""All actors go here. Concrete classes only.""" 
  • branches/active/character_customization/game/parpg/objects/base.py

    r734 r736  
    177177 
    178178class Scriptable (BaseObject): 
    179     """Allows objects to have predefined scripts executed on certain events""" 
    180     def __init__ (self, scripts = None, **kwargs): 
     179    """Allows objects to have predefined parpg executed on certain events""" 
     180    def __init__ (self, parpg = None, **kwargs): 
    181181        """Init operation for scriptable objects 
    182            @type scripts: Dictionary 
    183            @param scripts: Dictionary where the event strings are keys. The  
     182           @type parpg: Dictionary 
     183           @param parpg: Dictionary where the event strings are keys. The  
    184184           values are 3-item tuples (function, positional_args, keyword_args)""" 
    185185        BaseObject.__init__(self) 
    186186        self.attributes.append("scriptable") 
    187         self.scripts = scripts or {} 
     187        self.parpg = parpg or {} 
    188188         
    189189    def runScript (self, event): 
    190190        """Runs the script for the given event""" 
    191         if event in self.scripts and self.scripts[event]: 
    192             func, args, kwargs = self.scripts[event] 
     191        if event in self.parpg and self.parpg[event]: 
     192            func, args, kwargs = self.parpg[event] 
    193193            func (*args, **kwargs) 
    194194             
     
    197197        args = args or {} 
    198198        kwargs = kwargs or {} 
    199         self.scripts[event] = (func, args, kwargs) 
     199        self.parpg[event] = (func, args, kwargs) 
    200200 
    201201class Openable(DynamicObject, Scriptable): 
     
    323323            self.items[index] = item 
    324324 
    325         # Run any scripts associated with storing an item in the container 
     325        # Run any parpg associated with storing an item in the container 
    326326        try: 
    327327            if self.trueAttr ('scriptable'): 
     
    347347        del self.items[self.items.keys()[self.items.values().index(item)]] 
    348348 
    349         # Run any scripts associated with popping an item out of the container 
     349        # Run any parpg associated with popping an item out of the container 
    350350        try: 
    351351            if self.trueAttr ('scriptable'): 
     
    375375        del self.items[self.items.keys()[self.items.values().index(item)]] 
    376376 
    377         # Run any scripts associated with popping an item out of the container 
     377        # Run any parpg associated with popping an item out of the container 
    378378        try: 
    379379            if self.trueAttr ('scriptable'): 
  • branches/active/character_customization/game/parpg/quest_engine.py

    r734 r736  
    1717 
    1818import yaml 
    19 from scripts.common.utils import locateFiles 
     19from parpg.common.utils import locateFiles 
    2020import os.path 
    2121 
Note: See TracChangeset for help on using the changeset viewer.