diff --git a/.github/workflows/render_nanomaps.yml b/.github/workflows/render_nanomaps.yml new file mode 100644 index 00000000000..32bde6d350a --- /dev/null +++ b/.github/workflows/render_nanomaps.yml @@ -0,0 +1,35 @@ +# GitHub action to autorender nanomaps outside the game +# This kills off the awful verb we have that takes a full 50 seconds and hangs the whole server +# The file names and locations are VERY important here +# DO NOT EDIT THIS UNLESS YOU KNOW WHAT YOU ARE DOING +# -aa +name: 'Render Nanomaps' +on: + push: + branches: master + paths: + - '_maps/map_files/**' + +jobs: + generate_maps: + name: 'Generate NanoMaps' + runs-on: ubuntu-18.04 + steps: + - name: 'Update Branch' + uses: actions/checkout@v2 + with: + fetch-depth: 1 + + - name: 'Generate Maps' + run: './tools/github-actions/nanomap-renderer-invoker.sh' + + - name: 'Commit Maps' + run: | + git config --local user.email "action@github.com" + git config --local user.name "NanoMap Generation" + git pull origin master + git commit -m "NanoMap Auto-Update (`date`)" -a || true + - name: 'Push Maps' + uses: ad-m/github-push-action@master + with: + github_token: ${{ secrets.GITHUB_TOKEN }} diff --git a/README.md b/README.md index 943397b0fa8..2c0ababbe30 100644 --- a/README.md +++ b/README.md @@ -3,6 +3,7 @@ [](http://isitmaintained.com/project/paradisess13/paradise "Average time to resolve an issue") [](http://isitmaintained.com/project/paradisess13/paradise "Percentage of issues still open") [](http://www.krihelinator.xyz) + [](http://forthebadge.com) [](http://forthebadge.com) diff --git a/code/modules/admin/verbs/toggledebugverbs.dm b/code/modules/admin/verbs/toggledebugverbs.dm index 328b5176e9a..38b49869298 100644 --- a/code/modules/admin/verbs/toggledebugverbs.dm +++ b/code/modules/admin/verbs/toggledebugverbs.dm @@ -17,7 +17,6 @@ GLOBAL_LIST_INIT(admin_verbs_show_debug_verbs, list( /client/proc/print_jobban_old, /client/proc/print_jobban_old_filter, /client/proc/forceEvent, - /client/proc/nanomapgen_DumpImage, /client/proc/admin_redo_space_transitions, /client/proc/make_turf_space_map, /client/proc/vv_by_ref diff --git a/code/modules/nano/nanomapgen.dm b/code/modules/nano/nanomapgen.dm deleted file mode 100644 index b0a8869191f..00000000000 --- a/code/modules/nano/nanomapgen.dm +++ /dev/null @@ -1,90 +0,0 @@ -// This file is a modified version of https://raw2.github.com/Baystation12/OldCode-BS12/master/code/TakePicture.dm - -#define NANOMAP_ICON_SIZE 4 -#define NANOMAP_MAX_ICON_DIMENSION 1024 - -#define NANOMAP_TILES_PER_IMAGE (NANOMAP_MAX_ICON_DIMENSION / NANOMAP_ICON_SIZE) - -#define NANOMAP_TERMINALERR 5 -#define NANOMAP_INPROGRESS 2 -#define NANOMAP_BADOUTPUT 2 -#define NANOMAP_SUCCESS 1 -#define NANOMAP_WATCHDOGSUCCESS 4 -#define NANOMAP_WATCHDOGTERMINATE 3 - - -//Call these procs to dump your world to a series of image files (!!) -//NOTE: Does not explicitly support non 32x32 icons or stuff with large pixel_* values, so don't blame me if it doesn't work perfectly - -/client/proc/nanomapgen_DumpImage() - set name = "Generate NanoUI Map" - set category = "Mapping" - - if(holder) - nanomapgen_DumpTile(1, 1, text2num(input(usr,"Enter the Z level to generate"))) - -/client/proc/nanomapgen_DumpTile(var/startX = 1, var/startY = 1, var/currentZ = 1, var/endX = -1, var/endY = -1) - - if(endX < 0 || endX > world.maxx) - endX = world.maxx - - if(endY < 0 || endY > world.maxy) - endY = world.maxy - - if(currentZ < 0 || currentZ > world.maxz) - to_chat(usr, "NanoMapGen: ERROR: currentZ ([currentZ]) must be between 1 and [world.maxz]") - - sleep(3) - return NANOMAP_TERMINALERR - - if(startX > endX) - to_chat(usr, "NanoMapGen: ERROR: startX ([startX]) cannot be greater than endX ([endX])") - - sleep(3) - return NANOMAP_TERMINALERR - - if(startY > endX) - to_chat(usr, "NanoMapGen: ERROR: startY ([startY]) cannot be greater than endY ([endY])") - sleep(3) - return NANOMAP_TERMINALERR - - var/icon/Tile = icon(file("nano/mapbase1024.png")) - if(Tile.Width() != NANOMAP_MAX_ICON_DIMENSION || Tile.Height() != NANOMAP_MAX_ICON_DIMENSION) - log_world("NanoMapGen: ERROR: BASE IMAGE DIMENSIONS ARE NOT [NANOMAP_MAX_ICON_DIMENSION]x[NANOMAP_MAX_ICON_DIMENSION]") - sleep(3) - return NANOMAP_TERMINALERR - - log_world("NanoMapGen: GENERATE MAP ([startX],[startY],[currentZ]) to ([endX],[endY],[currentZ])") - to_chat(usr, "NanoMapGen: GENERATE MAP ([startX],[startY],[currentZ]) to ([endX],[endY],[currentZ])") - - var/count = 0 - for(var/WorldX = startX, WorldX <= endX, WorldX++) - for(var/WorldY = startY, WorldY <= endY, WorldY++) - - var/atom/Turf = locate(WorldX, WorldY, currentZ) - - var/icon/TurfIcon = new(Turf.icon, Turf.icon_state) - TurfIcon.Scale(NANOMAP_ICON_SIZE, NANOMAP_ICON_SIZE) - - Tile.Blend(TurfIcon, ICON_OVERLAY, ((WorldX - 1) * NANOMAP_ICON_SIZE), ((WorldY - 1) * NANOMAP_ICON_SIZE)) - - count++ - - if(count % 8000 == 0) - log_world("NanoMapGen: [count] tiles done") - sleep(1) - - var/mapFilename = "nanomap_z[currentZ]-new.png" - - log_world("NanoMapGen: sending [mapFilename] to client") - - usr << browse(Tile, "window=picture;file=[mapFilename];display=0") - - log_world("NanoMapGen: Done.") - - to_chat(usr, "NanoMapGen: Done. File [mapFilename] uploaded to your cache.") - - if(Tile.Width() != NANOMAP_MAX_ICON_DIMENSION || Tile.Height() != NANOMAP_MAX_ICON_DIMENSION) - return NANOMAP_BADOUTPUT - - return NANOMAP_SUCCESS diff --git a/nano/layouts/layout_default.tmpl b/nano/layouts/layout_default.tmpl index 2c0953fc0a9..d3a86461a76 100644 --- a/nano/layouts/layout_default.tmpl +++ b/nano/layouts/layout_default.tmpl @@ -21,10 +21,10 @@ {{:helper.link('Hide Map', 'close', {'showMap' : 0})}}