Skip to content

Commit

Permalink
Merge branch 'dev'
Browse files Browse the repository at this point in the history
  • Loading branch information
unknown authored and unknown committed Oct 1, 2015
2 parents 45a5b7d + ed7ec36 commit 5dd9222
Show file tree
Hide file tree
Showing 15 changed files with 283 additions and 164 deletions.
38 changes: 16 additions & 22 deletions src/app/assets/custom.css
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,15 @@
html, body {
overflow:hidden;
background-color: #424242;
font-size: 14px !important;
}

#app {
transition: all 0.26s ease-out;
color: white;
opacity: 0;
}

#app.show {
opacity:1;
}
Expand All @@ -18,23 +19,17 @@
color: black;
}

* {
* {#
-webkit-user-select: none; /* Chrome all / Safari all */
user-select: none;
}

.md-input-focused > .filterlabel {
opacity: 0;
}

i.controlbtn {

.filtericon {
color: #677e89;
font-size: 25px !important;
}

.slimscroll-l {
height: 570px;
}



.customAboutContainer img {
border-radius: 100%;
width: 120px;
Expand Down Expand Up @@ -97,14 +92,9 @@
.btn-sort:hover {
background-color: rgba(158, 158, 158, 0.4);
}

md-bottom-sheet {
color: black;
}


md-bottom-sheet .md-subheader .md-subheader-inner {
padding: 0 !important;
color: black;
padding: 0 !important;
}

.gameholder {
Expand Down Expand Up @@ -173,12 +163,17 @@
}

md-bottom-sheet.md-grid md-list-item .md-grid-item-content {
width: 70px !important;
width: 70px !important;
}

md-bottom-sheet.md-grid md-list-item {
padding: 5px;
}

.md-tab {
max-width: 100% !important;
}

md-bottom-sheet md-list-item:hover {
background-color: transparent;
}
Expand Down Expand Up @@ -213,7 +208,6 @@
transform: scale(0);
opacity:0;
}


.repeat-animation.ng-enter,
.repeat-animation.ng-leave,
Expand Down
31 changes: 19 additions & 12 deletions src/app/controllers/appController.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,13 @@
app.controller('appController', ['$scope', '$mdDialog', '$mdToast', '$mdBottomSheet', '$mdSidenav', 'modlistService', '$http', 'iwadService', 'nwService', appController]);

function appController($scope, $mdDialog, $mdToast, $mdBottomSheet, $mdSidenav, modlistService, $http, iwadService, nwService) {
var $PARENT = $scope;
var TOASTDELAY = 1500;

$mdToast.show(
$mdToast.simple()
.content('Checking for Updates...').position('bottom').hideDelay(TOASTDELAY)
);

$http.get('https://raw.githubusercontent.com/FreaKzero/ssgl-doom-launcher/master/package.json').
then(function(response) {
Expand All @@ -12,7 +19,7 @@
$scope.downloadversion = response.data.version;

$scope.download = function(url) {
var release = 'https://github.com/FreaKzero/ssgl-doom-launcher/releases/tag/v'+response.data.version;
var release = 'https://github.com/FreaKzero/ssgl-doom-launcher/releases/tag/v' + response.data.version;
nwService.getShell().openExternal(release);
};

Expand All @@ -31,10 +38,6 @@
console.log('ERROR: ' + response);
});


var $PARENT = $scope;
var TOASTDELAY = 1500;

if ($scope.config.freshinstall === true) {
SettingsDialog(null);
}
Expand Down Expand Up @@ -76,7 +79,6 @@
});

function AboutDialogController($scope, $mdBottomSheet) {
console.log($PARENT.APPVERSION)
$scope.version = $PARENT.APPVERSION;
$scope.openURL = function(url) {
nwService.getShell().openExternal(url);
Expand All @@ -97,6 +99,8 @@
});

function GameSelectionController($scope, $mdBottomSheet, iwadService) {
$scope.useoblige = false;

iwadService.getIWADS($PARENT.config.iwadpath).then(function(iwads) {
$scope.iwads = iwads;
});
Expand All @@ -111,11 +115,14 @@
$scope.engine = 'gzDoom';
}

$scope.startGame = function($index, engine) {
var iwad = $scope.iwads[$index].file;

$PARENT.$broadcast('STARTGZDOOM', iwad, false, engine);
$mdBottomSheet.hide();
$scope.startGame = function($index, engine, $event) {
if ($scope.useoblige === false) {
var iwad = $scope.iwads[$index].file;
$PARENT.$broadcast('STARTGZDOOM', iwad, false, engine);
$mdBottomSheet.hide();
} else {
$scope.startGameOblige($event, $index, engine);
}
};

$scope.startGameOblige = function(ev, $index, engine) {
Expand Down Expand Up @@ -152,7 +159,7 @@
};

$scope.continue = function() {
$PARENT.$broadcast('STARTGZDOOM', iwad, $PARENT.config.oblige.mappath, engine);
$PARENT.$broadcast('STARTGZDOOM', iwad, $PARENT.config.oblige.mappath, engine, $mdDialog);
};

$scope.cancel = function() {
Expand Down
44 changes: 38 additions & 6 deletions src/app/controllers/modController.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
(function() {

var execFile = require('child_process').execFile;
app.controller('modController', ['$scope', 'modService', 'modlistService', '$mdDialog', 'nwService','modselectedService', modController]);
app.controller('modController', ['$scope', 'modService', 'modlistService', '$mdDialog', 'nwService','modselectedService', '$mdToast', modController]);

function modController($scope, modService, modlistService, $mdDialog, nwService, modselectedService) {
function modController($scope, modService, modlistService, $mdDialog, nwService, modselectedService, $mdToast) {
var self = this;
var $parent = $scope;

Expand Down Expand Up @@ -79,7 +79,20 @@
$scope.checkdoubles = function() {};

$scope.submitForm = function() {
modlistService.saveSelected($scope.listname, $parent.selected);
modlistService.saveSelected($scope.listname, $parent.selected).then(function(listname) {
$mdToast.show(
$mdToast.simple()
.content('Saved List to '+listname).position('bottom').hideDelay(1500)
);
}, function(error) {
$mdToast.show(
$mdToast.simple()
.content(error.message).position('bottom').hideDelay(1500)
);
});



$parent.usedList = $scope.listname;
$mdDialog.cancel();
};
Expand Down Expand Up @@ -110,7 +123,7 @@
});
}
};

$scope.$on('STARTOBLIGE', function(ev, iwad, config, engine, log) {
$mdDialog.show({
templateUrl: 'app/templates/ObligeLoading.html',
Expand Down Expand Up @@ -145,11 +158,15 @@
});
});

$scope.$on('STARTGZDOOM', function(ev, iwad, map, engine) {
$scope.$on('STARTGZDOOM', function(ev, iwad, map, engine, dialog) {
if (typeof map === 'undefined') {
map = false;
}

if (typeof dialog === 'undefined') {
dialog = false;
}

var child;
var SAVEDIR;
var useEngine = "";
Expand All @@ -175,6 +192,17 @@
SAVEDIR = $scope.config.savepaths.zandronum + 'default';
}
break;

case "zdoom":
useEngine = $scope.config.engines.zdoom;

if ($scope.usedList !== false) {
SAVEDIR = $scope.config.savepaths.zdoom + $scope.usedList;
} else {
SAVEDIR = $scope.config.savepaths.zdoom + 'default';
}

break;
}

var params = ['-iwad', $scope.config.iwadpath + iwad, '-savedir', SAVEDIR];
Expand All @@ -186,9 +214,13 @@
wads.push(map);
}

if (dialog !== false) {
dialog.hide();
}

params = params.concat(['-file'], wads);
console.log(params);
child = execFile(useEngine, params,

function(error, stdout, stderr) {
if (error) {
console.log(error.stack);
Expand Down
34 changes: 28 additions & 6 deletions src/app/controllers/modlistController.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
(function() {
app.controller('modlistController', ['$scope', 'modlistService', '$rootScope', '$mdDialog', modlistController]);
app.controller('modlistController', ['$scope', 'modlistService', '$rootScope', '$mdDialog', '$mdToast', modlistController]);

function modlistController($scope, modlistService, $rootScope, $mdDialog) {
function modlistController($scope, modlistService, $rootScope, $mdDialog, $mdToast) {

modlistService.getLists().then(function(list) {
$scope.modlist = list;
Expand Down Expand Up @@ -37,11 +37,21 @@
};

$scope.submitForm = function(valid) {


if (valid && $scope.double.length === 0) {
item.name = $scope.listname;
modlistService.rename(item);

modlistService.rename(item).then(function(renamed) {
$mdToast.show(
$mdToast.simple()
.content('List renamed to ' + renamed).position('bottom').hideDelay(1500)
);
}, function(error) {
$mdToast.show(
$mdToast.simple()
.content(error.message).position('bottom').hideDelay(1500)
);
});

$mdDialog.cancel();
}
};
Expand All @@ -61,7 +71,19 @@
.targetEvent(ev);

$mdDialog.show(confirm).then(function() {
modlistService.remove($scope.modlist[$index]);

modlistService.remove($scope.modlist[$index]).then(function(listname) {
$mdToast.show(
$mdToast.simple()
.content('List ' + listname + ' removed').position('bottom').hideDelay(1500)
);
}, function(error) {
$mdToast.show(
$mdToast.simple()
.content(error.message).position('bottom').hideDelay(1500)
);
});

$scope.modlist.splice($index, 1);
}, function() {
$mdDialog.cancel();
Expand Down
12 changes: 8 additions & 4 deletions src/app/directives/directory-chooser.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
(function() {
app.directive('dirChoose', function() {
app.directive('dirChoose', ['nwService', function(nwService) {
return {
restrict: 'AE',
replace: 'true',
Expand All @@ -13,7 +13,12 @@
template: '<div><md-input-container><label>{{label}}</label><input class="fileInput" type="text" ng-click="openDialog()" ng-model="ngModel"></md-input-container><input type="file" nwworkingdir="{{wdir}}" class="fileDialog" style="display:none" nwdirectory /></div>',
link: function($scope, elem, att, ngModel) {

$scope.wdir = $scope.ngModel;
if (typeof $scope.ngModel !== 'undefined' && $scope.ngModel !== '') {
$scope.wdir = $scope.ngModel;
} else {
$scope.wdir = nwService.execpath;
}

$scope.label = att.label;

var z = elem[0].querySelector('.fileDialog');
Expand All @@ -27,7 +32,6 @@
$scope.$apply(function() {
$scope.ngModel = newPath;
});

}

}, false);
Expand All @@ -37,5 +41,5 @@
};
}
};
});
}]);
})();
6 changes: 3 additions & 3 deletions src/app/directives/file-chooser.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
(function() {
app.directive('fileChoose', function() {
app.directive('fileChoose', ['nwService', function(nwService) {
return {
restrict: 'AE',
replace: 'true',
Expand All @@ -17,7 +17,7 @@
if (typeof $scope.ngModel !== 'undefined' && $scope.ngModel !== '') {
$scope.wdir = $scope.ngModel.substring(0, $scope.ngModel.lastIndexOf('\\'));
} else {
$scope.wdir = '';
$scope.wdir = nwService.execpath;
}

$scope.label = att.label;
Expand All @@ -44,5 +44,5 @@
};
}
};
});
}]);
})();
Loading

0 comments on commit 5dd9222

Please sign in to comment.