Changes between Initial Version and Version 4 of Ticket #2019


Ignore:
Timestamp:
Jul 30, 2013, 9:36:32 PM (11 years ago)
Author:
leper
Comment:

Check SubmittingPatches when submitting patches (especially the part about the review keyword).

Some comments:

  • Change the cheat json data to something like
    {
      "Name": "wololo",
      "Data": {
        "Action": "convertunit",
        "IsNumeric": false
      }
    }
    
    Also do we really need the IsNumeric in each json file? Or does that throw a warning when accessing it, it shouldn't but I haven't checked (access as in if(mycheat.IsNumeric) ...)
  • Rename cheatList to cheats (or something like that)
  • getCheatsData
    • Change the for to a for each (var filename in filelist) and make cheats an object instead of an array (will come in handy later)
    • That way you can make the check if a cheat is already present (the name that is) to be something like
      if (cheats.indexOf(currentCheat.Name) !== -1)
        warn("Cheat '"+currentCheat.Name+"' is already present");
      else
        cheats[currentCheat.Name] = currentCheat.Data;
      
  • Change the current cheat detection in messages.js (lines 222-252 without the patch) to iterate over Object.keys(cheats) instead. Also that whole check should only be done if cheats are enabled, but that isn't really a problem if it isn't fixed as a part of this ticket.

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #2019

    • Property Keywords simple added; cheat json removed
  • Ticket #2019 – Description

    initial v4  
    11simulations/data/cheat.json now is not moddable in a way that it will override the original file. A suggestion for this is putting cheats in a folder instead of in one file.
    2 In case of readability maybe it's better to write the cheats in xml instead of json.
     2~~In case of readability maybe it's better to write the cheats in xml instead of json.~~
    33
    44when handling duplicates when combining, the cheat script just should take the first occurrence of the cheat with that name.