Skip to content

Commit

Permalink
Hopefully fixed issues with Font-Awesome paths, a few more replay dis…
Browse files Browse the repository at this point in the history
…play updates
  • Loading branch information
anther committed Oct 8, 2018
1 parent bc99a3d commit 5692270
Show file tree
Hide file tree
Showing 9 changed files with 29 additions and 45 deletions.
9 changes: 6 additions & 3 deletions app/app.global.scss
Original file line number Diff line number Diff line change
Expand Up @@ -402,14 +402,17 @@ h6 {
}

&.detailed{
.main_content{
.replay_content{
.back_button{
margin-bottom: 16px;
}
.game_data{
flex-direction: row;

.details{
order: 0;
flex-direction: column;
justify-content: baseline;
justify-content: initial;
margin-right: 16px;
}
}
Expand All @@ -419,7 +422,7 @@ h6 {
}
}

.main_content {
.replay_content {
display: flex;
flex-direction: column;
width: 100%;
Expand Down
10 changes: 8 additions & 2 deletions app/components/ReplayComponent.js
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,13 @@ export default class ReplayComponent extends Component {
const stats = replay.getStats(); // Currently used to fetch detailed stats
return (
<React.Fragment>
<div className='main_content'>
<div className='replay_content'>
{detailed &&
<Button
onClick={this.onDetailsClick}
className='back_button btn-small'
>Back</Button>
}
<div className='game_data'>
<div className='stocks'>
{replay.getPlayers().map((player, index) => (
Expand Down Expand Up @@ -150,7 +156,7 @@ export default class ReplayComponent extends Component {

<div className='file_name_holder'>
<a onClick={this.onOpenInExplorer} className='file_name'>
{replay.getFileName()}
{replay.getName()}
</a>
</div>
</div>
Expand Down
4 changes: 3 additions & 1 deletion app/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,7 @@
"postinstall": "yarn electron-rebuild"
},
"license": "",
"dependencies": {}
"dependencies": {
"@fortawesome/fontawesome-free": "^5.3.1"
}
}
1 change: 0 additions & 1 deletion app/utils/Files.js
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,6 @@ export default class Files {
return fs.mkdirSync(directoryPath, mask);
}
catch(error){
console.log('directory already exists', directoryPath);
}
}

Expand Down
40 changes: 8 additions & 32 deletions app/utils/Replay.js
Original file line number Diff line number Diff line change
Expand Up @@ -79,38 +79,16 @@ export default class Replay extends CacheableDataObject {
{
return this._fileDate;
}
const fileName = this.getFileName();
if(this.hasDefaultFileName()){

const dateString = fileName.slice(5, fileName.length - 4);
return this._fileDate = moment(dateString, "YYYYMMDDTHHmmss", true);
}
if(this.hasDirectoriedFileName())
{
const directory = path.basename(path.dirname(this.id));
const dateString = fileName.slice(0, 6);
return this._fileDate = moment(`${directory}${dateString}`, "YYYY-MM-DDHHmmss", true);
}

return this._fileDate = null; // Return really old date...

}

hasDirectoriedFileName(){
const fileName = this.getFileName();
for(let i = 0; i < 5; i++)
const stats = this.getStats();
if(!stats)
{
if(!Numbers.stringIsNumeric(fileName[i]))
{
return false;
}
}
if(fileName[6] === '_')
{
return true;
const fileStats = fs.lstatSync(this.filePath);
const theMoment = moment(fileStats.birthtime);
console.log('the brithtime', theMoment);
return this._fileDate = theMoment;
}
return false;

return this._fileDate = this.stats.startAt;
}

getName(){
Expand All @@ -124,7 +102,7 @@ export default class Replay extends CacheableDataObject {
const characters = this.getCharacters();
const stage = this.settings.stage;

return `${characters.map(character=>character.name).join(` vs `)} on ${stage.name} - ${this.getMatchTime()}`;
return `${characters.map(character=>character.name).join(` vs `)} on ${stage.name}`;
}
}

Expand Down Expand Up @@ -155,7 +133,6 @@ export default class Replay extends CacheableDataObject {
getStats(){
if(!this.isReadable())
{
console.log('not readable?!');
return null;
}
if(this.stats === null){
Expand Down Expand Up @@ -299,7 +276,6 @@ export default class Replay extends CacheableDataObject {
this._parsedMetaData = true;

this.settings.players = this.settings.players.map((player)=> {
console.log('replacing player at ', this.settings.players);
return SlippiPlayer.create(player)
});
this.settings.stage = MeleeStage.retrieve(this.settings.stageId);
Expand Down
3 changes: 3 additions & 0 deletions app/yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,6 @@
# yarn lockfile v1


"@fortawesome/fontawesome-free@^5.3.1":
version "5.3.1"
resolved "https://registry.yarnpkg.com/@fortawesome/fontawesome-free/-/fontawesome-free-5.3.1.tgz#5466b8f31c1f493a96754c1426c25796d0633dd9"
1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,6 @@
"yarn": "^1.9.2"
},
"dependencies": {
"@fortawesome/fontawesome-free": "^5.2.0",
"app-root-path": "^2.1.0",
"auto-launch": "^5.0.5",
"client-oauth2": "^4.2.1",
Expand Down
2 changes: 1 addition & 1 deletion webpack.config.renderer.prod.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ export default merge.smart(baseConfig, {

output: {
path: path.join(__dirname, 'app/dist'),
publicPath: './dist/',
publicPath: '',
filename: 'renderer.prod.js'
},

Expand Down
4 changes: 0 additions & 4 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -100,10 +100,6 @@
lodash "^4.2.0"
to-fast-properties "^2.0.0"

"@fortawesome/fontawesome-free@^5.2.0":
version "5.2.0"
resolved "https://registry.yarnpkg.com/@fortawesome/fontawesome-free/-/fontawesome-free-5.2.0.tgz#50cd9856774351c56c0b1b0db4efe122d7913e58"

"@mrmlnc/readdir-enhanced@^2.2.1":
version "2.2.1"
resolved "https://registry.yarnpkg.com/@mrmlnc/readdir-enhanced/-/readdir-enhanced-2.2.1.tgz#524af240d1a360527b730475ecfa1344aa540dde"
Expand Down

0 comments on commit 5692270

Please sign in to comment.