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
* Ace editor will now correctly highlight all functions.
Gang
* style improvements
Sleeve
* karma gain now scales with sync.
`

@ -1934,10 +1934,10 @@ Gang.prototype.updateGangMemberDisplayElement = function(memberObj) {
var gainInfo = document.getElementById(name + "gang-member-gain-info");
if (gainInfo) {
gainInfo.innerHTML =
[`Money: $ ${formatNumber(5*memberObj.calculateMoneyGain(this), 2)} / sec`,
`Respect: ${formatNumber(5*memberObj.calculateRespectGain(this), 6)} / sec`,
`Wanted Level: ${formatNumber(5*memberObj.calculateWantedLevelGain(this), 6)} / sec`,
`Total Respect Earned: ${formatNumber(memberObj.earnedRespect, 6)}`].join("<br>");
[`Money: ${numeralWrapper.format(5*memberObj.calculateMoneyGain(this), '$0.000a')} / sec`,
`Respect: ${numeralWrapper.format(5*memberObj.calculateRespectGain(this), '0.00000a')} / sec`,
`Wanted Level: ${numeralWrapper.format(5*memberObj.calculateWantedLevelGain(this), '0.00000a')} / sec`,
`Total Respect Earned: ${numeralWrapper.format(memberObj.earnedRespect, '0.00000a')}`].join("<br>");
}
// 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(){
function recursiveKeywords(namespace) {
const keywords = [];
let keywords = [];
for(const elem of Object.keys(namespace)) {
keywords.push(elem);
if(typeof namespace[elem] === Object) {
keywords.concat(namespace[elem]);
if(typeof namespace[elem] == 'object') {
console.log(recursiveKeywords(namespace[elem]));
keywords = keywords.concat(recursiveKeywords(namespace[elem]));
}
}
return keywords;
@ -75,6 +76,8 @@ let functions = (function(){
return recursiveKeywords(ns).sort().reverse().join("|");
})();
console.log(functions);
var NetscriptHighlightRules = function(options) {
var keywordMapper = this.createKeywordMapper({
"variable.language":