Skip to content
This repository was archived by the owner on Mar 25, 2022. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -44,3 +44,6 @@ DerivedData/
**/xcshareddata/WorkspaceSettings.xcsettings

# End of https://www.gitignore.io/api/xcode

## IDEA
.idea/*
32 changes: 32 additions & 0 deletions docs/AppKit/10-ASAppRepresentative/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -441,6 +441,20 @@
requestAllPermissions()
</a>

</li>

<li class="md-nav__item">
<a href="#applicationshouldlaunchatlogin" title="applicationShouldLaunchAtLogin()" class="md-nav__link">
applicationShouldLaunchAtLogin()
</a>

</li>

<li class="md-nav__item">
<a href="#applicationwilllaunchatlogin" title="applicationWillLaunchAtLogin()" class="md-nav__link">
applicationWillLaunchAtLogin()
</a>

</li>

<li class="md-nav__item">
Expand Down Expand Up @@ -804,6 +818,20 @@
requestAllPermissions()
</a>

</li>

<li class="md-nav__item">
<a href="#applicationshouldlaunchatlogin" title="applicationShouldLaunchAtLogin()" class="md-nav__link">
applicationShouldLaunchAtLogin()
</a>

</li>

<li class="md-nav__item">
<a href="#applicationwilllaunchatlogin" title="applicationWillLaunchAtLogin()" class="md-nav__link">
applicationWillLaunchAtLogin()
</a>

</li>

<li class="md-nav__item">
Expand Down Expand Up @@ -926,6 +954,10 @@ <h3 id="requestpermissionforpermission"><code>requestPermission(forPermission)</
</ul>
<h3 id="requestallpermissions"><code>requestAllPermissions()</code><a class="headerlink" href="#requestallpermissions" title="Permanent link">&para;</a></h3>
<p>Requests all permissions located in <code>requires</code>, one by one.</p>
<h3 id="applicationshouldlaunchatlogin"><code>applicationShouldLaunchAtLogin()</code><a class="headerlink" href="#applicationshouldlaunchatlogin" title="Permanent link">&para;</a></h3>
<p>Returns whether the app is authorized to run any login tasks.</p>
<h3 id="applicationwilllaunchatlogin"><code>applicationWillLaunchAtLogin()</code><a class="headerlink" href="#applicationwilllaunchatlogin" title="Permanent link">&para;</a></h3>
<p>Executes and preliminary actions during the boot sequence.</p>
<h3 id="applicationwilllaunch"><code>applicationWillLaunch()</code><a class="headerlink" href="#applicationwilllaunch" title="Permanent link">&para;</a></h3>
<p>Executes any preliminary actions before the app launches.</p>
<h3 id="applicationdidlaunch"><code>applicationDidLaunch()</code><a class="headerlink" href="#applicationdidlaunch" title="Permanent link">&para;</a></h3>
Expand Down
11 changes: 6 additions & 5 deletions docs/System/05-bootloader/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -620,8 +620,8 @@
<ul class="md-nav__list">

<li class="md-nav__item">
<a href="#asbootloaderboottimeout5-expresssetuptrue-disclaimernone" title="$ ASBootloader.boot(timeout=5, expressSetup=True, disclaimer=None)" class="md-nav__link">
$ ASBootloader.boot(timeout=5, expressSetup=True, disclaimer=None)
<a href="#asbootloaderboottimeout5-expresssetuptrue-disclaimernone-bootviewasbootloaderview" title="$ ASBootloader.boot(timeout=5, expressSetup=True, disclaimer=None, bootView="ASBootloaderView")" class="md-nav__link">
$ ASBootloader.boot(timeout=5, expressSetup=True, disclaimer=None, bootView="ASBootloaderView")
</a>

</li>
Expand Down Expand Up @@ -688,8 +688,8 @@
<ul class="md-nav__list">

<li class="md-nav__item">
<a href="#asbootloaderboottimeout5-expresssetuptrue-disclaimernone" title="$ ASBootloader.boot(timeout=5, expressSetup=True, disclaimer=None)" class="md-nav__link">
$ ASBootloader.boot(timeout=5, expressSetup=True, disclaimer=None)
<a href="#asbootloaderboottimeout5-expresssetuptrue-disclaimernone-bootviewasbootloaderview" title="$ ASBootloader.boot(timeout=5, expressSetup=True, disclaimer=None, bootView="ASBootloaderView")" class="md-nav__link">
$ ASBootloader.boot(timeout=5, expressSetup=True, disclaimer=None, bootView="ASBootloaderView")
</a>

</li>
Expand Down Expand Up @@ -720,13 +720,14 @@ <h1 id="bootloader">Bootloader<a class="headerlink" href="#bootloader" title="Pe
<p><img alt="Bootloader logo" src="../../images/system/bootloader.png" /></p>
<p>The bootloader is responsible for displaying a boot screen while important components are loading. The bootloader is cusomizable with a certain timeout, depending on how fast you want the OS to "load".</p>
<h2 id="available-methods">Available methods<a class="headerlink" href="#available-methods" title="Permanent link">&para;</a></h2>
<h3 id="asbootloaderboottimeout5-expresssetuptrue-disclaimernone"><code>$ ASBootloader.boot(timeout=5, expressSetup=True, disclaimer=None)</code><a class="headerlink" href="#asbootloaderboottimeout5-expresssetuptrue-disclaimernone" title="Permanent link">&para;</a></h3>
<h3 id="asbootloaderboottimeout5-expresssetuptrue-disclaimernone-bootviewasbootloaderview"><code>$ ASBootloader.boot(timeout=5, expressSetup=True, disclaimer=None, bootView="ASBootloaderView")</code><a class="headerlink" href="#asbootloaderboottimeout5-expresssetuptrue-disclaimernone-bootviewasbootloaderview" title="Permanent link">&para;</a></h3>
<p>Show the bootloader for a certain amount of time.</p>
<p><strong>Parameters</strong></p>
<ul>
<li><code>timeout</code>: The amount of seconds to show the bootloader for.</li>
<li><code>expressSetup</code>: Whether the Setup Assistant should start in Express Mode.</li>
<li><code>disclaimer</code>: Any license agreement or disclaimer that must be displayed during the Setup Assistant.</li>
<li><code>bootView</code>: The name of the Ren'Py screen to display as the GUI for the boot loader.</li>
</ul>


Expand Down
4 changes: 2 additions & 2 deletions docs/System/06-setup-assistant/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -775,10 +775,10 @@ <h1 id="setup-assistant">Setup Assistant<a class="headerlink" href="#setup-assis
<p>The Setup Assistant is a first-run tool designed to set any initial settings and/or configurations for AliceOS before starting the visual novel. It also lets the user create a username as well as read over and legel agreements or disclaimers the game creator has provided.</p>
<div class="admonition tip express mode">
<p class="admonition-title">Tip</p>
<p>Starting with AliceOS Prospect Park, the Setup Assistant is automatically configured to use Express Mode, which skips a lot of the onerous steps in the original process. However, for a more throrough experience, Express Mode can be turned off.</p>
<p>Starting with AliceOS Prospect Park, the Setup Assistant is automatically configured to use Express Mode, which skips a lot of the onerous steps in the original process. However, for a more thorough experience, Express Mode can be turned off.</p>
</div>
<h2 id="automatic-setup">Automatic Setup<a class="headerlink" href="#automatic-setup" title="Permanent link">&para;</a></h2>
<p>In the Bootloader, the Setup Assistant will run if it doesn't detect that any setup was done. This check is done via <code>persistent.AS_SETUP_COMPLETE</code>. The boot loader's <code>boot()</code> method contains parameters to customize the Assistant's modes and any additional disclaimers, if necessary.</p>
<p>In the Bootloader, the Setup Assistant will run if it doesn't detect that any setup was done. This check is done via <code>persistent.AS_COMPLETED_SETUP</code>. The boot loader's <code>boot()</code> method contains parameters to customize the Assistant's modes and any additional disclaimers, if necessary.</p>
<h2 id="manual-setup">Manual Setup<a class="headerlink" href="#manual-setup" title="Permanent link">&para;</a></h2>
<p>If you want to call the Setup Assistant manually, you can use <code>ASSetup.startSetup()</code> to call the Assistant at any time.</p>
<h3 id="startsetupexpresstrue-disclaimernone"><code>startSetup(express=True, disclaimer=None)</code><a class="headerlink" href="#startsetupexpresstrue-disclaimernone" title="Permanent link">&para;</a></h3>
Expand Down
2 changes: 1 addition & 1 deletion docs/search/search_index.json

Large diffs are not rendered by default.

53 changes: 19 additions & 34 deletions docs/sitemap.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,112 +2,97 @@
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
<url>
<loc>None</loc>
<lastmod>2019-09-11</lastmod>
<lastmod>2019-09-08</lastmod>
<changefreq>daily</changefreq>
</url>
<url>
<loc>None</loc>
<lastmod>2019-09-11</lastmod>
<lastmod>2019-09-08</lastmod>
<changefreq>daily</changefreq>
</url>
<url>
<loc>None</loc>
<lastmod>2019-09-11</lastmod>
<lastmod>2019-09-08</lastmod>
<changefreq>daily</changefreq>
</url>
<url>
<loc>None</loc>
<lastmod>2019-09-11</lastmod>
<lastmod>2019-09-08</lastmod>
<changefreq>daily</changefreq>
</url>
<url>
<loc>None</loc>
<lastmod>2019-09-11</lastmod>
<lastmod>2019-09-08</lastmod>
<changefreq>daily</changefreq>
</url>
<url>
<loc>None</loc>
<lastmod>2019-09-11</lastmod>
<lastmod>2019-09-08</lastmod>
<changefreq>daily</changefreq>
</url>
<url>
<loc>None</loc>
<lastmod>2019-09-11</lastmod>
<lastmod>2019-09-08</lastmod>
<changefreq>daily</changefreq>
</url>
<url>
<loc>None</loc>
<lastmod>2019-09-11</lastmod>
<lastmod>2019-09-08</lastmod>
<changefreq>daily</changefreq>
</url>
<url>
<loc>None</loc>
<lastmod>2019-09-11</lastmod>
<lastmod>2019-09-08</lastmod>
<changefreq>daily</changefreq>
</url>
<url>
<loc>None</loc>
<lastmod>2019-09-11</lastmod>
<lastmod>2019-09-08</lastmod>
<changefreq>daily</changefreq>
</url>
<url>
<loc>None</loc>
<lastmod>2019-09-11</lastmod>
<lastmod>2019-09-08</lastmod>
<changefreq>daily</changefreq>
</url>
<url>
<loc>None</loc>
<lastmod>2019-09-11</lastmod>
<lastmod>2019-09-08</lastmod>
<changefreq>daily</changefreq>
</url>
<url>
<loc>None</loc>
<lastmod>2019-09-11</lastmod>
<lastmod>2019-09-08</lastmod>
<changefreq>daily</changefreq>
</url>
<url>
<loc>None</loc>
<lastmod>2019-09-11</lastmod>
<lastmod>2019-09-08</lastmod>
<changefreq>daily</changefreq>
</url>
<url>
<loc>None</loc>
<lastmod>2019-09-11</lastmod>
<lastmod>2019-09-08</lastmod>
<changefreq>daily</changefreq>
</url>
<url>
<loc>None</loc>
<lastmod>2019-09-11</lastmod>
<lastmod>2019-09-08</lastmod>
<changefreq>daily</changefreq>
</url>
<url>
<loc>None</loc>
<lastmod>2019-09-11</lastmod>
<lastmod>2019-09-08</lastmod>
<changefreq>daily</changefreq>
</url>
<url>
<loc>None</loc>
<lastmod>2019-09-11</lastmod>
<lastmod>2019-09-08</lastmod>
<changefreq>daily</changefreq>
</url>
<url>
<loc>None</loc>
<lastmod>2019-09-11</lastmod>
<changefreq>daily</changefreq>
</url>
<url>
<loc>None</loc>
<lastmod>2019-09-11</lastmod>
<changefreq>daily</changefreq>
</url>
<url>
<loc>None</loc>
<lastmod>2019-09-11</lastmod>
<changefreq>daily</changefreq>
</url>
<url>
<loc>None</loc>
<lastmod>2019-09-11</lastmod>
<lastmod>2019-09-08</lastmod>
<changefreq>daily</changefreq>
</url>
</urlset>
Binary file modified docs/sitemap.xml.gz
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@
#

init 5 python:

from threading import Thread

class ASBootloaderCoreService(ASCoreServiceRepresentative):
bundleName = "Bootloader"
Expand All @@ -17,11 +19,36 @@ init 5 python:
bundleDescription = """\
Show a loading screen for AliceOS.
"""

# Looks for all apps using AppKit and returns a list of them.
def gatherAllApplications(self):
import gc
apps = []
for obj in gc.get_objects():
if isinstance(obj, ASAppRepresentative):
apps.append(obj)
return apps

def startLoginMethod(self, app):
if app.applicationShouldLaunchAtLogin is not None and app.applicationShouldLaunchAtLogin():
app.applicationWillLaunchAtLogin()
else:
if AS_REQUIRES_SYSTEM_EVENTS in app.requires and not app.applicationShouldLaunchAtLogin():
print("WARN: %s cannot run its login service because it doesn't have permission to do so." % (app.bundleName,))
else:
print("INFO: Skipping %s (%s) login service because it doesn't have one." % (app.bundleName, app.bundleId, ) )

def boot(self, timeout=5, expressSetup=True, disclaimer=None):
renpy.call_screen("ASBootloaderView", timeout=timeout)
def boot(self, timeout=5, expressSetup=True, disclaimer=None, bootView="ASBootloaderView"):
if not persistent.AS_COMPLETED_SETUP:
ASSetup.startSetup(express=expressSetup, disclaimer=disclaimer)

for app in self.gatherAllApplications():
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

might be better to thread startup applications so it doesn't slow down the whole process.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So probably have a thread for each applicationWillLaunchAtLogin?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

no, run a seperate init thread per startup app, this is considerably safer.

appProcess = Thread(target=self.startLoginMethod, args=(app, ))
appProcess.start()
appProcess.join()


renpy.call_screen(bootView, timeout=timeout)

def __init__(self):
ASCoreServiceRepresentative.__init__(self, AS_CORESERVICES_DIR + "Boot.aoscservice/")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ init screen ASBootloaderView(timeout=5):
tag ASBootloaderView
zorder 100
modal True

add ASBootloader.bundleDir + "Resources/Elements/PureBlackBoot.png"
add ASBootloader.bundleDir + "Resources/Elements/Background.png"

Expand All @@ -25,4 +25,4 @@ init screen ASBootloaderView(timeout=5):

add ASBootloader.bundleDir + "Resources/Elements/BootLogo.png"

timer timeout action Return('didBoot')
timer timeout action Return('didBoot')
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,21 @@ init python:


# MARK: Launch


# Determine whether the app has been given permission to launch during boot.
def applicationShouldLaunchAtLogin(self):
if AS_REQUIRES_SYSTEM_EVENTS in self.requires:
if persistent.AS_PERMISSIONS[self.bundleId] != None:
return persistent.AS_PERMISSIONS[self.bundleId][AS_REQUIRES_SYSTEM_EVENTS]
else:
return False
else:
return False

# Steps to take when running the app during the bootloader.
def applicationWillLaunchAtLogin(self):
return

# Steps to take when starting the app.
def applicationWillLaunch(self):
print("WARN: %s (%s) doesn't have the applicationWillLaunch method implemented." % (self.bundleName, self.bundleId, ))
Expand Down
8 changes: 8 additions & 0 deletions mkdocs/AppKit/10-ASAppRepresentative.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,14 @@ Requests a particular permission located in `requires`.

Requests all permissions located in `requires`, one by one.

### `applicationShouldLaunchAtLogin()`

Returns whether the app is authorized to run any login tasks.

### `applicationWillLaunchAtLogin()`

Executes and preliminary actions during the boot sequence.

### `applicationWillLaunch()`

Executes any preliminary actions before the app launches.
Expand Down
3 changes: 2 additions & 1 deletion mkdocs/System/05-bootloader.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ The bootloader is responsible for displaying a boot screen while important compo

## Available methods

### `$ ASBootloader.boot(timeout=5, expressSetup=True, disclaimer=None)`
### `$ ASBootloader.boot(timeout=5, expressSetup=True, disclaimer=None, bootView="ASBootloaderView")`

Show the bootloader for a certain amount of time.

Expand All @@ -15,3 +15,4 @@ Show the bootloader for a certain amount of time.
- `timeout`: The amount of seconds to show the bootloader for.
- `expressSetup`: Whether the Setup Assistant should start in Express Mode.
- `disclaimer`: Any license agreement or disclaimer that must be displayed during the Setup Assistant.
- `bootView`: The name of the Ren'Py screen to display as the GUI for the boot loader.
4 changes: 2 additions & 2 deletions mkdocs/System/06-setup-assistant.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@
The Setup Assistant is a first-run tool designed to set any initial settings and/or configurations for AliceOS before starting the visual novel. It also lets the user create a username as well as read over and legel agreements or disclaimers the game creator has provided.

!!! tip Express Mode
Starting with AliceOS Prospect Park, the Setup Assistant is automatically configured to use Express Mode, which skips a lot of the onerous steps in the original process. However, for a more throrough experience, Express Mode can be turned off.
Starting with AliceOS Prospect Park, the Setup Assistant is automatically configured to use Express Mode, which skips a lot of the onerous steps in the original process. However, for a more thorough experience, Express Mode can be turned off.

## Automatic Setup

In the Bootloader, the Setup Assistant will run if it doesn't detect that any setup was done. This check is done via `persistent.AS_SETUP_COMPLETE`. The boot loader's `boot()` method contains parameters to customize the Assistant's modes and any additional disclaimers, if necessary.
In the Bootloader, the Setup Assistant will run if it doesn't detect that any setup was done. This check is done via `persistent.AS_COMPLETED_SETUP`. The boot loader's `boot()` method contains parameters to customize the Assistant's modes and any additional disclaimers, if necessary.

## Manual Setup

Expand Down