-
Couldn't load subscription status.
- Fork 20
Update playing.js #55
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Changes from all commits
5a88692
e620bfd
638767e
de5f832
aac82eb
90d4330
c016e7c
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||
|---|---|---|---|---|
|
|
@@ -492,14 +492,15 @@ Main.k.tabs.playing = function() { | |||
|
|
||||
| // Planets | ||||
| if ($("#navModule").length > 0) { | ||||
| var tooltipText = Main.k.FormatPlanets(0,true); | ||||
| $("<a>").addClass("butmini formatbtn").html("<img src='/img/icons/ui/planet.png' />").attr("href", "#").appendTo(sharediv) | ||||
| .on("click", function() { | ||||
| var txt = Main.k.FormatPlanets(); | ||||
| $(this).parent().parent().siblings("td").first().find("textarea").insertAtCaret(txt); | ||||
| return false; | ||||
| }) | ||||
| .attr("_title", Main.k.text.gettext("Partager les planètes")) | ||||
| .attr("_desc", Main.k.text.gettext("<p>Insère les détails des planètes dans la zone de texte active.</p><p>TODO: Exemple</p>")) | ||||
| .attr("_desc", Main.k.text.gettext("<p>Insère les détails des planètes dans la zone de texte active.<br />"+tooltipText+"</p>")) | ||||
| .on("mouseover", Main.k.CustomTip) | ||||
| .on("mouseout", Main.k.hideTip); | ||||
| } | ||||
|
|
@@ -1002,8 +1003,18 @@ Main.k.tabs.playing = function() { | |||
| /** | ||||
| * @return string; | ||||
| */ | ||||
| Main.k.FormatPlanets = function(index) {//TODO: MULTILANG | ||||
| var ret = "**//"+Main.k.text.gettext("Planètes")+" : //**"; | ||||
| Main.k.FormatPlanets = function(index,tooltip) {//TODO: MULTILANG | ||||
| var ret = ''; | ||||
| var tooltipret = ''; | ||||
| var nbrPlanet = $("#navModule").find(".planet").not(".planetoff").length; | ||||
| var compteurPlanet = 0; | ||||
| var caseDesc = ''; | ||||
|
|
||||
| if(tooltip === undefined){ | ||||
| tooltip = false; | ||||
| }else{ | ||||
| tooltip = true; | ||||
| } | ||||
|
|
||||
| var parse = function(t) { | ||||
| t = t.replace(/<img\s+src=\"\/img\/icons\/ui\/triumph.png\"\s+alt=\"triomphe\"[\/\s]*>/ig, ":mush_triumph:"); | ||||
|
|
@@ -1033,19 +1044,89 @@ Main.k.tabs.playing = function() { | |||
|
|
||||
| // Cases | ||||
| var nbcases = $(this).find("td img.explTag").length; | ||||
| var nbCasesInconnues = $(this).find("td img.explTag.off").length; | ||||
| var cases = []; | ||||
| var casesToolTip = []; | ||||
| var casenamereg = /<h1>([^<]+)<\/h1>/; | ||||
| $(this).find("td img.explTag.on").each(function() { | ||||
| cases.push(casenamereg.exec($(this).attr("onmouseover"))[1]); | ||||
| }); | ||||
|
|
||||
| // Print planet | ||||
| ret += "\n**" + name + "** (" + nbcases + ' ' + Main.k.text.gettext('cases') + ")\n"; | ||||
| if (dist && dir) ret += "//" + dir + " - " + dist + " :mush_fuel:****//\n"; | ||||
| ret += cases.join(", "); | ||||
| var caseNameRecup = casenamereg.exec($(this).attr("onmouseover"))[1]; | ||||
| var finalCaseName = ''; | ||||
| var finalCaseNameToolTip = ''; | ||||
| switch(caseNameRecup){ | ||||
| case 'Sismique': | ||||
| case 'Mankarog': | ||||
| case 'Activité volcanique': | ||||
| finalCaseName = '**//'+caseNameRecup+'//** :dead:'; | ||||
| finalCaseNameToolTip = '<strong><em>'+caseNameRecup+'</em></strong> <img src="http://data.mush.vg/img/icons/ui/dead.png" />'; | ||||
| break; | ||||
| case 'Cristalite': | ||||
| finalCaseName = '//'+caseNameRecup+'// :mush:'; | ||||
| finalCaseNameToolTip = '<em>'+caseNameRecup+'</em> <img src="http://data.mush.vg/img/icons/ui/mush.png" />'; | ||||
| break; | ||||
| case 'Hydro-Carbure': | ||||
| finalCaseName = '**'+caseNameRecup+'** :fuel:'; | ||||
| finalCaseNameToolTip = '<strong>'+caseNameRecup+'</strong> <img src="http://data.mush.vg/img/icons/ui/fuel.png" />'; | ||||
| break; | ||||
| case 'Oxygène': | ||||
| finalCaseName = '**'+caseNameRecup+'** :o2:'; | ||||
| finalCaseNameToolTip = '<strong>'+caseNameRecup+'</strong> <img src="http://data.mush.vg/img/icons/ui/o2.png" />'; | ||||
| break; | ||||
| default: | ||||
| finalCaseNameToolTip = finalCaseName = caseNameRecup; | ||||
| } | ||||
| cases.push(finalCaseName); | ||||
| casesToolTip.push(finalCaseNameToolTip); | ||||
| }); | ||||
|
|
||||
| return ret; | ||||
| // Print planet | ||||
| if(compteurPlanet === 0){ | ||||
| compteurPlanet++; | ||||
| }else{ | ||||
| ret += "\n"; | ||||
| tooltipret += "<br />"; | ||||
| compteurPlanet++; | ||||
| } | ||||
| ret += "**" + name + "** (" + nbcases + ' ' + Main.k.text.gettext('cases') + ")\n"; | ||||
| tooltipret += "<strong>" + name + "</strong> (" + nbcases + ' ' + Main.k.text.gettext('cases') + ")<br />"; | ||||
| if (dist && dir) ret += "//" + dir + " - " + dist + " :mush_fuel:****//\n"; | ||||
| if (dist && dir) tooltipret += "<em>" + dir + " - " + dist + " <img alt=\"Icône Fuel\" src=\"http://data.twinoid.com/proxy/mush.vg/img/icons/ui/fuel.png\"/></em><br />"; | ||||
| ret += '---\n'+cases.join(", "); | ||||
| tooltipret += '--<br />'+casesToolTip.join(", "); | ||||
| if(nbCasesInconnues === 1){ | ||||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Tu peux me donner un exemple de ce que ça donne quand ctrl-w/src/main/tabs/playing.js Line 3448 in a274302
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Ah ! Nickel que cette fonction existe, merci ^^ |
||||
| if(cases.length === 0){ | ||||
| ret += "Encore "; | ||||
| tooltipret += "Encore "; | ||||
| } else { | ||||
| ret += " et encore "; | ||||
| tooltipret += " et encore "; | ||||
| } | ||||
| ret += "1 case inconnue."; | ||||
| tooltipret += "1 case inconnue."; | ||||
| } else if ( nbCasesInconnues === 0){ | ||||
| ret += "."; | ||||
| tooltipret += "."; | ||||
| } else { | ||||
| if(cases.length === 0){ | ||||
| ret += "Encore "; | ||||
| tooltipret += "Encore "; | ||||
| } else { | ||||
| ret += " et encore "; | ||||
| tooltipret += " et encore "; | ||||
| } | ||||
| ret += nbCasesInconnues+" cases inconnues."; | ||||
| tooltipret += nbCasesInconnues+" cases inconnues."; | ||||
| } | ||||
| }); | ||||
|
|
||||
| if(compteurPlanet > 0 && compteurPlanet < nbrPlanet){ | ||||
| tooltipret += '<hr />'; | ||||
| } | ||||
|
|
||||
| if(tooltip === true){ | ||||
| return tooltipret; | ||||
| }else{ | ||||
| return ret; | ||||
| } | ||||
| }; | ||||
| /** | ||||
| * @return string; | ||||
|
|
@@ -5335,6 +5416,7 @@ Main.k.tabs.playing = function() { | |||
| // Astro | ||||
| } else if ($("#navModule").length > 0) { | ||||
| var nav = $("#navModule"); | ||||
| var toolTipText = ''; | ||||
| var planets = nav.find(".planet").not(".planetoff"); | ||||
| if (planets.length > 0) { | ||||
| t = $("<h3>").html(Main.k.text.gettext("Planètes")).appendTo(project_list); | ||||
|
|
@@ -5343,6 +5425,7 @@ Main.k.tabs.playing = function() { | |||
|
|
||||
| projectsdiv = $("<div>").addClass("projectspreview planetpreview").attr("id", "projectspreview").appendTo(project_list); | ||||
| planets.each(function(i) { | ||||
| toolTipText = Main.k.FormatPlanets(i,true); | ||||
| // Print planet | ||||
| var planet = $("<div>").addClass("planetpreview").appendTo(projectsdiv); | ||||
| $("<img>").attr("width", "40") | ||||
|
|
@@ -5374,8 +5457,8 @@ Main.k.tabs.playing = function() { | |||
|
|
||||
| // Planets actions | ||||
| Main.k.MakeButton("<img src='/img/icons/ui/talk.gif' /> "+Main.k.text.gettext("Partager"), null, null, Main.k.text.gettext("Partager les planètes"), | ||||
| Main.k.text.gettext("Insère la liste de planètes dans la zone de texte active, de la forme :</p><p>" + | ||||
| "TODO: aperçu") | ||||
| Main.k.text.gettext("Insère la liste de planètes dans la zone de texte active, de la forme :<br />" + | ||||
| toolTipText + "</p>") | ||||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. C'est utile ce There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Étourdis comme je le suis, et vous l'avez constaté il y a peu, je ne risque pas d'être d'une grande aide. Mais je me ferais un plaisir de débusquer au filet à papillon les inscriptions caduques ^^ There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. ^^ Faudrait juste tester le jeu en l'enlevant voir si ça change quelque chose, si c'est pas le cas, on vire ! :) |
||||
| ).appendTo(project_list) | ||||
| .find("a").on("mousedown", function(e) { | ||||
| $('textarea:focus').each(function(e) { | ||||
|
|
@@ -5666,4 +5749,4 @@ Main.k.tabs.playing = function() { | |||
| $(document).keypress(function(e){ | ||||
| if (e.keyCode === 27) Main.k.ClosePopup(); | ||||
| }); | ||||
| }; | ||||
| }; | ||||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Le texte est différent selon la langue du jeu donc faudrait passer le texte FR dans la fonction
Main.k.text.gettext()There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tout à fait d'accord. N'ayant de compte sur les deux autres Mush, je ne m'étais attardé sur la question. De plus, le nom de la section/zone/case est différent de celui relevé dans les Wikis (c'est le cas pour l'activité sismique et celle volcanique). Comme je fais une petite pause sur le jeu en ce moment, je repousse la modification cette partie.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Si tu ne joue pas sur les autres versions, juste utiliser
Main.k.text.gettextsuffit. A un joueur d'une autre langue de passer ici pour traduire.