Skip to content

Commit e690410

Browse files
committed
Add UI frontend for mod installation with dummy values
Remove unused stuff from remove_mods
1 parent edfa07e commit e690410

File tree

2 files changed

+75
-1
lines changed

2 files changed

+75
-1
lines changed

mods/core/download_mods.rpy

Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,3 +4,77 @@ screen modmenu_download:
44
window id "modmenu_download" at alpha_dissolve:
55
style "nvl_window"
66
imagebutton idle "image/ui/close_idle.png" hover "image/ui/close_hover.png" action [Hide("modmenu_download", transition=dissolve), Play("audio", "se/sounds/close.ogg"), Show("modmenu")] hovered Play("audio", "se/sounds/select.ogg", Show("modmenu")) xalign 1.1 yalign -0.1 at nav_button
7+
8+
python:
9+
from renpy.display.im import Image
10+
from renpy.ui import Wrapper
11+
12+
class ImageURL(Image):
13+
"""
14+
This image manipulator loads an image from a url.
15+
"""
16+
def load(self, unscaled=False):
17+
import pygame
18+
from cStringIO import StringIO
19+
from urllib2 import urlopen
20+
from renpy.display.im import cache
21+
22+
url_f = urlopen(self.filename)
23+
virtual_f = StringIO(url_f.read())
24+
25+
cache.add_load_log(self.filename)
26+
if unscaled:
27+
surf = renpy.display.pgrender.load_image_unscaled(virtual_f, self.filename)
28+
else:
29+
surf = renpy.display.pgrender.load_image(virtual_f, self.filename)
30+
31+
return surf
32+
33+
def predict_files(self):
34+
return [self.url]
35+
ImageURL = Wrapper(ImageURL)
36+
37+
# (modid, name, author, description, image
38+
39+
contents = [(123, "Test mod", "muddyfish", "A test mod with an extremely long, multiline description. Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.", "http://s-media-cache-ak0.pinimg.com/originals/42/41/90/424190c7f88c514a1c26a79572d61191.png") for i in range(10)]
40+
41+
vpgrid:
42+
43+
rows 1
44+
spacing 32
45+
draggable True
46+
mousewheel True
47+
48+
scrollbars "horizontal"
49+
50+
# Since we have scrollbars, we have to position the side, rather
51+
# than the vpgrid proper.
52+
side_yalign 0.5
53+
54+
for modid, name, author, description, url in contents:
55+
vbox:
56+
xmaximum 500
57+
yminimum 600
58+
python:
59+
ImageURL(url)
60+
text name
61+
text author
62+
textbutton "Install" action [Show("modmenu_install_confirm", modid=modid, modname=name), Play("audio", "se/sounds/open.ogg")] hovered Play("audio", "se/sounds/select.ogg")
63+
text description size 24
64+
65+
66+
67+
screen modmenu_install_confirm(modid, modname) tag smallscreen2:
68+
modal True
69+
70+
window id "modmenu_install_confirm" at popup2:
71+
style "alertwindow"
72+
73+
hbox xalign 0.5 yalign 0.8:
74+
spacing 250
75+
textbutton "Yes" action [Hide("modmenu_install_confirm"), Play("audio", "se/sounds/close.ogg"), Show("modmenu_download")] hovered Play("audio", "se/sounds/select.ogg") style "yesnobutton"
76+
textbutton "No" action [Hide("modmenu_install_confirm"), Show("modmenu_download"), Play("audio", "se/sounds/close.ogg")] hovered Play("audio", "se/sounds/select.ogg") style "yesnobutton"
77+
78+
label "Are you sure you want to install [modname]?":
79+
style "yesno_prompt"
80+
text_style "yesno_prompt_text"

mods/core/remove_mods.rpy

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ screen modmenu_remove_confirm(modname) tag smallscreen2:
4141
hbox xalign 0.5 yalign 0.8:
4242
spacing 250
4343
textbutton "Yes" action [Hide("modmenu_remove_confirm"), Play("audio", "se/sounds/close.ogg"), lambda remove_mod=remove_mod, modname=modname: remove_mod(modname), Show("modmenu_remove")] hovered Play("audio", "se/sounds/select.ogg") style "yesnobutton"
44-
textbutton "No" action [Hide("modmenu_remove_confirm"), Show("modmenu_remove"), Play("audio", "se/sounds/close.ogg")] hovered Play("audio", "se/sounds/select.ogg") style "yesnobutton"
44+
textbutton "No" action [Hide("modmenu_remove_confirm"), Play("audio", "se/sounds/close.ogg")] hovered Play("audio", "se/sounds/select.ogg") style "yesnobutton"
4545

4646
label "Are you sure you want to remove [modname]?":
4747
style "yesno_prompt"

0 commit comments

Comments
 (0)