Skip to content

Commit

Permalink
Merge pull request #202 from SymphonyVR/master
Browse files Browse the repository at this point in the history
Some bugfixes (upscaling, preanimation, webp on char buttons, viewport layout)
  • Loading branch information
stonedDiscord committed Nov 23, 2023
2 parents 26e3cd4 + f126caa commit 0bde198
Show file tree
Hide file tree
Showing 4 changed files with 44 additions and 16 deletions.
18 changes: 15 additions & 3 deletions webAO/packets/handlers/handlePV.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,20 @@ export const handlePV = async (args: string[]) => {
}
// Make sure the asset server is case insensitive, or that everything on it is lowercase

const extensionsMap = [".png", ".webp"];
let url;
for (const extension of extensionsMap) {
url = `${AO_HOST}characters/${encodeURI(
me.name.toLowerCase()
)}/emotions/button${i}_off${extension}`;

const exists = await fileExists(url);

if (exists) {
break;
}
}

emotes[i] = {
desc: emoteinfo[0].toLowerCase(),
preanim: emoteinfo[1].toLowerCase(),
Expand All @@ -55,9 +69,7 @@ export const handlePV = async (args: string[]) => {
frame_screenshake: "",
frame_realization: "",
frame_sfx: "",
button: `${AO_HOST}characters/${encodeURI(
me.name.toLowerCase()
)}/emotions/button${i}_off.png`,
button: url,
};

const emote_item = new Image();
Expand Down
22 changes: 12 additions & 10 deletions webAO/styles/client.css
Original file line number Diff line number Diff line change
Expand Up @@ -241,15 +241,15 @@
}

.def_court {
object-position: left;
object-position: center;
}

.wit_court {
object-position: center;
}

.pro_court {
object-position: right;
object-position: center;
}

#client_fullview {
Expand Down Expand Up @@ -278,11 +278,11 @@
.client_char>img {
position: absolute;
height: 100%;
width: 100%;
bottom: 0;
left: 0;
object-fit: cover;
object-position: 50% 0;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);

}

#client_bench_classic {
Expand Down Expand Up @@ -311,17 +311,19 @@

.client_bench {
position: absolute;
height: auto;
width: 100%;
height: 100%;
bottom: 0;
object-fit: contain;
}

#client_fg {
position: absolute;
height: 100%;
width: 100%;
bottom: 0;
left: 0;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
}

#client_evi {
Expand Down Expand Up @@ -725,4 +727,4 @@
.hrtext:after {
left: 0.5em;
margin-right: -50%;
}
}
14 changes: 14 additions & 0 deletions webAO/styles/default.css
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,25 @@ body {
font-family: sans-serif;
}

@media (max-height: 270x) {
img {
image-rendering: crisp-edges;
image-rendering: pixelated;
}

}

img {
image-rendering: auto;
}

img[src$=".gif"],
img[src$=".apng"] {
image-rendering: crisp-edges;
image-rendering: pixelated;
}


.client_button {
margin: 1px;
padding: 2px 15px;
Expand Down
6 changes: 3 additions & 3 deletions webAO/viewport/viewport.ts
Original file line number Diff line number Diff line change
Expand Up @@ -234,9 +234,6 @@ const viewport = (): Viewport => {
// note: this is called fairly often
// do not perform heavy operations here
await delay(chatmsg.speed);
if (textnow === chatmsg.content) {
return;
}

const gamewindow = document.getElementById("client_gamewindow");
const waitingBox = document.getElementById("client_chatwaiting");
Expand Down Expand Up @@ -444,6 +441,9 @@ const viewport = (): Viewport => {
);
}
}
if (textnow === chatmsg.content) {
return;
}
if (animating) {
chat_tick();
}
Expand Down

0 comments on commit 0bde198

Please sign in to comment.