-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Smaller code overhead Bumped API version Fixed some linting
- Loading branch information
Showing
15 changed files
with
667 additions
and
2,864 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,84 @@ | ||
import resolve from "@rollup/plugin-node-resolve"; | ||
import terser from "@rollup/plugin-terser"; | ||
import typescript from "@rollup/plugin-typescript"; | ||
import { exec } from "child_process"; | ||
import { homedir } from "os"; | ||
import { promisify } from "util"; | ||
|
||
const options = | ||
{ | ||
filename: "OpenRct2-Cartographer.js", | ||
|
||
/** | ||
* Determines in what build mode the plugin should be build. The default here takes | ||
* from the environment (ex. CLI arguments) with "development" as fallback. | ||
*/ | ||
build: process.env.BUILD || "development" | ||
}; | ||
|
||
/** | ||
* Tip: if you change the path here to your personal user folder, | ||
* you can ignore this change in git with: | ||
* ``` | ||
* > git update-index --skip-worktree rollup.config.js | ||
* ``` | ||
* To accept changes on this file again, use: | ||
* ``` | ||
* > git update-index --no-skip-worktree rollup.config.js | ||
* ``` | ||
*/ | ||
async function getOutput() { | ||
if (options.build !== "development") { | ||
return `./dist/${options.filename}`; | ||
} | ||
|
||
const platform = process.platform; | ||
const pluginPath = `OpenRCT2/plugin/${options.filename}`; | ||
|
||
if (platform === "win32") // Windows | ||
{ | ||
const { stdout } = await promisify(exec)("powershell -command \"[Environment]::GetFolderPath('MyDocuments')\""); | ||
return `${stdout.trim()}/${pluginPath}`; | ||
} | ||
else if (platform === "darwin") // MacOS | ||
{ | ||
return `${homedir()}/Library/Application Support/${pluginPath}`; | ||
} | ||
else // Linux | ||
{ | ||
const configFolder = process.env.XDG_CONFIG_HOME || `${homedir()}/.config`; | ||
return `${configFolder}/${pluginPath}`; | ||
} | ||
} | ||
|
||
|
||
/** | ||
* @type {import("rollup").RollupOptions} | ||
*/ | ||
const config = { | ||
input: "./src/plugin.ts", | ||
output: { | ||
file: await getOutput(), | ||
format: "iife", | ||
compact: true | ||
}, | ||
treeshake: "smallest", | ||
plugins: [ | ||
resolve(), | ||
typescript(), | ||
terser({ | ||
compress: { | ||
passes: 5, | ||
toplevel: true, | ||
unsafe: true | ||
}, | ||
format: { | ||
comments: false, | ||
quote_style: 1, | ||
wrap_iife: true, | ||
beautify: (options.build === "development"), | ||
} | ||
}) | ||
] | ||
}; | ||
export default config; |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,5 @@ | ||
/// <reference path="environment.d.ts" /> | ||
|
||
export const pluginVersion = "1.4.1"; | ||
export const pluginVersion = "2.0.0"; | ||
export const pluginName = "Cartographer"; | ||
export const pluginAuthors = ["fidwell"]; | ||
export const buildConfiguration: BuildConfiguration = __BUILD_CONFIGURATION__; | ||
export const isProduction = (buildConfiguration === "production"); | ||
export const isDevelopment = (buildConfiguration === "development"); | ||
export const isUiAvailable = (typeof ui !== "undefined"); | ||
export const namespace = "cartographer"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,17 @@ | ||
export default class Options { | ||
showOpenRides: boolean; | ||
showOpenRides: boolean = false; | ||
|
||
showTestingRides: boolean; | ||
showTestingRides: boolean = false; | ||
|
||
showClosedRides: boolean; | ||
showClosedRides: boolean = false; | ||
|
||
showFootpath: boolean; | ||
showFootpath: boolean = false; | ||
|
||
showScenery: boolean; | ||
showScenery: boolean = false; | ||
|
||
showWater: boolean; | ||
showWater: boolean = false; | ||
|
||
showSurface: boolean; | ||
showSurface: boolean = false; | ||
|
||
showPeeps: boolean; | ||
showPeeps: boolean = false; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,12 @@ | ||
/// <reference path="../lib/openrct2.d.ts" /> | ||
|
||
import * as Environment from "./environment"; | ||
import main from "./main"; | ||
import * as Environment from "./environment"; | ||
|
||
registerPlugin({ | ||
name: Environment.pluginName, | ||
version: Environment.pluginVersion, | ||
authors: Environment.pluginAuthors, | ||
type: "local", | ||
licence: "MIT", | ||
targetApiVersion: 65, | ||
targetApiVersion: 81, | ||
main | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
{ | ||
"compilerOptions": { | ||
"esModuleInterop": true, | ||
"forceConsistentCasingInFileNames": true, | ||
"module": "ES2020", | ||
"moduleResolution": "node", | ||
"noFallthroughCasesInSwitch": true, | ||
"noImplicitAny": true, | ||
"noImplicitOverride": true, | ||
"noImplicitReturns": true, | ||
"noImplicitThis": true, | ||
"noUnusedLocals": true, | ||
"noUnusedParameters": true, | ||
"outDir": "out", | ||
"strict": true, | ||
"target": "es5", | ||
"lib": [ | ||
"es5" | ||
] | ||
}, | ||
"include": [ | ||
"./lib/**/*.ts", | ||
"./src/**/*.ts", | ||
], | ||
"noEmit": true | ||
} | ||
|