def editRF2Files(settings): # Car _carID = settings['Car'][-1] _carData = getSingleCarData(_carID, ['originalFolder', 'vehFile']) _status = changeCar(vehPath=_carData['originalFolder'], vehName=_carData['vehFile']) if _status != 'OK': return _status # Track _trackID = settings['Track'][-1] _trackData = getSingleTrackData( _trackID, ['originalFolder', 'Scene Description', 'Scene Description']) _status = changeTrack(scnPath=_trackData['originalFolder'], scnName=_trackData['Scene Description'], SceneDescription=_trackData['Scene Description']) if _status != 'OK': return _status if 0: # not working # Opponents _opponentIDs = settings['Opponents'] _opponents = [] for _opponent in _opponentIDs: # NO, it's not the DB file ID, see AllClasses.txt (NO SUCH FILE???) # - another field we have to sort out _opponents.append(_opponent[-1]) _opponentStr = '|' + '|'.join(_opponents) # Need to work out the field for this _status = # changeOpponents(opponents=_opponentStr) if _status != 'OK': return _status return 'OK'
def __on_right_click(self, data): """ On right-clicking car there are two options 1) Select the specific car 2) Edit the details """ # don't change data self.settings = data print('DEBUG') print("called command when row is right clicked") print(data) print("\n") #ttk.messagebox.askquestion('Car selected') top = tk.Toplevel(self.parentFrame) top.title("Car editor") fields = carTags data = getSingleCarData(ident=data[-1], tags=fields) o_tab = carNtrackEditor.Editor(top, fields, data, DatafilesFolder=CarDatafilesFolder)
] # _edit4 = [r'( *"Scene File" *:).*', '\\1"' + # os.path.join(rF2root, # r'Installed\Locations\OULTON_PARK_CIRCUIT_2015\1.25\OULTONPARK_INT.SCN",').replace('\\', # '\\\\\\\\')] #_edit4 = [r'( *"Scene File" *:).*', r'\1"C:\\\\Program Files (x86)\\\\Steam\\\\steamapps\\\\common\\\\rFactor 2\\\\Installed\\\\Locations\\\\F1_1988_Tracks\\\\0.941\\\\HOCKENHEIM_1988_C4.SCN",'] _edit5 = [r'( *"AI Database File" *:).*', r'\1"",'] # blank it _edit6 = [r'( *"Scene Description" *:).*', r'\1"HOCKENHEIM_1988_C4",'] _edit6 = [r'( *"Scene Description" *:).*', r'\1"OULTONPARK_INT",'] _edit7 = [r'( *"Scene Signature" *:).*', r'\1""'] # blank it NOTE NO COMMA _edited = __edit(_text4, [_edit4, _edit5, _edit6, _edit7], doubleSlash=True) writeFile(PlayerJSON, _edited) changeCar(vehPath=r'Installed\Locations\Oreca_07_LMP2_2017\1.41', vehName='ORECA07PREE6ED8B36') changeTrack(scnPath=r'Installed\Locations\OULTON_PARK_CIRCUIT_2015\1.25', scnName='OULTONPARK_INT', SceneDescription=r'OULTONPARK_INT') changeCar(vehPath=r'Installed\Locations\Norma_M30-LMP3_2017\1.51', vehName='NORMAM30_08') changeTrack(scnPath=r'Installed\Locations\F1_1988_Tracks\0.941', scnName='HOCKENHEIM_1988_C4', SceneDescription=r'HOCKENHEIM_1988_C4') vehBits = getSingleCarData('Oreca_07_LMP2_2017', ['originalFolder', 'vehFile', 'Name'])
'1960-', '*****', 'FLAT12_917k_1971'] o_tab = Editor(tabTrack, fields, sampleData, CarDatafilesFolder) elif edit == 'carData': sampleData = [ 'Porsche', '917K', 'Gp.C', 'Apex', 'GT', 'RWD', 1967, '1960-', '*****', 'FLAT12_917k_1971'] data = getSingleCarData(sampleData[-1], carTags) o_tab = Editor(tabTrack, carTags, data, CarDatafilesFolder) elif edit == 'serverData': # doesn't really work, need a separate editor for favourite server handling fields = ['Favourite', 'Password', 'DB file ID'] sampleData = { 'Favourite': 'N', 'Password': '', 'Server': 'My favourite server', 'DB file ID': 'favourite servers'} o_tab = Editor(tabTrack, fields, sampleData, 'favourites') root.mainloop()