Skip to content

Commit

Permalink
Merge pull request #5 from DRincs-Productions/1-non-use-task-explorer…
Browse files Browse the repository at this point in the history
…-but-powershell

1 Not use Task explorer but PowerShell
  • Loading branch information
BlackRam-oss committed Jul 17, 2022
2 parents af06ea4 + c69eba5 commit 650a452
Show file tree
Hide file tree
Showing 5 changed files with 74 additions and 114 deletions.
3 changes: 1 addition & 2 deletions .vscode/extensions.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,7 @@
// for the documentation about the extensions.json format
"recommendations": [
"luquedaniel.languague-renpy",
"spmeesseman.vscode-taskexplorer",
"ms-python.python",
"ms-vscode.PowerShell",
"ms-vscode.powershell"
]
}
42 changes: 38 additions & 4 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,18 +5,52 @@
"version": "0.2.0",
"configurations": [
{
"name": "Ren'Py Windows: Run",
"name": "Ren'Py: Setup",
"type": "PowerShell",
"request": "launch",
"script": "bin/renpy.ps1 -Command run",
"cwd": "${workspaceFolder}"
"script": "echo \"${input:RenPySdk}\" > .renpy-sdk",
},
{
"name": "Ren'Py MacOS/Linux: Run",
"name": "Ren'Py: Run",
"type": "PowerShell",
"request": "launch",
"script": "bin/renpy run",
"cwd": "${workspaceFolder}"
},
{
"name": "Ren'Py: Recompile & Run",
"type": "PowerShell",
"request": "launch",
"script": "bin/renpy compile; bin/renpy run",
"cwd": "${workspaceFolder}"
},
{
"name": "Ren'Py: Delete Persistent",
"type": "PowerShell",
"request": "launch",
"script": "bin/renpy rmpersistent",
"cwd": "${workspaceFolder}"
},
{
"name": "Ren'Py: Lint",
"type": "PowerShell",
"request": "launch",
"script": "bin/renpy lint",
"cwd": "${workspaceFolder}"
},
{
"name": "Ren'Py: Distribute",
"type": "PowerShell",
"request": "launch",
"script": "bin/renpy distribute",
"cwd": "${workspaceFolder}"
},
],
"inputs": [
{
"id": "RenPySdk",
"description": "Paste the path to your Ren'Py SDK folder",
"type": "promptString",
}
]
}
5 changes: 4 additions & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,10 @@
},
"editor.formatOnSave": true,
"files.exclude": {
"**/*.rpyc": true
"**/*.rpyc": true,
"**/*.rpa": true,
"**/*.rpymc": true,
"**/cache/": true
},
"editor.tokenColorCustomizations": {
"textMateRules": [
Expand Down
75 changes: 0 additions & 75 deletions .vscode/tasks.json

This file was deleted.

63 changes: 31 additions & 32 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,23 +1,45 @@
# Ren'Py VSCode Project Template
# Ren'Py VSCode Project Template & Debug

This template includes VSCode tasks and extensions for developing Ren'Py projects.
This template includes VSCode launchs and extensions for developing Ren'Py projects.

## File

- `bin/renpy`: macOS/linux script for calling Ren'Py SDK `renpy.sh`
- `bin/renpy.ps1`: Windows script for calling Ren'Py SDK `renpy.exe`
- `bin/set-origin.sh`: Git setup helper to configure your local folder to sync to a remote host
- `.vscode/tasks.json`: Tasks for launching Ren'Py SDK commands without opening the Ren'Py launcher.
- Set .renpy-sdk file (custom file for remembering your project's SDK path for commands to work)
- `.vscode/launch.json`: Launch for launching Ren'Py SDK commands without opening the Ren'Py launcher.
- Setup (custom file for remembering your project's SDK path for commands to work)
- Run
- Force Recompile & Run
- Delete Persistent
- Lint
- Force Recompile
- Delete Persistent data
- Distribute
- `.vscode/extensions.json`: Optional extensions that VSCode will offer to install for you
- `.vscode/settings.json`: For Test Formatting, and other settings
- [Ren'Py Language](https://marketplace.visualstudio.com/items?itemName=LuqueDaniel.languague-renpy) for syntax highlighting
- [Task Explorer](https://marketplace.visualstudio.com/items?itemName=spmeesseman.vscode-taskexplorer) for an easy clickable list of tasks from `.vscode/tasks.json`
- [Power Shell](https://marketplace.visualstudio.com/items?itemName=ms-vscode.PowerShell) for an easy clickable list of launchs from `.vscode/launch.json`
- [Python](https://marketplace.visualstudio.com/items?itemName=spmeesseman.vscode-taskexplorer) for python syntax highlighting
- `.gitignore`: Git configuration file for ignoring certain file paths and types.
- \*.rpyc/rpymc
- log.txt, error.txt, traceback.txt

## How Run Debug (F5)

![image](https://user-images.githubusercontent.com/67595890/179401467-c8abbc9b-8970-4bad-af86-2b5b31c173a4.png)


### Setup

( **Necessary only in the beginning** )

Paste the path to your Ren'Py SDK folder

### Run

Select:

- Run or
- Force Recompile & Run

And Play!

## Insert Template in your Project

Expand All @@ -41,26 +63,3 @@ git pull https://github.com/DRincs-Productions/renpy-template-debug-vscode.git t
```

At the end make a merge inside the arm of the project.

# Instructions for use

By default, opening a VSCode project will notify you of "recommended" extensions. VSCode is notifying you that our `.vscode/extensions.json` is present, and allows you install them for you. We include a task explorer panel and a Ren'Py language highlighter. Neither is required, but both are useful.

Locate the Task Explorer panel to run your project-specific tasks:

<img width="536" alt="task-explorer" src="https://user-images.githubusercontent.com/618184/113932541-bb318880-97c1-11eb-9e94-d678eb4c665f.png">

To see the tasks without the Task Explorer extension, open VSCode's [Command Palette](https://code.visualstudio.com/docs/getstarted/userinterface#_command-palette) and search for `Tasks: Run Task`:

<img width="878" alt="tasks" src="https://user-images.githubusercontent.com/618184/113929032-8b808180-97bd-11eb-8e77-5cd00534776a.png">

To use the provided tasks, please first run the task `Ren'Py Setup: Set .renpy-sdk path`. It will ask for the path to your Ren'Py SDK (where you unzipped it). The folder name is something like `renpy-7.4.4-sdk`, and should NOT include any trailing slashes at the end.

- If I keep my SDK in `~/Applications/`, then the path would be `/Users/autumn/Applications/renpy-7.4.4-sdk`
- If I keep my SDK in `C:\Program Files\`, then the path would be `C:\Program Files\renpy-7.4.4-sdk`

A file will be created in the root of your workspace called `.renpy-sdk` with the path you entered inside it. You can re-run the task to update it, or just modify the `.renpy-sdk` file directly.

The Windows-specific tasks will call on a `bin/renpy.ps1` helper script, while the non-Windows version will call on `bin/renpy`:

<img width="535" alt="all-tasks" src="https://user-images.githubusercontent.com/618184/113933305-6b06f600-97c2-11eb-84f7-f0c344dc23a3.png">

0 comments on commit 650a452

Please sign in to comment.