Skip to content

Commit

Permalink
fear: permit modifying image location
Browse files Browse the repository at this point in the history
* users can now specify an image offset (left/right, up/down)

#24
  • Loading branch information
Wrycu committed May 26, 2021
1 parent a6dc107 commit 1959d2b
Show file tree
Hide file tree
Showing 5 changed files with 31 additions and 13 deletions.
4 changes: 4 additions & 0 deletions lang/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,10 @@
"ffg-star-wars-enhancements.opening-crawl.new": "New",
"ffg-star-wars-enhancements.opening-crawl.create-journal": "Create Journal",
"ffg-star-wars-enhancements.opening-crawl.launch": "Launch",
"ffg-star-wars-enhancements.opening-crawl.opening-crawl-image-right": "Image offset (from the right)",
"ffg-star-wars-enhancements.opening-crawl.opening-crawl-image-right-hint": "Percentage of the screen to move the image to the left by",
"ffg-star-wars-enhancements.opening-crawl.opening-crawl-image-bottom": "Image offset (from the bottom)",
"ffg-star-wars-enhancements.opening-crawl.opening-crawl-image-bottom-right": "Number of pixels to move the image up by",
"ffg-star-wars-enhancements.datapads.datapad-template": "Datapad Template",
"ffg-star-wars-enhancements.datapads.datapad": "Datapad",
"ffg-star-wars-enhancements.datapads.bounty": "Bounty",
Expand Down
1 change: 1 addition & 0 deletions release-notes.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
* Add count for Adversary status ([#40](https://github.com/wrycu/StarWarsFFG-Enhancements/issues/40))
* Intro crawl improvements ([#24](https://github.com/wrycu/StarWarsFFG-Enhancements/issues/24))
* Add a setting for delay of music playback
* Add settings for moving the image left/right and up/down
* Allow the removal of custom attack animations per item ([#39](https://github.com/wrycu/StarWarsFFG-Enhancements/issues/39))
* Fix for incomplete localization of dice spender (thanks `@prolice`!)
* Add French localization (thanks `@prolice`!)
Expand Down
22 changes: 21 additions & 1 deletion scripts/opening_crawl.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,22 @@ export function init() {
type: Number,
default: 0.0,
});
game.settings.register("ffg-star-wars-enhancements", "opening-crawl-image-right", {
name: game.i18n.localize('ffg-star-wars-enhancements.opening-crawl.opening-crawl-image-right'),
hint: game.i18n.localize('ffg-star-wars-enhancements.opening-crawl.opening-crawl-image-right-hint'),
scope: "world",
config: true,
type: Number,
default: 0,
});
game.settings.register("ffg-star-wars-enhancements", "opening-crawl-image-bottom", {
name: game.i18n.localize('ffg-star-wars-enhancements.opening-crawl.opening-crawl-image-bottom'),
hint: game.i18n.localize('ffg-star-wars-enhancements.opening-crawl.opening-crawl-image-bottom-hint'),
scope: "world",
config: true,
type: Number,
default: 1300,
});
log('opening-crawl', 'Initialized');
}

Expand Down Expand Up @@ -80,7 +96,11 @@ class OpeningCrawlApplication extends Application {
* @returns object provided to the constructor
*/
getData() {
return this.data;
let data = this.data;
data.img = {};
data.img.bottom = game.settings.get("ffg-star-wars-enhancements", "opening-crawl-image-bottom");
data.img.right = game.settings.get("ffg-star-wars-enhancements", "opening-crawl-image-right");
return data;
}

/**
Expand Down
15 changes: 4 additions & 11 deletions styles/opening_crawl.css
Original file line number Diff line number Diff line change
Expand Up @@ -4,19 +4,19 @@
* https://github.com/KasselLabs/StarWarsIntroCreator
*
* MIT License
*
*
* Copyright 2020 Kassel Labs <[email protected]>
*
*
* Permission is hereby granted, free of charge, to any person obtaining a copy of
* this software and associated documentation files (the "Software"), to deal in
* the Software without restriction, including without limitation the rights to
* use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
* of the Software, and to permit persons to whom the Software is furnished to do
* so, subject to the following conditions:
*
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
Expand Down Expand Up @@ -213,13 +213,6 @@
background: url("/modules/ffg-star-wars-enhancements/artwork/stars.png") repeat;
}

.ffg-star-wars-enhancements-opening-crawl .backgroundSpace img {
position: absolute;
bottom: 1300px;
right: 0;
}


.ffg-star-wars-enhancements-opening-crawl {
display: initial;
}
Expand Down
2 changes: 1 addition & 1 deletion templates/opening_crawl.html
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<div class="ffg-star-wars-enhancements-opening-crawl">
<div class="backgroundSpace">
{{#if image}}
<img src="{{image}}"/>
<img src="{{image}}" style="position: absolute; bottom: {{img.bottom}}px; right: {{img.right}}%;"/>
{{/if}}
</div>
<div class="animation">
Expand Down

0 comments on commit 1959d2b

Please sign in to comment.