Skip to content
Open
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 phira-monitor/src/launch.rs
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ pub fn launch_task(id: i32, players: Vec<UserInfo>) -> Result<LaunchTask> {
for _ in 0..players.len() {
charts.push(GameScene::load_chart(fs.as_mut(), &info).await?.0);
}
let loading_scene = LoadingScene::new(GameMode::View, info, config, fs, None, None, None, None, None).await?;
let loading_scene = LoadingScene::new(GameMode::View, info, config, fs, None, None, None, None, None, None, None).await?;
let game_scene = loading_scene.load_task.unwrap().await?;

let views = players
Expand Down
8 changes: 8 additions & 0 deletions phira/locales/de-DE/replay_list.ftl
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
label = Replay List
chart-not-found = Could not find matching chart: { $chart }
load-failed = Failed to load replay
favorites-only = Favorites only
chart-empty = No replays for this chart
empty = No replays yet
empty-hint = Start playing after turning on "Auto-record replay"; replays will appear here
replay-count = { $count } replays
8 changes: 8 additions & 0 deletions phira/locales/en-US/replay_list.ftl
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
label = Replay List
chart-not-found = Could not find matching chart: { $chart }
load-failed = Failed to load replay
favorites-only = Favorites only
chart-empty = No replays for this chart
empty = No replays yet
empty-hint = Start playing after turning on "Auto-record replay"; replays will appear here
replay-count = { $count } replays
3 changes: 3 additions & 0 deletions phira/locales/en-US/settings.ftl
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,9 @@ item-opt = Chart Optimization
item-opt-sub = Significantly increase peformance while playing. (If unintended behavior arises, disable this.)
item-use-keyboard = Use Keyboard
item-use-keyboard-sub = Enable keyboard input for gameplay. Scores cannot be uploaded when enabled.

item-auto-record = Auto-record replays
item-auto-record-sub = Replays are saved automatically. View them from Home → Replays.
item-prefer-reduced-motion = Prefer Reduced Motion
item-prefer-reduced-motion-sub = Reduce animations and visual effects
item-speed = Speed
Expand Down
8 changes: 8 additions & 0 deletions phira/locales/fr-FR/replay_list.ftl
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
label = Replay List
chart-not-found = Could not find matching chart: { $chart }
load-failed = Failed to load replay
favorites-only = Favorites only
chart-empty = No replays for this chart
empty = No replays yet
empty-hint = Start playing after turning on "Auto-record replay"; replays will appear here
replay-count = { $count } replays
8 changes: 8 additions & 0 deletions phira/locales/id-ID/replay_list.ftl
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
label = Replay List
chart-not-found = Could not find matching chart: { $chart }
load-failed = Failed to load replay
favorites-only = Favorites only
chart-empty = No replays for this chart
empty = No replays yet
empty-hint = Start playing after turning on "Auto-record replay"; replays will appear here
replay-count = { $count } replays
8 changes: 8 additions & 0 deletions phira/locales/ja-JP/replay_list.ftl
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
label = Replay List
chart-not-found = Could not find matching chart: { $chart }
load-failed = Failed to load replay
favorites-only = Favorites only
chart-empty = No replays for this chart
empty = No replays yet
empty-hint = Start playing after turning on "Auto-record replay"; replays will appear here
replay-count = { $count } replays
8 changes: 8 additions & 0 deletions phira/locales/ko-KR/replay_list.ftl
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
label = Replay List
chart-not-found = Could not find matching chart: { $chart }
load-failed = Failed to load replay
favorites-only = Favorites only
chart-empty = No replays for this chart
empty = No replays yet
empty-hint = Start playing after turning on "Auto-record replay"; replays will appear here
replay-count = { $count } replays
8 changes: 8 additions & 0 deletions phira/locales/mn-MN/replay_list.ftl
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
label = Replay List
chart-not-found = Could not find matching chart: { $chart }
load-failed = Failed to load replay
favorites-only = Favorites only
chart-empty = No replays for this chart
empty = No replays yet
empty-hint = Start playing after turning on "Auto-record replay"; replays will appear here
replay-count = { $count } replays
8 changes: 8 additions & 0 deletions phira/locales/pl-PL/replay_list.ftl
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
label = Replay List
chart-not-found = Could not find matching chart: { $chart }
load-failed = Failed to load replay
favorites-only = Favorites only
chart-empty = No replays for this chart
empty = No replays yet
empty-hint = Start playing after turning on "Auto-record replay"; replays will appear here
replay-count = { $count } replays
8 changes: 8 additions & 0 deletions phira/locales/pt-BR/replay_list.ftl
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
label = Replay List
chart-not-found = Could not find matching chart: { $chart }
load-failed = Failed to load replay
favorites-only = Favorites only
chart-empty = No replays for this chart
empty = No replays yet
empty-hint = Start playing after turning on "Auto-record replay"; replays will appear here
replay-count = { $count } replays
8 changes: 8 additions & 0 deletions phira/locales/ru-RU/replay_list.ftl
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
label = Replay List
chart-not-found = Could not find matching chart: { $chart }
load-failed = Failed to load replay
favorites-only = Favorites only
chart-empty = No replays for this chart
empty = No replays yet
empty-hint = Start playing after turning on "Auto-record replay"; replays will appear here
replay-count = { $count } replays
8 changes: 8 additions & 0 deletions phira/locales/th-TH/replay_list.ftl
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
label = Replay List
chart-not-found = Could not find matching chart: { $chart }
load-failed = Failed to load replay
favorites-only = Favorites only
chart-empty = No replays for this chart
empty = No replays yet
empty-hint = Start playing after turning on "Auto-record replay"; replays will appear here
replay-count = { $count } replays
8 changes: 8 additions & 0 deletions phira/locales/tr-TR/replay_list.ftl
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
label = Replay List
chart-not-found = Could not find matching chart: { $chart }
load-failed = Failed to load replay
favorites-only = Favorites only
chart-empty = No replays for this chart
empty = No replays yet
empty-hint = Start playing after turning on "Auto-record replay"; replays will appear here
replay-count = { $count } replays
8 changes: 8 additions & 0 deletions phira/locales/vi-VN/replay_list.ftl
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
label = Replay List
chart-not-found = Could not find matching chart: { $chart }
load-failed = Failed to load replay
favorites-only = Favorites only
chart-empty = No replays for this chart
empty = No replays yet
empty-hint = Start playing after turning on "Auto-record replay"; replays will appear here
replay-count = { $count } replays
8 changes: 8 additions & 0 deletions phira/locales/zh-CN/replay_list.ftl
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
label = 回放列表
chart-not-found = 找不到对应的谱面:{ $chart }
load-failed = 加载回放失败
favorites-only = 仅显示收藏
chart-empty = 此谱面暂无回放
empty = 还没有任何回放
empty-hint = 打开 "自动录制回放" 后开始游玩,回放会出现在这里
replay-count = { $count } 个回放
3 changes: 3 additions & 0 deletions phira/locales/zh-CN/settings.ftl
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,9 @@ item-opt = 激进优化
item-opt-sub = 采用激进的优化策略,提升性能但可能导致部分谱面显示出错
item-use-keyboard = 使用键盘游玩
item-use-keyboard-sub = 开启后可以使用键盘进行游戏,但成绩无法上传

item-auto-record = 自动录制回放
item-auto-record-sub = 自动保存回放,可在首页 → 回放中查看
item-prefer-reduced-motion = 减少动画效果
item-prefer-reduced-motion-sub = 减少动画和视觉特效
item-speed = 速度
Expand Down
8 changes: 8 additions & 0 deletions phira/locales/zh-TW/replay_list.ftl
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
label = 回放列表
chart-not-found = 找不到對應的譜面:{ $chart }
load-failed = 載入回放失敗
favorites-only = 僅顯示收藏
chart-empty = 此譜面暫無回放
empty = 還沒有任何回放
empty-hint = 開啟 "自動錄製回放" 後開始遊玩,回放會顯示在這裡
replay-count = { $count } 個回放
4 changes: 4 additions & 0 deletions phira/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,10 @@ mod dir {
pub fn respacks() -> Result<String> {
ensure("data/respack")
}

pub fn replays() -> Result<String> {
ensure("data/replays")
}
}

async fn the_main() -> Result<()> {
Expand Down
3 changes: 3 additions & 0 deletions phira/src/page.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,9 @@ pub use respack::{ResPackItem, ResPackPage};

mod settings;
pub use settings::SettingsPage;

mod replay_list;
pub use replay_list::ReplayListPage;
use tokio::sync::Notify;

use crate::{
Expand Down
26 changes: 20 additions & 6 deletions phira/src/page/home.rs
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ pub struct HomePage {
btn_play: DRectButton,
btn_event: DRectButton,
btn_respack: DRectButton,
btn_replay: DRectButton,
btn_msg: DRectButton,
btn_settings: DRectButton,
btn_user: DRectButton,
Expand Down Expand Up @@ -132,6 +133,7 @@ impl HomePage {
btn_play: DRectButton::new().with_delta(-0.01).no_sound(),
btn_event: DRectButton::new().with_elevation(0.002).no_sound(),
btn_respack: DRectButton::new().with_elevation(0.002).no_sound(),
btn_replay: DRectButton::new().with_radius(0.008).with_delta(-0.003).with_elevation(0.002),
btn_msg: DRectButton::new().with_radius(0.008).with_delta(-0.003).with_elevation(0.002),
btn_settings: DRectButton::new().with_radius(0.008).with_delta(-0.003).with_elevation(0.002),
btn_user: DRectButton::new().with_delta(-0.003),
Expand Down Expand Up @@ -343,21 +345,28 @@ impl HomePage {
let lf = r.right() + 0.02;

s.render_fader(ui, |ui| {
let r = Rect::new(lf, top, 0.11, 0.11);
let r = Rect::new(lf, top, 0.11, 0.07);
self.btn_msg.render_shadow(ui, r, t, |ui, path| {
ui.fill_path(&path, semi_black(0.4));
let r = r.feather(-0.01);
let r = r.feather(-0.005);
ui.fill_rect(r, (*self.icons.msg, r, ScaleType::Fit));
if self.has_new {
let pad = 0.007;
ui.fill_circle(r.right() - pad, r.y + pad, 0.01, RED);
let pad = 0.006;
ui.fill_circle(r.right() - pad, r.y + pad, 0.008, RED);
}
});

let r = Rect::new(lf, top + 0.12, 0.11, 0.11);
let r = Rect::new(lf, top + 0.08, 0.11, 0.07);
self.btn_replay.render_shadow(ui, r, t, |ui, path| {
ui.fill_path(&path, semi_black(0.4));
let r = r.feather(-0.005);
ui.fill_rect(r, (*self.icons.play, r, ScaleType::Fit));
});

let r = Rect::new(lf, top + 0.16, 0.11, 0.07);
self.btn_settings.render_shadow(ui, r, t, |ui, path| {
ui.fill_path(&path, semi_black(0.4));
let r = r.feather(0.004);
let r = r.feather(-0.005);
ui.fill_rect(r, (*self.icons.settings, r, ScaleType::Fit));
});
});
Expand Down Expand Up @@ -413,6 +422,11 @@ impl Page for HomePage {
self.next_page = Some(NextPage::Overlay(Box::new(MessagePage::new(Arc::clone(&self.icons), s.icons.clone()))));
return Ok(true);
}
if self.btn_replay.touch(touch, t) {
button_hit_large();
self.next_page = Some(NextPage::Overlay(Box::new(super::ReplayListPage::new(Arc::clone(&self.icons), s.icons.clone())?)));
return Ok(true);
}
if self.btn_settings.touch(touch, t) {
self.next_page = Some(NextPage::Overlay(Box::new(SettingsPage::new(self.icons.icon.clone(), self.icons.lang.clone()))));
return Ok(true);
Expand Down
Loading