Comments (10)
@mafiakb Si bien podría hacerlo a través del cliente, creo que sería mucho más fácil editar eso en el lado del servidor. Y solo una pregunta, ¿quiere que el texto de la tabla de clasificación muestre específicamente "Usuario" y luego un número anterior? Nota al margen: la edición de la tabla de clasificación no funcionará en HTML. Y lo siento si mi gramática española es mala, culpen a Google traducir y mi pobre conocimiento de español.
from cigar-client.
Claro, seria en el lado del cliente. La idea es que se cada usuario en el leaderboard tenga <li>user1</li>
para poder darle ediciones en un futuro.
from cigar-client.
De la forma en que lo veo, tendrás que cambiar el siguiente código de:
for (ctx.font = "20px Ubuntu", b = 0; b < leaderBoard.length; ++b) {
c = leaderBoard[b].name || "An unnamed cell";
if (!showName) c = "An unnamed cell";
if (-1 != nodesOnScreen.indexOf(leaderBoard[b].id)) {
playerCells[0].name && (c = playerCells[0].name);
var userLBColor = String($("#lbColor").val());
ctx.fillStyle = "#" + userLBColor;
if (!noRanking) c = b + 1 + ". " + c;
ctx.fillText(c, 100 - ctx.measureText(c).width / 2, 70 + 24 * b);
} else {
ctx.fillStyle = "#FFF";
if (!noRanking) c = b + 1 + ". " + c;
ctx.fillText(c, 100 - ctx.measureText(c).width / 2, 70 + 24 * b);
}
}
A:
for (ctx.font = "20px Ubuntu", b = 0; b < leaderBoard.length; ++b) {
c = leaderBoard[b].name || "User";
if (!showName) c = "User";
if (-1 != nodesOnScreen.indexOf(leaderBoard[b].id)) {
playerCells[0].name && (c = playerCells[0].name);
var userLBColor = String($("#lbColor").val());
ctx.fillStyle = "#" + userLBColor;
if (!noRanking) c = b + 1 + ". " + c;
ctx.fillText("User", 100 - ctx.measureText("User").width / 2, 70 + 24 * b);
} else {
ctx.fillStyle = "#FFF";
if (!noRanking) c = b + 1 + ". " + c;
ctx.fillText("User", 100 - ctx.measureText("User").width / 2, 70 + 24 * b);
}
}
Este código se encuentra en:
https://github.com/Agarian/agarian.github.io/blob/master/assets/js/main_out.js#L1058
from cigar-client.
@mafiakb Lo que este cambio efectivamente hace es hacer que todos los nombres en la pantalla de la tabla de clasificación sean "Usuario". En cuanto a los números anteriores después del texto, como 1, 2, 3, 4 ..., esta es la razón por la que sugerí editar el código del servidor para esta función, ya que no hay forma de que sepa agregar los números anteriores en el cliente.
from cigar-client.
@Agarian Claro solo creo que me entendiste mal digamos yo en el cliente html tengo esto:
<div id="leaderboard-content-wrapper">
<span id="leaderboard-header">Leaderboard</span>
<li></li>
</div>
</div>
Lo que quiero que se emprima son los nicks en la etiqueta <li></li>
esta funcion:
if (!noRanking) c = b + 1 + ". " + c;
algo asi seria $("#leaderboard-header .li").html(c); pero no funciona solo muestra el primer nick no muestra todos.
Tiene que mostrar asi todos los nicks.
<div id="leaderboard-wrapper" style="display: block;">
<div id="leaderboard-content-wrapper">
<span id="leaderboard-header">Leaderboard</span>
<li>agarian</li>
<li>mafiakb</li>
<li>agarian</li>
<li>mafiakb</li>
<li>agarian</li>
<li>mafiakb</li>
<li>agarian</li>
<li>mafiakb</li>
</div>
</div>
from cigar-client.
@mafiakb Oh, está bien, veo lo que quieres. Dame algo de tiempo para ver si puedo hacer que funcione. Aunque no estoy seguro de cómo funcionará, intentaré hacerlo lo mejor posible.
from cigar-client.
Seré honesto contigo, no estoy seguro por dónde empezar con esto. Pero gracias por señalar:
if (!noRanking) c = b + 1 + ". " + c;
. Ese código lo hace un poco más fácil. Esto es lo que tengo hasta ahora, he conseguido que la tabla de clasificación muestre Usuario
luego un número anterior. El código para eso está abajo.
for (ctx.font = "20px Ubuntu", b = 0; b < leaderBoard.length; ++b) {
c = leaderBoard[b].name || "An unnamed cell";
if (!showName) c = "An unnamed cell";
if (-1 != nodesOnScreen.indexOf(leaderBoard[b].id)) {
playerCells[0].name && (c = playerCells[0].name);
var userLBColor = String($("#lbColor").val());
ctx.fillStyle = "#" + userLBColor;
if (!noRanking) c = b + 1 + ". " + "User " + b;
ctx.fillText(c, 100 - ctx.measureText(c).width / 2, 70 + 24 * b);
} else {
ctx.fillStyle = "#FFF";
if (!noRanking) c = b + 1 + ". " + "User " + b;
ctx.fillText(c, 100 - ctx.measureText(c).width / 2, 70 + 24 * b);
}
}
from cigar-client.
@Agarian ok buscare mas afondo para lograr y poner avances aqui.
from cigar-client.
@mafiakb and @Agarian add me on discord Revenge#5285 its urgent (do capital R)
from cigar-client.
Closing this.
from cigar-client.
Related Issues (20)
- How To Add zoom in/out to your client ? HOT 10
- I NEED HELP!!! HOT 2
- HELP! HOT 1
- where's mobile support HOT 2
- Skins - Hats HOT 1
- map sectore issue!! HOT 1
- Some of the skins don't render.
- which one exactly?? HOT 1
- when is the new protocol ?? :"))) HOT 1
- What is the more efficient client? HOT 1
- how to use wss
- curly brackets needed!
- how abt the mini map HOT 13
- Mobile client HOT 2
- (Spanish) Como se agrega party? HOT 5
- Border and Sectors HOT 3
- (spanish) como agregar hats? HOT 6
- Issue closed.
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from cigar-client.