Skip to content

Commit

Permalink
Enhanced wallpaper anchoring. (#47)
Browse files Browse the repository at this point in the history
* Working on wallpaper anchoring

* Applying anchoring now

* Updated changelog and bump version to v9.0.1
  • Loading branch information
Unthrottled authored Feb 20, 2021
1 parent 3e49548 commit 35c0f23
Show file tree
Hide file tree
Showing 22 changed files with 109 additions and 9 deletions.
9 changes: 9 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,14 @@
# Change Log

# 9.0.1 [Wallpaper Anchoring]

- Updated the anchoring of various theme's wallpapers so that you can see your waifu!
- Be sure to re-install the stickers for this to take effect.

| Before | After |
| --- | --- |
| ![Screenshot from 2021-02-20 06-10-01](https://user-images.githubusercontent.com/15972415/108594985-e14eb680-7342-11eb-8afc-09afe2bc9af0.png) | ![Screenshot from 2021-02-20 06-09-22](https://user-images.githubusercontent.com/15972415/108594986-e3187a00-7342-11eb-819c-30e49ea16cfe.png) |

# 9.0.0 [Zero Two, Sakurajima Mai]

## 4 New Themes
Expand Down
14 changes: 14 additions & 0 deletions buildSrc/BuildThemes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -112,13 +112,23 @@ interface Stickers {
normal?: string;
}

interface BackgroundPositioning {
anchor: string;
}

interface BackgroundPositionings {
default?: BackgroundPositioning;
secondary?: BackgroundPositioning;
}

export interface VSCodeDokiThemeDefinition {
id: string;
overrides: Overrides;
laf: {
extends: string;
ui: StringDictonary<string>;
};
backgrounds?: BackgroundPositionings;
syntax: {};
colors: {};
}
Expand Down Expand Up @@ -369,6 +379,7 @@ function createDokiTheme(
return {
path: swapMasterThemeForLocalTheme(dokiFileDefinitionPath),
definition: dokiThemeDefinition,
backgrounds: dokiThemeVSCodeDefinition.backgrounds,
theme: buildVSCodeTheme(
dokiThemeDefinition,
dokiThemeVSCodeDefinition,
Expand Down Expand Up @@ -439,16 +450,19 @@ const getStickers = (
) => {
const secondary =
dokiDefinition.stickers.secondary || dokiDefinition.stickers.normal;
const backgrounds = dokiTheme.backgrounds;
return {
default: {
path: resolveStickerPath(dokiTheme.path, dokiDefinition.stickers.default),
name: dokiDefinition.stickers.default,
anchoring: backgrounds?.default?.anchor || "center",
},
...(secondary
? {
secondary: {
path: resolveStickerPath(dokiTheme.path, secondary),
name: secondary,
anchoring: backgrounds?.secondary?.anchor || "center",
},
}
: {}),
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"displayName": "The Doki Theme",
"description": "A bunch of themes with cute anime girls. Code with your waifu!",
"publisher": "unthrottled",
"version": "9.0.0",
"version": "9.0.1",
"license": "MIT",
"icon": "Doki-Theme.png",
"galleryBanner": {
Expand Down
1 change: 1 addition & 0 deletions src/DokiTheme.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,4 +24,5 @@ export interface DokiSticker {
export interface Sticker {
path: string;
name: string;
anchoring: string;
}
2 changes: 1 addition & 1 deletion src/NotificationService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { VSCodeGlobals } from "./VSCodeGlobals";
import { attemptToGreetUser } from "./WelcomeService";

const SAVED_VERSION = "doki.theme.version";
const DOKI_THEME_VERSION = "v9.0.0";
const DOKI_THEME_VERSION = "v9.0.1";

export function attemptToNotifyUpdates(context: vscode.ExtensionContext) {
const savedVersion = VSCodeGlobals.globalState.get(SAVED_VERSION);
Expand Down
4 changes: 3 additions & 1 deletion src/StickerService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ function getVsCodeCss() {
function buildStickerCss({
stickerDataURL: stickerUrl,
backgroundImageURL: wallpaperUrl,
backgroundAnchoring,
}: DokiStickers): string {
const style =
"content:'';pointer-events:none;position:absolute;z-index:9001;width:100%;height:100%;background-position:100% 97%;background-repeat:no-repeat;opacity:1;";
Expand All @@ -37,7 +38,7 @@ function buildStickerCss({
/* Background Image */
.monaco-workbench .part.editor > .content {
background-image: url('${wallpaperUrl}') !important;
background-position: center;
background-position: ${backgroundAnchoring};
background-size: cover;
content:'';
z-index:9001;
Expand Down Expand Up @@ -69,6 +70,7 @@ function canWrite(): boolean {
export interface DokiStickers {
stickerDataURL: string;
backgroundImageURL: string;
backgroundAnchoring: string;
}

export async function installStickersAndWallPaper(
Expand Down
2 changes: 2 additions & 0 deletions src/StickerUpdateService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ export const attemptToUpdateSticker = async (
return {
stickerDataURL: remoteStickerUrl,
backgroundImageURL: remoteWallpaperUrl,
backgroundAnchoring: currentSticker.anchoring,
};
}

Expand All @@ -40,6 +41,7 @@ export const attemptToUpdateSticker = async (
return {
stickerDataURL: createCssDokiAssetUrl(localStickerPath),
backgroundImageURL: createCssDokiAssetUrl(localWallpaperPath),
backgroundAnchoring: currentSticker.anchoring,
};
};

Expand Down
18 changes: 12 additions & 6 deletions src/WelcomeService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,17 +34,23 @@ export function attemptToGreetUser(context: vscode.ExtensionContext) {
You can choose themes from the following Doki-Doki Theme Suites such as:
</p>
<ul>
<li>Darling in the Franxx</li>
<li>DanganRonpa</li>
<li>Doki-Doki Literature Club</li>
<li>Re:Zero</li>
<li>Fate</li>
<li>Gate</li>
<li>High School DxD</li>
<li>Kill La Kill</li>
<li>KonoSuba</li>
<li>DanganRonpa</li>
<li>High School DxD</li>
<li>Live Live!</li>
<li>Lucky Star</li>
<li>Sword Art Online</li>
<li>Fate</li>
<li>Gate</li>
<li>Miss Kobayashi's Dragon Maid</li>
<li>Neon Genesis Evangelion</li>
<li>OreGairu</li>
<li>Re:Zero</li>
<li>Rascal does not dream of bunny girl senpai</li>
<li>Steins Gate</li>
<li>Sword Art Online</li>
</ul>
<h2>Stickers!</h2>
<p>
Expand Down
1 change: 1 addition & 0 deletions src/extension.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import {attemptToUpdateSticker} from "./StickerUpdateService";
export interface Sticker {
path: string;
name: string;
anchoring: string;
}

export interface DokiThemeDefinition {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,11 @@
"extends": "dark-contrast",
"ui": {}
},
"backgrounds": {
"secondary": {
"anchor": "right"
}
},
"syntax": {},
"colors": {}
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,11 @@
"id": "98878c8e-9f91-4e25-930d-dd7d280d9e35",
"overrides": {},
"laf": {},
"backgrounds": {
"secondary": {
"anchor": "right"
}
},
"syntax": {},
"colors": {
"selectionBackground":"#d3d5f1"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,11 @@
"id": "420b0ed5-803c-4127-97e3-dae6aa1a5972",
"overrides": {},
"laf": {},
"backgrounds": {
"default": {
"anchor": "right"
}
},
"syntax": {},
"colors": {}
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,11 @@
"id": "697e8564-0975-4907-a34c-51f65177ebf3",
"overrides": {},
"laf": {},
"backgrounds": {
"default": {
"anchor": "right"
}
},
"syntax": {},
"colors": {}
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,11 @@
"id": "19b65ec8-133c-4655-a77b-13623d8e97d3",
"overrides": {},
"laf": {},
"backgrounds": {
"default": {
"anchor": "right"
}
},
"syntax": {},
"colors": {}
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,11 @@
"id": "a7e0aa28-739a-4671-80ae-3980997e6b71",
"overrides": {},
"laf": {},
"backgrounds": {
"default": {
"anchor": "right"
}
},
"syntax": {},
"colors": {}
}
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,11 @@
"activityBar.background": "&headerColor&"
}
},
"backgrounds": {
"default": {
"anchor": "right"
}
},
"syntax": {},
"colors": {}
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,11 @@
"id": "06143cbe-2d51-4423-9a93-73a02c828119",
"overrides": {},
"laf": {},
"backgrounds": {
"default": {
"anchor": "right"
}
},
"syntax": {},
"colors": {}
}
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,11 @@
"scrollbarSlider.activeBackground": "&accentColorSecondary&9A"
}
},
"backgrounds": {
"default": {
"anchor": "right"
}
},
"syntax": {},
"colors": {}
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,11 @@
"id": "696de7c1-3a8e-4445-83ee-3eb7e9dca47f",
"overrides": {},
"laf": {},
"backgrounds": {
"default": {
"anchor": "right"
}
},
"syntax": {},
"colors": {}
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,11 @@
"id": "e828aaae-aa8c-4084-8993-d64697146930",
"overrides": {},
"laf": {},
"backgrounds": {
"default": {
"anchor": "right"
}
},
"syntax": {},
"colors": {}
}
5 changes: 5 additions & 0 deletions themes/definitions/reZero/ram/ram.vsCode.definition.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,11 @@
"extends": "dark-contrast",
"ui": {}
},
"backgrounds": {
"default": {
"anchor": "right"
}
},
"syntax": {},
"colors": {}
}
5 changes: 5 additions & 0 deletions themes/definitions/reZero/rem/rem.vsCode.definition.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,11 @@
"id": "f770dcfc-f41e-4b49-aa17-66e9ffc208fd",
"overrides": {},
"laf": {},
"backgrounds": {
"default": {
"anchor": "right"
}
},
"syntax": {},
"colors": {}
}

0 comments on commit 35c0f23

Please sign in to comment.