Skip to content

Commit

Permalink
Release 0.6.1
Browse files Browse the repository at this point in the history
  • Loading branch information
ngld committed Nov 11, 2017
2 parents da1f935 + 932ea4f commit 59d5668
Show file tree
Hide file tree
Showing 36 changed files with 620 additions and 180 deletions.
1 change: 1 addition & 0 deletions Pipfile
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,5 @@ raven = "*"
pyqt5 = "*"
requests-toolbelt = "*"
ply = "*"
token-bucket = "*"

1 change: 1 addition & 0 deletions configure.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@
check_module('requests')
check_module('requests_toolbelt')
check_module('ply')
check_module('token_bucket')
if sys.platform == 'win32':
check_module('comtypes')

Expand Down
33 changes: 32 additions & 1 deletion html/css/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -387,12 +387,43 @@ iframe {
bottom: 7px;
width: calc(100% - 14px);
overflow-y: auto;
background-image: url(../images/BG.png);
/*background-image: url(../images/BG.png);
background-repeat: repeat;
box-shadow: inset 0px 13px 15px -10px rgba(0,0,0,1),
inset 0px -13px 15px -10px rgba(0,0,0,1),
inset 13px 0px 15px -10px rgba(0,0,0,1),
inset -13px 0px 15px -10px rgba(0,0,0,1);*/
}

#main-shadow-effect {
position: fixed;
top: 78px;
bottom: 7px;
left: 7px;
right: 7px;
box-shadow: inset 0px 13px 15px -10px rgba(0,0,0,1),
inset 0px -13px 15px -10px rgba(0,0,0,1),
inset 13px 0px 15px -10px rgba(0,0,0,1),
inset -13px 0px 15px -10px rgba(0,0,0,1);
pointer-events: none;
/*z-index: -1;*/
}

#main-background {
position: fixed;
top: 78px;
bottom: 7px;
left: 7px;
right: 7px;
background-image: url(../images/BG.png);
background-repeat: repeat;
pointer-events: none;
z-index: -3;
}

.mod-container {
position: inherit;
/*z-index: -2;*/
}

