Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Some bugfixes (upscaling, preanimation, webp on char buttons, viewport layout) #202

Merged
merged 6 commits into from
Nov 23, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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%;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

some benches are only a picture of the bench and this way they would stretch the entire height of the viewport and block it

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

bancodefensa

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
Loading