diff options
author | Jesusaves <cpntb1@ymail.com> | 2021-05-07 18:15:07 -0300 |
---|---|---|
committer | Jesusaves <cpntb1@ymail.com> | 2021-05-07 18:15:07 -0300 |
commit | 6af52634238e7160245e89838ebf616a2abb3ea7 (patch) | |
tree | 546a22cc53ee000572d0f2d472c3751603152f57 | |
parent | 2def3210ca69e7f2158c20f91f71a09eb338c479 (diff) | |
download | renpy-6af52634238e7160245e89838ebf616a2abb3ea7.tar.gz renpy-6af52634238e7160245e89838ebf616a2abb3ea7.tar.bz2 renpy-6af52634238e7160245e89838ebf616a2abb3ea7.tar.xz renpy-6af52634238e7160245e89838ebf616a2abb3ea7.zip |
Initial version - just a loading bar
-rw-r--r-- | game/COPYING | 7 | ||||
-rw-r--r-- | game/core.rpy | 96 | ||||
-rw-r--r-- | game/images/TMW2.png | bin | 0 -> 89940 bytes | |||
-rw-r--r-- | game/images/default.png | bin | 0 -> 965378 bytes | |||
-rw-r--r-- | game/options.rpy | 32 | ||||
-rw-r--r-- | game/renpy.rpy | 53 | ||||
-rw-r--r-- | game/script.rpy | 33 | ||||
-rw-r--r-- | game/update.rpy | 24 |
8 files changed, 209 insertions, 36 deletions
diff --git a/game/COPYING b/game/COPYING new file mode 100644 index 0000000..f7f7438 --- /dev/null +++ b/game/COPYING @@ -0,0 +1,7 @@ +MIT License + +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/game/core.rpy b/game/core.rpy new file mode 100644 index 0000000..0af84aa --- /dev/null +++ b/game/core.rpy @@ -0,0 +1,96 @@ +################################################################################# +# This file is part of Mana Launcher. +# Copyright (C) 2021 Jesusalva <jesusalva@tmw2.org> +# +# Distributed under the MIT license. +################################################################################# + +init -3 python: + renpy.add_python_directory("python-extra") + import requests, zlib, base64, sys, copy, uuid, time, json, traceback + import os.path + + print("[STDBY] Loading Basic functions.......") + + # set PYTHON_VERSION variable (e.g. 2715, 3605 etc.) + PYTHON_VERSION="%d%d%02d" % (sys.version_info.major, sys.version_info.minor, sys.version_info.micro) + PYTHON_VERSION=int(PYTHON_VERSION) + + # Ren'Py should come with Python 2.7.10 (2710), but just in case + # After all, I only tested with 2.7.10, 2.7.13 and 2.7.15 + if (PYTHON_VERSION < 2700 or PYTHON_VERSION > 3000): + raise Exception("WARNING: Python version is not 2.7\nStrange bugs may happen on your client.\n\nClick on \"Ignore\" to continue.\nClick on \"Quit\" to exit.") + + # Configuration + config.autoreload = False + config.save_on_mobile_background = False + persistent.release_name = "Core" + + # Smart Print command + def stdout(message): + if config.developer: + if renpy.android: + if not renpy.is_init_phase(): + renpy.notify(message) + else: + print(message) + renpy.write_log("[DEBUG] %s" % message) + else: + renpy.write_log("[GAME] %s" % message) + return + + # Smart wait + def sdelay(delta=0.02): + try: + renpy.pause(delta, hard=True) + except: + time.sleep(delta) + return + + # IF Then Else (IFTE) + def ifte(ifs, then, elses): + if (ifs): + return then + else: + return elses + + # Returns number of seconds since UNIX EPOCH + def now(): + return int(time.time()) + + # Global classes + # We need to override standard list method. Original by Triptych (stackoverflow) + class dlist(list): + + def __setitem__(self, index, value): + size = len(self) + if index >= size: + self.extend(None for _ in range(size, index + 1)) + + list.__setitem__(self, index, value) + + # Search for array[?][key]==search in an array of dicts + # Returns the dictionary, or returns ERR_INVALID + def dl_search(array, key, search): + try: + r=(item for item in array if item[key] == search).next() + except: + r=ERR_INVALID + if r is None: + r=ERR_INVALID + stdout("dlsearch: r is None") + return r + +######### Done with pre-init +label splashscreen: + show TMW2 at truecenter with fade + pause 2.5 + hide TMW2 with Dissolve(1.5) + return + +####### Defaults +default statusmsg = "Not yet initialized" +default progress = 0 + + + diff --git a/game/images/TMW2.png b/game/images/TMW2.png Binary files differnew file mode 100644 index 0000000..7882f0d --- /dev/null +++ b/game/images/TMW2.png diff --git a/game/images/default.png b/game/images/default.png Binary files differnew file mode 100644 index 0000000..dc0d329 --- /dev/null +++ b/game/images/default.png diff --git a/game/options.rpy b/game/options.rpy index e94a94c..68609a6 100644 --- a/game/options.rpy +++ b/game/options.rpy @@ -23,7 +23,7 @@ define gui.show_name = True ## The version of the game. -define config.version = "1.0" +define config.version = "21.05.07" ## Text that is placed on the game's about screen. Place the text between the @@ -37,7 +37,7 @@ define gui.about = _p(""" ## distribution. This must be ASCII-only, and must not contain spaces, colons, ## or semicolons. -define build.name = "ManaLauncher" +define build.name = "Mana-Launcher" ## Sounds and music ############################################################ @@ -142,7 +142,7 @@ default preferences.afm_time = 15 ## This generally should not be changed, and if it is, should always be a ## literal string, not an expression. -define config.save_directory = "ManaLauncher-1620420129" +define config.save_directory = "Mana-Launcher" ## Icon ######################################################################## @@ -182,6 +182,28 @@ init python: build.classify('**/.**', None) build.classify('**/#**', None) build.classify('**/thumbs.db', None) + build.classify('**.pyc', None) + build.classify('**.pyo', None) + + ## Remove development files + build.classify('**.pem', None) + build.classify('**.crt', None) + build.classify('**.json', None) + build.classify('**.diff', None) + build.classify('**/editor*', None) + build.classify('game/cache/**', None) + build.classify('game/saves/**', None) + build.classify('game/extra/**.png', None) + build.classify('game/extra/**.jpg', None) + build.classify('game/extra/**.webp', None) + build.classify('game/extra/**.mp3', None) + build.classify('game/extra/**.ogg', None) + build.classify('game/gfx/assets/**', None) + + ## These should not even exist, be sure! + build.classify('music.bak/**', None) + build.classify('backup.bak/**', None) + build.classify('old/**', None) ## To archive files, classify them as 'archive'. @@ -194,6 +216,10 @@ init python: build.documentation('*.html') build.documentation('*.txt') + # Remove renpy license from About. LGPL and MIT doesn't require it. + # Instead, leave only the link to Ren'Py licenses and legales. + renpy.license = _("{a=https://www.renpy.org/l/license}About Ren'Py{/a}") + ## A Google Play license key is required to download expansion files and perform ## in-app purchases. It can be found on the "Services & APIs" page of the Google diff --git a/game/renpy.rpy b/game/renpy.rpy new file mode 100644 index 0000000..cdb4616 --- /dev/null +++ b/game/renpy.rpy @@ -0,0 +1,53 @@ +################################################################################# +# This file is part of Mana Launcher. +# Copyright (C) 2021 Jesusalva <jesusalva@tmw2.org> +# +# Distributed under the MIT license. +################################################################################# + +image TMW2 = "images/TMW2.png" + +screen loading(): + fixed: + frame: + xfill True + yfill True + background Frame("images/default.png", 0, 0) + bar: + value progress + range 100 + xalign 0.5 + yalign 0.45 + xmaximum 0.75 + label "[statusmsg]": + xalign 0.5 + yalign 0.55 + +# The game starts here. +label start: + scene black + + show screen loading + + # Run updater + $ renpy.invoke_in_thread(CONFIGURE_LAUNCHER) + + # Estabilish the connection to server + python: + # Block the main thread until the socket connection is done + while progress < 100: + sdelay() + + $ stdout("Connection established!") + + # Open game + hide screen loading + scene black + show TMW2 at truecenter + with Dissolve(0.5) + pause 1.5 + hide TMW2 with dissolve + centered "Error" + + return + diff --git a/game/script.rpy b/game/script.rpy deleted file mode 100644 index 9657087..0000000 --- a/game/script.rpy +++ /dev/null @@ -1,33 +0,0 @@ -# The script of the game goes in this file. - -# Declare characters used by this game. The color argument colorizes the -# name of the character. - -define e = Character("Eileen") - - -# The game starts here. - -label start: - - # Show a background. This uses a placeholder by default, but you can - # add a file (named either "bg room.png" or "bg room.jpg") to the - # images directory to show it. - - scene bg room - - # This shows a character sprite. A placeholder is used, but you can - # replace it by adding a file named "eileen happy.png" to the images - # directory. - - show eileen happy - - # These display lines of dialogue. - - e "You've created a new Ren'Py game." - - e "Once you add a story, pictures, and music, you can release it to the world!" - - # This ends the game. - - return diff --git a/game/update.rpy b/game/update.rpy new file mode 100644 index 0000000..810be2c --- /dev/null +++ b/game/update.rpy @@ -0,0 +1,24 @@ +################################################################################# +# This file is part of Mana Launcher. +# Copyright (C) 2021 Jesusalva <jesusalva@tmw2.org> +# +# Distributed under the MIT license. +################################################################################# + +init python: + def CONFIGURE_LAUNCHER(): + global progress, statusmsg + time.sleep(1.0) + progress=25 + statusmsg="Loading..." + time.sleep(1.0) + progress=50 + statusmsg="Acquiring assets..." + time.sleep(1.0) + progress=75 + statusmsg="Almost finishing..." + time.sleep(1.0) + progress=100 + statusmsg="Done!" + return + |