Skip to content

Commit

Permalink
Deploying v0.50-alpha
Browse files Browse the repository at this point in the history
  • Loading branch information
abrahamYG committed Jun 17, 2019
1 parent f44b307 commit 6c2bf3b
Show file tree
Hide file tree
Showing 4 changed files with 88 additions and 9 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "sc2-campaign-manager",
"version": "0.4.0-alpha",
"version": "0.5.0-alpha",
"description": "A Campaign Manager for StarCraft II. ",
"main": "main.js",
"build": {
Expand Down
51 changes: 45 additions & 6 deletions public/sources.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,47 @@
[
"https://raw.githubusercontent.com/abrahamYG/sc2-campaign-sources/master/tactic.json",
"https://raw.githubusercontent.com/abrahamYG/sc2-campaign-sources/master/tacrem.json",
"https://raw.githubusercontent.com/abrahamYG/sc2-campaign-sources/master/scmr.json",
"https://raw.githubusercontent.com/abrahamYG/sc2-campaign-sources/master/annihilation.json",
"https://raw.githubusercontent.com/abrahamYG/sc2-campaign-sources/master/wott.json",
"https://raw.githubusercontent.com/abrahamYG/sc2-campaign-sources/master/perfect-soldiers.json"
"https://raw.githubusercontent.com/abrahamYG/sc2-campaign-sources/master/abandoment-campaign.json",
"https://raw.githubusercontent.com/abrahamYG/sc2-campaign-sources/master/alaraks-conquest-campaign.json",
"https://raw.githubusercontent.com/abrahamYG/sc2-campaign-sources/master/antioch-chronicles-remastered.json",
"https://raw.githubusercontent.com/abrahamYG/sc2-campaign-sources/master/brood.json",
"https://raw.githubusercontent.com/abrahamYG/sc2-campaign-sources/master/campaign-ascension-of-duran-reimagined.json",
"https://raw.githubusercontent.com/abrahamYG/sc2-campaign-sources/master/campaign-broods-wrath.json",
"https://raw.githubusercontent.com/abrahamYG/sc2-campaign-sources/master/campaign-evolution-swarm.json",
"https://raw.githubusercontent.com/abrahamYG/sc2-campaign-sources/master/campaign-race-with-destiny.json",
"https://raw.githubusercontent.com/abrahamYG/sc2-campaign-sources/master/campaign-shadow-of-the-past.json",
"https://raw.githubusercontent.com/abrahamYG/sc2-campaign-sources/master/campaign-starcraft-2-shadow-of-liberty.json",
"https://raw.githubusercontent.com/abrahamYG/sc2-campaign-sources/master/campaign-umojans-job-working-tit.json",
"https://raw.githubusercontent.com/abrahamYG/sc2-campaign-sources/master/campaign-wrath-taldarim.json",
"https://raw.githubusercontent.com/abrahamYG/sc2-campaign-sources/master/custom-campaign-initiative.json",
"https://raw.githubusercontent.com/abrahamYG/sc2-campaign-sources/master/custom-dlc-unification-purifiers.json",
"https://raw.githubusercontent.com/abrahamYG/sc2-campaign-sources/master/enslavers-redux.json",
"https://raw.githubusercontent.com/abrahamYG/sc2-campaign-sources/master/hammer-dawn.json",
"https://raw.githubusercontent.com/abrahamYG/sc2-campaign-sources/master/ignos.json",
"https://raw.githubusercontent.com/abrahamYG/sc2-campaign-sources/master/lifeforce.json",
"https://raw.githubusercontent.com/abrahamYG/sc2-campaign-sources/master/marauders-orbital-drop.json",
"https://raw.githubusercontent.com/abrahamYG/sc2-campaign-sources/master/njordysevac.json",
"https://raw.githubusercontent.com/abrahamYG/sc2-campaign-sources/master/noir-ascension.json",
"https://raw.githubusercontent.com/abrahamYG/sc2-campaign-sources/master/noir-automata.json",
"https://raw.githubusercontent.com/abrahamYG/sc2-campaign-sources/master/noir-evolution.json",
"https://raw.githubusercontent.com/abrahamYG/sc2-campaign-sources/master/perfect-soldiers.json",
"https://raw.githubusercontent.com/abrahamYG/sc2-campaign-sources/master/proditor-campaign.json",
"https://raw.githubusercontent.com/abrahamYG/sc2-campaign-sources/master/shadow-brood-campaign.json",
"https://raw.githubusercontent.com/abrahamYG/sc2-campaign-sources/master/silent-scream-custom-campaign.json",
"https://raw.githubusercontent.com/abrahamYG/sc2-campaign-sources/master/sotx.json",
"https://raw.githubusercontent.com/abrahamYG/sc2-campaign-sources/master/starcraft-2-odyssey-campaign.json",
"https://raw.githubusercontent.com/abrahamYG/sc2-campaign-sources/master/starcraft-2-time-convergence.json",
"https://raw.githubusercontent.com/abrahamYG/sc2-campaign-sources/master/starcraft-ii-annihilation-campaign.json",
"https://raw.githubusercontent.com/abrahamYG/sc2-campaign-sources/master/starcraft-mass-recall.json",
"https://raw.githubusercontent.com/abrahamYG/sc2-campaign-sources/master/starcraft-origins.json",
"https://raw.githubusercontent.com/abrahamYG/sc2-campaign-sources/master/starcraft-pandora.json",
"https://raw.githubusercontent.com/abrahamYG/sc2-campaign-sources/master/starcraft-reawakening.json",
"https://raw.githubusercontent.com/abrahamYG/sc2-campaign-sources/master/starcraft-replicant.json",
"https://raw.githubusercontent.com/abrahamYG/sc2-campaign-sources/master/starcraft-subjection.json",
"https://raw.githubusercontent.com/abrahamYG/sc2-campaign-sources/master/starcraft-time-splitters.json",
"https://raw.githubusercontent.com/abrahamYG/sc2-campaign-sources/master/the-hammer-of-dawn-revamp.json",
"https://raw.githubusercontent.com/abrahamYG/sc2-campaign-sources/master/thoughts-in-chaos.json",
"https://raw.githubusercontent.com/abrahamYG/sc2-campaign-sources/master/time-convergence.json",
"https://raw.githubusercontent.com/abrahamYG/sc2-campaign-sources/master/vortex-void.json",
"https://raw.githubusercontent.com/abrahamYG/sc2-campaign-sources/master/wrath-arius.json"

]

36 changes: 36 additions & 0 deletions src/classes/Downloader.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
import { ICampaign, ISC2Component } from "./Campaign";
import download = require("download");

interface ISource {
url?:string,
format?:string,
files?:Array<ISC2Component>,
progress?:number
}

export default class Downloader {
static downloads:ISource[] = [];
static progress: number = 0;
static pushCampaign(campaign:ICampaign){
let sources: {[key: string]: ISource} = {};
const mods = [...campaign.mods, ...campaign.maps];
mods.forEach(mod =>{
const {source, sourceFormat} = mod;
sources = {
[source]: {
format: sourceFormat,
files:[]
},
...sources
}
this.downloads.push({ url: source, format:sourceFormat, progress:0})

if(sources[source].format === "zip") {
sources[source].files.push(mod);
}
else{
sources[mod.source].files = [mod];
}
});
}
}
8 changes: 6 additions & 2 deletions src/components/CampaignDetails.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,11 @@ const CampaignDetails:FC<ICampaignDetailsProps> = (props) => {
const downloadProgress:number = (progress)?progress:0;
return (
<Router basename={basePath}>

<section className="campaign-content">
<Route exact path="/" render={() => (
<Redirect to="/description"/>
)}/>
<header className="campaign-content-header mb-2">
<div className="campaign-content-controls btn-group float-right" role="group">
{(isCampaignInstalled) &&
Expand Down Expand Up @@ -116,7 +120,7 @@ const CampaignDetails:FC<ICampaignDetailsProps> = (props) => {

<div className="campaign-content-body">
<div className="btn-group" role="group" aria-label="...">
<NavLink to="/" exact className="btn btn-outline-primary" activeClassName="btn-primary active">
<NavLink to="/description" className="btn btn-outline-primary" activeClassName="btn-primary active">
Description
</NavLink>
<NavLink to={`/screenshots`} className="btn btn-outline-primary" activeClassName="btn-primary active">
Expand All @@ -135,7 +139,7 @@ const CampaignDetails:FC<ICampaignDetailsProps> = (props) => {

<article>
<Switch>
<Route path={`${basePath}`} exact render={()=>
<Route path="/description" render={()=>
<section>
{(videos) &&
<iframe
Expand Down

0 comments on commit 6c2bf3b

Please sign in to comment.