Skip to content

Commit

Permalink
func: updated dependencies, gitignore and buildGUI
Browse files Browse the repository at this point in the history
webpack too!

added cat image
  • Loading branch information
uyen18827 committed Apr 26, 2021
1 parent ca4e27f commit d4052e4
Show file tree
Hide file tree
Showing 15 changed files with 4,610 additions and 210 deletions.
17 changes: 14 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@
*.sublime-workspace

# IDE - VSCode
.vscode/
!.vscode/settings.json
# .vscode/
.vscode/settings.json
!.vscode/tasks.json
!.vscode/launch.json
!.vscode/extensions.json
Expand All @@ -26,4 +26,15 @@ Thumbs.db

# Misc
/src/save for later
/dist/save for later
/dist/save for later
# /dist/
/build/BuildGUI
*.exe
!buildGUI.exe
/dist/web
/dist/BuildGUI
/dist/win-unpacked
/dist/builder-debug.yml
/dist/builder-effective-config.yaml
/__pycache__
BuildGUI.spec
4 changes: 2 additions & 2 deletions .vscode/vscode-snippet.code-snippets
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
"{",
" id: , ",
" content: ``, ",
" nextName: ",
" nextName: ``",
"},"
],
"description": "Template for Choice"
Expand Down Expand Up @@ -102,7 +102,7 @@
" },",
" ]"
],
"description": "Template for Quest's Stage"
"description": "template for an array of items"
},
//An item
"A single item": {
Expand Down
30 changes: 22 additions & 8 deletions BuildGUI.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@

app = tk.Tk()

app.title('Chosen Launcher')
app.title('VeinIF Build Tools')
app.resizable(False, False)
# app.geometry('800x600')
canvas = tk.Canvas(app, width=350, height=250)
dirname = os.path.dirname(os.path.realpath(__file__))
Expand All @@ -24,6 +25,10 @@ def startDesktopBuild():
t3=Thread(target = buildElectron)
t3.start()

#function: install dependencies
# def installDependencies():
# dep =

#function: run dev batch file
def startDevEnvironment():
filename = os.path.join(dirname, 'npm run dev.bat')
Expand All @@ -41,31 +46,40 @@ def buildElectron():

#function: open Github Repo
def openGitHub():
webbrowser.open('https://github.com/uyen18827/Choosen')
webbrowser.open('https://github.com/uyen18827/VeinIF')

#function: Open Documentation Page
def openDoc():
print("to be continue")
webbrowser.open('https://uyen18827.gitbook.io/veinif/')

#Install Dependencies button
# depButton = tk.Button(app, text = 'Install Dependencies')
# depButton.grid(column=0, row = 0, padx=5, pady=2)


#Framework name label
user_name = tk.Label(app, text="VeinIF development tools", font=(18)).grid(
column=0, row=0, columnspan=2, padx=5, pady=2)

#Run Development Environment button
runDevButton = tk.Button(app, text='Run Dev Environment (Browser)', command = startDevThread)
runDevButton.grid(column=0, row=0, padx=5, pady=2)
runDevButton.grid(column=0, row=1, padx=5, pady=2)

#Run Build Button
runBuildButton = tk.Button(app, text='Build Production (Web)', command = startBuildThread)
runBuildButton.grid(column=1, row=0, padx=5, pady=2)
runBuildButton.grid(column=1, row=1, padx=5, pady=2)

#Build Windows Distribution
runElectronBuild = tk.Button(app, text='Build Distribution (Windows | Portable)', command = startDesktopBuild)
runElectronBuild.grid(column=0,columnspan=2, row=1, padx=5, pady=2)
runElectronBuild.grid(column=0,columnspan=2, row=2, padx=5, pady=2)

#Open GitHub Repo Button
gitRepoButton = tk.Button(app, text='Visit GitHub Page (Online)', command = openGitHub )
gitRepoButton.grid(column=0, columnspan=2, row=2, padx=5, pady=2)
gitRepoButton.grid(column=0, columnspan=2, row=3, padx=5, pady=2)

#Open Documentation
docButton = tk.Button(app, text='Open Documentation (Online)', command = openDoc)
docButton.grid(column=0, columnspan=2, row=3, padx=5, pady=2)
docButton.grid(column=0, columnspan=2, row=4, padx=5, pady=2)

#start program
app.mainloop()
Binary file added assets/images/cat.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified buildGUI.exe
Binary file not shown.
7 changes: 0 additions & 7 deletions dist/web-js-unpacked/game/allParagraphs.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ export function getParagraph(player) {
],
},
{
// id: 1,
name: "wood",
content: `You are walking into the woods and there's no one around.
Or so you thought. Your senses tells you that there's something out there, but your conscious mind tries to convince otherwise.
Expand Down Expand Up @@ -51,7 +50,6 @@ export function getParagraph(player) {
preId: 0,
},
{
// id: 2,
name: "greeting",
content: `This is the third paragraph. A guy and his friend, Snail Guy waved at you and said: "This is ${player?.playerName}! ${capitalise(player?.pronouns.is)} finally here! ${capitalise(player?.pronouns.subjectPro) + " " + verbForm('was', 'were')} busy last time you were here, so I couldn't introduce ${player?.pronouns.subjectPro} to you. Oh well, this is the end. Bye ${player?.playerName}!"`,
choices: [
Expand Down Expand Up @@ -81,7 +79,6 @@ export function getParagraph(player) {
preId: 2
},
{
// id: 4,
name: "surprise",
content: `There's a bear behind you! AAAAAAAAAAAAAAAAAAAAA<br>
You run to the space-time door, which will lead you back to the beginning of the game. There's a key hole on the door. You must carry 6 flowers to get through the door.`,
Expand Down Expand Up @@ -124,7 +121,6 @@ export function getParagraph(player) {
preId: 3
},
{
// id: 5,
name: "oh? you're still here?",
content: ``,
choices: [
Expand All @@ -151,7 +147,6 @@ export function getParagraph(player) {
],
},
{
// id: 6,
name: "edge",
content: `You leaped across the ledge! And landed successfully. You are safe, for now.`,
choices: [
Expand All @@ -161,7 +156,6 @@ export function getParagraph(player) {
],
},
{
// id: 7,
name: "cave ahead",
content: `You walked south from where you started. You saw a cave`,
choices: [
Expand All @@ -183,7 +177,6 @@ export function getParagraph(player) {
],
},
{
// id: 8,
name: "enter cave",
content: `You enter the cave. It's dark, pitch-black in here`,
choices: [
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions electron-src/bundle.js

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions electron-src/c19f4f1fae0fcbcfd0c5.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions electron-src/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
<!doctype html><html lang="en"><head><meta charset="UTF-8"><meta name="viewport" content="width=device-width,initial-scale=1"><title>Choosen Demo</title><link href="https://cdn.jsdelivr.net/npm/bootstrap@5.0.0-beta1/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-giJF6kkoqNQ00vy+HMDP7azOuL0xtbfIcaT9wjKHr8RbDVddVHyTfAAsrekwKmP1" crossorigin="anonymous"><script src="https://cdn.jsdelivr.net/npm/bootstrap@5.0.0-beta1/dist/js/bootstrap.bundle.min.js" integrity="sha384-ygbV9kiqUc6oa4msXn9868pTtWMgiQaeYH7/t7LECLbyPA2x65Kgf80OJFdroafW" crossorigin="anonymous"></script><link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap-icons@1.4.0/font/bootstrap-icons.css"><script defer="defer" src="bundle.js"></script></head><body><div class="container"><div class="row mt-4" style="margin-bottom:110px"><noscript>This webpage needs JavaScript to function properly. Please enable JavaScript in your browser</noscript><div class="col-lg-2"></div><div class="col-lg-8 col-sm-12"><header><h1>Demo</h1></header><main><img src="assets/images/b5a241b1766437cbf058.jpg"><div id="paragraph"></div><div id="choices"></div><div id="items"></div></main></div><div class="col-lg-2"></div></div></div><nav class="navbar fixed-bottom navbar-expand-sm navbar-light bg-light"><div class="container-fluid" style="text-align:center"><button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbarSupportedContent" aria-controls="navbarSupportedContent" aria-expanded="false" aria-label="Toggle navigation"><span class="navbar-toggler-icon"></span></button><div class="collapse navbar-collapse" id="navbarSupportedContent"><ul class="navbar-nav mx-auto mb-2 mb-lg-0 text-center"><li class="nav-item"><a class="nav-link" data-bs-toggle="modal" data-bs-target="#playerModal" href="#"><i class="bi bi-person"></i> Player</a></li><li class="nav-item"><a class="nav-link" data-bs-toggle="modal" data-bs-target="#inventoryModal" href="#"><i class="bi bi-archive"></i> Inventory</a></li><li class="nav-item"><a class="nav-link" href="#"><i class="bi bi-book"></i> Quest Log</a></li><li class="nav-item"><a class="nav-link" href="#" data-bs-toggle="modal" data-bs-target="#saveModal"><i class="bi bi-folder"></i> Save</a></li><li class="nav-item"><a class="nav-link" data-bs-toggle="modal" data-bs-target="#settingModal" href="#"><i class="bi bi-gear"></i> Settings</a></li></ul></div></div></nav><div class="modal fade" id="saveModal" tabindex="-1" aria-labelledby="saveModalLabel" aria-hidden="true"><div class="modal-dialog"><div class="modal-content"><div class="modal-header"><h5 class="modal-title" id="saveModalLabel"><i class="bi bi-folder"></i> Save Game</h5><button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button></div><div class="modal-body"><small>Slot 1</small><br><div class="row"><div class="saveDesc col-lg-7 col-md-7 col-sm-7 col-xs-12" id="saveDesc-slot-1">Empty</div><div class="col-lg-5 col-md-5 col-sm-5 col-xs-12 mt-3 mt-sm-0" style="text-align:center"><button class="save btn-sm" value="slot-1" id="save1">Save</button> <button class="load btn-sm" value="slot-1" id="load1">Load</button> <button class="export btn-sm" value="slot-1" id="export1">Export</button></div></div><hr><small>Slot 2</small><br><div class="row"><div class="saveDesc col-lg-7 col-md-7 col-sm-7 col-xs-12" id="saveDesc-slot-2">Empty</div><div class="col-lg-5 col-md-5 col-sm-5 col-xs-12 mt-3 mt-sm-0" style="text-align:center"><button class="save btn-sm" value="slot-2" id="save2">Save</button> <button class="load btn-sm" value="slot-2" id="load2">Load</button> <button class="export btn-sm" value="slot-2" id="export2">Export</button></div></div><hr><small>Slot 3</small><br><div class="row"><div class="saveDesc col-lg-7 col-md-7 col-sm-7 col-xs-12" id="saveDesc-slot-3">Empty</div><div class="col-lg-5 col-md-5 col-sm-5 col-xs-12 mt-3 mt-sm-0" style="text-align:center"><button class="save btn-sm" value="slot-3" id="save3">Save</button> <button class="load btn-sm" value="slot-3" id="load3">Load</button> <button class="export btn-sm" value="slot-3" id="export3">Export</button></div></div><hr><p>Export Save?</p><div class="mb-3 mb-sm-0" style="text-align:center"><button class="exportSave btn-sm" id="export">Export new Save Code</button> <button class="importSave btn-sm" id="import">Load from Save Code</button></div><small id="exportMessage">Click Export to get a new Save code or paste existing Save Code below to Load<br>Please makes sure that your save code is valid, or all data might be lost. Load is irreversible.</small> <textarea class="form-control" rows="3" id="saveOutput"></textarea></div><div class="modal-footer"><button type="button" class="btn btn-secondary" data-bs-dismiss="modal">Close</button></div></div></div></div><div class="modal fade" id="settingModal" tabindex="-1" aria-labelledby="exampleModalLabel" aria-hidden="true"><div class="modal-dialog"><div class="modal-content"><div class="modal-header"><h5 class="modal-title" id="exampleModalLabel"><i class="bi bi-gear"></i> Settings</h5><button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button></div><div class="modal-body"><small>Day/Night Mode</small><br><div class="row"><div class="col-7">Toggle Day or Night mode.</div><div class="col-5" style="text-align:center"><div class="form-check form-check-inline"><input class="form-check-input" type="radio" name="inlineRadioOptions" id="inlineRadio1" value="option1"> <label class="form-check-label" for="inlineRadio1">Day</label></div><div class="form-check form-check-inline"><input class="form-check-input" type="radio" name="inlineRadioOptions" id="inlineRadio2" value="option2"> <label class="form-check-label" for="inlineRadio2">Night</label></div></div></div><hr><small>Restart</small><br><div class="row"><div class="col-7">Clear your progress and start over</div><div class="col-5" style="text-align:center"><button class="btn-sm restartBtn">Restart Game</button></div></div><hr><small>Placeholder</small><br><div class="row"><div class="col-7">Some function</div><div class="col-5" style="text-align:center"><button class="btn-sm">Placeholder button</button></div></div></div><div class="modal-footer"><button type="button" class="btn btn-secondary" data-bs-dismiss="modal">Close</button></div></div></div></div><div class="modal fade" id="playerModal" tabindex="-1" aria-labelledby="staticBackdropLabel" aria-hidden="true"><div class="modal-dialog"><div class="modal-content"><div class="modal-header"><h5 class="modal-title" id="staticBackdropLabel">Player Info</h5><button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button></div><div class="modal-body"><div class="row"><div class="col-md-6 col-sm-12"><h6 class="mb-2">General Information</h6><h6 style="display:inline" class="text-muted">Name:</h6><p style="display:inline" class="yourName d-inline"></p><br><h6 class="mb-2 text-muted" style="display:inline">Pronouns:</h6><p class="playerPronouns" style="display:inline"></p></div><div class="col-md-6 col-sm-12"><h6 class="mb-2">Stats:</h6><div class="stat"></div></div></div></div><div class="modal-footer"><button type="button" class="btn btn-secondary" data-bs-dismiss="modal">Close</button></div></div></div></div><div class="modal fade" id="inventoryModal" tabindex="-1" aria-labelledby="staticBackdropLabel" aria-hidden="true"><div class="modal-dialog"><div class="modal-content"><div class="modal-header"><h5 class="modal-title" id="staticBackdropLabel">Inventory</h5><button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button></div><div class="modal-body"><div class="row"><div class="col-md-6 col-sm-12"><h6 style="text-align:center">Items</h6><ul class="nav nav-pills mb-3" id="inventory-tab" role="tablist" style="max-height:275"></ul></div><div class="col-md-6 col-sm-12"><h6 style="text-align:center">Description</h6><div class="tab-content" id="inventory-tabContent"></div></div></div></div><div class="modal-footer"><button type="button" class="btn btn-secondary" data-bs-dismiss="modal">Close</button></div></div></div></div><script src="b2e25fae00390a8eb136.js" type="module"></script></body></html>
49 changes: 49 additions & 0 deletions electron-src/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
const { app, BrowserWindow } = require('electron');
const path = require('path');

// Handle creating/removing shortcuts on Windows when installing/uninstalling.
// if (require('electron-squirrel-startup')) { // eslint-disable-line global-require
// app.quit();
// }

const createWindow = () => {
// Create the browser window.
const mainWindow = new BrowserWindow({
width: 800,
height: 600,
webPreferences: {
devTools: false
}
});

// and load the index.html of the app.
mainWindow.loadFile(path.join(__dirname, 'index.html'));

// Open the DevTools.
// mainWindow.webContents.openDevTools();
};

// This method will be called when Electron has finished
// initialization and is ready to create browser windows.
// Some APIs can only be used after this event occurs.
app.on('ready', createWindow);

// Quit when all windows are closed, except on macOS. There, it's common
// for applications and their menu bar to stay active until the user quits
// explicitly with Cmd + Q.
app.on('window-all-closed', () => {
if (process.platform !== 'darwin') {
app.quit();
}
});

app.on('activate', () => {
// On OS X it's common to re-create a window in the app when the
// dock icon is clicked and there are no other windows open.
if (BrowserWindow.getAllWindows().length === 0) {
createWindow();
}
});

// In this file you can include the rest of your app's specific main process
// code. You can also put them in separate files and import them here.
Loading

0 comments on commit d4052e4

Please sign in to comment.