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

Added the .const file format #11

Merged
merged 6 commits into from Dec 14, 2017

Conversation

Projects
None yet
2 participants
@feliwir
Collaborator

feliwir commented Dec 11, 2017

The .const file format is the first step towards the integration of BFME (and following) GUI file formats. The file contains all constant variables that can be accessed by the correcsponding ,apt file in ActionScript and by Characters.

As an example it defines TextColors as a hexadecimal number.

@feliwir

This comment has been minimized.

Collaborator

feliwir commented Dec 11, 2017

Screenshot of the viewer:
image

reader.BaseStream.Seek(4, SeekOrigin.Current);
for (var i=0;i< numEntries;++i)

This comment has been minimized.

@tgjones

tgjones Dec 12, 2017

Collaborator

I'm not sure what spacing settings you're using here :) I should add an .editorconfig file for this stuff, so that Visual Studio will help with consistency.

This comment has been minimized.

@feliwir

feliwir Dec 12, 2017

Collaborator

It is the default setting of VS2017

@@ -99,7 +100,10 @@ public static string ReadFixedLengthString(this BinaryReader reader, int count)
var result = new string(chars);
// There might be garbage after the \0 character, so we can't just do TrimEnd('\0').
return result.Substring(0, result.IndexOf('\0'));
if (result.Contains('\0'))

This comment has been minimized.

@tgjones

tgjones Dec 12, 2017

Collaborator

I assume fixed-length strings in .const files don't necessarily have a null terminator?

This comment has been minimized.

@feliwir

feliwir Dec 12, 2017

Collaborator

Yes. Also the name ReadFixedLengthString doesn’t suggest a terminator is required. I guess you‘ve used that for W3D

@tgjones

This comment has been minimized.

Collaborator

tgjones commented Dec 12, 2017

It looks really great, thank you Stephan. Just a couple of minor comments, and then please could you rebase (to get rid of the merge commit)?

git fetch upstream
git rebase upstream/master
@tgjones

This comment has been minimized.

Collaborator

tgjones commented Dec 14, 2017

This is awesome, thank you!

@tgjones tgjones merged commit 28a1f9a into OpenSAGE:master Dec 14, 2017

@tgjones tgjones added this to the v0.1.0 milestone Apr 22, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment