Skip to content

Commit 0067405

Browse files
committed
Merge branch 'main' into tool-only
# Conflicts: # README.md
2 parents abeb6e5 + 5afaf2d commit 0067405

File tree

4 files changed

+121
-81
lines changed

4 files changed

+121
-81
lines changed

.vscode/extensions.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,7 @@
33
// for the documentation about the extensions.json format
44
"recommendations": [
55
"luquedaniel.languague-renpy",
6-
"spmeesseman.vscode-taskexplorer",
76
"ms-python.python",
8-
"ms-vscode.PowerShell",
7+
"ms-vscode.powershell"
98
]
109
}

.vscode/launch.json

Lines changed: 38 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,18 +5,52 @@
55
"version": "0.2.0",
66
"configurations": [
77
{
8-
"name": "Ren'Py Windows: Run",
8+
"name": "Ren'Py: Setup",
99
"type": "PowerShell",
1010
"request": "launch",
11-
"script": "bin/renpy.ps1 -Command run",
12-
"cwd": "${workspaceFolder}"
11+
"script": "echo \"${input:RenPySdk}\" > .renpy-sdk",
1312
},
1413
{
15-
"name": "Ren'Py MacOS/Linux: Run",
14+
"name": "Ren'Py: Run",
1615
"type": "PowerShell",
1716
"request": "launch",
1817
"script": "bin/renpy run",
1918
"cwd": "${workspaceFolder}"
2019
},
20+
{
21+
"name": "Ren'Py: Recompile & Run",
22+
"type": "PowerShell",
23+
"request": "launch",
24+
"script": "bin/renpy compile; bin/renpy run",
25+
"cwd": "${workspaceFolder}"
26+
},
27+
{
28+
"name": "Ren'Py: Delete Persistent",
29+
"type": "PowerShell",
30+
"request": "launch",
31+
"script": "bin/renpy rmpersistent",
32+
"cwd": "${workspaceFolder}"
33+
},
34+
{
35+
"name": "Ren'Py: Lint",
36+
"type": "PowerShell",
37+
"request": "launch",
38+
"script": "bin/renpy lint",
39+
"cwd": "${workspaceFolder}"
40+
},
41+
{
42+
"name": "Ren'Py: Distribute",
43+
"type": "PowerShell",
44+
"request": "launch",
45+
"script": "bin/renpy distribute",
46+
"cwd": "${workspaceFolder}"
47+
},
48+
],
49+
"inputs": [
50+
{
51+
"id": "RenPySdk",
52+
"description": "Paste the path to your Ren'Py SDK folder",
53+
"type": "promptString",
54+
}
2155
]
2256
}

.vscode/tasks.json

Lines changed: 0 additions & 75 deletions
This file was deleted.

game/tool/notify.rpy

Lines changed: 82 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,82 @@
1+
init python:
2+
class NotifyEx(renpy.python.RevertableObject):
3+
"""Notifications, to use: default ... = NotifyEx(msg="...", img="...")"""
4+
def __init__(self,
5+
msg: str,
6+
img: str
7+
):
8+
super(NotifyEx, self).__init__()
9+
self.msg = msg
10+
self.img = img
11+
self.remain = gui.notifyEx_delay
12+
13+
14+
def notifyEx(msg: str = None, img: str = None):
15+
notifications.append(NotifyEx(msg, img))
16+
if len(store.notifications) == 1:
17+
renpy.show_screen("notifyEx")
18+
19+
20+
def notifyExClean(value):
21+
if value in store.notifications:
22+
store.notifications.remove(value)
23+
if len(store.notifications) == 0:
24+
renpy.hide_screen("notifyEx")
25+
26+
27+
def notify(notific):
28+
"""View defined notifications.
29+
to use: $ notify(...)"""
30+
notifications.append(NotifyEx(notific.msg, notific.img))
31+
if len(store.notifications) == 1:
32+
renpy.show_screen("notifyEx")
33+
34+
# Delay of visibility of a notification.
35+
define gui.notifyEx_delay = 10.0
36+
# Width of the images.
37+
define gui.notifyEx_width = 64
38+
# Height of the images.
39+
define gui.notifyEx_height = 64
40+
41+
define gui.notifyEx_color = "#000000"
42+
43+
default notifications = []
44+
45+
style notify_text is default:
46+
color gui.notifyEx_color
47+
yalign 0.5
48+
49+
style notify_hbox is default:
50+
ysize gui.notifyEx_height
51+
52+
screen notifyEx():
53+
54+
zorder 100
55+
56+
style_prefix "notify"
57+
58+
vbox:
59+
for d in notifications:
60+
use notifyExInternal( d )
61+
# aerate a little.
62+
null height 5
63+
64+
screen notifyExInternal( n ):
65+
66+
style_prefix "notify"
67+
68+
frame at notify_appear:
69+
hbox:
70+
if not n.img is None:
71+
add n.img
72+
else:
73+
# Ensure that all the texts will be aligned.
74+
null width gui.notifyEx_width
75+
76+
# aerate a little.
77+
null width 5
78+
79+
if not n.msg is None:
80+
text n.msg
81+
82+
timer 0.05 repeat True action [ SetField( n, "remain", n.remain - 0.05 ), If( n.remain <= 0, Function( notifyExClean, n ), NullAction() ) ]

0 commit comments

Comments
 (0)