Skip to content

Commit

Permalink
update name
Browse files Browse the repository at this point in the history
  • Loading branch information
stutxo committed Jul 25, 2023
1 parent dadde42 commit c1d1aff
Show file tree
Hide file tree
Showing 4 changed files with 58 additions and 68 deletions.
6 changes: 3 additions & 3 deletions docs/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no">
<title>satrunner</title>
<script type="module">import init from './satrunner-76f59bbce60ef2c2.js';init('./satrunner-76f59bbce60ef2c2_bg.wasm');</script>
<script type="module">import init from './satrunner-fd197b55528b2ff4.js';init('./satrunner-fd197b55528b2ff4_bg.wasm');</script>
<style>
body,
html {
Expand All @@ -15,8 +15,8 @@
}
</style>

<link rel="preload" href="./satrunner-76f59bbce60ef2c2_bg.wasm" as="fetch" type="application/wasm" crossorigin="">
<link rel="modulepreload" href="./satrunner-76f59bbce60ef2c2.js"></head>
<link rel="preload" href="./satrunner-fd197b55528b2ff4_bg.wasm" as="fetch" type="application/wasm" crossorigin="">
<link rel="modulepreload" href="./satrunner-fd197b55528b2ff4.js"></head>

<body>
<script>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1090,16 +1090,6 @@ function __wbg_get_imports() {
const ret = getObject(arg0).createBuffer(arg1 >>> 0, arg2 >>> 0, arg3);
return addHeapObject(ret);
}, arguments) };
imports.wbg.__wbg_readyState_b25418fd198bf715 = function(arg0) {
const ret = getObject(arg0).readyState;
return ret;
};
imports.wbg.__wbg_send_280c8ab5d0df82de = function() { return handleError(function (arg0, arg1, arg2) {
getObject(arg0).send(getStringFromWasm0(arg1, arg2));
}, arguments) };
imports.wbg.__wbg_send_1a008ea2eb3a1951 = function() { return handleError(function (arg0, arg1, arg2) {
getObject(arg0).send(getArrayU8FromWasm0(arg1, arg2));
}, arguments) };
imports.wbg.__wbg_new_b66404b6322c59bf = function() { return handleError(function (arg0, arg1) {
const ret = new WebSocket(getStringFromWasm0(arg0, arg1));
return addHeapObject(ret);
Expand All @@ -1116,6 +1106,16 @@ function __wbg_get_imports() {
const ret = false;
return ret;
};
imports.wbg.__wbg_readyState_b25418fd198bf715 = function(arg0) {
const ret = getObject(arg0).readyState;
return ret;
};
imports.wbg.__wbg_send_280c8ab5d0df82de = function() { return handleError(function (arg0, arg1, arg2) {
getObject(arg0).send(getStringFromWasm0(arg1, arg2));
}, arguments) };
imports.wbg.__wbg_send_1a008ea2eb3a1951 = function() { return handleError(function (arg0, arg1, arg2) {
getObject(arg0).send(getArrayU8FromWasm0(arg1, arg2));
}, arguments) };
imports.wbg.__wbg_close_dfa389d8fddb52fc = function() { return handleError(function (arg0) {
getObject(arg0).close();
}, arguments) };
Expand Down Expand Up @@ -1885,64 +1885,64 @@ function __wbg_get_imports() {
imports.wbg.__wbg_cancelAnimationFrame_9b68e9588c6543bc = function() { return handleError(function (arg0, arg1) {
getObject(arg0).cancelAnimationFrame(arg1);
}, arguments) };
imports.wbg.__wbindgen_closure_wrapper2656 = function(arg0, arg1, arg2) {
const ret = makeMutClosure(arg0, arg1, 112, __wbg_adapter_34);
imports.wbg.__wbindgen_closure_wrapper2658 = function(arg0, arg1, arg2) {
const ret = makeMutClosure(arg0, arg1, 201, __wbg_adapter_34);
return addHeapObject(ret);
};
imports.wbg.__wbindgen_closure_wrapper37436 = function(arg0, arg1, arg2) {
const ret = makeMutClosure(arg0, arg1, 2281, __wbg_adapter_37);
imports.wbg.__wbindgen_closure_wrapper37322 = function(arg0, arg1, arg2) {
const ret = makeMutClosure(arg0, arg1, 2362, __wbg_adapter_37);
return addHeapObject(ret);
};
imports.wbg.__wbindgen_closure_wrapper37441 = function(arg0, arg1, arg2) {
const ret = makeMutClosure(arg0, arg1, 2283, __wbg_adapter_37);
imports.wbg.__wbindgen_closure_wrapper37327 = function(arg0, arg1, arg2) {
const ret = makeMutClosure(arg0, arg1, 2364, __wbg_adapter_37);
return addHeapObject(ret);
};
imports.wbg.__wbindgen_closure_wrapper37445 = function(arg0, arg1, arg2) {
const ret = makeMutClosure(arg0, arg1, 2283, __wbg_adapter_37);
imports.wbg.__wbindgen_closure_wrapper37331 = function(arg0, arg1, arg2) {
const ret = makeMutClosure(arg0, arg1, 2364, __wbg_adapter_37);
return addHeapObject(ret);
};
imports.wbg.__wbindgen_closure_wrapper37448 = function(arg0, arg1, arg2) {
const ret = makeMutClosure(arg0, arg1, 2283, __wbg_adapter_37);
imports.wbg.__wbindgen_closure_wrapper37334 = function(arg0, arg1, arg2) {
const ret = makeMutClosure(arg0, arg1, 2364, __wbg_adapter_37);
return addHeapObject(ret);
};
imports.wbg.__wbindgen_closure_wrapper37451 = function(arg0, arg1, arg2) {
const ret = makeMutClosure(arg0, arg1, 2283, __wbg_adapter_37);
imports.wbg.__wbindgen_closure_wrapper37337 = function(arg0, arg1, arg2) {
const ret = makeMutClosure(arg0, arg1, 2364, __wbg_adapter_37);
return addHeapObject(ret);
};
imports.wbg.__wbindgen_closure_wrapper37454 = function(arg0, arg1, arg2) {
const ret = makeMutClosure(arg0, arg1, 2283, __wbg_adapter_37);
imports.wbg.__wbindgen_closure_wrapper37340 = function(arg0, arg1, arg2) {
const ret = makeMutClosure(arg0, arg1, 2364, __wbg_adapter_37);
return addHeapObject(ret);
};
imports.wbg.__wbindgen_closure_wrapper37457 = function(arg0, arg1, arg2) {
const ret = makeMutClosure(arg0, arg1, 2283, __wbg_adapter_37);
imports.wbg.__wbindgen_closure_wrapper37343 = function(arg0, arg1, arg2) {
const ret = makeMutClosure(arg0, arg1, 2364, __wbg_adapter_37);
return addHeapObject(ret);
};
imports.wbg.__wbindgen_closure_wrapper37621 = function(arg0, arg1, arg2) {
const ret = makeMutClosure(arg0, arg1, 2281, __wbg_adapter_37);
imports.wbg.__wbindgen_closure_wrapper37504 = function(arg0, arg1, arg2) {
const ret = makeMutClosure(arg0, arg1, 2362, __wbg_adapter_37);
return addHeapObject(ret);
};
imports.wbg.__wbindgen_closure_wrapper38945 = function(arg0, arg1, arg2) {
const ret = makeMutClosure(arg0, arg1, 2281, __wbg_adapter_37);
imports.wbg.__wbindgen_closure_wrapper38863 = function(arg0, arg1, arg2) {
const ret = makeMutClosure(arg0, arg1, 2362, __wbg_adapter_37);
return addHeapObject(ret);
};
imports.wbg.__wbindgen_closure_wrapper38948 = function(arg0, arg1, arg2) {
const ret = makeMutClosure(arg0, arg1, 2281, __wbg_adapter_34);
imports.wbg.__wbindgen_closure_wrapper38866 = function(arg0, arg1, arg2) {
const ret = makeMutClosure(arg0, arg1, 2362, __wbg_adapter_34);
return addHeapObject(ret);
};
imports.wbg.__wbindgen_closure_wrapper38950 = function(arg0, arg1, arg2) {
const ret = makeMutClosure(arg0, arg1, 2281, __wbg_adapter_37);
imports.wbg.__wbindgen_closure_wrapper38868 = function(arg0, arg1, arg2) {
const ret = makeMutClosure(arg0, arg1, 2362, __wbg_adapter_37);
return addHeapObject(ret);
};
imports.wbg.__wbindgen_closure_wrapper38953 = function(arg0, arg1, arg2) {
const ret = makeMutClosure(arg0, arg1, 2281, __wbg_adapter_37);
imports.wbg.__wbindgen_closure_wrapper38871 = function(arg0, arg1, arg2) {
const ret = makeMutClosure(arg0, arg1, 2362, __wbg_adapter_37);
return addHeapObject(ret);
};
imports.wbg.__wbindgen_closure_wrapper42871 = function(arg0, arg1, arg2) {
const ret = makeMutClosure(arg0, arg1, 2281, __wbg_adapter_34);
imports.wbg.__wbindgen_closure_wrapper42793 = function(arg0, arg1, arg2) {
const ret = makeMutClosure(arg0, arg1, 2362, __wbg_adapter_34);
return addHeapObject(ret);
};
imports.wbg.__wbindgen_closure_wrapper44016 = function(arg0, arg1, arg2) {
const ret = makeMutClosure(arg0, arg1, 2281, __wbg_adapter_37);
imports.wbg.__wbindgen_closure_wrapper44011 = function(arg0, arg1, arg2) {
const ret = makeMutClosure(arg0, arg1, 2362, __wbg_adapter_37);
return addHeapObject(ret);
};

Expand Down Expand Up @@ -1986,7 +1986,7 @@ async function __wbg_init(input) {
if (wasm !== undefined) return wasm;

if (typeof input === 'undefined') {
input = new URL('satrunner-76f59bbce60ef2c2_bg.wasm', import.meta.url);
input = new URL('satrunner-fd197b55528b2ff4_bg.wasm', import.meta.url);
}
const imports = __wbg_get_imports();

Expand Down
Binary file not shown.
38 changes: 14 additions & 24 deletions src/game_core/gui.rs
Original file line number Diff line number Diff line change
Expand Up @@ -180,38 +180,28 @@ pub fn check_disconnected(
pub fn add_nameplates(
mut contexts: EguiContexts,
camera_query: Query<(&Camera, &GlobalTransform)>,
query_player: Query<&Player, Without<Enemy>>,
query_enemy: Query<(&Transform, &Enemy), Without<Player>>,
query_player: Query<(&Transform, &Player)>,
player_name: Res<PlayerName>,
) {
let ctx = contexts.ctx_mut();

for player in query_player.iter() {
for (player_transform, player) in query_player.iter() {
let text_pos = get_sceen_transform_and_visibility(&camera_query, player_transform);
let text = RichText::new(format!("{}: {}", player_name.name, player.score));
egui::Area::new("satrunner")
.anchor(egui::Align2::CENTER_CENTER, egui::Vec2::new(0.0, 155.))
let name_len = player_name.name.len();

// Apply the same transformation as for the player
egui::Area::new(format!("nameplate_{}", player.id))
.current_pos(pos2(
text_pos.translation.x / 10.0 / name_len as f32,
text_pos.translation.y - 20.,
))
.show(ctx, |ui| {
ui.label(text);
ui.vertical_centered(|ui| {
ui.label(text);
});
});
}
// for (enemy_transform, enemy) in query_enemy.iter() {
// let text_pos = get_sceen_transform_and_visibility(&camera_query, enemy_transform);
// let text = RichText::new(format!("{}: {}", enemy.name, enemy.score));
// let name_len = enemy.name.len();

// // Apply the same transformation as for the player
// info!("enemy {:?}", text_pos);
// egui::Area::new(format!("nameplate_{}", enemy.id))
// .current_pos(pos2(
// text_pos.translation.x / 10.0 / name_len as f32,
// text_pos.translation.y - 20.,
// ))
// .show(ctx, |ui| {
// ui.vertical_centered(|ui| {
// ui.label(text);
// });
// });
// }
}

fn get_sceen_transform_and_visibility(
Expand Down

0 comments on commit c1d1aff

Please sign in to comment.