Skip to content

Commit

Permalink
fix trophy viewer and models
Browse files Browse the repository at this point in the history
  • Loading branch information
mcfiredrill committed Apr 27, 2024
1 parent 7a9dda6 commit df95473
Show file tree
Hide file tree
Showing 7 changed files with 9 additions and 9 deletions.
5 changes: 3 additions & 2 deletions app/components/user/badge-viewer.js
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,8 @@ export default class UserBadgeViewer extends Component {
light2.position.set(120, 130, -130);
this.scene.add(light2);

let modelUrl = `/assets/models/${this.args.badge.name}.glb`;
let modelUrl = `/assets/models/${this.args.badge.name.replaceAll(" ", "_")}.glb`;
//let modelUrl = this.args.glbUrl;
const loader = new GLTFLoader();
console.log(loader);
loader.load(
Expand All @@ -83,4 +84,4 @@ declare module '@glint/environment-ember-loose/registry' {
UserBadgeViewer: typeof UserBadgeViewer;
}
}

4 changes: 4 additions & 0 deletions app/models/trophy-award.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@ export default class TrophyAward extends Model {
@attr('string') declare name: string;
@attr('string') declare imageUrl: string;
@attr('string') declare modelUrl: string;

get url() {
return this.imageUrl;
}
}

// DO NOT DELETE: this is how TypeScript knows how to look up your models.
Expand Down
9 changes: 2 additions & 7 deletions app/templates/home/shrimpos/entries/show.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -38,12 +38,7 @@
<div class="">
<div>
{{#each this.model.trophyAwards as |trophyAward|}}
<span>
<img
style="height: 3rem;"
src="{{trophyAward.imageUrl}}"
alt="{{trophyAward.name}}" />
</span>
<User::BadgeViewerContainer @badge={{trophyAward}} />
{{/each}}
</div>
<span class="font-extrabold">{{formatted-shrimpo-ranking this.model.ranking this.model.shrimpo.savedShrimpoEntries.length}}</span>
Expand Down Expand Up @@ -83,4 +78,4 @@
</section>
</section>
</section>
</section>
</section>
Binary file added public/assets/models/bronzeen_shrimpo.glb
Binary file not shown.
File renamed without changes.
Binary file added public/assets/models/good_beverage.glb
Binary file not shown.
Binary file added public/assets/models/silveren_shrimpo.glb
Binary file not shown.

0 comments on commit df95473

Please sign in to comment.