.main-notice {
Expand Down
6 changes: 3 additions & 3 deletions html/js/bbparser.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,9 @@ const parser = XBBCode.create({
sub: '<sub>{content}</sub>',
tt: '<tt>{content}</tt>',
pre: '<pre>{content}</pre>',
left: '<span style="text-align: left;">{content}</span>',
right: '<span style="text-align: right;">{content}</span>',
center: '<span style="text-align: center;">{content}</span>',
left: '<div style="text-align: left;">{content}</div>',
right: '<div style="text-align: right;">{content}</div>',
center: '<div style="text-align: center;">{content}</div>',
table: '<table class="table">{content}</table>',
tr: '<tr>{content}</tr>',
td: '<td>{content}</td>',
Expand Down
26 changes: 21 additions & 5 deletions html/js/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,6 @@ function init() {

window.vm = new Vue(Object.assign({ el: '#loading' }, KnPage));

call(fs2mod.finishInit, get_translation_source(), (t) => vm.trans = t);

let mod_table = null;
window.task_mod_map = {};

Expand Down Expand Up @@ -82,6 +80,19 @@ function init() {

vm.popup_visible = true;
});
fs2mod.showModDetails.connect((mid) => {
function cb() {
if(!mod_table || !mod_table[mid]) {
setTimeout(cb, 300);
return;
}

vm.page = 'details';
vm.mod = mod_table[mid];
}

cb();
});
fs2mod.updateModlist.connect((mods, type) => {
mod_table = {};
mods = JSON.parse(mods);
Expand All @@ -90,8 +101,11 @@ function init() {
}

vm.mods = mods;
vm.page = type === 'develop' ? 'develop' : 'modlist';
vm.tab = type;

if(vm.page === 'modlist' || vm.page === 'develop') {
vm.page = type === 'develop' ? 'develop' : 'modlist';
vm.tab = type;
}
});
fs2mod.hidePopup.connect(() => vm.popup_visible = false);

Expand Down Expand Up @@ -146,11 +160,13 @@ function init() {

// Open <a href="..." target="_blank">...</a> links in the system's default browser
document.body.addEventListener('click', (e) => {
if(e.target && e.target.nodeName === 'A' && e.target.target === '_blank' && e.className && e.className.indexOf('open-ext') > -1) {
if(e.target && e.target.nodeName === 'A' && e.className && e.className.indexOf('open-ext') > -1) {
e.preventDefault();
fs2mod.openExternal(e.target.href);
}
});

setTimeout(() => call(fs2mod.finishInit, get_translation_source(), (t) => vm.trans = t), 300);
}

if(window.qt) {
Expand Down
15 changes: 14 additions & 1 deletion html/templates/kn-devel-page.vue
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,19 @@ export default {
}
},
computed: {
engine_builds() {
let builds = [];
for(let mod of this.mods) {
if(mod.type === 'engine') {
builds = builds.concat(mod.versions);
}
}
return builds;
}
},
methods: {
showRetailPrompt() {
vm.showRetailPrompt();
Expand Down Expand Up @@ -740,7 +753,7 @@ export default {
<div class="input-group">
<select class="form-control" v-model="fso_build">
<option v-if="!isValidBuild()" :key="'invalid'" value="invalid">Please select a valid build</option>
<option v-for="mod in mods" v-if="mod.type === 'engine'" :key="mod.id + '-' + mod.version" :value="mod.id + '#' + mod.version">
<option v-for="mod in engine_builds" :key="mod.id + '-' + mod.version" :value="mod.id + '#' + mod.version">
{{ mod.title }} {{ mod.version }}
</option>
<option v-if="selected_mod.custom_build" :value="'custom#' + selected_mod.custom_build">{{ selected_mod.custom_build.replace(/\\/g, '/').split('/').pop() }}</option>
Expand Down
2 changes: 1 addition & 1 deletion html/templates/kn-mod-explore.vue
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ export default {
</button>

<button class="mod-btn btn-blue" v-if="mod.status !== 'updating'" @click="install">
<span class="btn-text">{{ mod.installed ? 'MODFIY' : 'INSTALL' }}</span>
<span class="btn-text">{{ mod.installed ? 'MODIFY' : 'INSTALL' }}</span>
</button>

<button class="mod-btn btn-blue" v-if="mod.status === 'updating'" @click="showProgress">
Expand Down
8 changes: 4 additions & 4 deletions html/templates/kn-mod-home.vue
Original file line number Diff line number Diff line change
Expand Up @@ -90,11 +90,11 @@ export default {
<span class="btn-text">DETAILS</span>
</button>

<kn-dropdown @open="updateTools(); open = true" @close="open = false">
<button v-for="tool in tools" @click="launchTool(tool)">Run {{ tool }}</button>
<kn-dropdown v-if="mod.status !== 'updating'" @open="updateTools(); open = true" @close="open = false">
<button v-for="tool in tools" v-if="(mod.status === 'ready' || mod.status === 'update') && (mod.type === 'mod' || mod.type == 'tc')" @click="launchTool(tool)">Run {{ tool }}</button>
<button @click="uploadLog">Upload Debug Log</button>
<button v-if="mod.id !== 'FS2' && mod.status !== 'updating'" @click="install">Modify</button>
<button v-if="mod.id !== 'FS2' && mod.status !== 'updating' && !mod.dev_mode" @click="uninstallMod">Uninstall</button>
<button v-if="mod.id !== 'FS2'" @click="install">Modify</button>
<button v-if="mod.id !== 'FS2' && !mod.dev_mode" @click="uninstallMod">Uninstall</button>
</kn-dropdown>
</div>
</div>
Expand Down
56 changes: 48 additions & 8 deletions html/templates/kn-page.vue
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,8 @@ export default {
popup_pkg_name: '',
popup_pkg_folder: '',
popup_ini_path: '',
popup_sure_question: '',
sureCallback: null,
Expand Down Expand Up @@ -80,6 +82,11 @@ export default {
},
showTab(tab) {
if(this.page === 'settings') {
this.tab = tab;
this.page = tab === 'develop' ? 'develop' : 'modlist';
}
if(window.qt) {
fs2mod.showTab(tab);
} else {
Expand Down Expand Up @@ -133,11 +140,14 @@ export default {
return;
}
call(fs2mod.createMod, this.popup_mod_name, this.popup_mod_id, this.popup_mod_version, this.popup_mod_type, this.popup_mod_parent, (result) => {
if(result) {
this.popup_visible = false;
call(fs2mod.createMod, this.popup_ini_path, this.popup_mod_name, this.popup_mod_id, this.popup_mod_version,
this.popup_mod_type, this.popup_mod_parent,
(result) => {
if(result) {
this.popup_visible = false;
}
}
});
);
},
addPackage() {
Expand Down Expand Up @@ -232,6 +242,20 @@ export default {
});
},
selectModIni() {
call(fs2mod.browseFiles, 'Please select the desired mod.ini', this.retail_data_path, 'mod.ini', (files) => {
if(files.length > 0) {
this.popup_ini_path = files[0];
call(fs2mod.parseIniMod, this.popup_ini_path, (mod) => {
let ini_mod = JSON.parse(mod);
this.popup_mod_id = ini_mod.id;
this.popup_mod_name = ini_mod.title;
});
}
});
},
finishRetailPrompt() {
call(fs2mod.copyRetailData, this.retail_data_path, (result) => {
if(result) this.popup_visible = false;
Expand Down Expand Up @@ -304,7 +328,8 @@ export default {

<!-------------------------------------------------------------------------------- Build the Main View container ---------->
<div class="main-container scroll-style">
<div class="container-fluid" v-if="page === 'modlist'">
<div id="main-background"></div>
<div class="container-fluid mod-container" v-if="page === 'modlist'">
<div v-if="tab === 'home'">
<kn-mod-home v-for="mod in mods" :key="mod.id" :mod="mod" :tab="tab"></kn-mod-home>
</div>
Expand All @@ -313,6 +338,7 @@ export default {
</div>
<div v-if="mods.length === 0" class="main-notice">No mods found.</div>
</div>
<div id="main-shadow-effect"></div>

<!-------------------------------------------------------------------------------- Start the Welcome page ---------->
<div data-tr class="info-page" v-if="page === 'welcome'">
Expand Down Expand Up @@ -446,6 +472,20 @@ export default {
</div>
</div>

<div class="form-group">
<label class="col-xs-3 control-label">Mod.ini path</label>
<div class="col-xs-9">
<div class="input-group">
<input type="text" class="form-control" v-model="popup_ini_path">
<span class="input-group-btn">
<button class="btn btn-default" @click.prevent="selectModIni">Select mod.ini</button>
</span>
</div>

<p class="help-block">Only use this if you want to convert a legacy mod! Will update Name and ID fields above.</p>
</div>
</div>

<div class="form-group">
<label class="col-xs-3 control-label">Version</label>
<div class="col-xs-9">
Expand All @@ -462,9 +502,9 @@ export default {
<div class="col-xs-9">
<select class="form-control" v-model="popup_mod_type">
<option value="mod">Mod</option>
<option value="tc">Total Conversion</option>
<option value="engine">FSO build</option>
<option value="tool">Tool</option>
<option value="tc" v-if="popup_mode === 'create_mod'">Total Conversion</option>
<option value="engine" v-if="popup_mode === 'create_mod'">FSO build</option>
<option value="tool" v-if="popup_mode === 'create_mod'">Tool</option>
<option value="ext">Extension</option>
</select>

Expand Down
39 changes: 30 additions & 9 deletions html/templates/kn-settings-page.vue
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ export default {
save() {
this.fso.joystick_ff_strength = this.ff_enabled ? 100 : 0;
for(let set of ['base_path', 'max_downloads', 'use_raven', 'engine_stability']) {
for(let set of ['base_path', 'max_downloads', 'use_raven', 'engine_stability', 'download_bandwidth']) {
if(this.knossos[set] != this.old_settings.knossos[set]) {
fs2mod.saveSetting(set, JSON.stringify(this.knossos[set]));
}
Expand Down Expand Up @@ -90,7 +90,7 @@ export default {
<div class="settings-exp">Click the arrows to reveal each group's options. Click SAVE when done.</div>

<kn-drawer label="Knossos">
<div class="settings-exp drawer-exp">Basic Knossos settings for downloads, errors, and data</div>
<div class="settings-exp drawer-exp">Settings for basic Knossos options, errors, and data</div>
<div class="form-group">
<label class="col-sm-4 control-label">Data Path:</label>
<div class="col-sm-8">
Expand All @@ -99,13 +99,6 @@ export default {
</div>
</div>

<div class="form-group">
<label class="col-sm-4 control-label">Max Downloads:</label>
<div class="col-sm-8">
<input type="number" style="width: 50px" v-model.number="knossos.max_downloads">
</div>
</div>

<div class="form-group">
<label class="col-sm-4 control-label">Send Error Reports:</label>
<div class="col-sm-8">
Expand All @@ -125,6 +118,34 @@ export default {
</div>
</kn-drawer>

<kn-drawer label="Downloads">
<div class="settings-exp drawer-exp">Configuration of how Knossos handles downloads</div>
<div class="form-group">
<label class="col-sm-4 control-label">Max Downloads:</label>
<div class="col-sm-8">
<input type="number" style="width: 50px" v-model.number="knossos.max_downloads">
</div>
</div>

<div class="form-group">
<label class="col-sm-4 control-label">Download bandwidth limit:</label>
<div class="col-sm-8">
<select v-model="knossos.download_bandwidth">
<option :value="-1 ">No limit</option>
<option :value="128 * 1024">128 KB/s</option>
<option :value="512 * 1024">512 KB/s</option>
<option :value="1 * 1024 * 1024">1 MB/s</option>
<option :value="2 * 1024 * 1024">2 MB/s</option>
<option :value="3 * 1024 * 1024">3 MB/s</option>
<option :value="5 * 1024 * 1024">5 MB/s</option>
<option :value="10 * 1024 * 1024">10 MB/s</option>
<option :value="20 * 1024 * 1024">20 MB/s</option>
<option :value="50 * 1024 * 1024">50 MB/s</option>
</select>
</div>
</div>
</kn-drawer>

<kn-drawer label="Video">
<div class="settings-exp drawer-exp">Set your default video settings and resolution</div>
<div class="form-group">
Expand Down
3 changes: 2 additions & 1 deletion knossos/center.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@

# The version should follow the http://semver.org guidelines.
# Only remove the -dev tag if you're making a release!
VERSION = '0.6.0'
VERSION = '0.6.1'
UPDATE_LINK = 'https://dev.tproxy.de/knossos'
INNOEXTRACT_LINK = 'https://dev.tproxy.de/knossos/innoextract.txt'
DEBUG = os.getenv('KN_DEBUG', '0').strip() == '1'
Expand Down Expand Up @@ -53,6 +53,7 @@
'base_dirs': [],
'hash_cache': None,
'max_downloads': 3,
'download_bandwidth': -1.0, # negative numbers are used to specify no limit
'repos': [('https://fsnebula.org/storage/repo.json', 'FSNebula')],
'nebula_link': 'https://fsnebula.org/api/1/',
'update_notify': True,
Expand Down
2 changes: 1 addition & 1 deletion knossos/integration.py
Original file line number Diff line number Diff line change
Expand Up @@ -223,7 +223,7 @@ def init():
if hasattr(gi, 'require_version'):
gi.require_version('Unity', '6.0')
except Exception:
logging.warn('Failed to specify Unity version. Most likely Unity is not available.')
logging.warning('Failed to specify Unity version. Most likely Unity is not available.')

from gi.repository import Unity
except ImportError:
Expand Down
Loading

0 comments on commit 59d5668

Please sign in to comment.