[Chapter 66] Tooltip bug on casting a targeted spell
まだ誰も着手していません。
評価
調査の方向性
chapter-66-spells/src/inventory_system/mod.rs の 41 行目と chapter-66-spells/src/gui.rs の 51 行目から始め、draw_tooltips、get_item_display_name、obfuscate_name が Position はあるものの Name がないエンティティをどのように扱っているかを追ってください。タイルにカーソルを合わせた状態で、Zap のような対象指定の呪文を詠唱して問題を再現します。完了条件は、期待されるパーティクルによって Nameless item (bug) ツールチップが表示されなくなり、名前付きの関数が報告されたバグを回避するようリファクタリングされていることです。
索引モデルが issue の本文から書いたものです。
説明
https://github.com/amethyst/rustrogueliketutorial/blob/33872fe582f226178436847e1f74eafcbf9c0d1a/chapter-66-spells/src/inventory_system/mod.rs#L41
https://github.com/amethyst/rustrogueliketutorial/blob/33872fe582f226178436847e1f74eafcbf9c0d1a/chapter-66-spells/src/gui.rs#L51
When casting a targeted spell (like Zap), a tooltip will be displayed with the Nameless item (bug) string.
This is because the tooltip logic will loop on every entity with a Position component and try to display it.
However, when spawning a Particle, it is expected for it to have a Position but no Name.
When casting the spell, a Particle is spawned on the exact tile the player is hovering, so the draw_tooltips logic catches it and tries to display it. But since it has no Name (which is expected), it displays this string.
We need to either:
- Filter entities we pass to
get_item_display_namedifferently so particles are omitted - Return
Nonefor an entity with noNamecomponent
Additionally, the code for get_item_display_name and obfuscate_name should be refactored to avoid bugs.
(get_item_display_name could simply get the proper stores and call obfuscate_name.)
- 主要言語
- Rust
- スター
- 968
- フォーク
- 166
- PR マージ指標
- 30日以内にマージされた PR はありません
環境構築
このプロジェクトの環境構築ファイルはまだ確認していません。まず README を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
amethyst/rustrogueliketutorial のほかの issue
-
難易度 1/5 1時間未満 初心者へのやさしさ 68/100
-
難易度 1/5 1時間未満 初心者へのやさしさ 68/100
-
難易度 1/5 1時間未満 初心者へのやさしさ 68/100
-
難易度 1/5 1時間未満 初心者へのやさしさ 68/100
-
難易度 1/5 1〜3時間 初心者へのやさしさ 45/100
amethyst/rustrogueliketutorial の issue をすべて見る
似ている issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
メンテナーはふだん 1 日以内に返信
-
難易度 1/5 1時間未満 初心者へのやさしさ 92/100
bytecodealliance/wasmtime#14433 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
-
難易度 2/5 1〜3時間 初心者へのやさしさ 88/100
メンテナーはふだん 1 日以内に返信