Skip to content
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
2 changes: 1 addition & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ jobs:
- name: Install Rust components
if: matrix.workspace == 'truncate_client'
run: |-
cargo install -f wasm-bindgen-cli --version 0.2.93
cargo install -f wasm-bindgen-cli --version 0.2.100
rustup target add wasm32-unknown-unknown

- name: Test
Expand Down
25 changes: 14 additions & 11 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 10 additions & 2 deletions Dockerfile.client
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,23 @@ RUN apt-get update && apt-get install -y \
cmake \
curl \
git \
binaryen \
jq

# Install latest binaryen release
RUN mkdir -p /tmp/binaryen \
&& curl -L https://github.com/WebAssembly/binaryen/releases/download/version_123/binaryen-version_123-x86_64-linux.tar.gz -o /tmp/binaryen.tar.gz \
&& tar -xzf /tmp/binaryen.tar.gz -C /tmp/binaryen --strip-components=1 \
&& cp -r /tmp/binaryen/bin/* /usr/local/bin/ \
&& cp -r /tmp/binaryen/lib/* /usr/local/lib/ \
&& cp -r /tmp/binaryen/include/* /usr/local/include/ \
&& rm -rf /tmp/binaryen /tmp/binaryen.tar.gz

RUN curl -fsSL https://deb.nodesource.com/setup_18.x | bash -
RUN apt-get install -y nodejs

RUN curl https://rustwasm.github.io/wasm-pack/installer/init.sh -sSf | sh
# Keep this wasm-bindgen-cli version aligned with the latest egui release's dependency
RUN cargo install -f wasm-bindgen-cli --version 0.2.93
RUN cargo install -f wasm-bindgen-cli --version 0.2.100
RUN rustup target add wasm32-unknown-unknown

RUN mkdir /app
Expand Down
54 changes: 36 additions & 18 deletions truncate_client/src/app_inner.rs
Original file line number Diff line number Diff line change
Expand Up @@ -128,24 +128,30 @@ pub fn render(outer: &mut OuterApplication, ui: &mut egui::Ui, current_time: Dur

if tutorial.priority == Some(ChangePriority::High) {
outer.event_dispatcher.event(format!("interrupt_{unread}"));
let changelog_ui = outer.inner_storage.changelog_ui.get_or_insert_with(|| {
ChangelogSplashUI::new(splash_message.clone(), current_time)
.with_button(
"view",
"VIEW SCENARIO".to_string(),
outer.theme.button_primary,
)
.with_button(
"skip",
"REMIND ME LATER".to_string(),
outer.theme.button_primary,
)
.with_button(
"ignore",
"IGNORE FOREVER".to_string(),
outer.theme.button_scary,
)
});
let changelog_ui =
outer.inner_storage.changelog_ui.get_or_insert_with(|| {
if tutorial.rules.is_empty() {
ChangelogSplashUI::new(splash_message.clone(), current_time)
.with_button("okay", "OKAY".to_string(), outer.theme.button_primary)
} else {
ChangelogSplashUI::new(splash_message.clone(), current_time)
.with_button(
"view",
"VIEW SCENARIO".to_string(),
outer.theme.button_primary,
)
.with_button(
"skip",
"REMIND ME LATER".to_string(),
outer.theme.button_primary,
)
.with_button(
"ignore",
"IGNORE FOREVER".to_string(),
outer.theme.button_scary,
)
}
});

let resp = changelog_ui.render(ui, &outer.theme, current_time, &outer.map_texture);

Expand Down Expand Up @@ -192,6 +198,18 @@ pub fn render(outer: &mut OuterApplication, ui: &mut egui::Ui, current_time: Dur
break;
}

if resp.clicked == Some("okay") {
outer
.event_dispatcher
.event(format!("interrupt_okay_{unread}"));
outer.unread_changelogs = vec![];
outer
.tx_player
.try_send(PlayerMessage::MarkChangelogRead(unread.clone()))
.unwrap();
break;
}

return;
}
}
Expand Down
Loading
Loading