Ignore:
Timestamp:
09/11/09 03:22:41 (10 years ago)
Author:
bretzel_parpg
Message:

Patch by Bretzel.

  • Wrote a parser for the new syntax I developed (I will post about this at the forums in the Dialog System Implementation thread)
  • Started to add a dialogue map, which will show you the flow of the dialogue
  • Overrode the resize event in the application so that it will also resize the editor and dialog map
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/tools/writing_editor/scripts/writingEditor.py

    r251 r280  
    2424from scripts.settings import Settings 
    2525from scripts.dialogMap import DialogMap 
     26from scripts.parser import parse 
     27 
    2628 
    2729class WritingEditor(QtGui.QMainWindow): 
     
    4143        self.ui = Ui_writingEditor() 
    4244        self.ui.setupUi(self) 
    43         self.dialogMap = DialogMap(self.settings, self.ui.main_edit, self.ui.dialog_map_tab) 
     45        self.ui.dialog_map = DialogMap(self.settings, self.ui.main_edit, self.ui.dialog_map_tab) 
    4446        self.syntax = SyntaxHighlighter(self.ui.main_edit.document()) 
    4547        self.syntaxCreated = True 
     
    194196        # it's the main editor 
    195197        if (index == 0): 
    196             self.dialogMap.clear() 
    197198            self.ui.actionCopy.setEnabled(True) 
    198199            self.ui.actionCut.setEnabled(True) 
     
    200201        # it's the dialog map 
    201202        elif (index == 1): 
    202             self.dialogMap.parser.parse() 
     203            self.ui.dialog_map.map.refreshMap() 
    203204            self.ui.actionCopy.setEnabled(False) 
    204205            self.ui.actionCut.setEnabled(False) 
     
    512513        return last_slash 
    513514 
     515    def resizeEvent(self, event): 
     516        """ 
     517        Overrides the normal resize event so it will also resize the widgets within 
     518        @type event: QResizeEvent 
     519        @param event: the event (it's provided by the Qt system) 
     520        @return: None 
     521        """ 
     522        self.ui.main_edit.setGeometry(QtCore.QRect(0, 0, event.size().width(), 
     523                                                   event.size().height()-73)) 
     524        self.ui.dialog_map.setGeometry(QtCore.QRect(0, 0, event.size().width(), 
     525                                                    event.size().height()-73)) 
     526 
    514527    def closeEvent(self, event): 
    515528        """ 
Note: See TracChangeset for help on using the changeset viewer.