├── .gitattributes ├── README.md ├── _doc_python.ini ├── apps └── python │ ├── AccExtHelper │ ├── AccExtHelper.py │ ├── sim_info.py │ ├── stdlib │ │ └── _ctypes.pyd │ ├── stdlib64 │ │ └── _ctypes.pyd │ └── ui │ │ └── ui_app.json │ ├── AccExtMirrors │ ├── AccExtMirrors.py │ ├── _ctypes.pyd │ └── ui │ │ └── ui_app.json │ ├── AccExtRain │ ├── AccExtRain.py │ └── ui │ │ └── ui_app.json │ └── AccExtWeather │ ├── AccExtWeather.py │ ├── settings │ └── settings_defaults.ini │ └── ui │ └── ui_app.json └── content └── gui └── icons ├── Shaders Patch Debug_OFF.png ├── Shaders Patch Debug_ON.png ├── Shaders Patch Mirrors_OFF.png ├── Shaders Patch Mirrors_ON.png ├── Shaders Patch Rain_OFF.png ├── Shaders Patch Rain_ON.png ├── Shaders Patch Weather_OFF.png └── Shaders Patch Weather_ON.png /.gitattributes: -------------------------------------------------------------------------------- 1 | # Auto detect text files and perform LF normalization 2 | * text=auto 3 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # acc-extension-apps 2 | 3 | ## Python apps for Assetto Corsa Custom Shaders Patch 4 | 5 | -4 python apps: 6 | 7 | AccExtHelper - switching VAO/driver, step car back 8 | 9 | AccExtMirrors - smart mirrors control 10 | 11 | AccExtRain - wipers/rain intensity 12 | 13 | AccExtWeather - time options and weather info 14 | 15 | ![Imgur Image](https://i.imgur.com/Q2zx6mw.png) 16 | 17 | ## download: 18 | - https://github.com/ac-custom-shaders-patch/acc-extension-apps/releases/tag/1.8 19 | 20 | ## install: 21 | - unpack to ac-root "steamapps\common\assettocorsa" 22 | 23 | ## source: 24 | - https://discordapp.com/channels/453595061788344330/ 25 | -------------------------------------------------------------------------------- /_doc_python.ini: -------------------------------------------------------------------------------- 1 | ; dyn lights shader patch, 69 extra python functions 2 | 3 | ; new in lights-patch-v0.1.25-preview49: 4 | ac.ext_currentPpFilter() ; returning the name of currently selected PP•filter; 5 | ac.ext_glSetTexture() ; to set texture for ac.glBegin()/ac.glEnd(); 6 | ac.ext_glTexCoord2f() ; to set UV coordinates for ac.glVertex2f(); 7 | 8 | ; new in lights-patch-v0.1.25-preview46: 9 | ac.ext_chaserCameraDebugText() 10 | 11 | ; new in lights-patch-v0.1.25-preview27: 12 | ac.ext_isG27Available() 13 | ac.ext_setG27Thresholds(minRpm, maxRpm) 14 | 15 | ; new in lights-patch-v0.1.24: 16 | ; for example, look at AccExtRain app 17 | ac.ext_debugWiperSoundState 18 | ac.ext_getHeadlights 19 | ac.ext_patchVersionCode 20 | ac.ext_rainParams 21 | ac.ext_rainParamsAdjust 22 | ac.ext_rainParamsSet 23 | ac.ext_weatherDebugText 24 | ac.ext_weatherFxActive 25 | ac.ext_weatherTimeOffset 26 | 27 | ; new in lights-patch-v0.1.23-preview90 28 | ac.ext_setTrackConditionInput('NAME', value) 29 | 30 | ; new in lights-patch-v0.1.23-preview87 31 | ac.ext_patchVersion() 32 | ac.ext_setDriverVisible(True/False) 33 | ac.ext_setDoorsOpen(True/False) 34 | 35 | ; new in lights-patch-v0.1.23-preview83 36 | ac.ext_getTyreVirtualKM(car,tyre) 37 | 38 | ; new in lights-patch-v0.1.23-preview83 39 | ; for example, look at AccExtHelper app 40 | ac.ext_version() 41 | ac.ext_getTyreGrain(car_index, tyre_index) 42 | ac.ext_getTyreBlister() 43 | ac.ext_getTyreFlatSpot() 44 | ac.ext_pauseFsWatching() 45 | ac.ext_resumeFsWatching() 46 | ac.ext_debugLights(...) 47 | ac.ext_applyTrackConfig(...) 48 | 49 | ; other python functions 50 | ac.ext_debugFn 51 | ac.ext_getAmbientMult 52 | ac.ext_getAngleSpeed 53 | ac.ext_getCameraFov 54 | ac.ext_getCameraMatrix 55 | ac.ext_getCameraPos 56 | ac.ext_getCameraProj 57 | ac.ext_getCameraView 58 | ac.ext_getCarLightsMirrorVisible 59 | ac.ext_getCarLightsNum 60 | ac.ext_getCarLightsVisible 61 | ac.ext_getLightsMirrorVisible 62 | ac.ext_getLightsNum 63 | ac.ext_getLightsVisible 64 | ac.ext_getTrackLightsMirrorVisible 65 | ac.ext_getTrackLightsNum 66 | ac.ext_getTrackLightsVisible 67 | ac.ext_isVaoPatchLoaded 68 | ac.ext_mirrorAspectRatioDown 69 | ac.ext_mirrorAspectRatioUp 70 | ac.ext_mirrorCurrent 71 | ac.ext_mirrorDebug 72 | ac.ext_mirrorDown 73 | ac.ext_mirrorFovDown 74 | ac.ext_mirrorFovUp 75 | ac.ext_mirrorLeft 76 | ac.ext_mirrorNext 77 | ac.ext_mirrorParams 78 | ac.ext_mirrorPrev 79 | ac.ext_mirrorRight 80 | ac.ext_mirrorToggleMon 81 | ac.ext_mirrorUp 82 | ac.ext_resetCar 83 | ac.ext_setCameraFov 84 | ac.ext_setClipboardData 85 | ac.ext_setVaoActive 86 | ac.ext_takeAStepBack 87 | ac.ext_vaoDisable 88 | ac.ext_vaoNormal 89 | ac.ext_vaoNormalDebug 90 | ac.ext_vaoOnly 91 | -------------------------------------------------------------------------------- /apps/python/AccExtHelper/AccExtHelper.py: -------------------------------------------------------------------------------- 1 | try: 2 | import ac 3 | import acsys 4 | import sys 5 | import os.path 6 | import platform 7 | import time 8 | import subprocess 9 | import traceback 10 | except ImportError: 11 | pass 12 | 13 | if platform.architecture()[0] == "64bit": 14 | sysdir=os.path.dirname(__file__)+'/stdlib64' 15 | else: 16 | sysdir=os.path.dirname(__file__)+'/stdlib' 17 | sys.path.insert(0, sysdir) 18 | os.environ['PATH'] = os.environ['PATH'] + ";." 19 | import ctypes, ctypes.wintypes 20 | 21 | from sim_info import info 22 | 23 | app = 0 24 | label = 0 25 | stepBackButton = 0 26 | resetButton = 0 27 | vaoToggleButton = 0 28 | vaoDebugButton = 0 29 | lightsDebugButton = 0 30 | copyCameraCoordsButton = 0 31 | doorToggleButton = 0 32 | driverToggleButton = 0 33 | isVaoActive = True 34 | currentVaoDebugMode = 0 35 | isLightsDebugOn = False 36 | areDoorsOpen = False 37 | isDriverVisible = True 38 | lastFrom = "" 39 | error = 0 40 | timer = 0 41 | 42 | # global variables 43 | rstButton = 0 44 | tick_counter = 0 45 | max_tick = 360 46 | # frames/second variables 47 | frame_counter = 0 48 | frame_buffer = 20 49 | time_elapsed = 0 50 | current_fps = 0 51 | # min max counter 52 | MAX_fps = 0 53 | MIN_fps = 5000 54 | MAX_lights = 0 55 | MIN_lights = 100000 56 | odd = True 57 | lx = 0.0 58 | ly = 0.0 59 | lz = 0.0 60 | 61 | def acMain(ac_version): 62 | global app, label, stepBackButton, resetButton, sVer 63 | global vaoToggleButton, vaoDebugButton, lightsDebugButton, copyCameraCoordsButton 64 | global doorToggleButton, driverToggleButton 65 | 66 | try: 67 | app = ac.newApp("Shaders Patch Debug") 68 | ac.setTitle(app, " Shaders Patch Debug") 69 | ac.setSize(app, 180, 358) 70 | ac.drawBackground(app,0) 71 | 72 | driverToggleButton = ac.addButton(app, "Driver") 73 | ac.setPosition(driverToggleButton, 20, 25) 74 | ac.setSize(driverToggleButton, 40, 20) 75 | ac.setFontSize(driverToggleButton, 12) 76 | ac.addOnClickedListener(driverToggleButton, driverToggle) 77 | 78 | doorToggleButton = ac.addButton(app, "🚪") 79 | ac.setPosition(doorToggleButton, 70, 25) 80 | ac.setCustomFont(doorToggleButton, "Segoe UI Symbol; Weight=UltraLight", 0, 0) 81 | ac.setSize(doorToggleButton, 40, 20) 82 | ac.setFontSize(doorToggleButton, 14) 83 | ac.addOnClickedListener(doorToggleButton, doorToggle) 84 | 85 | copyCameraCoordsButton = ac.addButton(app, "Copy") 86 | ac.setPosition(copyCameraCoordsButton, 120, 25) 87 | ac.setSize(copyCameraCoordsButton, 40, 20) 88 | ac.setFontSize(copyCameraCoordsButton, 12) 89 | ac.addOnClickedListener(copyCameraCoordsButton, copyCameraCoords) 90 | 91 | vaoToggleButton = ac.addButton(app, "V +/−") 92 | ac.setPosition(vaoToggleButton, 20, 45) 93 | ac.setSize(vaoToggleButton, 40, 20) 94 | ac.setFontSize(vaoToggleButton, 12) 95 | ac.addOnClickedListener(vaoToggleButton, vaoToggle) 96 | 97 | vaoDebugButton = ac.addButton(app, "V o/N") 98 | ac.setPosition(vaoDebugButton, 70, 45) 99 | ac.setSize(vaoDebugButton, 40, 20) 100 | ac.setFontSize(vaoDebugButton, 12) 101 | ac.addOnClickedListener(vaoDebugButton, vaoDebug) 102 | 103 | lightsDebugButton = ac.addButton(app, "🔦") 104 | ac.setPosition(lightsDebugButton, 120, 45) 105 | ac.setSize(lightsDebugButton, 40, 20) 106 | ac.setFontSize(lightsDebugButton, 14) 107 | ac.addOnClickedListener(lightsDebugButton, lightsDebug) 108 | 109 | stepBackButton = ac.addButton(app, "Step back") 110 | ac.setPosition(stepBackButton, 20, 65) 111 | ac.setSize(stepBackButton, 140, 20) 112 | ac.setFontSize(stepBackButton, 12) 113 | ac.addOnClickedListener(stepBackButton, takeAStepBack) 114 | ac.setCustomFont(stepBackButton, "Segoe UI; Weight=UltraBlack", 0, 0) 115 | 116 | resetButton = ac.addButton(app, "Reset") 117 | ac.setPosition(resetButton, 20, 85) 118 | ac.setSize(resetButton, 140, 20) 119 | ac.setFontSize(resetButton, 12) 120 | ac.addOnClickedListener(resetButton, resetCar) 121 | ac.setCustomFont(resetButton, "Segoe UI; Weight=UltraBlack", 0, 0) 122 | 123 | label = ac.addLabel(app, "") 124 | ac.setFontSize(label, 12) 125 | ac.setPosition(label, 5, 103) 126 | 127 | sVer = "CSP v" + str(ac.ext_patchVersion()) + "-code" + str(ac.ext_patchVersionCode()) 128 | # i = 0 129 | # while i < 1200: 130 | # labelTemp = ac.setPosition(ac.addLabel(app, "Label #" + str(i)), 5, 30 + i) 131 | # ac.setFontSize(labelTemp, 14 + (i % 10)) 132 | # i += 1 133 | except: 134 | ac.log("Unexpected error:" + traceback.format_exc()) 135 | return "AccExtHelper" 136 | 137 | def doorToggle(*args): 138 | global areDoorsOpen 139 | try: 140 | areDoorsOpen = not areDoorsOpen 141 | ac.ext_setDoorsOpen(areDoorsOpen) 142 | ac.ext_setTrackConditionInput('CAR_DOORS_OPENED', 1.0 if areDoorsOpen else 0.0) 143 | except: 144 | ac.log("Unexpected error:" + traceback.format_exc()) 145 | 146 | def driverToggle(*args): 147 | global isDriverVisible 148 | try: 149 | isDriverVisible = not isDriverVisible 150 | ac.ext_setDriverVisible(isDriverVisible) 151 | except: 152 | ac.log("Unexpected error:" + traceback.format_exc()) 153 | 154 | def vaoToggle(*args): 155 | global isVaoActive, currentVaoDebugMode 156 | try: 157 | isVaoActive = not isVaoActive 158 | currentVaoDebugMode = 0 159 | ac.ext_setVaoActive(isVaoActive) 160 | except: 161 | ac.log("Unexpected error:" + traceback.format_exc()) 162 | 163 | def vaoDebug(*args): 164 | global isVaoActive, currentVaoDebugMode 165 | try: 166 | isVaoActive = False 167 | if currentVaoDebugMode == 1: 168 | ac.ext_vaoNormalDebug() 169 | currentVaoDebugMode = 2 170 | else: 171 | ac.ext_vaoOnly() 172 | currentVaoDebugMode = 1 173 | except: 174 | ac.log("Unexpected error:" + traceback.format_exc()) 175 | 176 | class LightsDebugMode: 177 | Off = 0 178 | Outline = 1 179 | BoundingBox = 2 180 | BoundingSphere = 4 181 | Text = 8 182 | 183 | def lightsDebug(*args): 184 | global isLightsDebugOn 185 | try: 186 | isLightsDebugOn = not isLightsDebugOn 187 | if isLightsDebugOn: 188 | lightsDebugCount = 20 189 | lightsDebugDistance = 200.0 190 | lightsDebugMode = LightsDebugMode.Outline | LightsDebugMode.BoundingBox 191 | # | LightsDebugMode.Text 192 | ac.ext_debugLights("?", lightsDebugCount, lightsDebugDistance, lightsDebugMode) 193 | else: 194 | ac.ext_debugLights("?", 0, 0, 0) 195 | except: 196 | ac.log("Unexpected error:" + traceback.format_exc()) 197 | 198 | class ApplyTrackConfigFlags: 199 | Nothing = 0 200 | RestoreConditionsState = 1 201 | 202 | def resetCar(*args): 203 | try: 204 | ac.log("resetCar()") 205 | ac.ext_resetCar() 206 | except: 207 | ac.log("Unexpected error:" + traceback.format_exc()) 208 | 209 | def takeAStepBack(*args): 210 | try: 211 | ac.ext_takeAStepBack() 212 | # ac.ext_debugFn() 213 | # ac.ext_setCameraFov(30) 214 | # lightsDebugCount = 10 215 | # lightsDebugMode = LightsDebugMode.Outline | LightsDebugMode.BoundingBox | LightsDebugMode.Text 216 | # ac.ext_debugLights("?", lightsDebugCount, lightsDebugMode) 217 | 218 | # ac.ext_applyTrackConfig("[LIGHT_SERIES_0]\n\ 219 | # MESHES=Object345\n\ 220 | # DESCRIPTION=Pits\n\ 221 | # OFFSET=0,1.35,-1.2\n\ 222 | # CLUSTER_THRESHOLD=4\n\ 223 | # COLOR=" + str(random.randrange(1, 3)) + ", 1.2, 1, 4\n\ 224 | # SPOT=110\n\ 225 | # RANGE=10\n\ 226 | # FADE_AT=150\n\ 227 | # FADE_SMOOTH=50\n\ 228 | # SPOT_SHARPNESS=0.7\n\ 229 | # DIRECTION=0,-1,0\n\ 230 | # COLOR_OFF=1.2, 1.2, 0.8, 0\n\ 231 | # CONDITION=NIGHT_SHARP\n\ 232 | # \n\ 233 | # [LIGHT_SERIES_1]\n\ 234 | # MATERIALS=light_emissive\n\ 235 | # DESCRIPTION=Starting lane spotlghts\n\ 236 | # OFFSET=0,0,0\n\ 237 | # CLUSTER_THRESHOLD=8\n\ 238 | # COLOR=0.8, 0.8, 1, " + str(random.randrange(5, 25)) + "\n\ 239 | # SPOT=150\n\ 240 | # RANGE=35\n\ 241 | # RANGE_GRADIENT_OFFSET=0.6\n\ 242 | # FADE_AT=400\n\ 243 | # FADE_SMOOTH=10\n\ 244 | # SPOT_SHARPNESS=0.7\n\ 245 | # DIRECTION=NORMAL\n\ 246 | # CONDITION=NIGHT_SMOOTH_HEATING\n\ 247 | # SINGLE_FREQUENCY=0", ApplyTrackConfigFlags.RestoreConditionsState) 248 | ac.log("takeAStepBack() called") 249 | except: 250 | ac.log("Unexpected error:" + traceback.format_exc()) 251 | 252 | def __init__(): 253 | global tick_counter, max_tick, frame_counter, frame_buffer, time_elapsed, current_fps, MAX_fps, MIN_fps, MAX_lights, MIN_lights 254 | # global variables 255 | tick_counter = 0 256 | max_tick = 360 257 | # frames/second variables 258 | frame_counter = 0 259 | frame_buffer = 20 260 | time_elapsed = 0 261 | current_fps = 0 262 | MAX_fps = 0 263 | MIN_fps = 5000 264 | MAX_lights = 0 265 | MIN_lights = 100000 266 | 267 | def doReset(*args): 268 | __init__() 269 | 270 | def get_frames_per_second(deltaT): 271 | global tick_counter, max_tick, frame_counter, frame_buffer, time_elapsed, current_fps, MAX_fps, MIN_fps, MAX_lights, MIN_lights 272 | frame_counter += 1 273 | time_elapsed += deltaT 274 | if frame_counter == frame_buffer: 275 | # calculating frames per second 276 | current_fps = frame_buffer / time_elapsed 277 | if current_fps>MAX_fps: 278 | MAX_fps=current_fps 279 | if current_fps 30 else 30 284 | # reseting counters 285 | frame_counter = 0 286 | time_elapsed = 0 287 | 288 | def acShutdown(*args): 289 | return 290 | 291 | def acUpdate(delta_t): 292 | global error 293 | global timer 294 | global info 295 | global tick_counter, max_tick, frame_counter, frame_buffer, time_elapsed, current_fps, MAX_fps, MIN_fps, MAX_lights, MIN_lights 296 | global odd, lx, ly, lz, lastFrom, sVer 297 | timer += delta_t 298 | if timer > 0.05: 299 | timer = 0.0 300 | get_frames_per_second(delta_t) 301 | try: 302 | s = ', '.join(str(round(x, 4)) for x in ac.ext_getCameraPos()) 303 | sf = s.split(',') 304 | x = sf[0] 305 | y = sf[1] 306 | z = sf[2] 307 | dx = round(lx-float(sf[0]),4) 308 | dy = round(ly-float(sf[1]),4) 309 | dz = round(lz-float(sf[2]),4) 310 | dist = (dx*dx+dy*dy+dz*dz)*0.5 311 | if dist>15000: 312 | dist=0 313 | # ac.log("DIFF = " + str(dx) + ", " + str(dy) + ", "+ str(dz)) 314 | 315 | currPoT = ac.getCarState(0, acsys.CS.NormalizedSplinePosition) 316 | # xw, yw, zw = ac.getCarState(0, acsys.CS.WorldPosition) 317 | # currentTime = ac.getCarState(0, acsys.CS.LapTime) 318 | 319 | lightsvis = ac.ext_getLightsVisible() 320 | if lightsvis>MAX_lights: 321 | MAX_lights=lightsvis 322 | if lightsvis {} {}".format(field, type(value), value)) 242 | 243 | if __name__ == '__main__': 244 | do_test() 245 | demo() 246 | -------------------------------------------------------------------------------- /apps/python/AccExtHelper/stdlib/_ctypes.pyd: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ac-custom-shaders-patch/acc-extension-apps/9cf04b177f12e1aaa2132b9b13fc359d3d7bc032/apps/python/AccExtHelper/stdlib/_ctypes.pyd -------------------------------------------------------------------------------- /apps/python/AccExtHelper/stdlib64/_ctypes.pyd: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ac-custom-shaders-patch/acc-extension-apps/9cf04b177f12e1aaa2132b9b13fc359d3d7bc032/apps/python/AccExtHelper/stdlib64/_ctypes.pyd -------------------------------------------------------------------------------- /apps/python/AccExtHelper/ui/ui_app.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "Shaders Extension Debug", 3 | "version": "0.3", 4 | "author": "x4fab", 5 | "description": "Displays some information such as number of lights in total. Might be helpful if you’re setting up track lights.", 6 | "tags": [ 7 | "shaders extension", 8 | "ui", 9 | "debug" 10 | ], 11 | "country": null, 12 | "url": null 13 | } 14 | -------------------------------------------------------------------------------- /apps/python/AccExtMirrors/AccExtMirrors.py: -------------------------------------------------------------------------------- 1 | import ac, acsys, os, sys, traceback, configparser, codecs 2 | cwd = os.path.dirname(os.path.realpath(__file__)) 3 | sys.path.insert(0, os.path.join(cwd)) 4 | os.environ['PATH'] = os.environ['PATH'] + ";." 5 | import ctypes # we only provide 64bit _ctype version, CSP is only that 6 | from ctypes import wintypes 7 | CSIDL_PERSONAL = 5 # My Documents 8 | SHGFP_TYPE_CURRENT = 0 # Get current, not default value 9 | buf = ctypes.create_unicode_buffer(ctypes.wintypes.MAX_PATH) 10 | ctypes.windll.shell32.SHGetFolderPathW(None, CSIDL_PERSONAL, None, SHGFP_TYPE_CURRENT, buf) 11 | userDir = buf.value # bingo, userdir/documents! 12 | smart_mirrorini = userDir + "\\Assetto Corsa\\cfg\\extension\\smart_mirror.ini" 13 | ac.log('AccExtMirror ini: ' + smart_mirrorini) 14 | 15 | # \\Assetto Corsa\\extension\\config\\smart_mirror.ini 16 | # looks like this: 17 | # [PIECE_0] 18 | # ; hidden 19 | # WIDTH=0.1185 * screen.height * 4 20 | # HEIGHT=0.1185 * screen.height 21 | # CENTER_X=0.5 * screen.width 22 | # CENTER_Y=85 + 0.1185 * screen.height / 2 23 | # OPACITY=1 24 | 25 | 26 | xoffset = 0 27 | yoffset = 5 28 | app = 0 29 | mirror = 0 30 | timer = 0.0 31 | debug = 0 32 | isPatch = True 33 | mirrorrole = 0 34 | mirrorindex = 0 35 | toggleMonButton = 0 36 | fovValue = 0 37 | arUp = 0 38 | arDown = 0 39 | fovLabel = 0 40 | fovUpButton = 0 41 | fovDownButton = 0 42 | leftButton = 0 43 | rightButton = 0 44 | upButton = 0 45 | downButton = 0 46 | prevButton = 0 47 | nextButton = 0 48 | virt=False 49 | roles = "NLCR" 50 | rolesLONG = ["None","Left","Center","Right"] 51 | 52 | def VirtChange(dsize, dx, dy): 53 | global smart_mirrorini, xoffset, yoffset, smart_mirrorini 54 | try: 55 | configDocs = configparser.ConfigParser(empty_lines_in_values=False, inline_comment_prefixes=(";","/","#","\\"), strict=False) 56 | configDocs.optionxform = str # keep case 57 | if not os.path.isfile(smart_mirrorini): 58 | with codecs.open(smart_mirrorini, 'w', 'utf_8', errors='ignore') as f: 59 | f.write('') 60 | else: 61 | configDocs.read(smart_mirrorini) 62 | 63 | # defaults 64 | swO='0.1185' 65 | shO='0.1185' 66 | sxoffset=str(xoffset) 67 | syoffset=str(yoffset) 68 | if not configDocs.has_section('PIECE_0'): 69 | configDocs.add_section('PIECE_0') 70 | syoffset = '85 + ' + str(round(float(shO) + dsize,4)) + ' * screen.height / 2' 71 | else: 72 | if configDocs.has_option('PIECE_0', 'WIDTH'): 73 | swO = configDocs['PIECE_0']['WIDTH'].split('*')[0].strip() 74 | if configDocs.has_option('PIECE_0', 'HEIGHT'): 75 | shO = configDocs['PIECE_0']['HEIGHT'].split('*')[0].strip() 76 | if configDocs.has_option('PIECE_0', 'APP_VIRTYOFFSET'): 77 | yoffset = configDocs['PIECE_0']['APP_VIRTYOFFSET'] 78 | if configDocs.has_option('PIECE_0', 'APP_VIRTXOFFSET'): 79 | xoffset = configDocs['PIECE_0']['APP_VIRTXOFFSET'] 80 | sxoffset = '0.5 * screen.width + ' + str(round(float(xoffset) + float(dx), 4)) 81 | syoffset = str(float(yoffset) + float(dy)) + ' + '+ str(round(float(shO) + dsize,4)) + ' * screen.height / 2' 82 | 83 | configDocs.set('PIECE_0', 'WIDTH', str(round(float(swO) + dsize,4)) + ' * screen.height * 4') 84 | configDocs.set('PIECE_0', 'HEIGHT', str(round(float(shO) + dsize,4)) + ' * screen.height') 85 | configDocs.set('PIECE_0', 'CENTER_X', sxoffset) 86 | configDocs.set('PIECE_0', 'CENTER_Y', syoffset) 87 | configDocs.set('PIECE_0', 'OPACITY', '1') 88 | configDocs.set('PIECE_0', 'APP_VIRTXOFFSET', str(float(xoffset) + float(dx)) ) 89 | configDocs.set('PIECE_0', 'APP_VIRTYOFFSET', str(float(yoffset) + float(dy)) ) 90 | 91 | with open(smart_mirrorini, 'w') as configfile: 92 | configDocs.write(configfile, space_around_delimiters=False) 93 | except: 94 | ac.log('AccExtMirrors main: \n' + traceback.format_exc()) 95 | 96 | def prevMirror(*args): 97 | ac.ext_mirrorPrev() 98 | 99 | def nextMirror(*args): 100 | ac.ext_mirrorNext() 101 | 102 | def leftMirror(*args): 103 | global virt 104 | if virt: 105 | VirtChange(0,-5,0) 106 | else: 107 | ac.ext_mirrorLeft() 108 | 109 | def rightMirror(*args): 110 | global virt 111 | if virt: 112 | VirtChange(0,5,0) 113 | else: 114 | ac.ext_mirrorRight() 115 | 116 | def upMirror(*args): 117 | global virt 118 | if virt: 119 | VirtChange(0,0,-5) 120 | else: 121 | ac.ext_mirrorUp() 122 | 123 | def downMirror(*args): 124 | global virt 125 | if virt: 126 | VirtChange(0,0,5) 127 | else: 128 | ac.ext_mirrorDown() 129 | 130 | def fovUpMirror(*args): 131 | global virt 132 | if virt: 133 | VirtChange(0.01,0,0) 134 | else: 135 | ac.ext_mirrorFovUp() 136 | 137 | def fovDownMirror(*args): 138 | global virt 139 | if virt: 140 | VirtChange(-0.01,0,0) 141 | else: 142 | ac.ext_mirrorFovDown() 143 | 144 | def toggleMonMirror(*args): 145 | ac.ext_mirrorToggleMon() 146 | 147 | def downAR(*args): 148 | ac.ext_mirrorAspectRatioDown() 149 | 150 | def upAR(*args): 151 | ac.ext_mirrorAspectRatioUp() 152 | 153 | def ShowVirtControls(): 154 | global virt 155 | virt=True 156 | ac.setText(fovLabel, "Size") 157 | ac.setVisible(fovValue,1) 158 | ac.setVisible(fovLabel,1) 159 | ac.setVisible(fovUpButton,1) 160 | ac.setVisible(fovDownButton,1) 161 | ac.setVisible(leftButton,1) 162 | ac.setVisible(rightButton,1) 163 | ac.setVisible(upButton,1) 164 | ac.setVisible(downButton,1) 165 | 166 | def HideVirtControls(): 167 | global virt 168 | virt=False 169 | ac.setText(fovLabel, "FOV") 170 | ac.setVisible(fovValue,0) 171 | ac.setVisible(fovLabel,0) 172 | ac.setVisible(fovUpButton,0) 173 | ac.setVisible(fovDownButton,0) 174 | ac.setVisible(leftButton,0) 175 | ac.setVisible(rightButton,0) 176 | ac.setVisible(upButton,0) 177 | ac.setVisible(downButton,0) 178 | 179 | def HideControls(): 180 | global app, mirrorrole, mirrorindex, toggleMonButton, fovValue, arUp, arDown 181 | global fovLabel, fovUpButton, fovDownButton, leftButton, rightButton, upButton, downButton, prevButton, nextButton 182 | ac.setSize(app, 144, 85) 183 | ac.setVisible(mirrorindex,0) 184 | ac.setVisible(fovValue,0) 185 | ac.setVisible(fovLabel,0) 186 | ac.setVisible(fovUpButton,0) 187 | ac.setVisible(fovDownButton,0) 188 | ac.setVisible(leftButton,0) 189 | ac.setVisible(rightButton,0) 190 | ac.setVisible(upButton,0) 191 | ac.setVisible(downButton,0) 192 | ac.setVisible(arUp,0) 193 | ac.setVisible(arDown,0) 194 | ac.setVisible(prevButton,0) 195 | ac.setVisible(nextButton,0) 196 | ac.setVisible(toggleMonButton,0) 197 | 198 | def ShowControls(): 199 | global app, mirrorrole, mirrorindex, toggleMonButton, fovValue, arUp, arDown 200 | global fovLabel, fovUpButton, fovDownButton, leftButton, rightButton, upButton, downButton, prevButton, nextButton 201 | ac.setSize(app, 144, 213) 202 | ac.setVisible(mirrorindex,1) 203 | ac.setVisible(fovValue,1) 204 | ac.setVisible(fovLabel,1) 205 | ac.setVisible(fovUpButton,1) 206 | ac.setVisible(fovDownButton,1) 207 | ac.setVisible(leftButton,1) 208 | ac.setVisible(rightButton,1) 209 | ac.setVisible(upButton,1) 210 | ac.setVisible(downButton,1) 211 | ac.setVisible(arUp,1) 212 | ac.setVisible(arDown,1) 213 | ac.setVisible(prevButton,1) 214 | ac.setVisible(nextButton,1) 215 | ac.setVisible(toggleMonButton,1) 216 | 217 | def acMain(ac_version): 218 | try: 219 | global app, debug, mirrorrole, mirrorindex, toggleMonButton, fovValue, arUp, arDown, isPatch 220 | global fovLabel, fovUpButton, fovDownButton, prevButton, nextButton, leftButton, rightButton, upButton, downButton 221 | app = ac.newApp("AccExtMirrors") 222 | 223 | ac.setTitle(app, "Mirrors") 224 | ac.setSize(app, 144, 213) 225 | 226 | debug = ac.addLabel(app, "") 227 | ac.setPosition(debug, 6, 65) 228 | 229 | mirrorrole = ac.addLabel(app, "") 230 | # ac.setPosition(mirrorrole, 44, 40) 231 | ac.setPosition(mirrorrole, 35, 25) 232 | 233 | mirrorindex = ac.addLabel(app, "") 234 | ac.setPosition(mirrorindex, 54, 46) 235 | ac.setFontSize(mirrorindex, 12) 236 | 237 | fovLabel = ac.addLabel(app, "FOV") 238 | ac.setPosition(fovLabel, 102, 164) 239 | 240 | fovValue = ac.addLabel(app, "") 241 | ac.setPosition(fovValue, 108, 112) 242 | 243 | fovUpButton = ac.addButton(app, "+") 244 | ac.setPosition(fovUpButton, 104, 84) 245 | ac.setSize(fovUpButton, 24, 24) 246 | ac.setFontSize(fovUpButton, 14) 247 | ac.addOnClickedListener(fovUpButton, fovUpMirror) 248 | 249 | fovDownButton = ac.addButton(app, "-") 250 | ac.setPosition(fovDownButton, 104, 132) 251 | ac.setSize(fovDownButton, 24, 24) 252 | ac.setFontSize(fovDownButton, 14) 253 | ac.addOnClickedListener(fovDownButton, fovDownMirror) 254 | 255 | toggleMonButton = ac.addButton(app, "m") 256 | ac.setPosition(toggleMonButton, 104, 40) 257 | ac.setSize(toggleMonButton, 24, 24) 258 | ac.setFontSize(toggleMonButton, 14) 259 | ac.addOnClickedListener(toggleMonButton, toggleMonMirror) 260 | 261 | prevButton = ac.addButton(app, "-") 262 | ac.setPosition(prevButton, 16, 40) 263 | ac.setSize(prevButton, 24, 24) 264 | ac.setFontSize(prevButton, 14) 265 | ac.addOnClickedListener(prevButton, prevMirror) 266 | 267 | nextButton = ac.addButton(app, "+") 268 | ac.setPosition(nextButton, 64, 40) 269 | ac.setSize(nextButton, 24, 24) 270 | ac.setFontSize(nextButton, 14) 271 | ac.addOnClickedListener(nextButton, nextMirror) 272 | 273 | leftButton = ac.addButton(app, "L") 274 | ac.setPosition(leftButton, 16, 108) 275 | ac.setSize(leftButton, 24, 24) 276 | ac.setFontSize(leftButton, 14) 277 | ac.addOnClickedListener(leftButton, leftMirror) 278 | 279 | rightButton = ac.addButton(app, "R") 280 | ac.setPosition(rightButton, 64, 108) 281 | ac.setSize(rightButton, 24, 24) 282 | ac.setFontSize(rightButton, 14) 283 | ac.addOnClickedListener(rightButton, rightMirror) 284 | 285 | upButton = ac.addButton(app, "U") 286 | ac.setPosition(upButton, 40, 84) 287 | ac.setSize(upButton, 24, 24) 288 | ac.setFontSize(upButton, 14) 289 | ac.addOnClickedListener(upButton, upMirror) 290 | 291 | downButton = ac.addButton(app, "D") 292 | ac.setPosition(downButton, 40, 132) 293 | ac.setSize(downButton, 24, 24) 294 | ac.setFontSize(downButton, 14) 295 | ac.addOnClickedListener(downButton, downMirror) 296 | 297 | arDown = ac.addButton(app, " -") 298 | ac.setPosition(arDown, 15, 168) 299 | ac.setSize(arDown, 24, 24) 300 | ac.setFontSize(arDown, 14) 301 | ac.addOnClickedListener(arDown, downAR) 302 | ac.setFontAlignment(arDown, "left") 303 | 304 | arUp = ac.addButton(app, "+") 305 | ac.setPosition(arUp, 65, 168) 306 | ac.setSize(arUp, 24, 24) 307 | ac.setFontSize(arUp, 14) 308 | ac.addOnClickedListener(arUp, upAR) 309 | 310 | isPatch = int(ac.ext_patchVersionCode())>0 311 | # ac.log('AccExtMirrors: isPatch: \n' + str(isPatch) ) 312 | except: 313 | isPatch = 0 314 | ac.log('AccExtMirrors main: \n' + traceback.format_exc()) 315 | 316 | return "AccExtMirrors" 317 | 318 | def acUpdate(delta_t): 319 | global timer, isPatch, app, rolesLONG 320 | global debug, mirrorrole, mirrorindex, toggleMonButton, fovValue, arDown, arUp, prevButton, nextButton 321 | global btnVirtSizePlus, btnVirtSizeMinus 322 | timer += delta_t 323 | if timer > 0.1 and ac.isConnected(0): 324 | timer = 0.0 325 | if not isPatch: 326 | ac.setText(debug,'Shaders Patch not active.') 327 | else: 328 | try: 329 | cammode = ac.getCameraMode() 330 | if cammode == acsys.CM.Cockpit: 331 | params = ac.ext_mirrorParams() 332 | if params[3]==0: 333 | ac.setText(debug, '') # + str(ac.ext_mirrorDebug()) ) 334 | HideControls() 335 | ShowVirtControls() 336 | ac.setText(mirrorrole, 'F11 VirtMirror') 337 | ac.setText(fovValue, '') 338 | ac.setSize(app, 144, 213) 339 | else: 340 | index = int(params[4]) 341 | HideVirtControls() 342 | if bool(int(params[0])) == True: 343 | HideControls() 344 | ac.setText(debug, 'set to Monitor\n') # + str(ac.ext_mirrorDebug()) ) 345 | ac.setText(toggleMonButton, "M") 346 | else: 347 | ShowControls() 348 | ac.setText(debug, '\n') # + str(ac.ext_mirrorDebug()) ) 349 | ac.setText(toggleMonButton, "m") 350 | if index > 0: 351 | ac.setText(mirrorindex, str(index)) 352 | else: 353 | ac.setText(mirrorindex, "") 354 | if virt: 355 | ac.setText(fovValue, '') 356 | else: 357 | ac.setText(fovValue, str(int(params[1]))) 358 | # ac.setText(mirrorrole, roles[int(params[3])]) 359 | ac.setText(arDown, ' - ' + str(round(float(params[2]),1) ) + '\n AR') 360 | ac.setText(mirrorrole, rolesLONG[int(params[3])]) 361 | ac.setVisible(toggleMonButton,1) 362 | ac.setVisible(mirrorrole,1) 363 | ac.setVisible(prevButton,1) 364 | ac.setVisible(nextButton,1) 365 | ac.setSize(app, 144, 213) 366 | else: 367 | ac.setText(mirrorrole, 'Not in Cockpit\n') # + str(ac.ext_mirrorDebug()) ) 368 | ac.setText(debug, '') 369 | HideVirtControls() 370 | HideControls() 371 | ac.setSize(app, 144, 85) 372 | except: 373 | isPatch = False 374 | ac.log("AccExtMirror error: " + traceback.format_exc()) 375 | 376 | def acShutdown(*args): 377 | pass 378 | -------------------------------------------------------------------------------- /apps/python/AccExtMirrors/_ctypes.pyd: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ac-custom-shaders-patch/acc-extension-apps/9cf04b177f12e1aaa2132b9b13fc359d3d7bc032/apps/python/AccExtMirrors/_ctypes.pyd -------------------------------------------------------------------------------- /apps/python/AccExtMirrors/ui/ui_app.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "Shaders Extension Mirrors", 3 | "version": "0.6", 4 | "author": "henter, leBluem", 5 | "description": "Adjust mirrors, only with 'Real Mirrors' in 'Smart mirror' tab enabled.", 6 | "tags": [ 7 | "shaders extension", 8 | "ui", 9 | "mirrors" 10 | ], 11 | "country": null, 12 | "url": null 13 | } -------------------------------------------------------------------------------- /apps/python/AccExtRain/AccExtRain.py: -------------------------------------------------------------------------------- 1 | try: 2 | import ac 3 | import acsys 4 | import traceback 5 | import time 6 | except ImportError: 7 | pass 8 | 9 | app = 0 10 | error = 0 11 | rainStrengthValue = 0 12 | rainWiperSpeedValue = 0 13 | timer = 0.0 14 | 15 | def acMain(ac_version): 16 | global app, rainStrengthValue, rainWiperSpeedValue 17 | app = ac.newApp("Shaders Patch Rain") 18 | ac.setTitle(app, "Rain") 19 | ac.setSize(app, 174, 108) 20 | 21 | y = 40 22 | rainStrengthLabel = ac.addLabel(app, "Strength") 23 | ac.setPosition(rainStrengthLabel, 110, y) 24 | rainStrengthValue = ac.addLabel(app, "") 25 | ac.setPosition(rainStrengthValue, 48, y) 26 | rainStrengthDownButton = ac.addButton(app, "-") 27 | ac.setPosition(rainStrengthDownButton, 16, y) 28 | ac.setSize(rainStrengthDownButton, 24, 24) 29 | ac.setFontSize(rainStrengthDownButton, 14) 30 | ac.addOnClickedListener(rainStrengthDownButton, rainStrengthDown) 31 | rainStrengthUpButton = ac.addButton(app, "+") 32 | ac.setPosition(rainStrengthUpButton, 80, y) 33 | ac.setSize(rainStrengthUpButton, 24, 24) 34 | ac.setFontSize(rainStrengthUpButton, 14) 35 | ac.addOnClickedListener(rainStrengthUpButton, rainStrengthUp) 36 | 37 | y = 72 38 | rainWiperSpeedLabel = ac.addLabel(app, "Wiper") 39 | ac.setPosition(rainWiperSpeedLabel, 110, y) 40 | rainWiperSpeedValue = ac.addLabel(app, "") 41 | ac.setPosition(rainWiperSpeedValue, 48, y) 42 | rainWiperSpeedDownButton = ac.addButton(app, "-") 43 | ac.setPosition(rainWiperSpeedDownButton, 16, y) 44 | ac.setSize(rainWiperSpeedDownButton, 24, 24) 45 | ac.setFontSize(rainWiperSpeedDownButton, 14) 46 | ac.addOnClickedListener(rainWiperSpeedDownButton, rainWiperSpeedDown) 47 | 48 | rainWiperSpeedUpButton = ac.addButton(app, "+") 49 | ac.setPosition(rainWiperSpeedUpButton, 80, y) 50 | ac.setSize(rainWiperSpeedUpButton, 24, 24) 51 | ac.setFontSize(rainWiperSpeedUpButton, 14) 52 | ac.addOnClickedListener(rainWiperSpeedUpButton, rainWiperSpeedUp) 53 | return "AccExtRain" 54 | 55 | def rainStrengthDown(*args): 56 | try: 57 | ac.ext_rainParamsAdjust(-0.1, 0.0) 58 | except: 59 | ac.setText(debug, "AccExtRain: Shaders Patch not active? : \n" + traceback.format_exc()) 60 | 61 | def rainStrengthUp(*args): 62 | try: 63 | ac.ext_rainParamsAdjust(0.1, 0.0) 64 | except: 65 | ac.setText(debug, "AccExtRain: Shaders Patch not active? : \n" + traceback.format_exc()) 66 | 67 | def rainWiperSpeedDown(*args): 68 | try: 69 | ac.ext_rainParamsAdjust(0.0, -1.0) 70 | except: 71 | ac.setText(debug, "AccExtRain: Shaders Patch not active? : \n" + traceback.format_exc()) 72 | 73 | def rainWiperSpeedUp(*args): 74 | try: 75 | ac.ext_rainParamsAdjust(0.0, 1.0) 76 | except: 77 | ac.setText(debug, "AccExtRain: Shaders Patch not active? : \n" + traceback.format_exc()) 78 | 79 | def acUpdate(delta_t): 80 | global error, rainStrengthValue, rainWiperSpeedValue, debug 81 | global timer 82 | timer += delta_t 83 | if timer > 0.25: 84 | timer = 0.0 85 | if error < 1: 86 | try: 87 | params = ac.ext_rainParams() 88 | ac.setText(rainStrengthValue, str(round(params[0], 1))) 89 | ac.setText(rainWiperSpeedValue, str(round(params[1], 1))) 90 | except: 91 | error+=1 92 | ac.log("AccExtRain: Shaders Patch not active?\n\n" + traceback.format_exc()) 93 | # ac.setText(debug, "AccExtRain: Shaders Patch not active? : \n" + traceback.format_exc()) 94 | 95 | def acShutdown(*args): 96 | return 97 | -------------------------------------------------------------------------------- /apps/python/AccExtRain/ui/ui_app.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "Shaders Extension Rain", 3 | "version": "0.2", 4 | "author": "henter, leBluem", 5 | "description": "Adjust rain and wipers when having weatherFX enabled.", 6 | "tags": [ 7 | "shaders extension", 8 | "ui", 9 | "mirrors" 10 | ], 11 | "country": null, 12 | "url": null 13 | } 14 | -------------------------------------------------------------------------------- /apps/python/AccExtWeather/AccExtWeather.py: -------------------------------------------------------------------------------- 1 | # AccExtWeather.py - v0.95 - by x4fab, leBluem, Blamer 2 | 3 | try: 4 | import ac 5 | import acsys 6 | import os 7 | import traceback 8 | import random 9 | import time 10 | import re 11 | import configparser 12 | except ImportError: 13 | pass 14 | 15 | # option 16 | gWrapDebugText = False 17 | gHideBG = False 18 | gHideWeather = False 19 | gAppsize = 1.0 20 | #sizeToggle = 0 21 | 22 | # vars 23 | app = 0 24 | label = 0 25 | labeldate = 0 26 | error = 0 27 | timer = 0 28 | speed = 0 29 | day_offset = 0 30 | 31 | 32 | timeOffsetMinusSmallerButton = 0 33 | timeOffsetPlusSmallerButton = 0 34 | timeOffsetMinusSmallButton = 0 35 | timeOffsetPlusSmallButton = 0 36 | timeOffsetMinusBigButton = 0 37 | timeOffsetPlusBigButton = 0 38 | timeOffsetMinusHugeButton = 0 39 | timeOffsetPlusHugeButton = 0 40 | timeOffsetMinusPlayButton = 0 41 | timeOffsetPlusPlayButton = 0 42 | timeOffsetMinusPlaySmallButton = 0 43 | timeOffsetPlusPlaySmallButton = 0 44 | timeOffsetMinusMonthButton = 0 45 | timeOffsetPlusMonthButton = 0 46 | timeOffsetMinusYearButton = 0 47 | timeOffsetPlusYearButton = 0 48 | 49 | settingsFilePath = "apps\\python\\AccExtWeather\\settings\\settings.ini" 50 | documentSectionGeneral = "GENERAL" 51 | 52 | def appCreateMyself(): 53 | global app, label, labeldate 54 | global timeOffsetMinusSmallButton, timeOffsetPlusSmallButton, timeOffsetMinusBigButton, timeOffsetPlusBigButton, timeOffsetMinusHugeButton, timeOffsetPlusHugeButton, timeOffsetMinusPlayButton, timeOffsetPlusPlayButton 55 | global timeOffsetMinusSmallerButton, timeOffsetPlusSmallerButton, timeOffsetMinusPlaySmallButton, timeOffsetPlusPlaySmallButton 56 | global timeOffsetMinusMonthButton, timeOffsetPlusMonthButton, timeOffsetMinusYearButton, timeOffsetPlusYearButton 57 | global sizeToggle, gAppsize, gHideBG, gHideWeather 58 | 59 | xpos=10 60 | ypos=35 61 | dx=50 62 | dy=20 63 | fntsize=12 64 | mult=1.0 65 | if gAppsize>=0.5 and gAppsize<=4.0: 66 | mult=gAppsize 67 | dx=dx*mult 68 | dy=dy*mult 69 | fntsize=fntsize*mult 70 | 71 | app = ac.newApp("Shaders Patch Weather") 72 | ac.setTitle(app, " Weather FX") 73 | #ac.setSize(app, 420, 360) # v0.1 74 | if gHideWeather: 75 | ac.setSize(app, 335*mult, ypos+dy*3.5) 76 | else: 77 | ac.setSize(app, 335*mult, 380*mult) 78 | 79 | label = ac.addLabel(app, "") 80 | ac.setFontSize(label, fntsize-1) 81 | ac.setPosition(label, 10, ypos+dy*3+3) 82 | 83 | #labeldate = ac.addLabel(app, "") 84 | #ac.setFontSize(labeldate, fntsize+1) 85 | #ac.setPosition(labeldate, 300*mult, ypos+dy*3+30) 86 | 87 | timeOffsetMinusSmallerButton = ac.addButton(app, "−5min") 88 | ac.setPosition(timeOffsetMinusSmallerButton, xpos, ypos) 89 | ac.setSize(timeOffsetMinusSmallerButton, 50*mult, dy-1) 90 | ac.setFontSize(timeOffsetMinusSmallerButton, fntsize) 91 | ac.addOnClickedListener(timeOffsetMinusSmallerButton, timeOffsetMinusSmaller) 92 | xpos+=dx 93 | timeOffsetPlusSmallerButton = ac.addButton(app, "+5min") 94 | ac.setPosition(timeOffsetPlusSmallerButton, xpos, ypos) 95 | ac.setSize(timeOffsetPlusSmallerButton, 50*mult, dy-1) 96 | ac.setFontSize(timeOffsetPlusSmallerButton, fntsize) 97 | ac.addOnClickedListener(timeOffsetPlusSmallerButton, timeOffsetPlusSmaller) 98 | xpos+=dx+10*mult 99 | timeOffsetMinusHugeButton = ac.addButton(app, "−day") 100 | ac.setPosition(timeOffsetMinusHugeButton, xpos, ypos) 101 | ac.setSize(timeOffsetMinusHugeButton, 50*mult, dy-1) 102 | ac.setFontSize(timeOffsetMinusHugeButton, fntsize) 103 | ac.addOnClickedListener(timeOffsetMinusHugeButton, timeOffsetMinusHuge) 104 | xpos+=dx 105 | timeOffsetPlusHugeButton = ac.addButton(app, "+day") 106 | ac.setPosition(timeOffsetPlusHugeButton, xpos, ypos) 107 | ac.setSize(timeOffsetPlusHugeButton, 50*mult, dy-1) 108 | ac.setFontSize(timeOffsetPlusHugeButton, fntsize) 109 | ac.addOnClickedListener(timeOffsetPlusHugeButton, timeOffsetPlusHuge) 110 | xpos+=dx+10*mult 111 | timeOffsetMinusPlaySmallButton = ac.addButton(app, "- 1x") 112 | ac.setPosition(timeOffsetMinusPlaySmallButton, xpos, ypos) 113 | ac.setSize(timeOffsetMinusPlaySmallButton, 50*mult, dy-1) 114 | ac.setFontSize(timeOffsetMinusPlaySmallButton, fntsize) 115 | ac.addOnClickedListener(timeOffsetMinusPlaySmallButton, timeOffsetMinusPlaySmall) 116 | xpos+=dx 117 | timeOffsetPlusPlaySmallButton = ac.addButton(app, "+ 1x") 118 | ac.setPosition(timeOffsetPlusPlaySmallButton, xpos, ypos) 119 | ac.setSize(timeOffsetPlusPlaySmallButton, 50*mult, dy-1) 120 | ac.setFontSize(timeOffsetPlusPlaySmallButton, fntsize) 121 | ac.addOnClickedListener(timeOffsetPlusPlaySmallButton, timeOffsetPlusPlaySmall) 122 | 123 | xpos=10 124 | ypos=35+dy 125 | timeOffsetMinusSmallButton = ac.addButton(app, "−45min") 126 | ac.setPosition(timeOffsetMinusSmallButton, xpos, ypos) 127 | ac.setSize(timeOffsetMinusSmallButton, 50*mult, dy-1) 128 | ac.setFontSize(timeOffsetMinusSmallButton, fntsize) 129 | ac.addOnClickedListener(timeOffsetMinusSmallButton, timeOffsetMinusSmall) 130 | xpos+=dx 131 | timeOffsetPlusSmallButton = ac.addButton(app, "+45min") 132 | ac.setPosition(timeOffsetPlusSmallButton, xpos, ypos) 133 | ac.setSize(timeOffsetPlusSmallButton, 50*mult, dy-1) 134 | ac.setFontSize(timeOffsetPlusSmallButton, fntsize) 135 | ac.addOnClickedListener(timeOffsetPlusSmallButton, timeOffsetPlusSmall) 136 | xpos+=dx+10*mult 137 | timeOffsetMinusMonthButton = ac.addButton(app, "−month") 138 | ac.setPosition(timeOffsetMinusMonthButton, xpos, ypos) 139 | ac.setSize(timeOffsetMinusMonthButton, 50*mult, dy-1) 140 | ac.setFontSize(timeOffsetMinusMonthButton, fntsize) 141 | ac.addOnClickedListener(timeOffsetMinusMonthButton, timeOffsetMinusMonth) 142 | xpos+=dx 143 | timeOffsetPlusMonthButton = ac.addButton(app, "+month") 144 | ac.setPosition(timeOffsetPlusMonthButton, xpos, ypos) 145 | ac.setSize(timeOffsetPlusMonthButton, 50*mult, dy-1) 146 | ac.setFontSize(timeOffsetPlusMonthButton, fntsize) 147 | ac.addOnClickedListener(timeOffsetPlusMonthButton, timeOffsetPlusMonth) 148 | xpos+=dx+10*mult 149 | timeOffsetMinusPlayButton = ac.addButton(app, "- 10x") 150 | ac.setPosition(timeOffsetMinusPlayButton, xpos, ypos) 151 | ac.setSize(timeOffsetMinusPlayButton, 50*mult, dy-1) 152 | ac.setFontSize(timeOffsetMinusPlayButton, fntsize) 153 | ac.addOnClickedListener(timeOffsetMinusPlayButton, timeOffsetMinusPlay) 154 | xpos+=dx 155 | timeOffsetPlusPlayButton = ac.addButton(app, "+ 10x") 156 | ac.setPosition(timeOffsetPlusPlayButton, xpos, ypos) 157 | ac.setSize(timeOffsetPlusPlayButton, 50*mult, dy-1) 158 | ac.setFontSize(timeOffsetPlusPlayButton, fntsize) 159 | ac.addOnClickedListener(timeOffsetPlusPlayButton, timeOffsetPlusPlay) 160 | 161 | xpos=10 162 | ypos=35+dy*2 163 | timeOffsetMinusBigButton = ac.addButton(app, "−6hr") 164 | ac.setPosition(timeOffsetMinusBigButton, xpos, ypos) 165 | ac.setSize(timeOffsetMinusBigButton, 50*mult, dy-1) 166 | ac.setFontSize(timeOffsetMinusBigButton, fntsize) 167 | ac.addOnClickedListener(timeOffsetMinusBigButton, timeOffsetMinusBig) 168 | xpos+=dx 169 | timeOffsetPlusBigButton = ac.addButton(app, "+6hr") 170 | ac.setPosition(timeOffsetPlusBigButton, xpos, ypos) 171 | ac.setSize(timeOffsetPlusBigButton, 50*mult, dy-1) 172 | ac.setFontSize(timeOffsetPlusBigButton, fntsize) 173 | ac.addOnClickedListener(timeOffsetPlusBigButton, timeOffsetPlusBig) 174 | xpos+=dx+10*mult 175 | timeOffsetMinusYearButton = ac.addButton(app, "−year") 176 | ac.setPosition(timeOffsetMinusYearButton, xpos, ypos) 177 | ac.setSize(timeOffsetMinusYearButton, 50*mult, dy-1) 178 | ac.setFontSize(timeOffsetMinusYearButton, fntsize) 179 | ac.addOnClickedListener(timeOffsetMinusYearButton, timeOffsetMinusYear) 180 | xpos+=dx 181 | timeOffsetPlusYearButton = ac.addButton(app, "+year") 182 | ac.setPosition(timeOffsetPlusYearButton, xpos, ypos) 183 | ac.setSize(timeOffsetPlusYearButton, 50*mult, dy-1) 184 | ac.setFontSize(timeOffsetPlusYearButton, fntsize) 185 | ac.addOnClickedListener(timeOffsetPlusYearButton, timeOffsetPlusYear) 186 | xpos+=dx+10*mult 187 | timeOffsetMinusPlayBigButton = ac.addButton(app, "- 50x") 188 | ac.setPosition(timeOffsetMinusPlayBigButton, xpos, ypos) 189 | ac.setSize(timeOffsetMinusPlayBigButton, 50*mult, dy-1) 190 | ac.setFontSize(timeOffsetMinusPlayBigButton, fntsize) 191 | ac.addOnClickedListener(timeOffsetMinusPlayBigButton, timeOffsetMinusBigPlay) 192 | xpos+=dx 193 | timeOffsetPlusPlayBigButton = ac.addButton(app, "+ 50x") 194 | ac.setPosition(timeOffsetPlusPlayBigButton, xpos, ypos) 195 | ac.setSize(timeOffsetPlusPlayBigButton, 50*mult, dy-1) 196 | ac.setFontSize(timeOffsetPlusPlayBigButton, fntsize) 197 | ac.addOnClickedListener(timeOffsetPlusPlayBigButton, timeOffsetPlusBigPlay) 198 | 199 | def timeOffsetMinusSmaller(*args): 200 | try: 201 | ac.ext_weatherTimeOffset(-5 * 60) 202 | except: 203 | ac.log("AccExtWeatherFX: Unexpected error:" + traceback.format_exc()) 204 | 205 | def timeOffsetPlusSmaller(*args): 206 | try: 207 | ac.ext_weatherTimeOffset(5 * 60) 208 | except: 209 | ac.log("AccExtWeatherFX: Unexpected error:" + traceback.format_exc()) 210 | 211 | def timeOffsetMinusSmall(*args): 212 | try: 213 | ac.ext_weatherTimeOffset(-45 * 60) 214 | except: 215 | ac.log("AccExtWeatherFX: Unexpected error:" + traceback.format_exc()) 216 | 217 | def timeOffsetPlusSmall(*args): 218 | try: 219 | ac.ext_weatherTimeOffset(45 * 60) 220 | except: 221 | ac.log("AccExtWeatherFX: Unexpected error:" + traceback.format_exc()) 222 | 223 | def timeOffsetMinusBig(*args): 224 | try: 225 | ac.ext_weatherTimeOffset(-6 * 60 * 60) 226 | except: 227 | ac.log("AccExtWeatherFX: Unexpected error:" + traceback.format_exc()) 228 | 229 | def timeOffsetPlusBig(*args): 230 | try: 231 | ac.ext_weatherTimeOffset(6 * 60 * 60) 232 | except: 233 | ac.log("AccExtWeatherFX: Unexpected error:" + traceback.format_exc()) 234 | 235 | def timeOffsetMinusHuge(*args): 236 | try: 237 | ac.ext_weatherTimeOffset(-24 * 60 * 60) 238 | except: 239 | ac.log("AccExtWeatherFX: Unexpected error:" + traceback.format_exc()) 240 | 241 | def timeOffsetPlusHuge(*args): 242 | try: 243 | ac.ext_weatherTimeOffset(24 * 60 * 60) 244 | except: 245 | ac.log("AccExtWeatherFX: Unexpected error:" + traceback.format_exc()) 246 | 247 | def timeOffsetMinusMonth(*args): 248 | try: 249 | ac.ext_weatherTimeOffset(-30 * 24 * 60 * 60) 250 | except: 251 | ac.log("AccExtWeatherFX: Unexpected error:" + traceback.format_exc()) 252 | 253 | def timeOffsetPlusMonth(*args): 254 | try: 255 | ac.ext_weatherTimeOffset(30 * 24 * 60 * 60) 256 | except: 257 | ac.log("AccExtWeatherFX: Unexpected error:" + traceback.format_exc()) 258 | 259 | def timeOffsetMinusYear(*args): 260 | try: 261 | ac.ext_weatherTimeOffset(-365 * 24 * 60 * 60) 262 | except: 263 | ac.log("AccExtWeatherFX: Unexpected error:" + traceback.format_exc()) 264 | 265 | def timeOffsetPlusYear(*args): 266 | try: 267 | ac.ext_weatherTimeOffset(365 * 24 * 60 * 60) 268 | except: 269 | ac.log("AccExtWeatherFX: Unexpected error:" + traceback.format_exc()) 270 | 271 | def timeOffsetMinusPlaySmall(*args): 272 | global speed 273 | speed -= 1 274 | 275 | def timeOffsetPlusPlaySmall(*args): 276 | global speed 277 | speed += 1 278 | 279 | def timeOffsetMinusPlay(*args): 280 | global speed 281 | speed -= 10 282 | 283 | def timeOffsetPlusPlay(*args): 284 | global speed 285 | speed += 10 286 | 287 | def timeOffsetMinusBigPlay(*args): 288 | global speed 289 | speed -= 50 290 | 291 | def timeOffsetPlusBigPlay(*args): 292 | global speed 293 | speed += 50 294 | 295 | def getSettingsValue(parser, section, option, value, boolean = False): 296 | if parser.has_option(str(section), str(option)): 297 | if boolean: 298 | return parser.getboolean(str(section), option) 299 | else: 300 | return parser.get(str(section), str(option)) 301 | else: 302 | return str(value) 303 | 304 | def appReadSettings(): 305 | global gWrapDebugText, gAppsize, gHideBG, gHideWeather 306 | global settingsFilePath, documentSectionGeneral 307 | try: 308 | if not os.path.isfile(settingsFilePath): 309 | with open(settingsFilePath, "w") as sf: 310 | ac.log("AccExtWeatherFX: Settings file created") 311 | settingsParser = configparser.ConfigParser() 312 | settingsParser.optionxform = str 313 | settingsParser.read(settingsFilePath) 314 | gWrapDebugText = getSettingsValue(settingsParser, documentSectionGeneral, "uiWrapDebugText", False, True) 315 | gHideBG = getSettingsValue(settingsParser, documentSectionGeneral, "uiHideBG", False, True) 316 | gHideWeather = getSettingsValue(settingsParser, documentSectionGeneral, "uiHideWeather", False, True) 317 | gAppsize = float(getSettingsValue(settingsParser, documentSectionGeneral, "uiSize", "1.0", False)) 318 | except: 319 | ac.log("AccExtWeatherFX: Unexpected error:" + traceback.format_exc()) 320 | 321 | def acUpdate(delta_t): 322 | global error, timer, day_offset, gWrapDebugText, gAppsize, gHideBG, gHideWeather 323 | timer += delta_t 324 | day_offset += speed * delta_t 325 | if timer > 0.075: 326 | timer = 0.0 327 | if abs(day_offset) > 1: 328 | try: 329 | ac.ext_weatherTimeOffset(24 * 60 * 60 * day_offset / abs(day_offset)) 330 | except: 331 | ac.log("AccExtWeatherFX: Unexpected error:" + traceback.format_exc()) 332 | day_offset = 0 333 | if error < 1: 334 | try: 335 | if not gHideWeather: 336 | s = ac.ext_weatherDebugText() 337 | s = s.replace('current day:', ' > current day: ') 338 | if gWrapDebugText==True: 339 | s = '\n'.join(s.strip() for s in re.findall(r'.{1,80}(?:\s+|$)', s)) 340 | s = s.replace('>>> Sol weather: v', '\n>>> Sol weather: v') 341 | ac.setText(label, s) 342 | if gHideBG==True: 343 | ac.setBackgroundOpacity(app,0) 344 | ac.drawBorder(app,0) 345 | except: 346 | error = error + 1 347 | ac.log("AccExtWeatherFX: Unexpected error:" + traceback.format_exc()) 348 | ac.setText(label, "Shaders patch not installed? Error: \n" + traceback.format_exc()) 349 | 350 | def acMain(ac_version): 351 | try: 352 | appReadSettings() 353 | appCreateMyself() 354 | # ac.setVisible(app,1) # todo debug out 355 | except: 356 | ac.log("AccExtWeatherFX: Unexpected error:" + traceback.format_exc()) 357 | return "AccExtWeather" 358 | 359 | def acShutdown(*args): 360 | pass 361 | -------------------------------------------------------------------------------- /apps/python/AccExtWeather/settings/settings_defaults.ini: -------------------------------------------------------------------------------- 1 | [GENERAL] 2 | uiWrapDebugText = False ; wrap text ; "True" or "False" 3 | uiHideBG = False ; make transparent; "True" or "False" 4 | uiSize = 1.0 ; WeatherFX app window size multiplier; 0.7,0.8,0.9,1.0,1.25,1.5,1.75,2.0 5 | uiHideWeather = False ; Hide weather debug text; "True" or "False" 6 | -------------------------------------------------------------------------------- /apps/python/AccExtWeather/ui/ui_app.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "Shaders Extension Weather FX", 3 | "version": "0.95", 4 | "author": "x4fab, leBluem, Blamer", 5 | "description": "Tool to develop and debug weather. Contains BLM apps code.", 6 | "tags": [ 7 | "shaders extension", 8 | "ui", 9 | "debug" 10 | ], 11 | "country": "planet earth", 12 | "url": "https://trello.com/c/2Nb19GnT/12-weather-fx" 13 | } -------------------------------------------------------------------------------- /content/gui/icons/Shaders Patch Debug_OFF.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ac-custom-shaders-patch/acc-extension-apps/9cf04b177f12e1aaa2132b9b13fc359d3d7bc032/content/gui/icons/Shaders Patch Debug_OFF.png -------------------------------------------------------------------------------- /content/gui/icons/Shaders Patch Debug_ON.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ac-custom-shaders-patch/acc-extension-apps/9cf04b177f12e1aaa2132b9b13fc359d3d7bc032/content/gui/icons/Shaders Patch Debug_ON.png -------------------------------------------------------------------------------- /content/gui/icons/Shaders Patch Mirrors_OFF.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ac-custom-shaders-patch/acc-extension-apps/9cf04b177f12e1aaa2132b9b13fc359d3d7bc032/content/gui/icons/Shaders Patch Mirrors_OFF.png -------------------------------------------------------------------------------- /content/gui/icons/Shaders Patch Mirrors_ON.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ac-custom-shaders-patch/acc-extension-apps/9cf04b177f12e1aaa2132b9b13fc359d3d7bc032/content/gui/icons/Shaders Patch Mirrors_ON.png -------------------------------------------------------------------------------- /content/gui/icons/Shaders Patch Rain_OFF.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ac-custom-shaders-patch/acc-extension-apps/9cf04b177f12e1aaa2132b9b13fc359d3d7bc032/content/gui/icons/Shaders Patch Rain_OFF.png -------------------------------------------------------------------------------- /content/gui/icons/Shaders Patch Rain_ON.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ac-custom-shaders-patch/acc-extension-apps/9cf04b177f12e1aaa2132b9b13fc359d3d7bc032/content/gui/icons/Shaders Patch Rain_ON.png -------------------------------------------------------------------------------- /content/gui/icons/Shaders Patch Weather_OFF.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ac-custom-shaders-patch/acc-extension-apps/9cf04b177f12e1aaa2132b9b13fc359d3d7bc032/content/gui/icons/Shaders Patch Weather_OFF.png -------------------------------------------------------------------------------- /content/gui/icons/Shaders Patch Weather_ON.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ac-custom-shaders-patch/acc-extension-apps/9cf04b177f12e1aaa2132b9b13fc359d3d7bc032/content/gui/icons/Shaders Patch Weather_ON.png --------------------------------------------------------------------------------