diff --git a/.editorconfig b/.editorconfig new file mode 100644 index 0000000..b0914c1 --- /dev/null +++ b/.editorconfig @@ -0,0 +1,10 @@ +# top-most EditorConfig file +root = true + +[*] +end_of_line = CRLF # CRLF based line ending because of Windows based game. +insert_final_newline = true +trim_trailing_whitespace = true +indent_style = space +indent_size = 4 +charset = utf-8 diff --git a/.env.example b/.env.example new file mode 100644 index 0000000..995efad --- /dev/null +++ b/.env.example @@ -0,0 +1,6 @@ +gamePath="c:\Path\To\Farming Simulator 22\\" +gameProfile="c:\Documents\My Games\FarmingSimulator2022\\" +gameExe="c:\Program Files (x86)\Steam\steam.exe" -applaunch 2300320 +savegameId=1 +testRunner="c:\Path\To\TestRunner_public.exe" +testTempFolder="c:\Path\To\CleanCopy\For\Testing\\" diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..446293d --- /dev/null +++ b/.gitattributes @@ -0,0 +1,11 @@ +* text=auto + +*.i3d -text +*.ma -text -diff -merge + +/.editorconfig export-ignore +/.gitattributes export-ignore +/.gitignore export-ignore +/*.cmd export-ignore +/.github export-ignore +/.env.example export-ignore diff --git a/.github/workflows/pre-release.yml b/.github/workflows/pre-release.yml new file mode 100644 index 0000000..85a84d7 --- /dev/null +++ b/.github/workflows/pre-release.yml @@ -0,0 +1,30 @@ +--- +name: "pre-release" + +on: + push: + branches: + - "fs25" + tags-ignore: + - "*" + +jobs: + gh_pre_release: + runs-on: "windows-latest" + + steps: + - name: "Checkout source code" + uses: "actions/checkout@v3" + with: + lfs: true + + - run: "./pack.cmd" + + - uses: "marvinpinto/action-automatic-releases@latest" + with: + repo_token: "${{ secrets.GITHUB_TOKEN }}" + automatic_release_tag: "fs25-latest" + prerelease: true + title: "fs25-dev-latest" + files: | + FS25_NoTeleport.zip diff --git a/.github/workflows/tagged-release.yml b/.github/workflows/tagged-release.yml new file mode 100644 index 0000000..443f28b --- /dev/null +++ b/.github/workflows/tagged-release.yml @@ -0,0 +1,28 @@ +--- +name: "tagged-release" + +on: + push: + tags: + - "fs25-v*" + +jobs: + tagged-release: + name: "Tagged Release" + runs-on: "windows-latest" + + steps: + - name: "Checkout source code" + uses: "actions/checkout@v3" + with: + lfs: true + + - run: "./pack.cmd" + + - uses: "marvinpinto/action-automatic-releases@latest" + with: + repo_token: "${{ secrets.GITHUB_TOKEN }}" + automatic_release_tag: "${{ github.ref_name }}" + prerelease: false + files: | + FS25_NoTeleport.zip diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..8b09e1e --- /dev/null +++ b/.gitignore @@ -0,0 +1,13 @@ +# System stuff +.DS_STORE + +# Build system +.fsbuild.yml +FS25_* +*.zip +.env + +# IDE +.idea/ +.atom +*.exe diff --git a/LICENSE.md b/LICENSE.md new file mode 100644 index 0000000..943c29a --- /dev/null +++ b/LICENSE.md @@ -0,0 +1 @@ +This work is licensed under the Creative Commons Attribution-NonCommercial-NoDerivatives 4.0 International License. To view a copy of this license, visit http://creativecommons.org/licenses/by-nc-nd/4.0/ or send a letter to Creative Commons, PO Box 1866, Mountain View, CA 94042, USA. diff --git a/Readme.md b/Readme.md new file mode 100644 index 0000000..fd5e8f2 --- /dev/null +++ b/Readme.md @@ -0,0 +1,28 @@ +# No Teleport + +[![Farming Simulator 25](https://img.shields.io/badge/farming%20simulator-25-A0C213?style=flat-square)](https://www.farming-simulator.com/) +[![GitHub release (latest by date)](https://img.shields.io/github/v/release/VertexDezign/NoTeleport?style=flat-square)](https://github.com/VertexDezign/NoTeleport/releases) +[![GitHub issues](https://img.shields.io/github/issues/VertexDezign/NoTeleport?style=flat-square)](https://github.com/VertexDezign/NoTeleport/issues) +[![License: CC BY-NC-ND 4.0](https://img.shields.io/badge/License-CC_BY--NC--ND_4.0-lightgrey.svg?style=flat-square)](https://creativecommons.org/licenses/by-nc-nd/4.0/) + +The year 3025. There are stories about ancient peoples and their rudimentary methods of transportation. It is said that these people went to their destination by car. Sometimes they also walked. How old-fashioned is that? +Welcome to 2025... Teleporting is not yet a thing... + + +This is a Mod for Farming Simulator 25. + +**[Download latest development version here](https://github.com/VertexDezign/NoTeleport/releases/download/fs25-latest/FS25_NoTeleport.zip)** + +--- + +## Features + +- No "visit" buttons in map marker menus +- No "visit" buttons in production menu +- No vehicle tabbing + +--- + +Have ideas to make the mod even better? Found a bug? Let us know on [Github](https://github.com/VertexDezign/NoTeleport/issues) so we can keep improving the mod together! + +[FS25_TargetFillLevel](https://github.com/VertexDezign/NoTeleport/) by [André Buchmann](https://github.com/schliesser/) & [VertexDezign](https://vertexdezign.net/) is licensed under [CC BY NC ND 4.0](http://creativecommons.org/licenses/by-nc-nd/4.0/) diff --git a/icon_noTeleport.dds b/icon_noTeleport.dds new file mode 100644 index 0000000..78a4856 Binary files /dev/null and b/icon_noTeleport.dds differ diff --git a/modDesc.xml b/modDesc.xml new file mode 100644 index 0000000..ac0a8f3 --- /dev/null +++ b/modDesc.xml @@ -0,0 +1,41 @@ + + + -tinte- / VertexDezign + 1.0.0.0 + + <en>No Teleport</en> + <de>Kein Teleportieren</de> + + + + + + icon_noTeleport.dds + + + + + + diff --git a/pack.cmd b/pack.cmd new file mode 100644 index 0000000..1889725 --- /dev/null +++ b/pack.cmd @@ -0,0 +1,20 @@ +@ECHO off + +SET modName=FS25_NoTeleport +SET filename=%modName%.zip + +IF EXIST %filename% ( + DEL %filename% > NUL +) + +"7z" a -tzip %filename% ^ + -i!*.lua ^ + -i!*.dds ^ + -i!*.xml ^ + -xr!resources ^ + -xr!.vscode ^ + -xr!.idea ^ + -xr!.git ^ + -aoa -r ^ + +IF %ERRORLEVEL% NEQ 0 ( exit 1 ) diff --git a/run.cmd b/run.cmd new file mode 100644 index 0000000..3404d26 --- /dev/null +++ b/run.cmd @@ -0,0 +1,27 @@ +@ECHO off + +@REM Pack mod +CALL pack.cmd + +IF %ERRORLEVEL% NEQ 0 ( exit 1 ) + +setlocal +FOR /F "tokens=*" %%i in ('type .env') do SET %%i + +ECHO Copy file to mod folder +COPY %filename% %gameProfile%mods\ + +IF %ERRORLEVEL% NEQ 0 ( exit 1 ) + +ECHO Starting game with savegame %savegameId% ... +%gameExe% -cheats -autoStartSavegameId %savegameId% + +ECHO Happy Testing: %modName% + +@REM Available FS25 start params +@REM -cheats (enables cheats in the console) +@REM -autoStartSavegameId 3 (loads the savegame automatically | *Replace "3" with the savegame ID of your choice) +@REM -restart (prevents intro videos from playing | will also keep logging the game to the logfile) +@REM -disableFramerateLimiter (removes the FPS cap | not recommended ) + +endlocal diff --git a/runMP.cmd b/runMP.cmd new file mode 100644 index 0000000..d9d854e --- /dev/null +++ b/runMP.cmd @@ -0,0 +1,24 @@ +@ECHO off + +@REM Pack mod +CALL pack.cmd + +IF %ERRORLEVEL% NEQ 0 ( exit 1 ) + +setlocal +FOR /F "tokens=*" %%i in ('type .env') do SET %%i + +ECHO Copy file to mod folder +COPY %filename% %gameProfile%mods\ +ECHO Copy file to remote PC +COPY %filename% %remoteGameProfile%mods\ + +ECHO Happy Testing: %modName% + +@REM Available FS25 start params +@REM -cheats (enables cheats in the console) +@REM -autoStartSavegameId 3 (loads the savegame automatically | *Replace "3" with the savegame ID of your choice) +@REM -restart (prevents intro videos from playing | will also keep logging the game to the logfile) +@REM -disableFramerateLimiter (removes the FPS cap | not recommended ) + +endlocal diff --git a/scripts/main.lua b/scripts/main.lua new file mode 100644 index 0000000..1709d47 --- /dev/null +++ b/scripts/main.lua @@ -0,0 +1,33 @@ +--[[ +No Teleport Mod for Farming Simulator 25 + +Author: André Buchman & VertexDezign +Website: https://vertexdezign.net/ +Issues: https://github.com/VertexDezign/NoTeleport/issues + +Feel free to open a pull reuests for enhancements or bugfixes. + +FS25_NoTeleport © 2024 by André Buchmann & VertexDezign is licensed under CC BY-NC-ND 4.0. To view a copy of this license, visit http://creativecommons.org/licenses/by-nc-nd/4.0/ +]] +NoTeleport = {} +NoTeleport.name = "NoTeleport" + +-- Return false to disable overwritten function +function NoTeleport:disableFunction() + return false +end + +function NoTeleport:loadMapFinished() + g_currentMission.isToggleVehicleAllowed = false +end + +function initNoTeleport() + PlaceableHotspot.getBeVisited = Utils.overwrittenFunction(PlaceableHotspot.getBeVisited, NoTeleport.disableFunction) + NPCHotspot.getBeVisited = Utils.overwrittenFunction(NPCHotspot.getBeVisited, NoTeleport.disableFunction) + FerryHotspot.getBeVisited = Utils.overwrittenFunction(FerryHotspot.getBeVisited, NoTeleport.disableFunction) + Enterable.getIsEnterableFromMenu = Utils.overwrittenFunction(Enterable.getIsEnterableFromMenu, NoTeleport.disableFunction) + FSBaseMission.loadMapFinished = Utils.appendedFunction(FSBaseMission.loadMapFinished, NoTeleport.loadMapFinished) +end + +-- Load as early as possible to override the "Enterable" methods +initNoTeleport() diff --git a/test.cmd b/test.cmd new file mode 100644 index 0000000..d466de4 --- /dev/null +++ b/test.cmd @@ -0,0 +1,26 @@ +@ECHO off + +@REM Pack mod +CALL pack.cmd + +IF %ERRORLEVEL% NEQ 0 ( exit 1 ) + +setlocal +FOR /F "tokens=*" %%i IN ('type .env') DO SET %%i + +SET modTestPath=%testTempFolder%%modName% + +ECHO Prepare files to test +RMDIR %modTestPath% /s /q +MKDIR %modTestPath% +COPY %filename% %modTestPath% +CD %modTestPath% +UNZIP -o %filename% +DEL %filename% + +IF %ERRORLEVEL% NEQ 0 ( exit 1 ) + +ECHO Execute TestRunner +%testRunner% %modTestPath% -g %gamePath% --noPause + +endlocal