Well the codebase is looking a lot better now, I've attached what I've done to this post.
Note: there will be no difference for end users, but a lot of difference for programmers
Here's a change log of everything I did:
Code: Select all
[06.Apr.11] - Replaced all 'Maps.map[mapnumber]..' code with a single 'Map' reference in each mapForm (don't know why it wasn't done this way before, the abstraction made no logical sense and was harder to code with..)
- Moved map load code into a static 'Map.LoadFromFile(..', and made the Map .ctor internal.
- changed MainMenuEdit.cs to use Map objects not MapForms, and moved required code from MapForm into static methods.
- Removed 'Maps' class, placed Refresh method in 'Map'.
- Windows form generated code, in mapform and mainform, grouped together and placed at bottom of each code file out of the way.
- Lot of map load code commented
- Main form methods grouped together by relevance and placed in regions. Updated some menu names to reflect their usage.
- MetaEditor control now checks Meta Editor .xml exists before loading it to stop the mapForm designer crashing saying the file doesn't exist.
- Almost complete with grouping methods in MapForm into regions.
[07.Apr.11] - Finished placing all mapForm methods in regions.
- Moved classes in Map.cs to their own files.
- Restructured file hierarchy in solution explorer.
- Removed unused files.
- Ran solution through NArrange tool, which has arranged every code file so they all follow the same code standard
- Ran solution through DeCodEx tool which moves generated windows form UI code from the main file to a partial class in a designer file.
- Moved HaloMap and MetaEditor Projects into same folder as Main Project.
- Moved solution file outside entity project folder.
- Replaced all Application.StartupPath uses with Global.StartupPath; A custom variable that always points to the release folder, meaning dont have to have a copy of plugins etc in the debug folder.
- created a Global.ShowErrorMsg function for use when a messagebox is shown in a catch statement. This function also shows the internal error for better debugging.
[08.Apr.11] - Ran Resharper Code Cleanup, with StyleCop plugin, on Solution.
- Removed ref to map object in all meta class functions, and replaced with a single ref in the ctor, with refactoring
- Placed one meta scanner object in meta object, and refactored methods to use that.
- Replaced 'tagnumber' with 'TagIndex'
- Moved Metafunctions into Miscfunctions file, and removed map params from all these methods too.
- Made chunkAdder non-static and an object of Map, and moved into HaloMap lib.
- Removed most of places where map is passed as a parameter needlessly.
[09.Apr.11] - Moved a lots of files into HaloMap.
- Started creating xml prefs file for storing all settings, instead of the registry..
[10.Apr.11] - Finished xml prefs stuff.
[11.Apr.10] - Removed passing around of intptr for bitmaps.
- Refactored namespaces.
- Fixed most warnings.
- Ran Ghostdoc on solution.
The three worst areas still in the code in my opinion are:
Meta Editor: Code isn't very modular, or efficient.
Bitmap Class: Lots of meaningless variables, and the functions see to take 100+ parameters..
All Render Forms: Lots of copied code, rubbish dealing with graphics device.
I didn't do anything with them though, because your working on a new meta editor troy, and I've got better code for the last two in my Orbit app, so no point in going near them.
Also I removed your registry stuff and replaced it all with an xml file. Reason being I don't think unofficial hacking/modding programs should store stuff on a persons computer that they might not know about.. Much easier to keep it all in one directory
edit: Re-uploaded without my user settings.xml, as that may have caused errors..