fix bug in ace keywords highlight, more formatting in gang, update changelog

This commit is contained in:
Olivier Gagnon 2021-03-12 14:20:39 -05:00
parent f8d65b9240
commit 1df0af0fa4
3 changed files with 13 additions and 7 deletions

@ -237,6 +237,9 @@ export let CONSTANTS: IMap<any> = {
Netscript Netscript
* Ace editor will now correctly highlight all functions. * Ace editor will now correctly highlight all functions.
Gang
* style improvements
Sleeve Sleeve
* karma gain now scales with sync. * karma gain now scales with sync.
` `

@ -1934,10 +1934,10 @@ Gang.prototype.updateGangMemberDisplayElement = function(memberObj) {
var gainInfo = document.getElementById(name + "gang-member-gain-info"); var gainInfo = document.getElementById(name + "gang-member-gain-info");
if (gainInfo) { if (gainInfo) {
gainInfo.innerHTML = gainInfo.innerHTML =
[`Money: $ ${formatNumber(5*memberObj.calculateMoneyGain(this), 2)} / sec`, [`Money: ${numeralWrapper.format(5*memberObj.calculateMoneyGain(this), '$0.000a')} / sec`,
`Respect: ${formatNumber(5*memberObj.calculateRespectGain(this), 6)} / sec`, `Respect: ${numeralWrapper.format(5*memberObj.calculateRespectGain(this), '0.00000a')} / sec`,
`Wanted Level: ${formatNumber(5*memberObj.calculateWantedLevelGain(this), 6)} / sec`, `Wanted Level: ${numeralWrapper.format(5*memberObj.calculateWantedLevelGain(this), '0.00000a')} / sec`,
`Total Respect Earned: ${formatNumber(memberObj.earnedRespect, 6)}`].join("<br>"); `Total Respect Earned: ${numeralWrapper.format(memberObj.earnedRespect, '0.00000a')}`].join("<br>");
} }
// Update selector to have the correct task // Update selector to have the correct task

@ -60,11 +60,12 @@ var identifierRe = "[a-zA-Z\\$_\u00a1-\uffff][a-zA-Z\\d\\$_\u00a1-\uffff]*";
let functions = (function(){ let functions = (function(){
function recursiveKeywords(namespace) { function recursiveKeywords(namespace) {
const keywords = []; let keywords = [];
for(const elem of Object.keys(namespace)) { for(const elem of Object.keys(namespace)) {
keywords.push(elem); keywords.push(elem);
if(typeof namespace[elem] === Object) { if(typeof namespace[elem] == 'object') {
keywords.concat(namespace[elem]); console.log(recursiveKeywords(namespace[elem]));
keywords = keywords.concat(recursiveKeywords(namespace[elem]));
} }
} }
return keywords; return keywords;
@ -75,6 +76,8 @@ let functions = (function(){
return recursiveKeywords(ns).sort().reverse().join("|"); return recursiveKeywords(ns).sort().reverse().join("|");
})(); })();
console.log(functions);
var NetscriptHighlightRules = function(options) { var NetscriptHighlightRules = function(options) {
var keywordMapper = this.createKeywordMapper({ var keywordMapper = this.createKeywordMapper({
"variable.language": "variable.language":