mirror of
https://github.com/sfall-team/sfall.git
synced 2026-07-27 16:52:34 -07:00
commit latest source from official SourceForge repo
This commit is contained in:
+194
@@ -26,3 +26,197 @@
|
||||
*.exe
|
||||
*.out
|
||||
*.app
|
||||
|
||||
# NetBeans
|
||||
nbproject/private/
|
||||
build/
|
||||
nbbuild/
|
||||
dist/
|
||||
nbdist/
|
||||
nbactions.xml
|
||||
nb-configuration.xml
|
||||
.nb-gradle/
|
||||
|
||||
|
||||
## Ignore Visual Studio temporary files, build results, and
|
||||
## files generated by popular Visual Studio add-ons.
|
||||
|
||||
# User-specific files
|
||||
*.suo
|
||||
*.user
|
||||
*.userosscache
|
||||
*.sln.docstates
|
||||
|
||||
# User-specific files (MonoDevelop/Xamarin Studio)
|
||||
*.userprefs
|
||||
|
||||
# Build results
|
||||
[Dd]ebug/
|
||||
[Dd]ebugPublic/
|
||||
[Rr]elease/
|
||||
[Rr]eleases/
|
||||
x64/
|
||||
x86/
|
||||
build/
|
||||
bld/
|
||||
[Bb]in/
|
||||
[Oo]bj/
|
||||
|
||||
# Visual Studio 2015 cache/options directory
|
||||
.vs/
|
||||
|
||||
# MSTest test Results
|
||||
[Tt]est[Rr]esult*/
|
||||
[Bb]uild[Ll]og.*
|
||||
|
||||
# NUNIT
|
||||
*.VisualState.xml
|
||||
TestResult.xml
|
||||
|
||||
# Build Results of an ATL Project
|
||||
[Dd]ebugPS/
|
||||
[Rr]eleasePS/
|
||||
dlldata.c
|
||||
|
||||
# DNX
|
||||
project.lock.json
|
||||
artifacts/
|
||||
|
||||
*_i.c
|
||||
*_p.c
|
||||
*_i.h
|
||||
*.ilk
|
||||
*.meta
|
||||
*.obj
|
||||
*.pch
|
||||
*.pdb
|
||||
*.pgc
|
||||
*.pgd
|
||||
*.rsp
|
||||
*.sbr
|
||||
*.tlb
|
||||
*.tli
|
||||
*.tlh
|
||||
*.tmp
|
||||
*.tmp_proj
|
||||
*.log
|
||||
*.vspscc
|
||||
*.vssscc
|
||||
.builds
|
||||
*.pidb
|
||||
*.svclog
|
||||
*.scc
|
||||
|
||||
# Chutzpah Test files
|
||||
_Chutzpah*
|
||||
|
||||
# Visual C++ cache files
|
||||
ipch/
|
||||
*.aps
|
||||
*.ncb
|
||||
*.opensdf
|
||||
*.sdf
|
||||
*.cachefile
|
||||
|
||||
# Visual Studio profiler
|
||||
*.psess
|
||||
*.vsp
|
||||
*.vspx
|
||||
|
||||
# ReSharper is a .NET coding add-in
|
||||
_ReSharper*/
|
||||
*.[Rr]e[Ss]harper
|
||||
*.DotSettings.user
|
||||
|
||||
# Web workbench (sass)
|
||||
.sass-cache/
|
||||
|
||||
# Installshield output folder
|
||||
[Ee]xpress/
|
||||
|
||||
# DocProject is a documentation generator add-in
|
||||
DocProject/buildhelp/
|
||||
DocProject/Help/*.HxT
|
||||
DocProject/Help/*.HxC
|
||||
DocProject/Help/*.hhc
|
||||
DocProject/Help/*.hhk
|
||||
DocProject/Help/*.hhp
|
||||
DocProject/Help/Html2
|
||||
DocProject/Help/html
|
||||
|
||||
# Click-Once directory
|
||||
publish/
|
||||
|
||||
# Publish Web Output
|
||||
*.[Pp]ublish.xml
|
||||
*.azurePubxml
|
||||
# TODO: Comment the next line if you want to checkin your web deploy settings
|
||||
# but database connection strings (with potential passwords) will be unencrypted
|
||||
*.pubxml
|
||||
*.publishproj
|
||||
|
||||
# NuGet Packages
|
||||
*.nupkg
|
||||
# The packages folder can be ignored because of Package Restore
|
||||
**/packages/*
|
||||
# except build/, which is used as an MSBuild target.
|
||||
!**/packages/build/
|
||||
# Uncomment if necessary however generally it will be regenerated when needed
|
||||
#!**/packages/repositories.config
|
||||
|
||||
# Windows Azure Build Output
|
||||
csx/
|
||||
*.build.csdef
|
||||
|
||||
# Windows Store app package directory
|
||||
AppPackages/
|
||||
|
||||
# Visual Studio cache files
|
||||
# files ending in .cache can be ignored
|
||||
*.[Cc]ache
|
||||
# but keep track of directories ending in .cache
|
||||
!*.[Cc]ache/
|
||||
|
||||
# Others
|
||||
ClientBin/
|
||||
[Ss]tyle[Cc]op.*
|
||||
~$*
|
||||
*~
|
||||
*.dbmdl
|
||||
*.dbproj.schemaview
|
||||
*.pfx
|
||||
*.publishsettings
|
||||
node_modules/
|
||||
orleans.codegen.cs
|
||||
|
||||
# RIA/Silverlight projects
|
||||
Generated_Code/
|
||||
|
||||
# Backup & report files from converting an old project file
|
||||
# to a newer Visual Studio version. Backup files are not needed,
|
||||
# because we have git ;-)
|
||||
_UpgradeReport_Files/
|
||||
Backup*/
|
||||
UpgradeLog*.XML
|
||||
UpgradeLog*.htm
|
||||
|
||||
# SQL Server files
|
||||
*.mdf
|
||||
*.ldf
|
||||
|
||||
# Business Intelligence projects
|
||||
*.rdl.data
|
||||
*.bim.layout
|
||||
*.bim_*.settings
|
||||
|
||||
# Microsoft Fakes
|
||||
FakesAssemblies/
|
||||
|
||||
# Node.js Tools for Visual Studio
|
||||
.ntvs_analysis.dat
|
||||
|
||||
# Visual Studio 6 build log
|
||||
*.plg
|
||||
|
||||
# Visual Studio 6 workspace options file
|
||||
*.opt
|
||||
Generated
+182
@@ -0,0 +1,182 @@
|
||||
namespace FalloutClient {
|
||||
partial class DebugEditor {
|
||||
/// <summary>
|
||||
/// Required designer variable.
|
||||
/// </summary>
|
||||
private System.ComponentModel.IContainer components = null;
|
||||
|
||||
/// <summary>
|
||||
/// Clean up any resources being used.
|
||||
/// </summary>
|
||||
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
|
||||
protected override void Dispose(bool disposing) {
|
||||
if(disposing && (components != null)) {
|
||||
components.Dispose();
|
||||
}
|
||||
base.Dispose(disposing);
|
||||
}
|
||||
|
||||
#region Windows Form Designer generated code
|
||||
|
||||
/// <summary>
|
||||
/// Required method for Designer support - do not modify
|
||||
/// the contents of this method with the code editor.
|
||||
/// </summary>
|
||||
private void InitializeComponent() {
|
||||
this.dataGridView1 = new System.Windows.Forms.DataGridView();
|
||||
this.bGlobals = new System.Windows.Forms.Button();
|
||||
this.bMapVars = new System.Windows.Forms.Button();
|
||||
this.bCritters = new System.Windows.Forms.Button();
|
||||
this.bSGlobals = new System.Windows.Forms.Button();
|
||||
this.bArrays = new System.Windows.Forms.Button();
|
||||
this.Column0 = new System.Windows.Forms.DataGridViewTextBoxColumn();
|
||||
this.Column1 = new System.Windows.Forms.DataGridViewTextBoxColumn();
|
||||
this.Column2 = new System.Windows.Forms.DataGridViewTextBoxColumn();
|
||||
this.Column3 = new System.Windows.Forms.DataGridViewTextBoxColumn();
|
||||
this.bEdit = new System.Windows.Forms.Button();
|
||||
((System.ComponentModel.ISupportInitialize)(this.dataGridView1)).BeginInit();
|
||||
this.SuspendLayout();
|
||||
//
|
||||
// dataGridView1
|
||||
//
|
||||
this.dataGridView1.AllowUserToAddRows = false;
|
||||
this.dataGridView1.AllowUserToDeleteRows = false;
|
||||
this.dataGridView1.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
|
||||
| System.Windows.Forms.AnchorStyles.Left)
|
||||
| System.Windows.Forms.AnchorStyles.Right)));
|
||||
this.dataGridView1.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize;
|
||||
this.dataGridView1.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] {
|
||||
this.Column0,
|
||||
this.Column1,
|
||||
this.Column2,
|
||||
this.Column3});
|
||||
this.dataGridView1.Location = new System.Drawing.Point(12, 12);
|
||||
this.dataGridView1.Name = "dataGridView1";
|
||||
this.dataGridView1.Size = new System.Drawing.Size(444, 215);
|
||||
this.dataGridView1.TabIndex = 0;
|
||||
this.dataGridView1.CellEndEdit += new System.Windows.Forms.DataGridViewCellEventHandler(this.dataGridView1_CellEndEdit);
|
||||
//
|
||||
// bGlobals
|
||||
//
|
||||
this.bGlobals.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
|
||||
this.bGlobals.Location = new System.Drawing.Point(12, 233);
|
||||
this.bGlobals.Name = "bGlobals";
|
||||
this.bGlobals.Size = new System.Drawing.Size(100, 23);
|
||||
this.bGlobals.TabIndex = 1;
|
||||
this.bGlobals.Text = "Globals";
|
||||
this.bGlobals.UseVisualStyleBackColor = true;
|
||||
this.bGlobals.Click += new System.EventHandler(this.bGlobals_Click);
|
||||
//
|
||||
// bMapVars
|
||||
//
|
||||
this.bMapVars.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
|
||||
this.bMapVars.Location = new System.Drawing.Point(118, 233);
|
||||
this.bMapVars.Name = "bMapVars";
|
||||
this.bMapVars.Size = new System.Drawing.Size(100, 23);
|
||||
this.bMapVars.TabIndex = 2;
|
||||
this.bMapVars.Text = "Map variables";
|
||||
this.bMapVars.UseVisualStyleBackColor = true;
|
||||
this.bMapVars.Click += new System.EventHandler(this.bMapVars_Click);
|
||||
//
|
||||
// bCritters
|
||||
//
|
||||
this.bCritters.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
|
||||
this.bCritters.Location = new System.Drawing.Point(118, 262);
|
||||
this.bCritters.Name = "bCritters";
|
||||
this.bCritters.Size = new System.Drawing.Size(100, 23);
|
||||
this.bCritters.TabIndex = 3;
|
||||
this.bCritters.Text = "Critters";
|
||||
this.bCritters.UseVisualStyleBackColor = true;
|
||||
this.bCritters.Click += new System.EventHandler(this.bCritters_Click);
|
||||
//
|
||||
// bSGlobals
|
||||
//
|
||||
this.bSGlobals.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
|
||||
this.bSGlobals.Location = new System.Drawing.Point(225, 233);
|
||||
this.bSGlobals.Name = "bSGlobals";
|
||||
this.bSGlobals.Size = new System.Drawing.Size(100, 23);
|
||||
this.bSGlobals.TabIndex = 4;
|
||||
this.bSGlobals.Text = "sfall globals";
|
||||
this.bSGlobals.UseVisualStyleBackColor = true;
|
||||
this.bSGlobals.Click += new System.EventHandler(this.bSGlobals_Click);
|
||||
//
|
||||
// bArrays
|
||||
//
|
||||
this.bArrays.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
|
||||
this.bArrays.Location = new System.Drawing.Point(12, 262);
|
||||
this.bArrays.Name = "bArrays";
|
||||
this.bArrays.Size = new System.Drawing.Size(100, 23);
|
||||
this.bArrays.TabIndex = 5;
|
||||
this.bArrays.Text = "sfall arrays";
|
||||
this.bArrays.UseVisualStyleBackColor = true;
|
||||
this.bArrays.Click += new System.EventHandler(this.bArrays_Click);
|
||||
//
|
||||
// Column0
|
||||
//
|
||||
this.Column0.HeaderText = "ID";
|
||||
this.Column0.Name = "Column0";
|
||||
this.Column0.ReadOnly = true;
|
||||
//
|
||||
// Column1
|
||||
//
|
||||
this.Column1.HeaderText = "Name";
|
||||
this.Column1.Name = "Column1";
|
||||
this.Column1.ReadOnly = true;
|
||||
//
|
||||
// Column2
|
||||
//
|
||||
this.Column2.HeaderText = "Value (Int)";
|
||||
this.Column2.Name = "Column2";
|
||||
//
|
||||
// Column3
|
||||
//
|
||||
this.Column3.HeaderText = "Value (Float)";
|
||||
this.Column3.Name = "Column3";
|
||||
//
|
||||
// bEdit
|
||||
//
|
||||
this.bEdit.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
|
||||
this.bEdit.Location = new System.Drawing.Point(225, 262);
|
||||
this.bEdit.Name = "bEdit";
|
||||
this.bEdit.Size = new System.Drawing.Size(100, 23);
|
||||
this.bEdit.TabIndex = 6;
|
||||
this.bEdit.Text = "Edit";
|
||||
this.bEdit.UseVisualStyleBackColor = true;
|
||||
this.bEdit.Click += new System.EventHandler(this.bEdit_Click);
|
||||
//
|
||||
// DebugEditor
|
||||
//
|
||||
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
|
||||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
||||
this.ClientSize = new System.Drawing.Size(468, 297);
|
||||
this.Controls.Add(this.bEdit);
|
||||
this.Controls.Add(this.bArrays);
|
||||
this.Controls.Add(this.bSGlobals);
|
||||
this.Controls.Add(this.bCritters);
|
||||
this.Controls.Add(this.bMapVars);
|
||||
this.Controls.Add(this.bGlobals);
|
||||
this.Controls.Add(this.dataGridView1);
|
||||
this.Name = "DebugEditor";
|
||||
this.Text = "DebugEditor";
|
||||
this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(this.DebugEditor_FormClosing);
|
||||
((System.ComponentModel.ISupportInitialize)(this.dataGridView1)).EndInit();
|
||||
this.ResumeLayout(false);
|
||||
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
private System.Windows.Forms.DataGridView dataGridView1;
|
||||
private System.Windows.Forms.Button bGlobals;
|
||||
private System.Windows.Forms.Button bMapVars;
|
||||
private System.Windows.Forms.Button bCritters;
|
||||
private System.Windows.Forms.Button bSGlobals;
|
||||
private System.Windows.Forms.Button bArrays;
|
||||
private System.Windows.Forms.DataGridViewTextBoxColumn Column0;
|
||||
private System.Windows.Forms.DataGridViewTextBoxColumn Column1;
|
||||
private System.Windows.Forms.DataGridViewTextBoxColumn Column2;
|
||||
private System.Windows.Forms.DataGridViewTextBoxColumn Column3;
|
||||
private System.Windows.Forms.Button bEdit;
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,300 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.Drawing;
|
||||
using System.Text;
|
||||
using System.Windows.Forms;
|
||||
using File=System.IO.File;
|
||||
using StreamReader=System.IO.StreamReader;
|
||||
using MemoryStream=System.IO.MemoryStream;
|
||||
using BinaryReader=System.IO.BinaryReader;
|
||||
using BinaryWriter=System.IO.BinaryWriter;
|
||||
|
||||
namespace FalloutClient {
|
||||
public partial class DebugEditor : Form {
|
||||
[System.Runtime.InteropServices.StructLayout(System.Runtime.InteropServices.LayoutKind.Explicit)]
|
||||
private struct ByteConverter {
|
||||
[System.Runtime.InteropServices.FieldOffset(0)]
|
||||
private int i;
|
||||
[System.Runtime.InteropServices.FieldOffset(0)]
|
||||
private float f;
|
||||
|
||||
public int GetAsInt(float f) {
|
||||
this.f=f;
|
||||
return i;
|
||||
}
|
||||
public float GetAsFloat(int i) {
|
||||
this.i=i;
|
||||
return f;
|
||||
}
|
||||
public byte[] GetAsBytes(ulong ul) {
|
||||
byte[] b=new byte[8];
|
||||
for(int i=0;i<8;i++) b[i]=(byte)((ul&((ulong)0xff<<(i*8)))>>(i*8));
|
||||
return b;
|
||||
}
|
||||
}
|
||||
|
||||
private static ByteConverter converter=new ByteConverter();
|
||||
|
||||
private enum Mode { Globals, MapVars, SGlobals, Arrays, Critters }
|
||||
|
||||
private readonly EditorConnection connection;
|
||||
private Mode mode;
|
||||
|
||||
private readonly Dictionary<int, string> GlobNames=new Dictionary<int, string>();
|
||||
private readonly Dictionary<uint, string> CritNames=new Dictionary<uint, string>();
|
||||
|
||||
private void Redraw() {
|
||||
dataGridView1.SuspendLayout();
|
||||
dataGridView1.Rows.Clear();
|
||||
switch(mode) {
|
||||
case Mode.Globals:
|
||||
Column2.ReadOnly=false;
|
||||
Column3.ReadOnly=false;
|
||||
Column2.HeaderText="Value (Int)";
|
||||
Column3.HeaderText="Value (Float)";
|
||||
bEdit.Enabled=false;
|
||||
for(int i=0;i<connection.Globals.Length;i++) {
|
||||
string name=GlobNames.ContainsKey(i)?GlobNames[i]:"";
|
||||
dataGridView1.Rows.Add(i, name, connection.Globals[i], converter.GetAsFloat(connection.Globals[i]));
|
||||
}
|
||||
break;
|
||||
case Mode.MapVars:
|
||||
Column2.ReadOnly=false;
|
||||
Column3.ReadOnly=false;
|
||||
Column2.HeaderText="Value (Int)";
|
||||
Column3.HeaderText="Value (Float)";
|
||||
bEdit.Enabled=false;
|
||||
for(int i=0;i<connection.MapVars.Length;i++) {
|
||||
dataGridView1.Rows.Add(i, "", connection.MapVars[i], converter.GetAsFloat(connection.MapVars[i]));
|
||||
}
|
||||
break;
|
||||
case Mode.SGlobals:
|
||||
Column2.ReadOnly=false;
|
||||
Column3.ReadOnly=false;
|
||||
Column2.HeaderText="Value (Int)";
|
||||
Column3.HeaderText="Value (Float)";
|
||||
bEdit.Enabled=false;
|
||||
for(int i=0;i<connection.SGlobalKeys.Length;i++) {
|
||||
string s=connection.SGlobalKeys[i]>0xffffffff?new string(System.Text.ASCIIEncoding.ASCII.GetChars(converter.GetAsBytes(connection.SGlobalKeys[i]))):("0x"+connection.SGlobalKeys[i].ToString("x"));
|
||||
dataGridView1.Rows.Add(s, "", connection.sGlobals[i], converter.GetAsFloat(connection.sGlobals[i]));
|
||||
}
|
||||
break;
|
||||
case Mode.Arrays:
|
||||
Column2.ReadOnly=true;
|
||||
Column3.ReadOnly=true;
|
||||
Column2.HeaderText="Array length";
|
||||
Column3.HeaderText="Element size";
|
||||
bEdit.Enabled=true;
|
||||
for(int i=0;i<connection.Arrays.Length;i++) {
|
||||
dataGridView1.Rows.Add(connection.Arrays[i], "", connection.ArrayLengths[i], connection.ArrayDataSizes[i]);
|
||||
}
|
||||
break;
|
||||
case Mode.Critters:
|
||||
Column2.ReadOnly=true;
|
||||
Column3.ReadOnly=true;
|
||||
Column2.HeaderText="pid";
|
||||
Column3.HeaderText="";
|
||||
bEdit.Enabled=true;
|
||||
for(int i=0;i<connection.Critters.Length;i++) {
|
||||
uint modcrit=(connection.Critters[i]&0xfffff);
|
||||
string name=CritNames.ContainsKey(modcrit)?CritNames[modcrit]:"";
|
||||
dataGridView1.Rows.Add(i+1, name, connection.Critters[i].ToString("x"), "");
|
||||
}
|
||||
break;
|
||||
}
|
||||
dataGridView1.ResumeLayout();
|
||||
}
|
||||
|
||||
internal DebugEditor(EditorConnection connection) {
|
||||
InitializeComponent();
|
||||
this.connection=connection;
|
||||
mode=Mode.Globals;
|
||||
if(File.Exists("globals.txt")) {
|
||||
StreamReader sr=new StreamReader("globals.txt");
|
||||
while(!sr.EndOfStream) {
|
||||
string[] line=sr.ReadLine().Split(' ');
|
||||
GlobNames[int.Parse(line[0])]=line[1];
|
||||
}
|
||||
sr.Close();
|
||||
}
|
||||
if(File.Exists("critters.txt")) {
|
||||
StreamReader sr=new StreamReader("critters.txt");
|
||||
while(!sr.EndOfStream) {
|
||||
string line=sr.ReadLine();
|
||||
CritNames[uint.Parse(line.Remove(line.IndexOf(' ')))]=line.Substring(line.IndexOf(' ')+1);
|
||||
}
|
||||
sr.Close();
|
||||
}
|
||||
Redraw();
|
||||
}
|
||||
|
||||
private void DebugEditor_FormClosing(object sender, FormClosingEventArgs e) {
|
||||
connection.WriteDataType(DataTypeSend.Exit);
|
||||
connection.Close();
|
||||
}
|
||||
|
||||
private void bGlobals_Click(object sender, EventArgs e) {
|
||||
mode=Mode.Globals;
|
||||
Redraw();
|
||||
}
|
||||
|
||||
private void bMapVars_Click(object sender, EventArgs e) {
|
||||
mode=Mode.MapVars;
|
||||
Redraw();
|
||||
}
|
||||
|
||||
private void bSGlobals_Click(object sender, EventArgs e) {
|
||||
mode=Mode.SGlobals;
|
||||
Redraw();
|
||||
}
|
||||
|
||||
private void bArrays_Click(object sender, EventArgs e) {
|
||||
mode=Mode.Arrays;
|
||||
Redraw();
|
||||
}
|
||||
|
||||
private void bCritters_Click(object sender, EventArgs e) {
|
||||
mode=Mode.Critters;
|
||||
Redraw();
|
||||
}
|
||||
|
||||
private void dataGridView1_CellEndEdit(object sender, DataGridViewCellEventArgs e) {
|
||||
int[] array=null;
|
||||
DataTypeSend dts;
|
||||
switch(mode) {
|
||||
case Mode.Globals:
|
||||
array=connection.Globals;
|
||||
dts=DataTypeSend.SetGlobal;
|
||||
break;
|
||||
case Mode.MapVars:
|
||||
array=connection.MapVars;
|
||||
dts=DataTypeSend.SetMapVar;
|
||||
break;
|
||||
case Mode.SGlobals:
|
||||
array=connection.sGlobals;
|
||||
dts=DataTypeSend.SetSGlobal;
|
||||
break;
|
||||
default:
|
||||
return;
|
||||
}
|
||||
if(e.ColumnIndex==2) {
|
||||
int val;
|
||||
if(!int.TryParse(dataGridView1.Rows[e.RowIndex].Cells[e.ColumnIndex].Value.ToString(), out val)) {
|
||||
dataGridView1.Rows[e.RowIndex].Cells[e.ColumnIndex].Value=array[e.RowIndex];
|
||||
} else {
|
||||
array[e.RowIndex]=val;
|
||||
connection.WriteDataType(dts);
|
||||
connection.WriteInt(e.RowIndex);
|
||||
connection.WriteInt(val);
|
||||
}
|
||||
} else {
|
||||
float val;
|
||||
if(!float.TryParse(dataGridView1.Rows[e.RowIndex].Cells[e.ColumnIndex].Value.ToString(), out val)) {
|
||||
dataGridView1.Rows[e.RowIndex].Cells[e.ColumnIndex].Value=array[e.RowIndex];
|
||||
} else {
|
||||
array[e.RowIndex]=converter.GetAsInt(val);
|
||||
connection.WriteDataType(dts);
|
||||
connection.WriteInt(e.RowIndex);
|
||||
connection.WriteInt(converter.GetAsInt(val));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void bEdit_Click(object sender, EventArgs e) {
|
||||
if(dataGridView1.SelectedRows.Count!=1) return;
|
||||
int i=dataGridView1.SelectedRows[0].Index;
|
||||
switch(mode) {
|
||||
case Mode.Arrays: {
|
||||
DataType[] types=new DataType[connection.ArrayLengths[i]];
|
||||
string[] strings=new string[connection.ArrayLengths[i]];
|
||||
connection.WriteDataType(DataTypeSend.GetArray);
|
||||
connection.WriteInt(i);
|
||||
for(int j=0;j<strings.Length;j++) types[j]=(DataType)connection.ReadInt();
|
||||
byte[] buf=connection.ReadBytes(connection.ArrayLengths[i]*connection.ArrayDataSizes[i]);
|
||||
MemoryStream ms=new MemoryStream(buf);
|
||||
BinaryReader br=new BinaryReader(ms);
|
||||
for(int j=0;j<strings.Length;j++) {
|
||||
ms.Position=j*connection.ArrayDataSizes[i];
|
||||
switch(types[j]) {
|
||||
case DataType.Int:
|
||||
strings[j]=br.ReadInt32().ToString();
|
||||
break;
|
||||
case DataType.Float:
|
||||
strings[j]=br.ReadSingle().ToString();
|
||||
break;
|
||||
case DataType.String:
|
||||
byte[] bytes=br.ReadBytes(connection.ArrayDataSizes[i]);
|
||||
strings[j]=System.Text.Encoding.ASCII.GetString(bytes, 0, Array.IndexOf<byte>(bytes, 0));
|
||||
break;
|
||||
}
|
||||
}
|
||||
br.Close();
|
||||
strings=EditorWindow.ShowEditor(null, types, strings);
|
||||
if(strings!=null) {
|
||||
connection.WriteDataType(DataTypeSend.SetArray);
|
||||
connection.WriteInt(i);
|
||||
ms=new MemoryStream(connection.ArrayLengths[i]*connection.ArrayDataSizes[i]);
|
||||
BinaryWriter bw=new BinaryWriter(ms);
|
||||
for(int j=0;j<strings.Length;j++) {
|
||||
ms.Position=j*connection.ArrayDataSizes[i];
|
||||
switch(types[j]) {
|
||||
case DataType.Int:
|
||||
bw.Write(int.Parse(strings[j]));
|
||||
break;
|
||||
case DataType.Float:
|
||||
bw.Write(float.Parse(strings[j]));
|
||||
break;
|
||||
case DataType.String:
|
||||
byte[] bytes=System.Text.Encoding.ASCII.GetBytes(strings[j]);
|
||||
if(bytes.Length<connection.ArrayDataSizes[i]) bw.Write(bytes);
|
||||
else bw.Write(bytes, 0, connection.ArrayDataSizes[i]-1);
|
||||
bw.Write(0);
|
||||
break;
|
||||
}
|
||||
}
|
||||
connection.WriteBytes(ms.GetBuffer(), 0, connection.ArrayLengths[i]*connection.ArrayDataSizes[i]);
|
||||
bw.Close();
|
||||
}
|
||||
}
|
||||
break;
|
||||
case Mode.Critters: {
|
||||
DataType[] types=new DataType[29];
|
||||
string[] strings=new string[29];
|
||||
string[] names=new string[29];
|
||||
connection.WriteDataType(DataTypeSend.RetrieveCritter);
|
||||
connection.WriteInt(i);
|
||||
BinaryReader br=new BinaryReader(new System.IO.MemoryStream(connection.ReadBytes(29*4)));
|
||||
for(int j=0;j<29;j++) {
|
||||
types[j]=DataType.Int;
|
||||
strings[j]=br.ReadInt32().ToString();
|
||||
names[j]="0x"+(j*4).ToString("x");
|
||||
}
|
||||
br.Close();
|
||||
names[1]="Tile";
|
||||
names[10]="Elevation";
|
||||
names[11]="Inventory count";
|
||||
names[13]="Inventory pointer";
|
||||
names[16]="Current AP";
|
||||
names[17]="Crippled limbs";
|
||||
names[22]="HP";
|
||||
names[23]="Rads";
|
||||
names[24]="Poison";
|
||||
names[25]="Proto ID";
|
||||
strings=EditorWindow.ShowEditor(names, types, strings);
|
||||
if(strings!=null) {
|
||||
MemoryStream ms=new MemoryStream(29*4);
|
||||
BinaryWriter bw=new BinaryWriter(ms);
|
||||
for(int j=0;j<29;j++) bw.Write(int.Parse(strings[j]));
|
||||
connection.WriteDataType(DataTypeSend.SetCritter);
|
||||
connection.WriteInt(i);
|
||||
connection.WriteBytes(ms.GetBuffer(), 0, 29*4);
|
||||
bw.Close();
|
||||
}
|
||||
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,132 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<root>
|
||||
<!--
|
||||
Microsoft ResX Schema
|
||||
|
||||
Version 2.0
|
||||
|
||||
The primary goals of this format is to allow a simple XML format
|
||||
that is mostly human readable. The generation and parsing of the
|
||||
various data types are done through the TypeConverter classes
|
||||
associated with the data types.
|
||||
|
||||
Example:
|
||||
|
||||
... ado.net/XML headers & schema ...
|
||||
<resheader name="resmimetype">text/microsoft-resx</resheader>
|
||||
<resheader name="version">2.0</resheader>
|
||||
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
|
||||
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
|
||||
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
|
||||
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
|
||||
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
|
||||
<value>[base64 mime encoded serialized .NET Framework object]</value>
|
||||
</data>
|
||||
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
|
||||
<comment>This is a comment</comment>
|
||||
</data>
|
||||
|
||||
There are any number of "resheader" rows that contain simple
|
||||
name/value pairs.
|
||||
|
||||
Each data row contains a name, and value. The row also contains a
|
||||
type or mimetype. Type corresponds to a .NET class that support
|
||||
text/value conversion through the TypeConverter architecture.
|
||||
Classes that don't support this are serialized and stored with the
|
||||
mimetype set.
|
||||
|
||||
The mimetype is used for serialized objects, and tells the
|
||||
ResXResourceReader how to depersist the object. This is currently not
|
||||
extensible. For a given mimetype the value must be set accordingly:
|
||||
|
||||
Note - application/x-microsoft.net.object.binary.base64 is the format
|
||||
that the ResXResourceWriter will generate, however the reader can
|
||||
read any of the formats listed below.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.binary.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.soap.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.bytearray.base64
|
||||
value : The object must be serialized into a byte array
|
||||
: using a System.ComponentModel.TypeConverter
|
||||
: and then encoded with base64 encoding.
|
||||
-->
|
||||
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
|
||||
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
|
||||
<xsd:element name="root" msdata:IsDataSet="true">
|
||||
<xsd:complexType>
|
||||
<xsd:choice maxOccurs="unbounded">
|
||||
<xsd:element name="metadata">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" use="required" type="xsd:string" />
|
||||
<xsd:attribute name="type" type="xsd:string" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="assembly">
|
||||
<xsd:complexType>
|
||||
<xsd:attribute name="alias" type="xsd:string" />
|
||||
<xsd:attribute name="name" type="xsd:string" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="data">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
|
||||
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="resheader">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:choice>
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:schema>
|
||||
<resheader name="resmimetype">
|
||||
<value>text/microsoft-resx</value>
|
||||
</resheader>
|
||||
<resheader name="version">
|
||||
<value>2.0</value>
|
||||
</resheader>
|
||||
<resheader name="reader">
|
||||
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<resheader name="writer">
|
||||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<metadata name="Column0.UserAddedColumn" type="System.Boolean, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>True</value>
|
||||
</metadata>
|
||||
<metadata name="Column1.UserAddedColumn" type="System.Boolean, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>True</value>
|
||||
</metadata>
|
||||
<metadata name="Column2.UserAddedColumn" type="System.Boolean, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>True</value>
|
||||
</metadata>
|
||||
<metadata name="Column3.UserAddedColumn" type="System.Boolean, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>True</value>
|
||||
</metadata>
|
||||
</root>
|
||||
@@ -0,0 +1,103 @@
|
||||
using System;
|
||||
using System.Net.Sockets;
|
||||
using System.IO;
|
||||
|
||||
namespace FalloutClient {
|
||||
class EditorConnection {
|
||||
private TcpClient client;
|
||||
private NetworkStream stream;
|
||||
private BinaryReader br;
|
||||
private BinaryWriter bw;
|
||||
|
||||
public readonly int[] Globals;
|
||||
public readonly int[] MapVars;
|
||||
public readonly uint[] Critters;
|
||||
public readonly ulong[] SGlobalKeys;
|
||||
public readonly int[] sGlobals;
|
||||
public readonly uint[] Arrays;
|
||||
public readonly int[] ArrayLengths;
|
||||
public readonly int[] ArrayDataSizes;
|
||||
|
||||
public EditorConnection() {
|
||||
System.Threading.Thread.Sleep(1000);
|
||||
client=new TcpClient("127.0.0.1", 4245);
|
||||
stream=client.GetStream();
|
||||
br=new BinaryReader(stream);
|
||||
bw=new BinaryWriter(stream);
|
||||
Globals=new int[br.ReadInt32()];
|
||||
MapVars=new int[br.ReadInt32()];
|
||||
SGlobalKeys=new ulong[br.ReadInt32()];
|
||||
sGlobals=new int[SGlobalKeys.Length];
|
||||
Arrays=new uint[br.ReadInt32()];
|
||||
ArrayLengths=new int[Arrays.Length];
|
||||
ArrayDataSizes=new int[Arrays.Length];
|
||||
Critters=new uint[br.ReadInt32()];
|
||||
|
||||
for(int i=0;i<Globals.Length;i++) Globals[i]=br.ReadInt32();
|
||||
for(int i=0;i<MapVars.Length;i++) MapVars[i]=br.ReadInt32();
|
||||
for(int i=0;i<sGlobals.Length;i++) {
|
||||
SGlobalKeys[i]=br.ReadUInt64();
|
||||
sGlobals[i]=br.ReadInt32();
|
||||
br.ReadInt32();
|
||||
}
|
||||
for(int i=0;i<Arrays.Length;i++) {
|
||||
Arrays[i]=br.ReadUInt32();
|
||||
ArrayLengths[i]=br.ReadInt32();
|
||||
ArrayDataSizes[i]=br.ReadInt32();
|
||||
}
|
||||
for(int i=0;i<Critters.Length;i++) Critters[i]=br.ReadUInt32();
|
||||
}
|
||||
|
||||
public void Close() {
|
||||
stream.Close();
|
||||
client.Close();
|
||||
stream=null;
|
||||
client=null;
|
||||
}
|
||||
|
||||
public void WriteDataType(DataTypeSend type) {
|
||||
stream.WriteByte((byte)type);
|
||||
//bw.Write((byte)type);
|
||||
}
|
||||
public void WriteByte(byte b) { bw.Write(b); }
|
||||
public void WriteInt16(short value) { bw.Write(value); }
|
||||
public void WriteInt(int value) { bw.Write(value); }
|
||||
public void WriteBytes(byte[] buf) { bw.Write(buf); }
|
||||
public void WriteBytes(byte[] buf, int start, int len) {
|
||||
bw.Write(buf, start, len);
|
||||
}
|
||||
|
||||
public void Read(byte[] buffer) {
|
||||
int upto=0;
|
||||
while(upto<buffer.Length) {
|
||||
upto+=stream.Read(buffer, upto, buffer.Length-upto);
|
||||
}
|
||||
}
|
||||
public void Read(byte[] buffer, int offset, int length) {
|
||||
int upto=0;
|
||||
//System.Diagnostics.Debug.WriteLine("Read - offset: "+offset+" length: "+length);
|
||||
while(upto<length) {
|
||||
upto+=stream.Read(buffer, offset+upto, length-upto);
|
||||
}
|
||||
}
|
||||
public int ReadByte() {
|
||||
//System.Diagnostics.Debug.WriteLine("Read byte");
|
||||
return stream.ReadByte();
|
||||
}
|
||||
public int ReadShort() {
|
||||
//System.Diagnostics.Debug.WriteLine("Read short");
|
||||
return br.ReadInt16();
|
||||
}
|
||||
public int ReadInt() {
|
||||
//System.Diagnostics.Debug.WriteLine("Read int");
|
||||
return br.ReadInt32();
|
||||
}
|
||||
public uint ReadUInt() {
|
||||
//System.Diagnostics.Debug.WriteLine("Read uint");
|
||||
return br.ReadUInt32();
|
||||
}
|
||||
public byte[] ReadBytes(int count) {
|
||||
return br.ReadBytes(count);
|
||||
}
|
||||
}
|
||||
}
|
||||
Generated
+116
@@ -0,0 +1,116 @@
|
||||
namespace FalloutClient {
|
||||
partial class EditorWindow {
|
||||
/// <summary>
|
||||
/// Required designer variable.
|
||||
/// </summary>
|
||||
private System.ComponentModel.IContainer components = null;
|
||||
|
||||
/// <summary>
|
||||
/// Clean up any resources being used.
|
||||
/// </summary>
|
||||
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
|
||||
protected override void Dispose(bool disposing) {
|
||||
if(disposing && (components != null)) {
|
||||
components.Dispose();
|
||||
}
|
||||
base.Dispose(disposing);
|
||||
}
|
||||
|
||||
#region Windows Form Designer generated code
|
||||
|
||||
/// <summary>
|
||||
/// Required method for Designer support - do not modify
|
||||
/// the contents of this method with the code editor.
|
||||
/// </summary>
|
||||
private void InitializeComponent() {
|
||||
this.bSave = new System.Windows.Forms.Button();
|
||||
this.bCancel = new System.Windows.Forms.Button();
|
||||
this.dataGridView1 = new System.Windows.Forms.DataGridView();
|
||||
this.Column1 = new System.Windows.Forms.DataGridViewTextBoxColumn();
|
||||
this.Column2 = new System.Windows.Forms.DataGridViewTextBoxColumn();
|
||||
this.Column3 = new System.Windows.Forms.DataGridViewTextBoxColumn();
|
||||
((System.ComponentModel.ISupportInitialize)(this.dataGridView1)).BeginInit();
|
||||
this.SuspendLayout();
|
||||
//
|
||||
// bSave
|
||||
//
|
||||
this.bSave.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
|
||||
this.bSave.Location = new System.Drawing.Point(281, 265);
|
||||
this.bSave.Name = "bSave";
|
||||
this.bSave.Size = new System.Drawing.Size(75, 23);
|
||||
this.bSave.TabIndex = 0;
|
||||
this.bSave.Text = "Save";
|
||||
this.bSave.UseVisualStyleBackColor = true;
|
||||
this.bSave.Click += new System.EventHandler(this.bSave_Click);
|
||||
//
|
||||
// bCancel
|
||||
//
|
||||
this.bCancel.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
|
||||
this.bCancel.Location = new System.Drawing.Point(200, 265);
|
||||
this.bCancel.Name = "bCancel";
|
||||
this.bCancel.Size = new System.Drawing.Size(75, 23);
|
||||
this.bCancel.TabIndex = 1;
|
||||
this.bCancel.Text = "Cancel";
|
||||
this.bCancel.UseVisualStyleBackColor = true;
|
||||
this.bCancel.Click += new System.EventHandler(this.bCancel_Click);
|
||||
//
|
||||
// dataGridView1
|
||||
//
|
||||
this.dataGridView1.AllowUserToAddRows = false;
|
||||
this.dataGridView1.AllowUserToDeleteRows = false;
|
||||
this.dataGridView1.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
|
||||
| System.Windows.Forms.AnchorStyles.Left)
|
||||
| System.Windows.Forms.AnchorStyles.Right)));
|
||||
this.dataGridView1.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize;
|
||||
this.dataGridView1.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] {
|
||||
this.Column1,
|
||||
this.Column2,
|
||||
this.Column3});
|
||||
this.dataGridView1.Location = new System.Drawing.Point(12, 12);
|
||||
this.dataGridView1.Name = "dataGridView1";
|
||||
this.dataGridView1.Size = new System.Drawing.Size(344, 247);
|
||||
this.dataGridView1.TabIndex = 2;
|
||||
this.dataGridView1.CellEndEdit += new System.Windows.Forms.DataGridViewCellEventHandler(this.dataGridView1_CellEndEdit);
|
||||
//
|
||||
// Column1
|
||||
//
|
||||
this.Column1.HeaderText = "Name";
|
||||
this.Column1.Name = "Column1";
|
||||
this.Column1.ReadOnly = true;
|
||||
//
|
||||
// Column2
|
||||
//
|
||||
this.Column2.HeaderText = "Type";
|
||||
this.Column2.Name = "Column2";
|
||||
this.Column2.ReadOnly = true;
|
||||
//
|
||||
// Column3
|
||||
//
|
||||
this.Column3.HeaderText = "Value";
|
||||
this.Column3.Name = "Column3";
|
||||
//
|
||||
// EditorWindow
|
||||
//
|
||||
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
|
||||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
||||
this.ClientSize = new System.Drawing.Size(368, 300);
|
||||
this.Controls.Add(this.dataGridView1);
|
||||
this.Controls.Add(this.bCancel);
|
||||
this.Controls.Add(this.bSave);
|
||||
this.Name = "EditorWindow";
|
||||
this.Text = "EditorWindow";
|
||||
((System.ComponentModel.ISupportInitialize)(this.dataGridView1)).EndInit();
|
||||
this.ResumeLayout(false);
|
||||
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
private System.Windows.Forms.Button bSave;
|
||||
private System.Windows.Forms.Button bCancel;
|
||||
private System.Windows.Forms.DataGridView dataGridView1;
|
||||
private System.Windows.Forms.DataGridViewTextBoxColumn Column1;
|
||||
private System.Windows.Forms.DataGridViewTextBoxColumn Column2;
|
||||
private System.Windows.Forms.DataGridViewTextBoxColumn Column3;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,56 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Windows.Forms;
|
||||
|
||||
namespace FalloutClient {
|
||||
public enum DataType : int { None=0, Int=1, Float=2, String=3 }
|
||||
public partial class EditorWindow : Form {
|
||||
private readonly DataType[] types;
|
||||
private readonly string[] values;
|
||||
private bool save;
|
||||
|
||||
private EditorWindow(string[] names, DataType[] types, string[] values) {
|
||||
this.types=types;
|
||||
this.values=values;
|
||||
InitializeComponent();
|
||||
dataGridView1.SuspendLayout();
|
||||
if(names==null) for(int i=0;i<types.Length;i++) dataGridView1.Rows.Add(i.ToString(), types[i].ToString(), values[i]);
|
||||
else for(int i=0;i<types.Length;i++) dataGridView1.Rows.Add(names[i], types[i].ToString(), values[i]);
|
||||
dataGridView1.ResumeLayout();
|
||||
}
|
||||
|
||||
public static string[] ShowEditor(string[] names, DataType[] types, string[] values) {
|
||||
EditorWindow editor=new EditorWindow(names, types, values);
|
||||
editor.ShowDialog();
|
||||
if(editor.save) return editor.values;
|
||||
else return null;
|
||||
}
|
||||
|
||||
private bool CheckInput(DataType type, string str) {
|
||||
switch(type) {
|
||||
case DataType.Int:
|
||||
int i;
|
||||
return int.TryParse(str, out i);
|
||||
case DataType.Float:
|
||||
float f;
|
||||
return float.TryParse(str, out f);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
private void dataGridView1_CellEndEdit(object sender, DataGridViewCellEventArgs e) {
|
||||
string str=(string)dataGridView1.Rows[e.RowIndex].Cells[e.ColumnIndex].Value;
|
||||
if(CheckInput(types[e.RowIndex], str)) values[e.RowIndex]=str;
|
||||
else dataGridView1.Rows[e.RowIndex].Cells[e.ColumnIndex].Value=values[e.RowIndex];
|
||||
}
|
||||
|
||||
private void bCancel_Click(object sender, EventArgs e) {
|
||||
Close();
|
||||
}
|
||||
|
||||
private void bSave_Click(object sender, EventArgs e) {
|
||||
save=true;
|
||||
Close();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,138 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<root>
|
||||
<!--
|
||||
Microsoft ResX Schema
|
||||
|
||||
Version 2.0
|
||||
|
||||
The primary goals of this format is to allow a simple XML format
|
||||
that is mostly human readable. The generation and parsing of the
|
||||
various data types are done through the TypeConverter classes
|
||||
associated with the data types.
|
||||
|
||||
Example:
|
||||
|
||||
... ado.net/XML headers & schema ...
|
||||
<resheader name="resmimetype">text/microsoft-resx</resheader>
|
||||
<resheader name="version">2.0</resheader>
|
||||
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
|
||||
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
|
||||
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
|
||||
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
|
||||
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
|
||||
<value>[base64 mime encoded serialized .NET Framework object]</value>
|
||||
</data>
|
||||
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
|
||||
<comment>This is a comment</comment>
|
||||
</data>
|
||||
|
||||
There are any number of "resheader" rows that contain simple
|
||||
name/value pairs.
|
||||
|
||||
Each data row contains a name, and value. The row also contains a
|
||||
type or mimetype. Type corresponds to a .NET class that support
|
||||
text/value conversion through the TypeConverter architecture.
|
||||
Classes that don't support this are serialized and stored with the
|
||||
mimetype set.
|
||||
|
||||
The mimetype is used for serialized objects, and tells the
|
||||
ResXResourceReader how to depersist the object. This is currently not
|
||||
extensible. For a given mimetype the value must be set accordingly:
|
||||
|
||||
Note - application/x-microsoft.net.object.binary.base64 is the format
|
||||
that the ResXResourceWriter will generate, however the reader can
|
||||
read any of the formats listed below.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.binary.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.soap.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.bytearray.base64
|
||||
value : The object must be serialized into a byte array
|
||||
: using a System.ComponentModel.TypeConverter
|
||||
: and then encoded with base64 encoding.
|
||||
-->
|
||||
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
|
||||
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
|
||||
<xsd:element name="root" msdata:IsDataSet="true">
|
||||
<xsd:complexType>
|
||||
<xsd:choice maxOccurs="unbounded">
|
||||
<xsd:element name="metadata">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" use="required" type="xsd:string" />
|
||||
<xsd:attribute name="type" type="xsd:string" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="assembly">
|
||||
<xsd:complexType>
|
||||
<xsd:attribute name="alias" type="xsd:string" />
|
||||
<xsd:attribute name="name" type="xsd:string" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="data">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
|
||||
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="resheader">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:choice>
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:schema>
|
||||
<resheader name="resmimetype">
|
||||
<value>text/microsoft-resx</value>
|
||||
</resheader>
|
||||
<resheader name="version">
|
||||
<value>2.0</value>
|
||||
</resheader>
|
||||
<resheader name="reader">
|
||||
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<resheader name="writer">
|
||||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<metadata name="Column1.UserAddedColumn" type="System.Boolean, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>True</value>
|
||||
</metadata>
|
||||
<metadata name="Column2.UserAddedColumn" type="System.Boolean, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>True</value>
|
||||
</metadata>
|
||||
<metadata name="Column3.UserAddedColumn" type="System.Boolean, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>True</value>
|
||||
</metadata>
|
||||
<metadata name="Column1.UserAddedColumn" type="System.Boolean, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>True</value>
|
||||
</metadata>
|
||||
<metadata name="Column2.UserAddedColumn" type="System.Boolean, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>True</value>
|
||||
</metadata>
|
||||
<metadata name="Column3.UserAddedColumn" type="System.Boolean, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>True</value>
|
||||
</metadata>
|
||||
</root>
|
||||
@@ -0,0 +1,76 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="4.0">
|
||||
<PropertyGroup>
|
||||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
||||
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
|
||||
<ProductVersion>9.0.21022</ProductVersion>
|
||||
<SchemaVersion>2.0</SchemaVersion>
|
||||
<ProjectGuid>{80ED0DCE-100E-4EC9-A79D-2FBFA4CAD1E3}</ProjectGuid>
|
||||
<OutputType>WinExe</OutputType>
|
||||
<AppDesignerFolder>Properties</AppDesignerFolder>
|
||||
<RootNamespace>FalloutClient</RootNamespace>
|
||||
<AssemblyName>FalloutClient</AssemblyName>
|
||||
<FileUpgradeFlags>
|
||||
</FileUpgradeFlags>
|
||||
<OldToolsVersion>3.5</OldToolsVersion>
|
||||
<UpgradeBackupLocation>
|
||||
</UpgradeBackupLocation>
|
||||
<TargetFrameworkVersion>v2.0</TargetFrameworkVersion>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
|
||||
<DebugSymbols>true</DebugSymbols>
|
||||
<DebugType>full</DebugType>
|
||||
<Optimize>false</Optimize>
|
||||
<OutputPath>bin\Debug\</OutputPath>
|
||||
<DefineConstants>DEBUG;TRACE</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
|
||||
<DebugType>pdbonly</DebugType>
|
||||
<Optimize>true</Optimize>
|
||||
<OutputPath>bin\Release\</OutputPath>
|
||||
<DefineConstants>TRACE</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<Reference Include="System" />
|
||||
<Reference Include="System.Drawing" />
|
||||
<Reference Include="System.Windows.Forms" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="DebugEditor.cs">
|
||||
<SubType>Form</SubType>
|
||||
</Compile>
|
||||
<Compile Include="DebugEditor.Designer.cs">
|
||||
<DependentUpon>DebugEditor.cs</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="EditorConnection.cs" />
|
||||
<Compile Include="EditorWindow.cs">
|
||||
<SubType>Form</SubType>
|
||||
</Compile>
|
||||
<Compile Include="EditorWindow.Designer.cs">
|
||||
<DependentUpon>EditorWindow.cs</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="Program.cs" />
|
||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||
<EmbeddedResource Include="DebugEditor.resx">
|
||||
<DependentUpon>DebugEditor.cs</DependentUpon>
|
||||
</EmbeddedResource>
|
||||
<EmbeddedResource Include="EditorWindow.resx">
|
||||
<DependentUpon>EditorWindow.cs</DependentUpon>
|
||||
</EmbeddedResource>
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
|
||||
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
|
||||
Other similar extension points exist, see Microsoft.Common.targets.
|
||||
<Target Name="BeforeBuild">
|
||||
</Target>
|
||||
<Target Name="AfterBuild">
|
||||
</Target>
|
||||
-->
|
||||
<PropertyGroup>
|
||||
<PostBuildEvent>copy "$(TargetPath)" "C:\Games\Fallout2\$(TargetName)$(TargetExt)"</PostBuildEvent>
|
||||
</PropertyGroup>
|
||||
</Project>
|
||||
@@ -0,0 +1,19 @@
|
||||
Microsoft Visual Studio Solution File, Format Version 11.00
|
||||
# Visual Studio 2010
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MPClient", "MPClient.csproj", "{80ED0DCE-100E-4EC9-A79D-2FBFA4CAD1E3}"
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
Debug|Any CPU = Debug|Any CPU
|
||||
Release|Any CPU = Release|Any CPU
|
||||
EndGlobalSection
|
||||
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
||||
{80ED0DCE-100E-4EC9-A79D-2FBFA4CAD1E3}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{80ED0DCE-100E-4EC9-A79D-2FBFA4CAD1E3}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{80ED0DCE-100E-4EC9-A79D-2FBFA4CAD1E3}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{80ED0DCE-100E-4EC9-A79D-2FBFA4CAD1E3}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
EndGlobalSection
|
||||
GlobalSection(SolutionProperties) = preSolution
|
||||
HideSolutionNode = FALSE
|
||||
EndGlobalSection
|
||||
EndGlobal
|
||||
@@ -0,0 +1,28 @@
|
||||
using System;
|
||||
using System.Windows.Forms;
|
||||
using System.IO;
|
||||
|
||||
namespace FalloutClient {
|
||||
static class Program {
|
||||
/// <summary>
|
||||
/// The main entry point for the application.
|
||||
/// </summary>
|
||||
[STAThread]
|
||||
static void Main(string[] args) {
|
||||
Application.EnableVisualStyles();
|
||||
Application.SetCompatibleTextRenderingDefault(false);
|
||||
|
||||
if(args.Length==1&&args[0]=="-debugedit") {
|
||||
Application.Run(new DebugEditor(new EditorConnection()));
|
||||
} else {
|
||||
throw new Exception("Multiplayer is no longer supported");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
enum DataTypeSend {
|
||||
Mouse=0, LMouseDown=1, LMouseUp=2, RMouseDown=3, RMouseUp=4, TakeChar=5, ReleaseChar=6,
|
||||
SetGlobal=0, SetMapVar=1, RetrieveCritter=2, SetCritter=3, SetSGlobal=4, GetArray=9, SetArray=10,
|
||||
Exit=254
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,33 @@
|
||||
using System.Reflection;
|
||||
using System.Runtime.CompilerServices;
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
// General Information about an assembly is controlled through the following
|
||||
// set of attributes. Change these attribute values to modify the information
|
||||
// associated with an assembly.
|
||||
[assembly: AssemblyTitle("FalloutClient")]
|
||||
[assembly: AssemblyDescription("")]
|
||||
[assembly: AssemblyConfiguration("")]
|
||||
[assembly: AssemblyCompany("")]
|
||||
[assembly: AssemblyProduct("FalloutClient")]
|
||||
[assembly: AssemblyCopyright("Copyright © 2009")]
|
||||
[assembly: AssemblyTrademark("")]
|
||||
[assembly: AssemblyCulture("")]
|
||||
|
||||
// Setting ComVisible to false makes the types in this assembly not visible
|
||||
// to COM components. If you need to access a type in this assembly from
|
||||
// COM, set the ComVisible attribute to true on that type.
|
||||
[assembly: ComVisible(false)]
|
||||
|
||||
// The following GUID is for the ID of the typelib if this project is exposed to COM
|
||||
[assembly: Guid("6b3c8cd6-54f0-4f35-a87e-50f760ad36fd")]
|
||||
|
||||
// Version information for an assembly consists of the following four values:
|
||||
//
|
||||
// Major Version
|
||||
// Minor Version
|
||||
// Build Number
|
||||
// Revision
|
||||
//
|
||||
[assembly: AssemblyVersion("1.0.0.0")]
|
||||
[assembly: AssemblyFileVersion("1.0.0.0")]
|
||||
@@ -0,0 +1,15 @@
|
||||
; Top-most EditorConfig file
|
||||
root = true
|
||||
|
||||
; 4-column tab indentation
|
||||
[*.cpp]
|
||||
indent_style = tab
|
||||
indent_size = 4
|
||||
|
||||
[*.h]
|
||||
indent_style = tab
|
||||
indent_size = 4
|
||||
|
||||
[*.hpp]
|
||||
indent_style = tab
|
||||
indent_size = 4
|
||||
+126
@@ -0,0 +1,126 @@
|
||||
/*
|
||||
* sfall
|
||||
* Copyright (C) 2012 The sfall team
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#include "main.h"
|
||||
#include "AI.h"
|
||||
#include "SafeWrite.h"
|
||||
#include "FalloutEngine.h"
|
||||
|
||||
#include <hash_map>
|
||||
|
||||
typedef stdext::hash_map<DWORD, DWORD> :: const_iterator iter;
|
||||
|
||||
static stdext::hash_map<DWORD,DWORD> targets;
|
||||
static stdext::hash_map<DWORD,DWORD> sources;
|
||||
|
||||
DWORD _stdcall AIGetLastAttacker(DWORD target) {
|
||||
iter itr=sources.find(target);
|
||||
if(itr==sources.end()) return 0;
|
||||
else return itr->second;
|
||||
}
|
||||
|
||||
DWORD _stdcall AIGetLastTarget(DWORD source) {
|
||||
iter itr=targets.find(source);
|
||||
if(itr==targets.end()) return 0;
|
||||
else return itr->second;
|
||||
}
|
||||
|
||||
static void _stdcall CombatAttackHook(DWORD source, DWORD target) {
|
||||
sources[target]=source;
|
||||
targets[source]=target;
|
||||
}
|
||||
|
||||
//static const DWORD _ai_attack=0x42A748;
|
||||
static const DWORD _combat_attack=0x422F3C;
|
||||
static void __declspec(naked) combat_attack_hook() {
|
||||
_asm {
|
||||
pushad;
|
||||
push edx;
|
||||
push eax;
|
||||
call CombatAttackHook;
|
||||
popad;
|
||||
jmp _combat_attack;
|
||||
}
|
||||
}
|
||||
|
||||
static DWORD CombatDisabled;
|
||||
static char CombatBlockedMessage[128];
|
||||
|
||||
static void _stdcall CombatBlocked() {
|
||||
DisplayConsoleMessage(CombatBlockedMessage);
|
||||
}
|
||||
|
||||
static const DWORD BlockCombatHook1Ret1=0x45F6B4;
|
||||
static const DWORD BlockCombatHook1Ret2=0x45F6D7;
|
||||
static void __declspec(naked) BlockCombatHook1() {
|
||||
__asm {
|
||||
mov eax, CombatDisabled;
|
||||
test eax, eax;
|
||||
jz end;
|
||||
call CombatBlocked;
|
||||
jmp BlockCombatHook1Ret2;
|
||||
end:
|
||||
mov eax, 0x14;
|
||||
jmp BlockCombatHook1Ret1;
|
||||
}
|
||||
}
|
||||
|
||||
static void __declspec(naked) BlockCombatHook2() {
|
||||
__asm {
|
||||
mov eax, dword ptr ds:[0x518F10];
|
||||
test eax, eax;
|
||||
jz end;
|
||||
mov eax, CombatDisabled;
|
||||
test eax, eax;
|
||||
jz succeed;
|
||||
pushad;
|
||||
call CombatBlocked;
|
||||
popad;
|
||||
xor eax, eax;
|
||||
jmp end;
|
||||
succeed:
|
||||
inc eax;
|
||||
end:
|
||||
retn;
|
||||
}
|
||||
}
|
||||
|
||||
void _stdcall AIBlockCombat(DWORD i) {
|
||||
if(i) CombatDisabled=1;
|
||||
else CombatDisabled=0;
|
||||
}
|
||||
|
||||
void AIInit() {
|
||||
//HookCall(0x42AE1D, ai_attack_hook);
|
||||
//HookCall(0x42AE5C, ai_attack_hook);
|
||||
HookCall(0x426A95, combat_attack_hook);
|
||||
HookCall(0x42A796, combat_attack_hook);
|
||||
MakeCall(0x45F6AF, BlockCombatHook1, true);
|
||||
HookCall(0x4432A6, BlockCombatHook2);
|
||||
GetPrivateProfileString("sfall", "BlockedCombat", "You cannot enter combat at this time.", CombatBlockedMessage, 128, translationIni);
|
||||
}
|
||||
|
||||
void _stdcall AICombatStart() {
|
||||
targets.clear();
|
||||
sources.clear();
|
||||
}
|
||||
|
||||
void _stdcall AICombatEnd() {
|
||||
targets.clear();
|
||||
sources.clear();
|
||||
}
|
||||
+26
@@ -0,0 +1,26 @@
|
||||
/*
|
||||
* sfall
|
||||
* Copyright (C) 2012 The sfall team
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
void AIInit();
|
||||
void _stdcall AICombatStart();
|
||||
void _stdcall AICombatEnd();
|
||||
|
||||
DWORD _stdcall AIGetLastAttacker(DWORD target);
|
||||
DWORD _stdcall AIGetLastTarget(DWORD source);
|
||||
|
||||
void _stdcall AIBlockCombat(DWORD i);
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,21 @@
|
||||
/*
|
||||
* sfall
|
||||
* Copyright (C) 2008, 2009 The sfall team
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
void AmmoModInit();
|
||||
@@ -0,0 +1,378 @@
|
||||
/*
|
||||
* sfall
|
||||
* Copyright (C) 2009, 2010 Mash (Matt Wells, mashw at bigpond dot net dot au)
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#include "main.h"
|
||||
|
||||
#include "AnimationsAtOnceLimit.h"
|
||||
|
||||
|
||||
static bool AniLimitFixActive=false;
|
||||
|
||||
//pointers to new animation struct arrays
|
||||
static BYTE *aniMem;
|
||||
static BYTE *aniMem2;
|
||||
|
||||
void AnimationsAtOnceInit(signed char aniMax) {
|
||||
|
||||
if(aniMax<=32) return;
|
||||
|
||||
AniLimitFixActive=true;
|
||||
|
||||
//allocate memory to store larger animation struct arrays
|
||||
aniMem = new BYTE[2656*(aniMax+1)];
|
||||
aniMem2 = new BYTE[3240*(aniMax+1)];
|
||||
|
||||
|
||||
//set general animation limit check (old 20) aniMax-12 -- +12 reserved for PC movement(4) + other critical animations(8)?
|
||||
SafeWrite8(0x413C07, aniMax-12);
|
||||
|
||||
//PC movement animation limit checks (old 24) aniMax-8 -- +8 reserved for other critical animations?.
|
||||
SafeWrite8(0x416E11, aniMax-8);
|
||||
SafeWrite8(0x416F64, aniMax-8);
|
||||
SafeWrite8(0x417143, aniMax-8);
|
||||
SafeWrite8(0x41725C, aniMax-8);
|
||||
SafeWrite8(0x4179CC, aniMax-8);
|
||||
|
||||
//Max animation limit checks (old 32) aniMax
|
||||
SafeWrite8(0x413A70, aniMax);
|
||||
SafeWrite8(0x413ADD, aniMax);
|
||||
SafeWrite8(0x413BDD, aniMax);
|
||||
SafeWrite8(0x413EB8, aniMax);
|
||||
SafeWrite8(0x413F4E, aniMax);
|
||||
SafeWrite8(0x4186F1, aniMax);
|
||||
|
||||
|
||||
//Max animations checks - animation struct size * max num of animations (old 2656*32=84992)
|
||||
SafeWrite32(0x413AA9, 2656*aniMax);
|
||||
SafeWrite32(0x413CB7, 2656*aniMax);
|
||||
SafeWrite32(0x413DC2, 2656*aniMax);
|
||||
SafeWrite32(0x417F3A, 2656*aniMax);
|
||||
|
||||
|
||||
//divert old animation structure list pointers to newly alocated memory
|
||||
|
||||
//struct array 1///////////////////
|
||||
|
||||
//old addr 0x54C1B4
|
||||
SafeWrite32(0x413A9E, (DWORD)aniMem);
|
||||
|
||||
//old addr 0x54C1C0
|
||||
SafeWrite32(0x413AA4, 12+(DWORD)aniMem);
|
||||
SafeWrite32(0x413DBC, 12+(DWORD)aniMem);
|
||||
|
||||
//old addr 0x54CC14
|
||||
SafeWrite32(0x413B96, 2656+(DWORD)aniMem);
|
||||
SafeWrite32(0x413C5A, 2656+(DWORD)aniMem);
|
||||
SafeWrite32(0x413CF0, 2656+(DWORD)aniMem);
|
||||
SafeWrite32(0x413DE1, 2656+(DWORD)aniMem);
|
||||
SafeWrite32(0x413E66, 2656+(DWORD)aniMem);
|
||||
SafeWrite32(0x413EF3, 2656+(DWORD)aniMem);
|
||||
SafeWrite32(0x413FA2, 2656+(DWORD)aniMem);
|
||||
SafeWrite32(0x414161, 2656+(DWORD)aniMem);
|
||||
SafeWrite32(0x4142D3, 2656+(DWORD)aniMem);
|
||||
SafeWrite32(0x41449A, 2656+(DWORD)aniMem);
|
||||
SafeWrite32(0x41460B, 2656+(DWORD)aniMem);
|
||||
SafeWrite32(0x4146FF, 2656+(DWORD)aniMem);
|
||||
SafeWrite32(0x414826, 2656+(DWORD)aniMem);
|
||||
SafeWrite32(0x41491A, 2656+(DWORD)aniMem);
|
||||
SafeWrite32(0x4149F8, 2656+(DWORD)aniMem);
|
||||
SafeWrite32(0x414AD0, 2656+(DWORD)aniMem);
|
||||
SafeWrite32(0x414BA4, 2656+(DWORD)aniMem);
|
||||
SafeWrite32(0x414C8C, 2656+(DWORD)aniMem);
|
||||
SafeWrite32(0x414CF0, 2656+(DWORD)aniMem);
|
||||
SafeWrite32(0x414D60, 2656+(DWORD)aniMem);
|
||||
SafeWrite32(0x414DD0, 2656+(DWORD)aniMem);
|
||||
SafeWrite32(0x414E48, 2656+(DWORD)aniMem);
|
||||
SafeWrite32(0x414EDA, 2656+(DWORD)aniMem);
|
||||
SafeWrite32(0x414F5E, 2656+(DWORD)aniMem);
|
||||
SafeWrite32(0x414FEE, 2656+(DWORD)aniMem);
|
||||
SafeWrite32(0x41505C, 2656+(DWORD)aniMem);
|
||||
SafeWrite32(0x4150D0, 2656+(DWORD)aniMem);
|
||||
SafeWrite32(0x415158, 2656+(DWORD)aniMem);
|
||||
SafeWrite32(0x4151B8, 2656+(DWORD)aniMem);
|
||||
SafeWrite32(0x415286, 2656+(DWORD)aniMem);
|
||||
SafeWrite32(0x41535C, 2656+(DWORD)aniMem);
|
||||
SafeWrite32(0x4153D0, 2656+(DWORD)aniMem);
|
||||
SafeWrite32(0x41544A, 2656+(DWORD)aniMem);
|
||||
SafeWrite32(0x4154EC, 2656+(DWORD)aniMem);
|
||||
SafeWrite32(0x4155EA, 2656+(DWORD)aniMem);
|
||||
SafeWrite32(0x4156C0, 2656+(DWORD)aniMem);
|
||||
SafeWrite32(0x4156D5, 2656+(DWORD)aniMem);
|
||||
SafeWrite32(0x4156F2, 2656+(DWORD)aniMem);
|
||||
SafeWrite32(0x41572F, 2656+(DWORD)aniMem);
|
||||
SafeWrite32(0x41573E, 2656+(DWORD)aniMem);
|
||||
SafeWrite32(0x415B1B, 2656+(DWORD)aniMem);
|
||||
SafeWrite32(0x415B56, 2656+(DWORD)aniMem);
|
||||
SafeWrite32(0x415BB6, 2656+(DWORD)aniMem);
|
||||
SafeWrite32(0x415C7C, 2656+(DWORD)aniMem);
|
||||
SafeWrite32(0x415CA3, 2656+(DWORD)aniMem);
|
||||
SafeWrite32(0x415DE4, 2656+(DWORD)aniMem);
|
||||
|
||||
//old addr 0x54CC18
|
||||
SafeWrite32(0x413D07, 2656+4+(DWORD)aniMem);
|
||||
SafeWrite32(0x415700, 2656+4+(DWORD)aniMem);
|
||||
SafeWrite32(0x415B6B, 2656+4+(DWORD)aniMem);
|
||||
SafeWrite32(0x415B78, 2656+4+(DWORD)aniMem);
|
||||
SafeWrite32(0x415C2D, 2656+4+(DWORD)aniMem);
|
||||
SafeWrite32(0x415D38, 2656+4+(DWORD)aniMem);
|
||||
SafeWrite32(0x415D56, 2656+4+(DWORD)aniMem);
|
||||
SafeWrite32(0x415D63, 2656+4+(DWORD)aniMem);
|
||||
SafeWrite32(0x415DCF, 2656+4+(DWORD)aniMem);
|
||||
|
||||
//old addr 0x54CC1C
|
||||
SafeWrite32(0x413C6A, 2656+8+(DWORD)aniMem);
|
||||
SafeWrite32(0x413CA3, 2656+8+(DWORD)aniMem);
|
||||
SafeWrite32(0x413CF6, 2656+8+(DWORD)aniMem);
|
||||
SafeWrite32(0x413E76, 2656+8+(DWORD)aniMem);
|
||||
SafeWrite32(0x413EA4, 2656+8+(DWORD)aniMem);
|
||||
SafeWrite32(0x413F03, 2656+8+(DWORD)aniMem);
|
||||
SafeWrite32(0x413F20, 2656+8+(DWORD)aniMem);
|
||||
SafeWrite32(0x413F3A, 2656+8+(DWORD)aniMem);
|
||||
SafeWrite32(0x4156EC, 2656+8+(DWORD)aniMem);
|
||||
SafeWrite32(0x415B72, 2656+8+(DWORD)aniMem);
|
||||
SafeWrite32(0x415C18, 2656+8+(DWORD)aniMem);
|
||||
SafeWrite32(0x415C58, 2656+8+(DWORD)aniMem);
|
||||
SafeWrite32(0x415C6D, 2656+8+(DWORD)aniMem);
|
||||
SafeWrite32(0x415DBE, 2656+8+(DWORD)aniMem);
|
||||
|
||||
//old addr 0x54CC20
|
||||
SafeWrite32(0x413B2A, 2656+12+(DWORD)aniMem);
|
||||
SafeWrite32(0x413B33, 2656+12+(DWORD)aniMem);
|
||||
SafeWrite32(0x413B43, 2656+12+(DWORD)aniMem);
|
||||
SafeWrite32(0x413B54, 2656+12+(DWORD)aniMem);
|
||||
SafeWrite32(0x413B66, 2656+12+(DWORD)aniMem);
|
||||
SafeWrite32(0x413BA2, 2656+12+(DWORD)aniMem);
|
||||
SafeWrite32(0x413BAB, 2656+12+(DWORD)aniMem);
|
||||
SafeWrite32(0x413BC0, 2656+12+(DWORD)aniMem);
|
||||
SafeWrite32(0x413BCD, 2656+12+(DWORD)aniMem);
|
||||
SafeWrite32(0x413C3C, 2656+12+(DWORD)aniMem);
|
||||
SafeWrite32(0x413C87, 2656+12+(DWORD)aniMem);
|
||||
SafeWrite32(0x413D01, 2656+12+(DWORD)aniMem);
|
||||
SafeWrite32(0x413D10, 2656+12+(DWORD)aniMem);
|
||||
SafeWrite32(0x413D36, 2656+12+(DWORD)aniMem);
|
||||
SafeWrite32(0x413D53, 2656+12+(DWORD)aniMem);
|
||||
SafeWrite32(0x413DAD, 2656+12+(DWORD)aniMem);
|
||||
SafeWrite32(0x413E93, 2656+12+(DWORD)aniMem);
|
||||
SafeWrite32(0x4155DF, 2656+12+(DWORD)aniMem);
|
||||
SafeWrite32(0x415AE2, 2656+12+(DWORD)aniMem);
|
||||
SafeWrite32(0x415D9A, 2656+12+(DWORD)aniMem);
|
||||
SafeWrite32(0x415DDE, 2656+12+(DWORD)aniMem);
|
||||
SafeWrite32(0x415E06, 2656+12+(DWORD)aniMem);
|
||||
SafeWrite32(0x415E12, 2656+12+(DWORD)aniMem);
|
||||
SafeWrite32(0x417F25, 2656+12+(DWORD)aniMem);
|
||||
SafeWrite32(0x417F30, 2656+12+(DWORD)aniMem);
|
||||
|
||||
//old addr 0x54CC24
|
||||
SafeWrite32(0x413C7E, 2656+16+(DWORD)aniMem);
|
||||
SafeWrite32(0x413E8A, 2656+16+(DWORD)aniMem);
|
||||
SafeWrite32(0x413F17, 2656+16+(DWORD)aniMem);
|
||||
SafeWrite32(0x415C24, 2656+16+(DWORD)aniMem);
|
||||
SafeWrite32(0x415D16, 2656+16+(DWORD)aniMem);
|
||||
SafeWrite32(0x415D44, 2656+16+(DWORD)aniMem);
|
||||
|
||||
//old addr 0x54CC28
|
||||
SafeWrite32(0x413C76, 2656+20+(DWORD)aniMem);
|
||||
SafeWrite32(0x413E82, 2656+20+(DWORD)aniMem);
|
||||
SafeWrite32(0x413F0F, 2656+20+(DWORD)aniMem);
|
||||
SafeWrite32(0x415C3E, 2656+20+(DWORD)aniMem);
|
||||
SafeWrite32(0x415D0E, 2656+20+(DWORD)aniMem);
|
||||
SafeWrite32(0x415D4D, 2656+20+(DWORD)aniMem);
|
||||
|
||||
//old addr 0x54CC38
|
||||
SafeWrite32(0x413F29, 2656+36+(DWORD)aniMem);
|
||||
|
||||
//old addr 0x54CC3C
|
||||
SafeWrite32(0x413D1C, 2656+40+(DWORD)aniMem);
|
||||
SafeWrite32(0x41570D, 2656+40+(DWORD)aniMem);
|
||||
SafeWrite32(0x415720, 2656+40+(DWORD)aniMem);
|
||||
|
||||
//old addr 0x54CC48
|
||||
SafeWrite32(0x415C35, 2656+52+(DWORD)aniMem);
|
||||
|
||||
|
||||
//struct array 2///////////////////
|
||||
|
||||
//old addr 0x530014
|
||||
SafeWrite32(0x416E4A, (DWORD)aniMem2);
|
||||
SafeWrite32(0x416E56, (DWORD)aniMem2);
|
||||
SafeWrite32(0x416EBD, (DWORD)aniMem2);
|
||||
SafeWrite32(0x416F98, (DWORD)aniMem2);
|
||||
SafeWrite32(0x416FAC, (DWORD)aniMem2);
|
||||
SafeWrite32(0x4170C5, (DWORD)aniMem2);
|
||||
SafeWrite32(0x417167, (DWORD)aniMem2);
|
||||
SafeWrite32(0x4171F6, (DWORD)aniMem2);
|
||||
SafeWrite32(0x4172A5, (DWORD)aniMem2);
|
||||
SafeWrite32(0x417583, (DWORD)aniMem2);
|
||||
SafeWrite32(0x417856, (DWORD)aniMem2);
|
||||
SafeWrite32(0x4178AE, (DWORD)aniMem2);
|
||||
SafeWrite32(0x417937, (DWORD)aniMem2);
|
||||
SafeWrite32(0x4179FA, (DWORD)aniMem2);
|
||||
SafeWrite32(0x417A86, (DWORD)aniMem2);
|
||||
SafeWrite32(0x417BB7, (DWORD)aniMem2);
|
||||
SafeWrite32(0x417CD1, (DWORD)aniMem2);
|
||||
SafeWrite32(0x417D54, (DWORD)aniMem2);
|
||||
SafeWrite32(0x417E14, (DWORD)aniMem2);
|
||||
SafeWrite32(0x417E3C, (DWORD)aniMem2);
|
||||
SafeWrite32(0x417FB1, (DWORD)aniMem2);
|
||||
SafeWrite32(0x417FB7, (DWORD)aniMem2);
|
||||
SafeWrite32(0x417FCC, (DWORD)aniMem2);
|
||||
|
||||
//old addr 0x530018
|
||||
SafeWrite32(0x415D7D, 4+(DWORD)aniMem2);
|
||||
SafeWrite32(0x416E40, 4+(DWORD)aniMem2);
|
||||
SafeWrite32(0x416F8F, 4+(DWORD)aniMem2);
|
||||
SafeWrite32(0x41738B, 4+(DWORD)aniMem2);
|
||||
SafeWrite32(0x417786, 4+(DWORD)aniMem2);
|
||||
SafeWrite32(0x4177E7, 4+(DWORD)aniMem2);
|
||||
SafeWrite32(0x417983, 4+(DWORD)aniMem2);
|
||||
SafeWrite32(0x417AC1, 4+(DWORD)aniMem2);
|
||||
SafeWrite32(0x417B70, 4+(DWORD)aniMem2);
|
||||
SafeWrite32(0x417C0D, 4+(DWORD)aniMem2);
|
||||
|
||||
//old addr 0x53001C
|
||||
SafeWrite32(0x416EB8, 8+(DWORD)aniMem2);
|
||||
SafeWrite32(0x416ECB, 8+(DWORD)aniMem2);
|
||||
SafeWrite32(0x416FA6, 8+(DWORD)aniMem2);
|
||||
SafeWrite32(0x416FFF, 8+(DWORD)aniMem2);
|
||||
SafeWrite32(0x41702F, 8+(DWORD)aniMem2);
|
||||
SafeWrite32(0x4177F9, 8+(DWORD)aniMem2);
|
||||
SafeWrite32(0x417AC7, 8+(DWORD)aniMem2);
|
||||
SafeWrite32(0x417ADB, 8+(DWORD)aniMem2);
|
||||
SafeWrite32(0x417C63, 8+(DWORD)aniMem2);
|
||||
SafeWrite32(0x417CA3, 8+(DWORD)aniMem2);
|
||||
|
||||
//old addr 0x530020
|
||||
SafeWrite32(0x416EF8, 12+(DWORD)aniMem2);
|
||||
SafeWrite32(0x4173EE, 12+(DWORD)aniMem2);
|
||||
|
||||
//old addr 0x530024
|
||||
SafeWrite32(0x416EC3, 16+(DWORD)aniMem2);
|
||||
SafeWrite32(0x417035, 16+(DWORD)aniMem2);
|
||||
SafeWrite32(0x417AD5, 16+(DWORD)aniMem2);
|
||||
SafeWrite32(0x417B7B, 16+(DWORD)aniMem2);
|
||||
SafeWrite32(0x417B9A, 16+(DWORD)aniMem2);
|
||||
|
||||
//old addr 0x530028
|
||||
SafeWrite32(0x416ED8, 20+(DWORD)aniMem2);
|
||||
SafeWrite32(0x417066, 20+(DWORD)aniMem2);
|
||||
SafeWrite32(0x417B08, 20+(DWORD)aniMem2);
|
||||
SafeWrite32(0x417B88, 20+(DWORD)aniMem2);
|
||||
|
||||
//old addr 0x53002C
|
||||
SafeWrite32(0x415BF7, 24+(DWORD)aniMem2);
|
||||
SafeWrite32(0x416EEC, 24+(DWORD)aniMem2);
|
||||
SafeWrite32(0x41706C, 24+(DWORD)aniMem2);
|
||||
SafeWrite32(0x4177AB, 24+(DWORD)aniMem2);
|
||||
SafeWrite32(0x4179A4, 24+(DWORD)aniMem2);
|
||||
SafeWrite32(0x417ACF, 24+(DWORD)aniMem2);
|
||||
SafeWrite32(0x417B94, 24+(DWORD)aniMem2);
|
||||
SafeWrite32(0x417C30, 24+(DWORD)aniMem2);
|
||||
SafeWrite32(0x417D73, 24+(DWORD)aniMem2);
|
||||
SafeWrite32(0x417E78, 24+(DWORD)aniMem2);
|
||||
|
||||
//old addr 0x530030
|
||||
SafeWrite32(0x416869, 28+(DWORD)aniMem2);
|
||||
SafeWrite32(0x416871, 28+(DWORD)aniMem2);
|
||||
SafeWrite32(0x4168B0, 28+(DWORD)aniMem2);
|
||||
SafeWrite32(0x4168FC, 28+(DWORD)aniMem2);
|
||||
SafeWrite32(0x416942, 28+(DWORD)aniMem2);
|
||||
SafeWrite32(0x41694A, 28+(DWORD)aniMem2);
|
||||
SafeWrite32(0x416D6D, 28+(DWORD)aniMem2);
|
||||
SafeWrite32(0x416D74, 28+(DWORD)aniMem2);
|
||||
SafeWrite32(0x416DB2, 28+(DWORD)aniMem2);
|
||||
SafeWrite32(0x416DE4, 28+(DWORD)aniMem2);
|
||||
SafeWrite32(0x416DEC, 28+(DWORD)aniMem2);
|
||||
SafeWrite32(0x416F08, 28+(DWORD)aniMem2);
|
||||
SafeWrite32(0x416F36, 28+(DWORD)aniMem2);
|
||||
SafeWrite32(0x4170FC, 28+(DWORD)aniMem2);
|
||||
SafeWrite32(0x41759D, 28+(DWORD)aniMem2);
|
||||
SafeWrite32(0x4176EE, 28+(DWORD)aniMem2);
|
||||
SafeWrite32(0x4178A7, 28+(DWORD)aniMem2);
|
||||
SafeWrite32(0x41792F, 28+(DWORD)aniMem2);
|
||||
SafeWrite32(0x417B1A, 28+(DWORD)aniMem2);
|
||||
SafeWrite32(0x417BAE, 28+(DWORD)aniMem2);
|
||||
|
||||
//old addr 0x530034
|
||||
SafeWrite32(0x415BFF, 32+(DWORD)aniMem2);
|
||||
SafeWrite32(0x415D85, 32+(DWORD)aniMem2);
|
||||
SafeWrite32(0x41687B, 32+(DWORD)aniMem2);
|
||||
SafeWrite32(0x416D7E, 32+(DWORD)aniMem2);
|
||||
SafeWrite32(0x416E7A, 32+(DWORD)aniMem2);
|
||||
SafeWrite32(0x416F12, 32+(DWORD)aniMem2);
|
||||
SafeWrite32(0x417023, 32+(DWORD)aniMem2);
|
||||
SafeWrite32(0x417106, 32+(DWORD)aniMem2);
|
||||
SafeWrite32(0x417385, 32+(DWORD)aniMem2);
|
||||
SafeWrite32(0x417434, 32+(DWORD)aniMem2);
|
||||
SafeWrite32(0x4174BA, 32+(DWORD)aniMem2);
|
||||
SafeWrite32(0x4175A7, 32+(DWORD)aniMem2);
|
||||
SafeWrite32(0x41760D, 32+(DWORD)aniMem2);
|
||||
SafeWrite32(0x4176E7, 32+(DWORD)aniMem2);
|
||||
SafeWrite32(0x4176F4, 32+(DWORD)aniMem2);
|
||||
SafeWrite32(0x41771E, 32+(DWORD)aniMem2);
|
||||
SafeWrite32(0x41779A, 32+(DWORD)aniMem2);
|
||||
SafeWrite32(0x4177E1, 32+(DWORD)aniMem2);
|
||||
SafeWrite32(0x417806, 32+(DWORD)aniMem2);
|
||||
SafeWrite32(0x4178A1, 32+(DWORD)aniMem2);
|
||||
SafeWrite32(0x4178B4, 32+(DWORD)aniMem2);
|
||||
SafeWrite32(0x41790B, 32+(DWORD)aniMem2);
|
||||
SafeWrite32(0x417929, 32+(DWORD)aniMem2);
|
||||
SafeWrite32(0x417961, 32+(DWORD)aniMem2);
|
||||
SafeWrite32(0x417993, 32+(DWORD)aniMem2);
|
||||
SafeWrite32(0x417B0E, 32+(DWORD)aniMem2);
|
||||
SafeWrite32(0x417B60, 32+(DWORD)aniMem2);
|
||||
SafeWrite32(0x417BF8, 32+(DWORD)aniMem2);
|
||||
SafeWrite32(0x417C15, 32+(DWORD)aniMem2);
|
||||
SafeWrite32(0x417C21, 32+(DWORD)aniMem2);
|
||||
SafeWrite32(0x417C4B, 32+(DWORD)aniMem2);
|
||||
SafeWrite32(0x417D79, 32+(DWORD)aniMem2);
|
||||
SafeWrite32(0x417E31, 32+(DWORD)aniMem2);
|
||||
SafeWrite32(0x417F58, 32+(DWORD)aniMem2);
|
||||
SafeWrite32(0x417F81, 32+(DWORD)aniMem2);
|
||||
SafeWrite32(0x417FC6, 32+(DWORD)aniMem2);
|
||||
|
||||
//old addr 0x530038
|
||||
SafeWrite32(0x4168D7, 36+(DWORD)aniMem2);
|
||||
SafeWrite32(0x416914, 36+(DWORD)aniMem2);
|
||||
SafeWrite32(0x41691F, 36+(DWORD)aniMem2);
|
||||
SafeWrite32(0x416DD9, 36+(DWORD)aniMem2);
|
||||
SafeWrite32(0x416EE1, 36+(DWORD)aniMem2);
|
||||
SafeWrite32(0x41758F, 36+(DWORD)aniMem2);
|
||||
|
||||
//old addr 0x53003A
|
||||
SafeWrite32(0x416903, 38+(DWORD)aniMem2);
|
||||
|
||||
//old addr 0x53003B
|
||||
SafeWrite32(0x4168C5, 39+(DWORD)aniMem2);
|
||||
SafeWrite32(0x416DBD, 39+(DWORD)aniMem2);
|
||||
|
||||
//old addr 0x53003C
|
||||
SafeWrite32(0x4173CE, 40+(DWORD)aniMem2);
|
||||
SafeWrite32(0x4174C1, 40+(DWORD)aniMem2);
|
||||
SafeWrite32(0x4175F1, 40+(DWORD)aniMem2);
|
||||
SafeWrite32(0x417730, 40+(DWORD)aniMem2);
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
void AnimationsAtOnceExit() {
|
||||
if(!AniLimitFixActive) return;
|
||||
delete[] aniMem;
|
||||
delete[] aniMem2;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,26 @@
|
||||
/*
|
||||
* sfall
|
||||
* Copyright (C) 2009 Mash (Matt Wells, mashw at bigpond dot net dot au)
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
|
||||
#pragma once
|
||||
|
||||
|
||||
void AnimationsAtOnceInit(signed char aniMax);
|
||||
void AnimationsAtOnceExit();
|
||||
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user