mirror of
https://github.com/sfall-team/sfall.git
synced 2026-07-27 16:52:34 -07:00
Fixed setting array values in the debug editor.
Some code corrections.
This commit is contained in:
Generated
-1
@@ -23,7 +23,6 @@
|
|||||||
/// the contents of this method with the code editor.
|
/// the contents of this method with the code editor.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
private void InitializeComponent() {
|
private void InitializeComponent() {
|
||||||
this.components = new System.ComponentModel.Container();
|
|
||||||
this.dataGridView1 = new System.Windows.Forms.DataGridView();
|
this.dataGridView1 = new System.Windows.Forms.DataGridView();
|
||||||
this.Column0 = new System.Windows.Forms.DataGridViewTextBoxColumn();
|
this.Column0 = new System.Windows.Forms.DataGridViewTextBoxColumn();
|
||||||
this.Column1 = new System.Windows.Forms.DataGridViewTextBoxColumn();
|
this.Column1 = new System.Windows.Forms.DataGridViewTextBoxColumn();
|
||||||
|
|||||||
@@ -231,6 +231,9 @@ namespace FalloutClient {
|
|||||||
BinaryReader br = new BinaryReader(new MemoryStream(buf));
|
BinaryReader br = new BinaryReader(new MemoryStream(buf));
|
||||||
for (int j = 0; j < strings.Length; j++) {
|
for (int j = 0; j < strings.Length; j++) {
|
||||||
switch (types[j]) {
|
switch (types[j]) {
|
||||||
|
case DataType.None:
|
||||||
|
br.BaseStream.Position += 4;
|
||||||
|
break;
|
||||||
case DataType.Int:
|
case DataType.Int:
|
||||||
strings[j] = br.ReadInt32().ToString();
|
strings[j] = br.ReadInt32().ToString();
|
||||||
break;
|
break;
|
||||||
@@ -250,6 +253,9 @@ namespace FalloutClient {
|
|||||||
BinaryWriter bw = new BinaryWriter(ms);
|
BinaryWriter bw = new BinaryWriter(ms);
|
||||||
for (int j = 0; j < strings.Length; j++) {
|
for (int j = 0; j < strings.Length; j++) {
|
||||||
switch (types[j]) {
|
switch (types[j]) {
|
||||||
|
case DataType.None:
|
||||||
|
bw.BaseStream.Position += 4;
|
||||||
|
break;
|
||||||
case DataType.Int:
|
case DataType.Int:
|
||||||
bw.Write(int.Parse(strings[j]));
|
bw.Write(int.Parse(strings[j]));
|
||||||
break;
|
break;
|
||||||
|
|||||||
Generated
+1
-1
@@ -111,7 +111,7 @@
|
|||||||
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.SizableToolWindow;
|
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.SizableToolWindow;
|
||||||
this.MinimumSize = new System.Drawing.Size(300, 200);
|
this.MinimumSize = new System.Drawing.Size(300, 200);
|
||||||
this.Name = "EditorWindow";
|
this.Name = "EditorWindow";
|
||||||
this.Text = "Editor Values";
|
this.Text = "Edit Values";
|
||||||
((System.ComponentModel.ISupportInitialize)(this.dataGridView1)).EndInit();
|
((System.ComponentModel.ISupportInitialize)(this.dataGridView1)).EndInit();
|
||||||
this.ResumeLayout(false);
|
this.ResumeLayout(false);
|
||||||
|
|
||||||
|
|||||||
@@ -102,6 +102,11 @@ Delegate<>& OnInputLoop() {
|
|||||||
return onInputLoop;
|
return onInputLoop;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void FlushInputBuffer() {
|
||||||
|
while (!bufferedPresses.empty()) bufferedPresses.pop();
|
||||||
|
__asm call fo::funcoffs::kb_clear_;
|
||||||
|
}
|
||||||
|
|
||||||
DWORD _stdcall KeyDown(DWORD key) {
|
DWORD _stdcall KeyDown(DWORD key) {
|
||||||
if ((key & 0x80000000) > 0) { // special flag to check by VK code directly
|
if ((key & 0x80000000) > 0) { // special flag to check by VK code directly
|
||||||
return GetAsyncKeyState(key & 0xFFFF) & 0x8000;
|
return GetAsyncKeyState(key & 0xFFFF) & 0x8000;
|
||||||
|
|||||||
+3
-2
@@ -31,6 +31,7 @@ extern bool middleMouseDown;
|
|||||||
void SetMDown(bool down, bool right);
|
void SetMDown(bool down, bool right);
|
||||||
void SetMPos(int x, int y);
|
void SetMPos(int x, int y);
|
||||||
|
|
||||||
|
void FlushInputBuffer();
|
||||||
DWORD _stdcall KeyDown(DWORD key);
|
DWORD _stdcall KeyDown(DWORD key);
|
||||||
void _stdcall TapKey(DWORD key);
|
void _stdcall TapKey(DWORD key);
|
||||||
|
|
||||||
@@ -43,6 +44,8 @@ Delegate<>& OnInputLoop();
|
|||||||
|
|
||||||
void GetMouse(int* x, int* y);
|
void GetMouse(int* x, int* y);
|
||||||
|
|
||||||
|
void _stdcall ForceGraphicsRefresh(DWORD);
|
||||||
|
|
||||||
#define DIK_ESCAPE 0x01
|
#define DIK_ESCAPE 0x01
|
||||||
#define DIK_1 0x02
|
#define DIK_1 0x02
|
||||||
#define DIK_2 0x03
|
#define DIK_2 0x03
|
||||||
@@ -190,6 +193,4 @@ void GetMouse(int* x, int* y);
|
|||||||
*/
|
*/
|
||||||
#define DIK_CIRCUMFLEX DIK_PREVTRACK /* Japanese keyboard */
|
#define DIK_CIRCUMFLEX DIK_PREVTRACK /* Japanese keyboard */
|
||||||
|
|
||||||
void _stdcall ForceGraphicsRefresh(DWORD);
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2582,14 +2582,14 @@ void BugFixes::init()
|
|||||||
0x499013 // PrintAMelevList_
|
0x499013 // PrintAMelevList_
|
||||||
});
|
});
|
||||||
|
|
||||||
|
// Fix "out of bounds" bug when printing the automap list
|
||||||
|
HookCall(0x499240, PrintAMList_hook);
|
||||||
|
|
||||||
// Fix for a duplicate obj_dude script being created when loading a saved game
|
// Fix for a duplicate obj_dude script being created when loading a saved game
|
||||||
HookCall(0x48D63E, obj_load_dude_hook0);
|
HookCall(0x48D63E, obj_load_dude_hook0);
|
||||||
HookCall(0x48D666, obj_load_dude_hook1);
|
HookCall(0x48D666, obj_load_dude_hook1);
|
||||||
BlockCall(0x48D675);
|
BlockCall(0x48D675);
|
||||||
BlockCall(0x48D69D);
|
BlockCall(0x48D69D);
|
||||||
|
|
||||||
// Fix "out of bounds" bug when printing the automap list
|
|
||||||
HookCall(0x499240, PrintAMList_hook);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -202,6 +202,7 @@ static void RunEditorInternal(SOCKET &s) {
|
|||||||
delete[] sglobals;
|
delete[] sglobals;
|
||||||
delete[] arrays;
|
delete[] arrays;
|
||||||
|
|
||||||
|
FlushInputBuffer();
|
||||||
*(DWORD*)FO_VAR_script_engine_running = 1;
|
*(DWORD*)FO_VAR_script_engine_running = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -92,7 +92,7 @@ std::vector<FakePerk> fakeTraits;
|
|||||||
std::vector<FakePerk> fakePerks;
|
std::vector<FakePerk> fakePerks;
|
||||||
std::vector<FakePerk> fakeSelectablePerks; // available perks for selection in the perk selection list
|
std::vector<FakePerk> fakeSelectablePerks; // available perks for selection in the perk selection list
|
||||||
|
|
||||||
static std::list<int> RemoveTraitID;
|
static long RemoveTraitID = -1;
|
||||||
static std::list<int> RemovePerkID;
|
static std::list<int> RemovePerkID;
|
||||||
static std::list<int> RemoveSelectableID;
|
static std::list<int> RemoveSelectableID;
|
||||||
|
|
||||||
@@ -605,7 +605,7 @@ static void _stdcall AddFakePerk(DWORD perkID) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (!matched) {
|
if (!matched) {
|
||||||
RemoveTraitID.push_back(count); // index of the added trait
|
if (RemoveTraitID == -1) RemoveTraitID = count; // index of the added trait
|
||||||
fakeTraits.push_back(fakeSelectablePerks[perkID]);
|
fakeTraits.push_back(fakeSelectablePerks[perkID]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1314,16 +1314,14 @@ void _stdcall ClearSelectablePerks() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void PerksEnterCharScreen() {
|
void PerksEnterCharScreen() {
|
||||||
RemoveTraitID.clear();
|
RemoveTraitID = -1;
|
||||||
RemovePerkID.clear();
|
RemovePerkID.clear();
|
||||||
RemoveSelectableID.clear();
|
RemoveSelectableID.clear();
|
||||||
}
|
}
|
||||||
|
|
||||||
void PerksCancelCharScreen() {
|
void PerksCancelCharScreen() {
|
||||||
if (RemoveTraitID.size() > 1) RemoveTraitID.sort();
|
if (RemoveTraitID != -1) {
|
||||||
while (!RemoveTraitID.empty()) {
|
fakeTraits.erase(fakeTraits.begin() + RemoveTraitID, fakeTraits.end());
|
||||||
fakeTraits.erase(fakeTraits.begin() + RemoveTraitID.back());
|
|
||||||
RemoveTraitID.pop_back();
|
|
||||||
}
|
}
|
||||||
if (RemovePerkID.size() > 1) RemovePerkID.sort(); // sorting to correctly remove from the end
|
if (RemovePerkID.size() > 1) RemovePerkID.sort(); // sorting to correctly remove from the end
|
||||||
while (!RemovePerkID.empty()) {
|
while (!RemovePerkID.empty()) {
|
||||||
|
|||||||
@@ -345,6 +345,9 @@ void DESetArray(int id, const DWORD* types, const char* data) {
|
|||||||
for (size_t i = 0; i < arrays[id].val.size(); i++) {
|
for (size_t i = 0; i < arrays[id].val.size(); i++) {
|
||||||
auto& arVal = arrays[id].val[i];
|
auto& arVal = arrays[id].val[i];
|
||||||
switch (arVal.type) {
|
switch (arVal.type) {
|
||||||
|
case DataType::NONE:
|
||||||
|
pos += 4;
|
||||||
|
break;
|
||||||
case DataType::INT:
|
case DataType::INT:
|
||||||
arVal.intVal = *(long*)(data + pos);
|
arVal.intVal = *(long*)(data + pos);
|
||||||
pos += 4;
|
pos += 4;
|
||||||
|
|||||||
@@ -74,7 +74,7 @@ struct ProtoModify {
|
|||||||
std::forward_as_tuple(newProto, objPID));
|
std::forward_as_tuple(newProto, objPID));
|
||||||
} else {
|
} else {
|
||||||
s_proto = it->second.proto;
|
s_proto = it->second.proto;
|
||||||
if (s_proto == nullptr) { // prototype has not been created yet
|
if (s_proto == nullptr) { // prototype has not been created
|
||||||
it->second.sharedCount = CreateProtoMem(it, defaultProto, s_proto);
|
it->second.sharedCount = CreateProtoMem(it, defaultProto, s_proto);
|
||||||
it->second.proto = s_proto;
|
it->second.proto = s_proto;
|
||||||
}
|
}
|
||||||
@@ -504,7 +504,7 @@ bool Stats::LoadStatData(HANDLE file) {
|
|||||||
if (sizeRead != 20) return true;
|
if (sizeRead != 20) return true;
|
||||||
s_baseStatProto.emplace_back(data);
|
s_baseStatProto.emplace_back(data);
|
||||||
if (protoMem.find(data.objID) == protoMem.end()) {
|
if (protoMem.find(data.objID) == protoMem.end()) {
|
||||||
protoMem.emplace(data.objID, data.objPID); // protoMem[data.objID] = ProtoMem(data.objPID);
|
protoMem.emplace(data.objID, data.objPID);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
ReadFile(file, &count, 4, &sizeRead, 0);
|
ReadFile(file, &count, 4, &sizeRead, 0);
|
||||||
|
|||||||
Reference in New Issue
Block a user