After Width: | Height: | Size: 4.0 KiB |
After Width: | Height: | Size: 2.4 KiB |
After Width: | Height: | Size: 3.4 KiB |
After Width: | Height: | Size: 3.3 KiB |
After Width: | Height: | Size: 3.4 KiB |
After Width: | Height: | Size: 2.3 KiB |
After Width: | Height: | Size: 2.8 KiB |
After Width: | Height: | Size: 3.8 KiB |
After Width: | Height: | Size: 1.2 KiB |
@ -0,0 +1,171 @@
|
||||
#ingame_HUD_StandaloneAdvantages {
|
||||
.content {
|
||||
@include S(width, 440px);
|
||||
@include S(min-height, 300px);
|
||||
}
|
||||
p {
|
||||
@include PlainText;
|
||||
}
|
||||
|
||||
.points {
|
||||
display: grid;
|
||||
grid-template-columns: 1fr 1fr;
|
||||
@include S(grid-column-gap, 10px);
|
||||
@include S(grid-row-gap, 20px);
|
||||
@include S(margin, 10px, 0, 20px);
|
||||
grid-template-rows: #{D(40px)};
|
||||
align-items: center;
|
||||
}
|
||||
.lowerBar {
|
||||
width: 100%;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
overflow: hidden;
|
||||
|
||||
> button {
|
||||
transition: opacity 0.12s ease-in-out;
|
||||
&:hover {
|
||||
opacity: 0.85;
|
||||
}
|
||||
}
|
||||
|
||||
.otherCloseButton {
|
||||
@include SuperSmallText;
|
||||
@include S(margin-right, 30px);
|
||||
color: #aaa;
|
||||
@include S(margin, 0);
|
||||
@include IncreasedClickArea(0px);
|
||||
@include S(margin-top, 15px);
|
||||
|
||||
@include InlineAnimation(5s ease-in-out) {
|
||||
0% {
|
||||
opacity: 0.05;
|
||||
}
|
||||
50% {
|
||||
opacity: 0.05;
|
||||
}
|
||||
100% {
|
||||
opacity: 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.steamLinkButton {
|
||||
@include IncreasedClickArea(5px);
|
||||
@include S(margin, 0);
|
||||
@include S(width, 180px);
|
||||
@include S(height, 40px);
|
||||
& {
|
||||
/* @load-async */
|
||||
background: #171a23 uiResource("get_on_steam.png") center center / contain no-repeat;
|
||||
}
|
||||
|
||||
@include S(border-radius, $globalBorderRadius);
|
||||
}
|
||||
}
|
||||
|
||||
.point {
|
||||
display: grid;
|
||||
grid-template-columns: #{D(55px)} auto;
|
||||
grid-template-rows: 1fr 1fr;
|
||||
|
||||
> strong {
|
||||
grid-column: 2 / 3;
|
||||
grid-row: 1 / 2;
|
||||
@include PlainText;
|
||||
text-transform: uppercase;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
> p {
|
||||
grid-column: 2 / 3;
|
||||
grid-row: 2 / 3;
|
||||
@include SuperSmallText;
|
||||
opacity: 0.8;
|
||||
}
|
||||
|
||||
background: transparent #{D(10px)} center / #{D(30px)} no-repeat;
|
||||
|
||||
&.levels {
|
||||
& {
|
||||
/* @load-async */
|
||||
background-image: uiResource("res/ui/icons/advantage_new_levels.png");
|
||||
}
|
||||
> strong {
|
||||
color: #f13555;
|
||||
}
|
||||
}
|
||||
|
||||
&.upgrades {
|
||||
& {
|
||||
/* @load-async */
|
||||
background-image: uiResource("res/ui/icons/advantage_upgrades.png");
|
||||
}
|
||||
> strong {
|
||||
color: #8a00ff;
|
||||
}
|
||||
}
|
||||
|
||||
&.buildings {
|
||||
& {
|
||||
/* @load-async */
|
||||
background-image: uiResource("res/ui/icons/advantage_buildings.png");
|
||||
}
|
||||
> strong {
|
||||
color: #3fce8b;
|
||||
}
|
||||
}
|
||||
|
||||
&.wires {
|
||||
& {
|
||||
/* @load-async */
|
||||
background-image: uiResource("res/ui/icons/advantage_wires.png");
|
||||
}
|
||||
> strong {
|
||||
color: #ef2fdb;
|
||||
}
|
||||
}
|
||||
|
||||
&.markers {
|
||||
& {
|
||||
/* @load-async */
|
||||
background-image: uiResource("res/ui/icons/advantage_markers.png");
|
||||
}
|
||||
> strong {
|
||||
color: #4294ff;
|
||||
}
|
||||
}
|
||||
|
||||
&.savegames {
|
||||
& {
|
||||
/* @load-async */
|
||||
background-image: uiResource("res/ui/icons/advantage_savegames.png");
|
||||
}
|
||||
> strong {
|
||||
color: #ff9500;
|
||||
}
|
||||
}
|
||||
|
||||
&.darkmode {
|
||||
& {
|
||||
/* @load-async */
|
||||
background-image: uiResource("res/ui/icons/advantage_dark_mode.png");
|
||||
}
|
||||
> strong {
|
||||
color: #292c32;
|
||||
}
|
||||
}
|
||||
|
||||
&.support {
|
||||
& {
|
||||
/* @load-async */
|
||||
background-image: uiResource("res/ui/icons/advantage_support.png");
|
||||
}
|
||||
> strong {
|
||||
color: #e72d2d;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
@ -1,22 +1,85 @@
|
||||
#ingame_HUD_Watermark {
|
||||
position: absolute;
|
||||
& {
|
||||
/* @load-async */
|
||||
background: uiResource("get_on_steam.png") center center / contain no-repeat;
|
||||
|
||||
@include S(border-radius, $globalBorderRadius);
|
||||
@include S(top, 70px);
|
||||
pointer-events: all;
|
||||
cursor: pointer;
|
||||
left: 50%;
|
||||
text-align: center;
|
||||
|
||||
background: rgba(207, 65, 65, 0.8);
|
||||
color: #fff;
|
||||
transform: translateX(-50%);
|
||||
@include PlainText;
|
||||
@include S(padding, 10px);
|
||||
|
||||
&:hover {
|
||||
transform: translateX(-50%) scale(1.02) !important;
|
||||
}
|
||||
|
||||
> strong {
|
||||
@include PlainText;
|
||||
text-transform: uppercase;
|
||||
}
|
||||
> p {
|
||||
@include SuperSmallText;
|
||||
opacity: 0.7;
|
||||
}
|
||||
|
||||
@include S(width, 110px);
|
||||
@include S(height, 40px);
|
||||
@include S(top, 10px);
|
||||
opacity: 0;
|
||||
|
||||
&.visible {
|
||||
@include InlineAnimation(0.5s ease-in-out) {
|
||||
0% {
|
||||
opacity: 0;
|
||||
}
|
||||
100% {
|
||||
opacity: 1;
|
||||
}
|
||||
}
|
||||
opacity: 1;
|
||||
}
|
||||
|
||||
&:not(.visible) {
|
||||
@include InlineAnimation(0.5s ease-in-out) {
|
||||
0% {
|
||||
opacity: 1;
|
||||
}
|
||||
100% {
|
||||
opacity: 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#ingame_HUD_WatermarkClicker {
|
||||
@include S(top, 55px);
|
||||
position: absolute;
|
||||
left: 50%;
|
||||
transform: translateX(-50%) !important;
|
||||
@include SuperSmallText;
|
||||
color: $colorBlueBright;
|
||||
text-transform: uppercase;
|
||||
pointer-events: all;
|
||||
cursor: pointer;
|
||||
@include S(left, 160px);
|
||||
display: flex;
|
||||
align-items: center;
|
||||
|
||||
transition: all 0.12s ease-in;
|
||||
transition-property: opacity, transform;
|
||||
transform: skewX(-0.5deg);
|
||||
&:hover {
|
||||
transform: skewX(-1deg) scale(1.02);
|
||||
opacity: 0.9;
|
||||
}
|
||||
|
||||
&::after {
|
||||
@include S(margin-left, 4px);
|
||||
content: "";
|
||||
@include S(width, 10px);
|
||||
@include S(height, 10px);
|
||||
display: inline-flex;
|
||||
background: center center / contain no-repeat;
|
||||
& {
|
||||
/* @load-async */
|
||||
background-image: uiResource("res/ui/icons/demo_steam_link_indicator.png");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -0,0 +1,84 @@
|
||||
import { THIRDPARTY_URLS } from "../../../core/config";
|
||||
import { InputReceiver } from "../../../core/input_receiver";
|
||||
import { makeDiv } from "../../../core/utils";
|
||||
import { T } from "../../../translations";
|
||||
import { BaseHUDPart } from "../base_hud_part";
|
||||
import { DynamicDomAttach } from "../dynamic_dom_attach";
|
||||
|
||||
const showIntervalSeconds = 30 * 60;
|
||||
|
||||
export class HUDStandaloneAdvantages extends BaseHUDPart {
|
||||
createElements(parent) {
|
||||
this.background = makeDiv(parent, "ingame_HUD_StandaloneAdvantages", ["ingameDialog"]);
|
||||
|
||||
// DIALOG Inner / Wrapper
|
||||
this.dialogInner = makeDiv(this.background, null, ["dialogInner"]);
|
||||
this.title = makeDiv(this.dialogInner, null, ["title"], T.ingame.standaloneAdvantages.title);
|
||||
this.contentDiv = makeDiv(
|
||||
this.dialogInner,
|
||||
null,
|
||||
["content"],
|
||||
`
|
||||
<div class="points">
|
||||
${Object.entries(T.ingame.standaloneAdvantages.points)
|
||||
.map(
|
||||
([key, trans]) => `
|
||||
<div class="point ${key}">
|
||||
<strong>${trans.title}</strong>
|
||||
<p>${trans.desc}</p>
|
||||
</div>`
|
||||
)
|
||||
.join("")}
|
||||
|
||||
</div>
|
||||
|
||||
<div class="lowerBar">
|
||||
<button class="steamLinkButton">
|
||||
<button class="otherCloseButton">${T.ingame.standaloneAdvantages.no_thanks}</button>
|
||||
</button>
|
||||
</div>
|
||||
`
|
||||
);
|
||||
|
||||
this.trackClicks(this.contentDiv.querySelector("button.steamLinkButton"), () => {
|
||||
this.root.app.analytics.trackUiClick("standalone_advantage_visit_steam");
|
||||
this.root.app.platformWrapper.openExternalLink(THIRDPARTY_URLS.standaloneStorePage + "?ref=savs");
|
||||
this.close();
|
||||
});
|
||||
this.trackClicks(this.contentDiv.querySelector("button.otherCloseButton"), () => {
|
||||
this.root.app.analytics.trackUiClick("standalone_advantage_no_thanks");
|
||||
this.close();
|
||||
});
|
||||
}
|
||||
|
||||
initialize() {
|
||||
this.domAttach = new DynamicDomAttach(this.root, this.background, {
|
||||
attachClass: "visible",
|
||||
});
|
||||
|
||||
this.inputReciever = new InputReceiver("standalone-advantages");
|
||||
this.close();
|
||||
|
||||
this.lastShown = this.root.gameIsFresh ? this.root.time.now() : 0;
|
||||
}
|
||||
|
||||
show() {
|
||||
this.lastShown = this.root.time.now();
|
||||
this.visible = true;
|
||||
this.root.app.inputMgr.makeSureAttachedAndOnTop(this.inputReciever);
|
||||
}
|
||||
|
||||
close() {
|
||||
this.visible = false;
|
||||
this.root.app.inputMgr.makeSureDetached(this.inputReciever);
|
||||
this.update();
|
||||
}
|
||||
|
||||
update() {
|
||||
if (!this.visible && this.root.time.now() - this.lastShown > showIntervalSeconds) {
|
||||
this.show();
|
||||
}
|
||||
|
||||
this.domAttach.update(this.visible);
|
||||
}
|
||||
}
|
@ -1,44 +1,67 @@
|
||||
import { BaseHUDPart } from "../base_hud_part";
|
||||
import { DrawParameters } from "../../../core/draw_parameters";
|
||||
import { makeDiv } from "../../../core/utils";
|
||||
import { THIRDPARTY_URLS } from "../../../core/config";
|
||||
import { makeDiv } from "../../../core/utils";
|
||||
import { T } from "../../../translations";
|
||||
import { BaseHUDPart } from "../base_hud_part";
|
||||
import { DynamicDomAttach } from "../dynamic_dom_attach";
|
||||
|
||||
export class HUDWatermark extends BaseHUDPart {
|
||||
createElements(parent) {
|
||||
this.element = makeDiv(parent, "ingame_HUD_Watermark");
|
||||
this.element = makeDiv(
|
||||
parent,
|
||||
"ingame_HUD_Watermark",
|
||||
[],
|
||||
`
|
||||
<strong>${T.ingame.watermark.title}</strong>
|
||||
<p>${T.ingame.watermark.desc}</p>
|
||||
`
|
||||
);
|
||||
|
||||
this.linkElement = makeDiv(
|
||||
parent,
|
||||
"ingame_HUD_WatermarkClicker",
|
||||
[],
|
||||
T.ingame.watermark.get_on_steam
|
||||
);
|
||||
this.trackClicks(this.linkElement, () => {
|
||||
this.root.app.analytics.trackUiClick("watermark_click_2_direct");
|
||||
this.root.app.platformWrapper.openExternalLink(THIRDPARTY_URLS.standaloneStorePage + "?ref=wtmd");
|
||||
});
|
||||
}
|
||||
|
||||
initialize() {
|
||||
this.trackClicks(this.element, this.onWatermarkClick);
|
||||
|
||||
this.domAttach = new DynamicDomAttach(this.root, this.element, {
|
||||
attachClass: "visible",
|
||||
timeToKeepSeconds: 0.5,
|
||||
});
|
||||
}
|
||||
|
||||
update() {
|
||||
this.domAttach.update(this.root.time.realtimeNow() % (G_IS_DEV ? 20 : 180) < 5);
|
||||
}
|
||||
|
||||
onWatermarkClick() {
|
||||
this.root.app.analytics.trackUiClick("watermark_click_2");
|
||||
this.root.app.platformWrapper.openExternalLink(THIRDPARTY_URLS.standaloneStorePage);
|
||||
this.root.app.analytics.trackUiClick("watermark_click_2_new");
|
||||
this.root.hud.parts.standaloneAdvantages.show();
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @param {DrawParameters} parameters
|
||||
* @param {import("../../../core/draw_utils").DrawParameters} parameters
|
||||
*/
|
||||
drawOverlays(parameters) {
|
||||
const w = this.root.gameWidth;
|
||||
const x = 280 * this.root.app.getEffectiveUiScale();
|
||||
|
||||
parameters.context.fillStyle = "#f77";
|
||||
parameters.context.font = "bold " + this.root.app.getEffectiveUiScale() * 17 + "px GameFont";
|
||||
// parameters.context.textAlign = "center";
|
||||
parameters.context.fillStyle = "rgba(230, 230, 230, 0.9)";
|
||||
parameters.context.font = "bold " + this.root.app.getEffectiveUiScale() * 40 + "px GameFont";
|
||||
parameters.context.textAlign = "center";
|
||||
parameters.context.fillText(
|
||||
T.demoBanners.title.toUpperCase(),
|
||||
x,
|
||||
this.root.app.getEffectiveUiScale() * 27
|
||||
w / 2,
|
||||
this.root.app.getEffectiveUiScale() * 50
|
||||
);
|
||||
|
||||
parameters.context.font = "bold " + this.root.app.getEffectiveUiScale() * 12 + "px GameFont";
|
||||
// parameters.context.textAlign = "center";
|
||||
parameters.context.fillText(T.demoBanners.intro, x, this.root.app.getEffectiveUiScale() * 45);
|
||||
|
||||
// parameters.context.textAlign = "left";
|
||||
parameters.context.textAlign = "left";
|
||||
}
|
||||
}
|
||||
|