mirror of
https://git.do.srb2.org/STJr/UltimateZoneBuilder.git
synced 2025-01-18 14:31:50 +00:00
Added long texture names support (enabled when "longtexturenames" game configuration property is set to true and "Use long texture names" check box is checked in Map Options).
Open Map in Current WAD: resources are now reloaded when current and target map's resources don't match. Added some boilerplate to UniversalParser and PK3FileImage. Internal: ImageSelectorControl now has "UsePreviews" property. Internal: added ConfigurablePictureBox. Updated ZDoom_DECORATE.cfg.
This commit is contained in:
parent
ecc4cd9281
commit
6b765f5a27
79 changed files with 2088 additions and 1453 deletions
|
@ -21,10 +21,11 @@ topboundary = 32767;
|
|||
bottomboundary = -32768;
|
||||
|
||||
|
||||
// Maximum length of texture name length in characters (0 for unlimited)
|
||||
// WARNING: changing this may destroy your WAD file. Only change it when
|
||||
// you know what you're doing!
|
||||
maxtexturenamelength = 8;
|
||||
// Enables support for long (> 8 chars) texture names
|
||||
// (to use long texture names you must also enable "Use long texture names" in the Map Configuration window).
|
||||
// WARNING: this should only be enabled for UDMF game configurations!
|
||||
// WARNING: enabling this will make maps incompatible with Doom Builder 2 and can lead to problems in Slade 3!
|
||||
longtexturenames = false;
|
||||
|
||||
|
||||
|
||||
|
|
|
@ -308,15 +308,16 @@ mapformat_hexen
|
|||
mapformat_udmf
|
||||
{
|
||||
// The format interface handles the map data format
|
||||
formatinterface = "UniversalMapSetIO";
|
||||
formatinterface = "UniversalMapSetIO";
|
||||
|
||||
//mxd. The default script compiler to use
|
||||
defaultscriptcompiler = "zdoom_acs.cfg";
|
||||
|
||||
// Maximum length of texture name length in characters (0 for unlimited)
|
||||
// WARNING: changing this may destroy your WAD file. Only change it when
|
||||
// you know what you're doing!
|
||||
maxtexturenamelength = 2048;
|
||||
// Enables support for long (> 8 chars) texture names
|
||||
// (to use long texture names you must also enable "Use long texture names" in the Map Configuration window).
|
||||
// WARNING: this should only be enabled for UDMF game configurations!
|
||||
// WARNING: enabling this will make maps incompatible with Doom Builder 2 and can lead to problems in Slade 3!
|
||||
longtexturenames = true;
|
||||
|
||||
// Default nodebuilder configurations
|
||||
defaultsavecompiler = "zdbsp_udmf_normal";
|
||||
|
|
|
@ -554,10 +554,10 @@ enums
|
|||
|
||||
generic_door_delays
|
||||
{
|
||||
8 = "1 second";
|
||||
34 = "4 seconds";
|
||||
69 = "9 seconds";
|
||||
240 = "30 seconds";
|
||||
8 = "8: 1 second";
|
||||
34 = "34: 4 seconds";
|
||||
69 = "69: 9 seconds";
|
||||
240 = "240: 30 seconds";
|
||||
}
|
||||
|
||||
donut
|
||||
|
|
|
@ -26,6 +26,12 @@ include("Includes\\ZDoom_common.cfg", "common");
|
|||
// Settings common to text map format
|
||||
include("Includes\\ZDoom_common.cfg", "mapformat_udmf");
|
||||
|
||||
// Enables support for long (> 8 chars) texture names
|
||||
// (to use long texture names you must also enable "Use long texture names" in the Map Configuration window).
|
||||
// WARNING: this should only be enabled for UDMF game configurations!
|
||||
// WARNING: enabling this will make maps incompatible with Doom Builder 2 and can lead to problems in Slade 3!
|
||||
longtexturenames = false;
|
||||
|
||||
// mxd. Default script compiler
|
||||
defaultscriptcompiler = "zandronum_acs.cfg";
|
||||
|
||||
|
|
|
@ -26,6 +26,12 @@ include("Includes\\ZDoom_common.cfg", "common");
|
|||
// Settings common to text map format
|
||||
include("Includes\\ZDoom_common.cfg", "mapformat_udmf");
|
||||
|
||||
// Enables support for long (> 8 chars) texture names
|
||||
// (to use long texture names you must also enable "Use long texture names" in the Map Configuration window).
|
||||
// WARNING: this should only be enabled for UDMF game configurations!
|
||||
// WARNING: enabling this will make maps incompatible with Doom Builder 2 and can lead to problems in Slade 3!
|
||||
longtexturenames = false;
|
||||
|
||||
// mxd. Default script compiler
|
||||
defaultscriptcompiler = "zandronum_acs.cfg";
|
||||
|
||||
|
|
|
@ -26,6 +26,12 @@ include("Includes\\ZDoom_common.cfg", "common");
|
|||
// Settings common to text map format
|
||||
include("Includes\\ZDoom_common.cfg", "mapformat_udmf");
|
||||
|
||||
// Enables support for long (> 8 chars) texture names
|
||||
// (to use long texture names you must also enable "Use long texture names" in the Map Configuration window).
|
||||
// WARNING: this should only be enabled for UDMF game configurations!
|
||||
// WARNING: enabling this will make maps incompatible with Doom Builder 2 and can lead to problems in Slade 3!
|
||||
longtexturenames = false;
|
||||
|
||||
// mxd. Default script compiler
|
||||
defaultscriptcompiler = "zandronum_acs.cfg";
|
||||
|
||||
|
|
|
@ -26,6 +26,12 @@ include("Includes\\ZDoom_common.cfg", "common");
|
|||
// Settings common to text map format
|
||||
include("Includes\\ZDoom_common.cfg", "mapformat_udmf");
|
||||
|
||||
// Enables support for long (> 8 chars) texture names
|
||||
// (to use long texture names you must also enable "Use long texture names" in the Map Configuration window).
|
||||
// WARNING: this should only be enabled for UDMF game configurations!
|
||||
// WARNING: enabling this will make maps incompatible with Doom Builder 2 and can lead to problems in Slade 3!
|
||||
longtexturenames = false;
|
||||
|
||||
// mxd. Default script compiler
|
||||
defaultscriptcompiler = "zandronum_acs.cfg";
|
||||
|
||||
|
|
|
@ -23,16 +23,16 @@ keywords
|
|||
A_AlertMonsters = "A_AlertMonsters[(float maxrange = 0[, int flags = 0])]";
|
||||
A_Burst = "A_Burst(string type)";
|
||||
A_CentaurDefend = "A_CentaurDefend";
|
||||
A_Chase = "A_Chase[(string meleestate = 'Melee'[, string rangedstate = 'Missile'[, int flags = 0]])]";
|
||||
A_Chase = "A_Chase[(string meleestate = \"Melee\"[, string rangedstate = \"Missile\"[, int flags = 0]])]";
|
||||
A_ClearLastHeard = "A_ClearLastHeard";
|
||||
A_ClearSoundTarget = "A_ClearSoundTarget";
|
||||
A_ClearTarget = "A_ClearTarget";
|
||||
A_DamageChildren = "A_DamageChildren(int amount[, string damagetype = 'None'[, int flags = 0]])\namount: amount of damage to inflict. Use a negative value to heal.\ndamagetype: the type of damage to inflict.\nflags: DMSS flags.";
|
||||
A_DamageMaster = "A_DamageMaster(int amount[, string damagetype = 'None'[, int flags = 0]])\namount: amount of damage to inflict. Use a negative value to heal.\ndamagetype: the type of damage to inflict.\nflags: DMSS flags.";
|
||||
A_DamageSelf = "A_DamageSelf(int amount[, string damagetype = 'None'[, int flags = 0]])\namount: amount of damage to inflict. Use a negative value to heal.\ndamagetype: the type of damage to inflict.\nflags: DMSS flags.";
|
||||
A_DamageSiblings = "A_DamageSiblings(int amount[, string damagetype = 'None'[, int flags = 0]])\namount: amount of damage to inflict. Use a negative value to heal.\ndamagetype: the type of damage to inflict.\nflags: DMSS flags.";
|
||||
A_DamageTarget = "A_DamageTarget(int amount[, string damagetype = 'None'[, int flags = 0]])\namount: amount of damage to inflict. Use a negative value to heal.\ndamagetype: the type of damage to inflict.\nflags: DMSS flags.";
|
||||
A_DamageTracer = "A_DamageTracer(int amount[, string damagetype = 'None'[, int flags = 0]])\namount: amount of damage to inflict. Use a negative value to heal.\ndamagetype: the type of damage to inflict.\nflags: DMSS flags.";
|
||||
A_DamageChildren = "A_DamageChildren(int amount[, string damagetype = \"None\"[, int flags = 0]])\namount: amount of damage to inflict. Use a negative value to heal.\ndamagetype: the type of damage to inflict.\nflags: DMSS flags.";
|
||||
A_DamageMaster = "A_DamageMaster(int amount[, string damagetype = \"None\"[, int flags = 0]])\namount: amount of damage to inflict. Use a negative value to heal.\ndamagetype: the type of damage to inflict.\nflags: DMSS flags.";
|
||||
A_DamageSelf = "A_DamageSelf(int amount[, string damagetype = \"None\"[, int flags = 0]])\namount: amount of damage to inflict. Use a negative value to heal.\ndamagetype: the type of damage to inflict.\nflags: DMSS flags.";
|
||||
A_DamageSiblings = "A_DamageSiblings(int amount[, string damagetype = \"None\"[, int flags = 0]])\namount: amount of damage to inflict. Use a negative value to heal.\ndamagetype: the type of damage to inflict.\nflags: DMSS flags.";
|
||||
A_DamageTarget = "A_DamageTarget(int amount[, string damagetype = \"None\"[, int flags = 0]])\namount: amount of damage to inflict. Use a negative value to heal.\ndamagetype: the type of damage to inflict.\nflags: DMSS flags.";
|
||||
A_DamageTracer = "A_DamageTracer(int amount[, string damagetype = \"None\"[, int flags = 0]])\namount: amount of damage to inflict. Use a negative value to heal.\ndamagetype: the type of damage to inflict.\nflags: DMSS flags.";
|
||||
A_Die = "A_Die[(string damagetype)]";
|
||||
A_FaceTarget = "A_FaceTarget[(float angle = 0[, float pitch = 0])]";
|
||||
A_FaceMaster = "A_FaceMaster[(float angle = 0[, float pitch = 0])]";
|
||||
|
@ -56,7 +56,7 @@ keywords
|
|||
A_Remove = "A_Remove(int pointer, int flags)\nflags: RMVF flags.";
|
||||
A_SentinelBob = "A_SentinelBob";
|
||||
A_TurretLook = "A_TurretLook";
|
||||
A_Teleport = "A_Teleport[(string teleportstate = 'Teleport'[, string targettype = 'BossSpot'[, string fogtype = 'TeleportFog'[, int flags = 0[, float mindist = 0[, float maxdist = 0]]]]])]";
|
||||
A_Teleport = "A_Teleport[(string teleportstate = \"Teleport\"[, string targettype = \"BossSpot\"[, string fogtype = \"TeleportFog\"[, int flags = 0[, float mindist = 0[, float maxdist = 0]]]]])]";
|
||||
A_VileChase = "A_VileChase";
|
||||
A_Wander = "A_Wander";
|
||||
//Generic monster attacks
|
||||
|
@ -64,16 +64,16 @@ keywords
|
|||
A_CustomBulletAttack = "A_CustomBulletAttack(float horz_spread, float vert_spread, int numbullets, int damageperbullet, string pufftype[, float range[, int flags]])";
|
||||
A_CustomRailgun = "A_CustomRailgun(int damage[, int offset[, color ringcolor[, color corecolor[, int flags[, bool aim[, float maxdiff[, string pufftype[, float spread_xy[, float spread_z[, fixed range[, int duration[, float sparsity[, float driftspeed[, string spawnclass]]]]]]]]]]]]]])";
|
||||
A_CustomMeleeAttack = "A_CustomMeleeAttack(int damage[, string meleesound[, string misssound[, string damagetype[, bool bleed]]]])";
|
||||
A_CustomComboAttack = "A_CustomComboAttack(string missiletype, float spawnheight, int damage, string meleesound[, string damagetype = 'Melee'[, bool bleed = true]])";
|
||||
A_CustomComboAttack = "A_CustomComboAttack(string missiletype, float spawnheight, int damage, string meleesound[, string damagetype = \"Melee\"[, bool bleed = true]])";
|
||||
A_MonsterRefire = "A_MonsterRefire(int chancecontinue, string abortstate) ";
|
||||
A_BasicAttack = "A_BasicAttack(int meleedamage, string meleesound, string missiletype, float missileheight)";
|
||||
A_BulletAttack = "A_BulletAttack";
|
||||
A_MonsterRail = "A_MonsterRail";
|
||||
A_Explode = "A_Explode[(int explosiondamage = 128[, int explosionradius = 128[, int flags = XF_HURTSOURCE[, bool alert = false[, int fulldamageradius = 0[, int nails = 0[, int naildamage = 10[, string pufftype = 'BulletPuff']]]]]]])]";
|
||||
A_Explode = "A_Explode[(int explosiondamage = 128[, int explosionradius = 128[, int flags = XF_HURTSOURCE[, bool alert = false[, int fulldamageradius = 0[, int nails = 0[, int naildamage = 10[, string pufftype = \"BulletPuff\"]]]]]]])]";
|
||||
A_RadiusThrust = "A_RadiusThrust(int force, int distance[, int flags[, int fullthrustdistance]])";
|
||||
A_Detonate = "A_Detonate";
|
||||
A_ThrowGrenade = "A_ThrowGrenade(string spawntype[, float spawnheight[, float throwspeed_horz[, float throwspeed_vert[, bool useammo]]]])";
|
||||
A_WolfAttack = "A_WolfAttack[(int flags = 0[, string soundname = 'weapons/pistol'[, float snipe = 1.0[, int damage = 64[, int blocksize = 128[, int pointblank = 0[, int longrange = 0[, float runspeed = 160.0, [string pufftype = 'BulletPuff']]]]]]]])]";
|
||||
A_WolfAttack = "A_WolfAttack[(int flags = 0[, string soundname = \"weapons/pistol\"[, float snipe = 1.0[, int damage = 64[, int blocksize = 128[, int pointblank = 0[, int longrange = 0[, float runspeed = 160.0, [string pufftype = \"BulletPuff\"]]]]]]]])]";
|
||||
//Freeze death functions
|
||||
A_FreezeDeath = "A_FreezeDeath";
|
||||
A_GenericFreezeDeath = "A_GenericFreezeDeath";
|
||||
|
@ -95,8 +95,8 @@ keywords
|
|||
A_BrainAwake = "A_BrainAwake";
|
||||
A_BFGSound = "A_BFGSound";
|
||||
//Print actions
|
||||
A_Print = "A_Print(string text[, float time = 0.0[, string fontname = 'SmallFont']])";
|
||||
A_PrintBold = "A_PrintBold(string text[, float time = 0.0[, string fontname = 'SmallFont']])";
|
||||
A_Print = "A_Print(string text[, float time = 0.0[, string fontname = \"SmallFont\"]])";
|
||||
A_PrintBold = "A_PrintBold(string text[, float time = 0.0[, string fontname = \"SmallFont\"]])";
|
||||
A_Log = "A_Log(string text)";
|
||||
A_LogInt = "A_LogInt(int number)";
|
||||
//Special actions
|
||||
|
@ -109,8 +109,8 @@ keywords
|
|||
A_SetBlend = "A_SetBlend(string blendcolor, float alpha, int duration[, string fadecolor])";
|
||||
A_CheckPlayerDone = "A_CheckPlayerDone";
|
||||
A_PlayerSkinCheck = "A_PlayerSkinCheck(string state)";
|
||||
A_SkullPop = "A_SkullPop[(string type = 'BloodySkull')]";
|
||||
A_Quake = "A_Quake (int intensity, int duration, int damageradius, int tremorradius[, string sound = 'world/quake'])";
|
||||
A_SkullPop = "A_SkullPop[(string type = \"BloodySkull\")]";
|
||||
A_Quake = "A_Quake (int intensity, int duration, int damageradius, int tremorradius[, string sound = \"world/quake\"])";
|
||||
//Spawn functions
|
||||
A_TossGib = "A_TossGib";
|
||||
A_SpawnDebris = "A_SpawnDebris(string type[, bool translation = false[, float horizontal_vel = 1.0[, float vertical_vel = 1.0]]])";
|
||||
|
@ -159,14 +159,14 @@ keywords
|
|||
A_Respawn = "A_Respawn[(int flags = RSF_FOG)]\nflags: RSF flags";
|
||||
A_ScaleVelocity = "A_ScaleVelocity(float scale)";
|
||||
A_ScreamAndUnblock = "A_ScreamAndUnblock";
|
||||
A_SetAngle = "A_SetAngle(float angle[, int flags])\nangle: the actor's new angle, in degrees.\nflags: SPF flags.";
|
||||
A_SetAngle = "A_SetAngle(float angle[, int flags])\nangle: the actor\"s new angle, in degrees.\nflags: SPF flags.";
|
||||
A_SetArg = "A_SetArg(int position, int value)";
|
||||
A_SetDamageType = "A_SetDamageType(string damagetype)";
|
||||
A_SetFloat = "A_SetFloat";
|
||||
A_SetFloorClip = "A_SetFloorClip";
|
||||
A_SetInvulnerable = "A_SetInvulnerable";
|
||||
A_SetMass = "A_SetMass(int mass)";
|
||||
A_SetPitch = "A_SetPitch(float pitch[, int flags])\npitch: The actor's new pitch, in degrees.\nflags: SPF flags.";
|
||||
A_SetPitch = "A_SetPitch(float pitch[, int flags])\npitch: The actor\"s new pitch, in degrees.\nflags: SPF flags.";
|
||||
A_SetReflective = "A_SetReflective";
|
||||
A_SetReflectiveInvulnerable = "A_SetReflectiveInvulnerable";
|
||||
A_SetScale = "A_SetScale(float scaleX[, float scaleY = scaleX])";
|
||||
|
@ -215,9 +215,9 @@ keywords
|
|||
A_WeaponReady = "A_WeaponReady[(int flags = 0)]\nflags: WRF flags.";
|
||||
A_Lower = "A_Lower";
|
||||
A_Raise = "A_Raise";
|
||||
A_ReFire = "A_ReFire[(string state = 'Hold')]";
|
||||
A_ReFire = "A_ReFire[(string state = \"Hold\")]";
|
||||
A_ClearReFire = "A_ClearReFire";
|
||||
A_GunFlash = "A_GunFlash[(string state = 'Flash'[, int flags = 0])]\nflags: GFF flags.";
|
||||
A_GunFlash = "A_GunFlash[(string state = \"Flash\"[, int flags = 0])]\nflags: GFF flags.";
|
||||
A_CheckReload = "A_CheckReload";
|
||||
A_CheckForReload = "A_CheckForReload(int counter, string state[, bool dontincrement = false])";
|
||||
A_ResetReloadCounter = "A_ResetReloadCounter";
|
||||
|
@ -231,9 +231,9 @@ keywords
|
|||
A_SetCrosshair = "A_SetCrosshair(int number)";
|
||||
//Weapon attack functions
|
||||
A_Punch = "A_Punch";
|
||||
A_Saw = "A_Saw[(string fullsound = 'weapons/sawfull'[, string hitsound = 'weapons/sawhit'[, int damage = 0[, string pufftype = 'BulletPuff'[, int flags = 0[, float range = 65.0[, float spread_xy = 2.8125[, float spread_z = 0[, float lifesteal = 0]]]]]]]])]";
|
||||
A_CustomPunch = "A_CustomPunch(int damage[, bool norandom = false[, int flags = 0[, string pufftype = 'BulletPuff'[, float range = 64.0[, float lifesteal = 0]]]]])";
|
||||
A_FireBullets = "A_FireBullets(int spread_horz, int spread_vert, int numbullets, int damage[, string pufftype = ''[, int flags = FBF_USEAMMO[, float range = 0]]])";
|
||||
A_Saw = "A_Saw[(string fullsound = \"weapons/sawfull\"[, string hitsound = \"weapons/sawhit\"[, int damage = 0[, string pufftype = \"BulletPuff\"[, int flags = 0[, float range = 65.0[, float spread_xy = 2.8125[, float spread_z = 0[, float lifesteal = 0]]]]]]]])]";
|
||||
A_CustomPunch = "A_CustomPunch(int damage[, bool norandom = false[, int flags = 0[, string pufftype = \"BulletPuff\"[, float range = 64.0[, float lifesteal = 0]]]]])";
|
||||
A_FireBullets = "A_FireBullets(int spread_horz, int spread_vert, int numbullets, int damage[, string pufftype = \"\"[, int flags = FBF_USEAMMO[, float range = 0]]])";
|
||||
A_FireCustomMissile = "A_FireCustomMissile(string missiletype[, int angle = 0[, bool useammo = false[, int spawnofs_horz = 0[, int spawnheight = 0[, bool aim = false OR int flags = 0[, angle pitch = 0]]]]]])";
|
||||
A_RailAttack = "A_RailAttack(int damage[, int spawnofs_horz[, bool useammo[, color ringcolor[, color corecolor[, int flags[, int maxdiff[, string pufftype[, float spread_xy = 0[, float spread_z = 0[, fixed range = 8192[, int duration = 35[, float sparsity = 1.0[, float driftspeed = 1.0[, string spawnclass[, float spawnofs_z = 0]]]]]]]]]]]]]]])";
|
||||
A_FireAssaultGun = "A_FireAssaultGun";
|
||||
|
@ -266,23 +266,23 @@ keywords
|
|||
A_SkullAttack = "A_SkullAttack[(int speed = 20)]";
|
||||
A_BspiAttack = "A_BspiAttack";
|
||||
A_CyberAttack = "A_CyberAttack";
|
||||
A_PainAttack = "A_PainAttack[(string spawntype = 'LostSoul'[, float angle = 0[, int flags = 0[, int limit = 21]]])]";
|
||||
A_DualPainAttack = "A_DualPainAttack[(string spawntype = 'LostSoul')]";
|
||||
A_PainDie = "A_PainDie[(string spawntype = 'LostSoul')]";
|
||||
A_PainAttack = "A_PainAttack[(string spawntype = \"LostSoul\"[, float angle = 0[, int flags = 0[, int limit = 21]]])]";
|
||||
A_DualPainAttack = "A_DualPainAttack[(string spawntype = \"LostSoul\")]";
|
||||
A_PainDie = "A_PainDie[(string spawntype = \"LostSoul\")]";
|
||||
A_SkelFist = "A_SkelFist";
|
||||
A_SkelMissile = "A_SkelMissile";
|
||||
A_FatAttack1 = "A_FatAttack1[(string spawntype = 'FatShot')]";
|
||||
A_FatAttack2 = "A_FatAttack2[(string spawntype = 'FatShot')]";
|
||||
A_FatAttack3 = "A_FatAttack3[(string spawntype = 'FatShot')]";
|
||||
A_VileTarget = "A_VileTarget[(string type = 'ArchvileFire')]";
|
||||
A_VileAttack = "A_VileAttack[(string sound = 'vile/stop'[, int initialdamage = 20[, int blastdamage = 70[, int blastradius = 70[, float thrustfactor = 1.0[, string damagetype = 'Fire'[, int flags = 0]]]]]])]";
|
||||
A_BrainSpit = "A_BrainSpit[(string spawntype = 'SpawnShot')]";
|
||||
A_SpawnFly = "A_SpawnFly[(string fogactor = 'SpawnFire')]";
|
||||
A_FatAttack1 = "A_FatAttack1[(string spawntype = \"FatShot\")]";
|
||||
A_FatAttack2 = "A_FatAttack2[(string spawntype = \"FatShot\")]";
|
||||
A_FatAttack3 = "A_FatAttack3[(string spawntype = \"FatShot\")]";
|
||||
A_VileTarget = "A_VileTarget[(string type = \"ArchvileFire\")]";
|
||||
A_VileAttack = "A_VileAttack[(string sound = \"vile/stop\"[, int initialdamage = 20[, int blastdamage = 70[, int blastradius = 70[, float thrustfactor = 1.0[, string damagetype = \"Fire\"[, int flags = 0]]]]]])]";
|
||||
A_BrainSpit = "A_BrainSpit[(string spawntype = \"SpawnShot\")]";
|
||||
A_SpawnFly = "A_SpawnFly[(string fogactor = \"SpawnFire\")]";
|
||||
A_SpawnSound = "A_SpawnSound";
|
||||
A_BrainScream = "A_BrainScream";
|
||||
A_BrainExplode = "A_BrainExplode";
|
||||
A_Mushroom = "A_Mushroom[(string spawntype = 'FatShot'[, int amount[, int flags = MSF_STANDARD[, float vrange = 4.0[, float hrange = 0.5]]]])]";
|
||||
A_M_Saw = "A_M_Saw[(string fullsound = 'weapons/sawfull'[, string hitsound = 'weapons/sawhit'[, int damage = 0[, string pufftype = 'BulletPuff']]])]";
|
||||
A_Mushroom = "A_Mushroom[(string spawntype = \"FatShot\"[, int amount[, int flags = MSF_STANDARD[, float vrange = 4.0[, float hrange = 0.5]]]])]";
|
||||
A_M_Saw = "A_M_Saw[(string fullsound = \"weapons/sawfull\"[, string hitsound = \"weapons/sawhit\"[, int damage = 0[, string pufftype = \"BulletPuff\"]]])]";
|
||||
A_SentinelRefire = "A_SentinelRefire";
|
||||
A_BetaSkullAttack = "A_BetaSkullAttack";
|
||||
//Miscellaneous functions for Doom
|
||||
|
@ -293,8 +293,21 @@ keywords
|
|||
A_SkelWhoosh = "A_SkelWhoosh";
|
||||
A_StartFire = "A_StartFire";
|
||||
A_FireCrackle = "A_FireCrackle";
|
||||
A_BFGSpray = "A_BFGSpray[(string flashtype = 'BFGExtra'[, int numrays = 40[, int damage = 15[, float angle = 90[, float distance = 1024[, float vrange = 32[, int explicit_damage = 0]]]]]])]";
|
||||
A_BarrelDestroy = "A_BarrelDestroy";
|
||||
A_BFGSpray = "A_BFGSpray[(string flashtype = \"BFGExtra\"[, int numrays = 40[, int damage = 15[, float angle = 90[, float distance = 1024[, float vrange = 32[, int explicit_damage = 0]]]]]])]";
|
||||
A_BarrelDestroy = "A_BarrelDestroy";
|
||||
//Miscellaneous functions not listed in the "Action functions" wiki article
|
||||
A_Bang4Cloud = "A_Bang4Cloud";
|
||||
A_Blast = "A_Blast[(int flags = 0[, int strength = 255[, int radius = 255[, float speed = 20[, string blasteffect = \"BlastEffect\"[, sound blastsound = \"BlastRadius\"]]]]])]";
|
||||
A_DropWeaponPieces = "A_DropWeaponPieces(string actorclass1, string actorclass2, string actorclass3)";
|
||||
A_Feathers = "A_Feathers";
|
||||
A_GiveQuestItem = "A_GiveQuestItem(int itemnum)";
|
||||
A_PigPain = "A_PigPain";
|
||||
A_RemoveForcefield = "A_RemoveForcefield";
|
||||
A_RocketInFlight = "A_RocketInFlight";
|
||||
A_SetGravity = "A_SetGravity(float gravity)\nSets the amount of gravity for the calling actor.";
|
||||
A_SetUserArray = "A_SetUserArray(string name, int index, int value)";
|
||||
A_ShootGun = "A_ShootGun";
|
||||
A_SPosAttackUseAtkSound = "A_SPosAttackUseAtkSound";
|
||||
//Mathematical functions
|
||||
abs = "abs(x)\nreturns the absolute value of x.";
|
||||
sin = "sin(x)\ntrigonometry function, x must be in degrees.";
|
||||
|
@ -606,6 +619,7 @@ constants
|
|||
SPAWNSOUNDSOURCE;
|
||||
PAINLESS;
|
||||
FORCEPAIN;
|
||||
CAUSEPAIN;
|
||||
DONTSEEKINVISIBLE;
|
||||
STEPMISSILE;
|
||||
ADDITIVEPOISONDAMAGE;
|
||||
|
@ -650,6 +664,7 @@ constants
|
|||
NOTAUTOAIMED;
|
||||
NOTONAUTOMAP;
|
||||
WEAPONSPAWN;
|
||||
NOMENU;
|
||||
PICKUP;
|
||||
TOUCHY;
|
||||
VULNERABLE;
|
||||
|
@ -713,6 +728,10 @@ constants
|
|||
AMF_EMITFROMTARGET;
|
||||
AMF_TARGETEMITTER;
|
||||
AMF_TARGETNONPLAYER;
|
||||
BF_USEAMMO;
|
||||
BF_DONTWARN;
|
||||
BF_AFFECTBOSSES;
|
||||
BF_NOIMPACTDAMAGE;
|
||||
CBAF_AIMFACING;
|
||||
CBAF_EXPLICITANGLE;
|
||||
CBAF_NOPITCH;
|
||||
|
|
|
@ -699,6 +699,9 @@
|
|||
<Compile Include="Controls\DockersTabsControl.cs">
|
||||
<SubType>Component</SubType>
|
||||
</Compile>
|
||||
<Compile Include="Controls\ConfigurablePictureBox.cs">
|
||||
<SubType>Component</SubType>
|
||||
</Compile>
|
||||
<Compile Include="Controls\HintsPanel.cs">
|
||||
<SubType>UserControl</SubType>
|
||||
</Compile>
|
||||
|
|
|
@ -59,6 +59,7 @@ namespace CodeImp.DoomBuilder.Config
|
|||
private Configuration config; //mxd
|
||||
private bool enabled; //mxd
|
||||
private bool changed; //mxd
|
||||
private bool longtexturenames; //mxd
|
||||
|
||||
private List<EngineInfo> testEngines; //mxd
|
||||
private int currentEngineIndex; //mxd
|
||||
|
@ -84,6 +85,7 @@ namespace CodeImp.DoomBuilder.Config
|
|||
internal Configuration Configuration { get { return config; } } //mxd
|
||||
public bool Enabled { get { return enabled; } internal set { enabled = value; } } //mxd
|
||||
public bool Changed { get { return changed; } internal set { changed = value; } } //mxd
|
||||
public bool SupportsLongTextureNames { get { return longtexturenames; } internal set { longtexturenames = value; } } //mxd
|
||||
|
||||
//mxd
|
||||
public string TestProgramName { get { return testEngines[currentEngineIndex].TestProgramName; } internal set { testEngines[currentEngineIndex].TestProgramName = value; } }
|
||||
|
@ -116,6 +118,7 @@ namespace CodeImp.DoomBuilder.Config
|
|||
// Load settings from game configuration
|
||||
this.name = config.ReadSetting("game", "<unnamed game>");
|
||||
this.defaultlumpname = config.ReadSetting("defaultlumpname", "");
|
||||
this.longtexturenames = config.ReadSetting("longtexturenames", false); //mxd
|
||||
|
||||
// Load settings from program configuration
|
||||
this.nodebuildersave = General.Settings.ReadSetting("configurations." + settingskey + ".nodebuildersave", MISSING_NODEBUILDER);
|
||||
|
@ -132,7 +135,8 @@ namespace CodeImp.DoomBuilder.Config
|
|||
currentEngineIndex = General.Settings.ReadSetting("configurations." + settingskey + ".currentengineindex", 0);
|
||||
|
||||
//no engine list found? use old engine properties
|
||||
if (list.Count == 0) {
|
||||
if (list.Count == 0)
|
||||
{
|
||||
EngineInfo info = new EngineInfo();
|
||||
info.TestProgram = General.Settings.ReadSetting("configurations." + settingskey + ".testprogram", "");
|
||||
info.TestProgramName = General.Settings.ReadSetting("configurations." + settingskey + ".testprogramname", EngineInfo.DEFAULT_ENGINE_NAME);
|
||||
|
@ -143,9 +147,12 @@ namespace CodeImp.DoomBuilder.Config
|
|||
info.TestSkill = General.Settings.ReadSetting("configurations." + settingskey + ".testskill", 3);
|
||||
testEngines.Add(info);
|
||||
currentEngineIndex = 0;
|
||||
} else {
|
||||
}
|
||||
else
|
||||
{
|
||||
//read engines settings from config
|
||||
foreach (DictionaryEntry de in list) {
|
||||
foreach (DictionaryEntry de in list)
|
||||
{
|
||||
string path = "configurations." + settingskey + ".engines." + de.Key;
|
||||
EngineInfo info = new EngineInfo();
|
||||
info.TestProgram = General.Settings.ReadSetting(path + ".testprogram", "");
|
||||
|
@ -166,13 +173,17 @@ namespace CodeImp.DoomBuilder.Config
|
|||
list = General.Settings.ReadSetting("configurations." + settingskey + ".linedefcolorpresets", new ListDictionary());
|
||||
|
||||
//no presets? add "classic" ones then.
|
||||
if(list.Count == 0) {
|
||||
if(list.Count == 0)
|
||||
{
|
||||
LinedefColorPreset anyActionPreset = new LinedefColorPreset("Any action", PixelColor.FromColor(System.Drawing.Color.PaleGreen), -1, 0, new List<string>(), new List<string>());
|
||||
anyActionPreset.SetValid();
|
||||
colorPresets.Add(anyActionPreset);
|
||||
} else {
|
||||
}
|
||||
else
|
||||
{
|
||||
//read custom linedef colors from config
|
||||
foreach(DictionaryEntry de in list) {
|
||||
foreach(DictionaryEntry de in list)
|
||||
{
|
||||
string path = "configurations." + settingskey + ".linedefcolorpresets." + de.Key;
|
||||
string presetname = General.Settings.ReadSetting(path + ".name", "Unnamed");
|
||||
PixelColor color = PixelColor.FromInt(General.Settings.ReadSetting(path + ".color", -1));
|
||||
|
|
|
@ -25,6 +25,7 @@ using CodeImp.DoomBuilder.Map;
|
|||
using CodeImp.DoomBuilder.Editing;
|
||||
|
||||
using CodeImp.DoomBuilder.GZBuilder.Data;
|
||||
using CodeImp.DoomBuilder.Data;
|
||||
|
||||
#endregion
|
||||
|
||||
|
@ -311,7 +312,6 @@ namespace CodeImp.DoomBuilder.Config
|
|||
linetagindicatesectors = cfg.ReadSetting("linetagindicatesectors", false);
|
||||
decorategames = cfg.ReadSetting("decorategames", "");
|
||||
skyflatname = cfg.ReadSetting("skyflatname", "F_SKY1");
|
||||
maxtexturenamelength = cfg.ReadSetting("maxtexturenamelength", 8);
|
||||
leftboundary = cfg.ReadSetting("leftboundary", -32768);
|
||||
rightboundary = cfg.ReadSetting("rightboundary", 32767);
|
||||
topboundary = cfg.ReadSetting("topboundary", 32767);
|
||||
|
@ -320,6 +320,10 @@ namespace CodeImp.DoomBuilder.Config
|
|||
defaultLinedefActivation = cfg.ReadSetting("defaultlinedefactivation", ""); //mxd
|
||||
for(int i = 0; i < Linedef.NUM_ARGS; i++) makedoorargs[i] = cfg.ReadSetting("makedoorarg" + i.ToString(CultureInfo.InvariantCulture), 0);
|
||||
|
||||
//mxd. Texture names length
|
||||
bool uselongtexturenames = cfg.ReadSetting("longtexturenames", false);
|
||||
maxtexturenamelength = (uselongtexturenames ? short.MaxValue : DataManager.CLASIC_IMAGE_NAME_LENGTH);
|
||||
|
||||
// Flags have special (invariant culture) conversion
|
||||
// because they are allowed to be written as integers in the configs
|
||||
object obj = cfg.ReadSettingObject("singlesidedflag", 0);
|
||||
|
|
40
Source/Core/Controls/ConfigurablePictureBox.cs
Normal file
40
Source/Core/Controls/ConfigurablePictureBox.cs
Normal file
|
@ -0,0 +1,40 @@
|
|||
using System.Drawing;
|
||||
using System.Drawing.Drawing2D;
|
||||
using System.Windows.Forms;
|
||||
|
||||
namespace CodeImp.DoomBuilder.Controls
|
||||
{
|
||||
public class ConfigurablePictureBox : PictureBox
|
||||
{
|
||||
private InterpolationMode interpolationmode = InterpolationMode.NearestNeighbor;
|
||||
private SmoothingMode smoothingmode = SmoothingMode.Default;
|
||||
private CompositingQuality compositingquality = CompositingQuality.Default;
|
||||
private PixelOffsetMode pixeloffsetmode = PixelOffsetMode.None;
|
||||
private GraphicsUnit pageunit = GraphicsUnit.Pixel;
|
||||
|
||||
public InterpolationMode InterpolationMode { get { return interpolationmode; } set { interpolationmode = value; } }
|
||||
public SmoothingMode SmoothingMode { get { return smoothingmode; } set { smoothingmode = value; } }
|
||||
public CompositingQuality CompositingQuality { get { return compositingquality; } set { compositingquality = value; } }
|
||||
public PixelOffsetMode PixelOffsetMode { get { return pixeloffsetmode; } set { pixeloffsetmode = value; } }
|
||||
public GraphicsUnit PageUnit { get { return pageunit; } set { pageunit = value; } }
|
||||
|
||||
/*public ConfigurablePictureBox()
|
||||
{
|
||||
InterpolationMode = InterpolationMode.NearestNeighbor;
|
||||
SmoothingMode = SmoothingMode.Default;
|
||||
CompositingQuality = CompositingQuality.Default;
|
||||
PixelOffsetMode = PixelOffsetMode.None;
|
||||
PageUnit = GraphicsUnit.Pixel;
|
||||
}*/
|
||||
|
||||
protected override void OnPaint(PaintEventArgs pe)
|
||||
{
|
||||
pe.Graphics.InterpolationMode = InterpolationMode;
|
||||
pe.Graphics.SmoothingMode = SmoothingMode;
|
||||
pe.Graphics.CompositingQuality = CompositingQuality;
|
||||
pe.Graphics.PageUnit = PageUnit;
|
||||
pe.Graphics.PixelOffsetMode = PixelOffsetMode;
|
||||
base.OnPaint(pe);
|
||||
}
|
||||
}
|
||||
}
|
|
@ -27,15 +27,14 @@ namespace CodeImp.DoomBuilder
|
|||
{
|
||||
#region ================== Variables
|
||||
|
||||
private static readonly List<KeyValuePair<DebugMessageType, string>> messages = new List<KeyValuePair<DebugMessageType, string>>(1000);
|
||||
private DebugMessageType filters;
|
||||
private const int MAX_MESSAGES = 1024;
|
||||
private static readonly List<KeyValuePair<DebugMessageType, string>> messages = new List<KeyValuePair<DebugMessageType, string>>(MAX_MESSAGES);
|
||||
|
||||
//Colors
|
||||
private readonly Dictionary<DebugMessageType, Color> textcolors;
|
||||
private readonly Dictionary<DebugMessageType, string> textheaders;
|
||||
|
||||
private static int charcount;
|
||||
private const int MAX_CHARS = short.MaxValue;
|
||||
private DebugMessageType filters;
|
||||
private static long starttime = -1;
|
||||
private static DebugConsole me;
|
||||
|
||||
|
@ -107,6 +106,7 @@ namespace CodeImp.DoomBuilder
|
|||
}
|
||||
else
|
||||
{
|
||||
if (messages.Count + 1 > MAX_MESSAGES) lock (messages) { messages.RemoveAt(0); }
|
||||
messages.Add(new KeyValuePair<DebugMessageType, string>(type, text));
|
||||
if(me != null && (me.filters & type) == type)
|
||||
{
|
||||
|
@ -130,7 +130,6 @@ namespace CodeImp.DoomBuilder
|
|||
{
|
||||
if (me != null) me.console.Clear();
|
||||
messages.Clear();
|
||||
charcount = 0;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -163,18 +162,6 @@ namespace CodeImp.DoomBuilder
|
|||
private void AddMessage(DebugMessageType type, string text, bool scroll)
|
||||
{
|
||||
text = textheaders[type] + text;
|
||||
bool updatemessages = false;
|
||||
|
||||
while (charcount + text.Length > MAX_CHARS)
|
||||
{
|
||||
charcount -= messages[0].Value.Length;
|
||||
messages.RemoveAt(0);
|
||||
updatemessages = true;
|
||||
}
|
||||
|
||||
if(updatemessages) UpdateMessages();
|
||||
charcount += text.Length;
|
||||
|
||||
console.SelectionStart = console.TextLength;
|
||||
console.SelectionColor = textcolors[type];
|
||||
console.AppendText(text);
|
||||
|
@ -197,7 +184,6 @@ namespace CodeImp.DoomBuilder
|
|||
private void UpdateMessages()
|
||||
{
|
||||
console.Clear();
|
||||
charcount = 0;
|
||||
|
||||
console.SuspendLayout();
|
||||
foreach (KeyValuePair<DebugMessageType, string> pair in messages)
|
||||
|
|
|
@ -61,10 +61,10 @@ namespace CodeImp.DoomBuilder.Controls
|
|||
|
||||
if(string.IsNullOrEmpty(texture.FullName) || texture is UnknownImage) DisplayImageSize(0, 0); //mxd
|
||||
else DisplayImageSize(texture.ScaledWidth, texture.ScaledHeight); //mxd
|
||||
if(!texture.IsPreviewLoaded) timer.Start(); //mxd
|
||||
if(usepreviews ? !texture.IsPreviewLoaded : !texture.IsImageLoaded) timer.Start(); //mxd
|
||||
|
||||
// Set the image
|
||||
return texture.GetPreview();
|
||||
return (usepreviews ? texture.GetPreview() : texture.GetBitmap());
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -100,6 +100,7 @@ namespace CodeImp.DoomBuilder.Controls
|
|||
// list
|
||||
//
|
||||
this.list.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.list.Font = new System.Drawing.Font("Arial", 8F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
|
||||
this.list.HideSelection = false;
|
||||
this.list.Location = new System.Drawing.Point(0, 0);
|
||||
this.list.MultiSelect = false;
|
||||
|
@ -132,6 +133,7 @@ namespace CodeImp.DoomBuilder.Controls
|
|||
this.filterHeight.AllowRelative = false;
|
||||
this.filterHeight.ButtonStep = 1;
|
||||
this.filterHeight.ButtonStepFloat = 1F;
|
||||
this.filterHeight.ButtonStepsWrapAround = false;
|
||||
this.filterHeight.Location = new System.Drawing.Point(410, 4);
|
||||
this.filterHeight.Name = "filterHeight";
|
||||
this.filterHeight.Size = new System.Drawing.Size(54, 24);
|
||||
|
@ -156,6 +158,7 @@ namespace CodeImp.DoomBuilder.Controls
|
|||
this.filterWidth.AllowRelative = false;
|
||||
this.filterWidth.ButtonStep = 1;
|
||||
this.filterWidth.ButtonStepFloat = 1F;
|
||||
this.filterWidth.ButtonStepsWrapAround = false;
|
||||
this.filterWidth.Location = new System.Drawing.Point(308, 4);
|
||||
this.filterWidth.Name = "filterWidth";
|
||||
this.filterWidth.Size = new System.Drawing.Size(54, 24);
|
||||
|
|
|
@ -69,7 +69,6 @@ namespace CodeImp.DoomBuilder.Controls
|
|||
public bool PreventSelection { get { return preventselection; } set { preventselection = value; } }
|
||||
public bool HideInputBox { get { return splitter.Panel2Collapsed; } set { splitter.Panel2Collapsed = value; } }
|
||||
public bool BrowseFlats { get { return browseFlats; } set { browseFlats = value; } } //mxd
|
||||
//public string LabelText { get { return label.Text; } set { label.Text = value; objectname.Left = label.Right + label.Margin.Right + objectname.Margin.Left; } } //mxd
|
||||
public ListViewItem SelectedItem { get { if(list.SelectedItems.Count > 0) return list.SelectedItems[0]; else return null; } }
|
||||
|
||||
#endregion
|
||||
|
@ -108,9 +107,12 @@ namespace CodeImp.DoomBuilder.Controls
|
|||
list.TileSize = new Size(itemwidth, itemheight);
|
||||
|
||||
//mxd
|
||||
if(General.Map.Config.MixTexturesFlats) {
|
||||
if(General.Map.Config.MixTexturesFlats)
|
||||
{
|
||||
cbMixMode.SelectedIndex = mixMode;
|
||||
} else {
|
||||
}
|
||||
else
|
||||
{
|
||||
labelMixMode.Visible = false;
|
||||
cbMixMode.Visible = false;
|
||||
label.Left = labelMixMode.Left;
|
||||
|
@ -261,7 +263,8 @@ namespace CodeImp.DoomBuilder.Controls
|
|||
}
|
||||
|
||||
//mxd
|
||||
private void cbMixMode_SelectedIndexChanged(object sender, EventArgs e) {
|
||||
private void cbMixMode_SelectedIndexChanged(object sender, EventArgs e)
|
||||
{
|
||||
mixMode = cbMixMode.SelectedIndex;
|
||||
RefillList(false);
|
||||
}
|
||||
|
@ -278,9 +281,11 @@ namespace CodeImp.DoomBuilder.Controls
|
|||
ListViewItem selected = list.SelectedItems[0];
|
||||
|
||||
//mxd
|
||||
foreach(ListViewItem n in visibleitems) {
|
||||
foreach(ListViewItem n in visibleitems)
|
||||
{
|
||||
if(n == selected) continue;
|
||||
if(n.Text == selected.Text) {
|
||||
if(n.Text == selected.Text)
|
||||
{
|
||||
n.Selected = true;
|
||||
n.Focused = true;
|
||||
n.EnsureVisible();
|
||||
|
@ -293,7 +298,7 @@ namespace CodeImp.DoomBuilder.Controls
|
|||
// This selects an item by name
|
||||
public void SelectItem(string name, ListViewGroup preferredgroup)
|
||||
{
|
||||
ListViewItem lvi = null;
|
||||
ImageBrowserItem lvi = null; //mxd
|
||||
|
||||
// Not when selecting is prevented
|
||||
if(preventselection) return;
|
||||
|
@ -303,9 +308,10 @@ namespace CodeImp.DoomBuilder.Controls
|
|||
{
|
||||
foreach(ListViewItem item in list.Items)
|
||||
{
|
||||
if(string.Compare(item.Text, name, true) == 0)
|
||||
ImageBrowserItem curitem = item as ImageBrowserItem;
|
||||
if(curitem != null && string.Compare(curitem.icon.Name, name, true) == 0)
|
||||
{
|
||||
lvi = item;
|
||||
lvi = curitem;
|
||||
if(item.Group == preferredgroup) break;
|
||||
}
|
||||
}
|
||||
|
@ -326,9 +332,6 @@ namespace CodeImp.DoomBuilder.Controls
|
|||
// This performs item sleection by keys
|
||||
private void SelectNextItem(SearchDirectionHint dir)
|
||||
{
|
||||
ListViewItem lvi;
|
||||
Point spos;
|
||||
|
||||
// Not when selecting is prevented
|
||||
if(preventselection) return;
|
||||
|
||||
|
@ -341,9 +344,9 @@ namespace CodeImp.DoomBuilder.Controls
|
|||
else
|
||||
{
|
||||
// Get selected item
|
||||
lvi = list.SelectedItems[0];
|
||||
ListViewItem lvi = list.SelectedItems[0];
|
||||
Rectangle lvirect = list.GetItemRect(lvi.Index, ItemBoundsPortion.Entire);
|
||||
spos = new Point(lvirect.Location.X + lvirect.Width / 2, lvirect.Y + lvirect.Height / 2);
|
||||
Point spos = new Point(lvirect.Location.X + lvirect.Width / 2, lvirect.Y + lvirect.Height / 2);
|
||||
|
||||
// Try finding 5 times in the given direction
|
||||
for(int i = 0; i < 5; i++)
|
||||
|
@ -378,8 +381,6 @@ namespace CodeImp.DoomBuilder.Controls
|
|||
// This selectes the first item
|
||||
private void SelectFirstItem()
|
||||
{
|
||||
ListViewItem lvi;
|
||||
|
||||
// Not when selecting is prevented
|
||||
if(preventselection) return;
|
||||
|
||||
|
@ -387,7 +388,7 @@ namespace CodeImp.DoomBuilder.Controls
|
|||
if(list.Items.Count > 0)
|
||||
{
|
||||
list.SelectedItems.Clear();
|
||||
lvi = list.GetItemAt(list.TileSize.Width / 2, list.TileSize.Height / 2);
|
||||
ListViewItem lvi = list.GetItemAt(list.TileSize.Width / 2, list.TileSize.Height / 2);
|
||||
if(lvi != null)
|
||||
{
|
||||
lvi.Selected = true;
|
||||
|
@ -424,14 +425,6 @@ namespace CodeImp.DoomBuilder.Controls
|
|||
// This ends adding items
|
||||
public void EndAdding()
|
||||
{
|
||||
//mxd. Do we need to change item width?
|
||||
if (longestTextureName.Length > 8)
|
||||
{
|
||||
Graphics g = Graphics.FromImage(new Bitmap(1, 1));
|
||||
SizeF size = g.MeasureString(longestTextureName, list.Font);
|
||||
list.TileSize = new Size((int)(size.Width + 12), list.TileSize.Height);
|
||||
}
|
||||
|
||||
// Fill list with items
|
||||
RefillList(true);
|
||||
|
||||
|
|
|
@ -29,6 +29,12 @@ namespace CodeImp.DoomBuilder.Controls
|
|||
{
|
||||
internal class ImageBrowserItem : ListViewItem, IComparable<ImageBrowserItem>
|
||||
{
|
||||
#region ================== Constants
|
||||
|
||||
private const int MAX_DISPLAY_NAME_LENGTH = 16; //mxd
|
||||
|
||||
#endregion
|
||||
|
||||
#region ================== Variables
|
||||
|
||||
// Display image and text
|
||||
|
@ -58,6 +64,9 @@ namespace CodeImp.DoomBuilder.Controls
|
|||
{
|
||||
// Initialize
|
||||
this.Text = text;
|
||||
if (text.Length > MAX_DISPLAY_NAME_LENGTH) text = text.Substring(0, MAX_DISPLAY_NAME_LENGTH); //mxd
|
||||
this.displaytext = text;
|
||||
|
||||
if(General.Settings.ShowTextureSizes)
|
||||
this.displaytext = text + "\n" + icon.ScaledWidth + " x " + icon.ScaledHeight;
|
||||
else
|
||||
|
|
|
@ -32,34 +32,32 @@ namespace CodeImp.DoomBuilder.Controls
|
|||
this.components = new System.ComponentModel.Container();
|
||||
this.preview = new System.Windows.Forms.Panel();
|
||||
this.labelSize = new System.Windows.Forms.Label();
|
||||
this.name = new CodeImp.DoomBuilder.Controls.AutoSelectTextbox();
|
||||
this.imagebox = new CodeImp.DoomBuilder.Controls.ConfigurablePictureBox();
|
||||
this.timer = new System.Windows.Forms.Timer(this.components);
|
||||
this.tooltip = new System.Windows.Forms.ToolTip(this.components);
|
||||
this.name = new CodeImp.DoomBuilder.Controls.AutoSelectTextbox();
|
||||
this.preview.SuspendLayout();
|
||||
((System.ComponentModel.ISupportInitialize)(this.imagebox)).BeginInit();
|
||||
this.SuspendLayout();
|
||||
//
|
||||
// preview
|
||||
//
|
||||
this.preview.BackColor = System.Drawing.SystemColors.AppWorkspace;
|
||||
this.preview.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Zoom;
|
||||
this.preview.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D;
|
||||
this.preview.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
|
||||
this.preview.Controls.Add(this.labelSize);
|
||||
this.preview.Controls.Add(this.imagebox);
|
||||
this.preview.Location = new System.Drawing.Point(0, 0);
|
||||
this.preview.Name = "preview";
|
||||
this.preview.Size = new System.Drawing.Size(68, 60);
|
||||
this.preview.TabIndex = 1;
|
||||
this.preview.MouseLeave += new System.EventHandler(this.preview_MouseLeave);
|
||||
this.preview.MouseMove += new System.Windows.Forms.MouseEventHandler(this.preview_MouseMove);
|
||||
this.preview.Click += new System.EventHandler(this.preview_Click);
|
||||
this.preview.MouseDown += new System.Windows.Forms.MouseEventHandler(this.preview_MouseDown);
|
||||
this.preview.MouseUp += new System.Windows.Forms.MouseEventHandler(this.preview_MouseUp);
|
||||
this.preview.MouseEnter += new System.EventHandler(this.preview_MouseEnter);
|
||||
//
|
||||
// labelSize
|
||||
//
|
||||
this.labelSize.AutoSize = true;
|
||||
this.labelSize.BackColor = System.Drawing.Color.Black;
|
||||
this.labelSize.BackColor = System.Drawing.SystemColors.ControlText;
|
||||
this.labelSize.Font = new System.Drawing.Font("Microsoft Sans Serif", 7F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(204)));
|
||||
this.labelSize.ForeColor = System.Drawing.Color.White;
|
||||
this.labelSize.ForeColor = System.Drawing.SystemColors.HighlightText;
|
||||
this.labelSize.Location = new System.Drawing.Point(1, 1);
|
||||
this.labelSize.MaximumSize = new System.Drawing.Size(0, 13);
|
||||
this.labelSize.Name = "labelSize";
|
||||
|
@ -68,6 +66,30 @@ namespace CodeImp.DoomBuilder.Controls
|
|||
this.labelSize.Text = "128x128";
|
||||
this.labelSize.Visible = false;
|
||||
//
|
||||
// imagebox
|
||||
//
|
||||
this.imagebox.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Zoom;
|
||||
this.imagebox.CompositingQuality = System.Drawing.Drawing2D.CompositingQuality.Default;
|
||||
this.imagebox.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.imagebox.InterpolationMode = System.Drawing.Drawing2D.InterpolationMode.NearestNeighbor;
|
||||
this.imagebox.Location = new System.Drawing.Point(0, 0);
|
||||
this.imagebox.Name = "imagebox";
|
||||
this.imagebox.PageUnit = System.Drawing.GraphicsUnit.Pixel;
|
||||
this.imagebox.PixelOffsetMode = System.Drawing.Drawing2D.PixelOffsetMode.None;
|
||||
this.imagebox.Size = new System.Drawing.Size(66, 58);
|
||||
this.imagebox.SizeMode = System.Windows.Forms.PictureBoxSizeMode.Zoom;
|
||||
this.imagebox.SmoothingMode = System.Drawing.Drawing2D.SmoothingMode.Default;
|
||||
this.imagebox.TabIndex = 3;
|
||||
this.imagebox.TabStop = false;
|
||||
this.imagebox.MouseLeave += new System.EventHandler(this.preview_MouseLeave);
|
||||
this.imagebox.Click += new System.EventHandler(this.preview_Click);
|
||||
this.imagebox.MouseDown += new System.Windows.Forms.MouseEventHandler(this.preview_MouseDown);
|
||||
this.imagebox.MouseEnter += new System.EventHandler(this.preview_MouseEnter);
|
||||
//
|
||||
// timer
|
||||
//
|
||||
this.timer.Tick += new System.EventHandler(this.timer_Tick);
|
||||
//
|
||||
// name
|
||||
//
|
||||
this.name.AutoCompleteMode = System.Windows.Forms.AutoCompleteMode.Suggest;
|
||||
|
@ -79,11 +101,6 @@ namespace CodeImp.DoomBuilder.Controls
|
|||
this.name.TabIndex = 2;
|
||||
this.name.TextChanged += new System.EventHandler(this.name_TextChanged);
|
||||
//
|
||||
// timer
|
||||
//
|
||||
this.timer.Interval = 1000;
|
||||
this.timer.Tick += new System.EventHandler(this.timer_Tick);
|
||||
//
|
||||
// ImageSelectorControl
|
||||
//
|
||||
this.AutoScaleDimensions = new System.Drawing.SizeF(96F, 96F);
|
||||
|
@ -97,6 +114,7 @@ namespace CodeImp.DoomBuilder.Controls
|
|||
this.EnabledChanged += new System.EventHandler(this.ImageSelectorControl_EnabledChanged);
|
||||
this.preview.ResumeLayout(false);
|
||||
this.preview.PerformLayout();
|
||||
((System.ComponentModel.ISupportInitialize)(this.imagebox)).EndInit();
|
||||
this.ResumeLayout(false);
|
||||
this.PerformLayout();
|
||||
|
||||
|
@ -108,6 +126,8 @@ namespace CodeImp.DoomBuilder.Controls
|
|||
protected CodeImp.DoomBuilder.Controls.AutoSelectTextbox name;
|
||||
private System.Windows.Forms.Label labelSize;
|
||||
protected System.Windows.Forms.Timer timer;
|
||||
private System.Windows.Forms.ToolTip tooltip;
|
||||
private ConfigurablePictureBox imagebox;
|
||||
|
||||
}
|
||||
}
|
||||
|
|
|
@ -36,17 +36,18 @@ namespace CodeImp.DoomBuilder.Controls
|
|||
public event EventHandler OnValueChanged; //mxd
|
||||
|
||||
private Bitmap bmp;
|
||||
private bool ismouseinside;
|
||||
private MouseButtons button;
|
||||
private string previousImageName; //mxd
|
||||
protected bool multipletextures; //mxd
|
||||
protected bool usepreviews = true; //mxd
|
||||
|
||||
#endregion
|
||||
|
||||
#region ================== Properties
|
||||
|
||||
public string TextureName { get { return name.Text; } set { name.Text = value; } }
|
||||
|
||||
public bool UsePreviews { get { return usepreviews; } set { usepreviews = value; } } //mxd
|
||||
|
||||
[Browsable(false)]
|
||||
public bool MultipleTextures { get { return multipletextures; } set { multipletextures = value; } }
|
||||
|
||||
|
@ -67,6 +68,7 @@ namespace CodeImp.DoomBuilder.Controls
|
|||
// set the max length of texture names
|
||||
name.MaxLength = General.Map.Config.MaxTextureNameLength;
|
||||
if(General.Settings.CapitalizeTextureNames) this.name.CharacterCasing = CharacterCasing.Upper; //mxd
|
||||
labelSize.BackColor = Color.FromArgb(196, labelSize.BackColor);
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
@ -92,8 +94,7 @@ namespace CodeImp.DoomBuilder.Controls
|
|||
// Image clicked
|
||||
private void preview_Click(object sender, EventArgs e)
|
||||
{
|
||||
preview.BackColor = SystemColors.Highlight;
|
||||
ShowPreview(FindImage(name.Text));
|
||||
imagebox.BackColor = SystemColors.Highlight;
|
||||
if(button == MouseButtons.Right)
|
||||
{
|
||||
name.Text = "-";
|
||||
|
@ -109,6 +110,9 @@ namespace CodeImp.DoomBuilder.Controls
|
|||
{
|
||||
// Show it centered
|
||||
ShowPreview(FindImage(name.Text));
|
||||
|
||||
// Update tooltip (mxd)
|
||||
tooltip.SetToolTip(imagebox, name.Text);
|
||||
}
|
||||
|
||||
// Mouse pressed
|
||||
|
@ -117,44 +121,20 @@ namespace CodeImp.DoomBuilder.Controls
|
|||
button = e.Button;
|
||||
if((button == MouseButtons.Left) || ((button == MouseButtons.Right)))
|
||||
{
|
||||
//ispressed = true;
|
||||
preview.BackColor = AdjustedColor(SystemColors.Highlight, 0.2f);
|
||||
ShowPreview(FindImage(name.Text));
|
||||
imagebox.BackColor = AdjustedColor(SystemColors.Highlight, 0.2f);
|
||||
}
|
||||
}
|
||||
|
||||
// Mouse released
|
||||
private void preview_MouseUp(object sender, MouseEventArgs e)
|
||||
{
|
||||
//ispressed = false;
|
||||
ShowPreview(FindImage(name.Text));
|
||||
}
|
||||
|
||||
// Mouse leaves
|
||||
private void preview_MouseLeave(object sender, EventArgs e)
|
||||
{
|
||||
//ispressed = false;
|
||||
ismouseinside = false;
|
||||
preview.BackColor = SystemColors.AppWorkspace;
|
||||
imagebox.BackColor = SystemColors.AppWorkspace;
|
||||
}
|
||||
|
||||
// Mouse enters
|
||||
private void preview_MouseEnter(object sender, EventArgs e)
|
||||
{
|
||||
ismouseinside = true;
|
||||
preview.BackColor = SystemColors.Highlight;
|
||||
ShowPreview(FindImage(name.Text));
|
||||
}
|
||||
|
||||
// Mouse moves
|
||||
private void preview_MouseMove(object sender, MouseEventArgs e)
|
||||
{
|
||||
if(!ismouseinside)
|
||||
{
|
||||
ismouseinside = true;
|
||||
preview.BackColor = SystemColors.Highlight;
|
||||
ShowPreview(FindImage(name.Text));
|
||||
}
|
||||
imagebox.BackColor = SystemColors.Highlight;
|
||||
}
|
||||
|
||||
//mxd
|
||||
|
@ -185,7 +165,7 @@ namespace CodeImp.DoomBuilder.Controls
|
|||
private void ShowPreview(Image image)
|
||||
{
|
||||
// Dispose old image
|
||||
preview.BackgroundImage = null;
|
||||
imagebox.BackgroundImage = null;
|
||||
if(bmp != null)
|
||||
{
|
||||
bmp.Dispose();
|
||||
|
@ -195,12 +175,13 @@ namespace CodeImp.DoomBuilder.Controls
|
|||
if(image != null)
|
||||
{
|
||||
// Show it centered
|
||||
General.DisplayZoomedImage(preview, image);
|
||||
preview.Refresh();
|
||||
imagebox.Image = image;
|
||||
imagebox.Refresh();
|
||||
}
|
||||
|
||||
//mxd. Dispatch event
|
||||
if(OnValueChanged != null && previousImageName != name.Text) {
|
||||
if(OnValueChanged != null && previousImageName != name.Text)
|
||||
{
|
||||
previousImageName = name.Text;
|
||||
OnValueChanged(this, EventArgs.Empty);
|
||||
}
|
||||
|
|
|
@ -120,12 +120,15 @@
|
|||
<metadata name="preview.Locked" type="System.Boolean, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>True</value>
|
||||
</metadata>
|
||||
<metadata name="name.Locked" type="System.Boolean, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>True</value>
|
||||
</metadata>
|
||||
<metadata name="timer.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
|
||||
<value>17, 17</value>
|
||||
</metadata>
|
||||
<metadata name="tooltip.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
|
||||
<value>97, 17</value>
|
||||
</metadata>
|
||||
<metadata name="name.Locked" type="System.Boolean, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>True</value>
|
||||
</metadata>
|
||||
<metadata name="$this.Locked" type="System.Boolean, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>True</value>
|
||||
</metadata>
|
||||
|
|
|
@ -35,6 +35,7 @@ namespace CodeImp.DoomBuilder.Controls
|
|||
private int doomformatwidth;
|
||||
private List<UniversalFieldInfo> fieldInfos;
|
||||
private int[] labelPositionsY = new[] { 39, 58, 77 }; //mxd
|
||||
private const int defaultPanelWidth = 270; //mxd
|
||||
|
||||
// Constructor
|
||||
public LinedefInfoPanel()
|
||||
|
@ -52,12 +53,10 @@ namespace CodeImp.DoomBuilder.Controls
|
|||
{
|
||||
bool upperunpegged, lowerunpegged;
|
||||
string peggedness;
|
||||
int defaultPanelWidth = 270; //mxd
|
||||
|
||||
//mxd
|
||||
if (General.Map.UDMF && fieldInfos == null) {
|
||||
if (General.Map.UDMF && fieldInfos == null)
|
||||
fieldInfos = General.Map.Config.SidedefFields;
|
||||
}
|
||||
|
||||
// Show/hide stuff depending on format
|
||||
if(!General.Map.FormatInterface.HasActionArgs)
|
||||
|
@ -90,15 +89,18 @@ namespace CodeImp.DoomBuilder.Controls
|
|||
}
|
||||
|
||||
//mxd. Hide activation or tag and rearrange labels
|
||||
if(!General.Map.FormatInterface.HasBuiltInActivations && General.Map.FormatInterface.HasNumericLinedefActivations) { //Hexen map format?
|
||||
if(!General.Map.FormatInterface.HasBuiltInActivations && General.Map.FormatInterface.HasNumericLinedefActivations) //Hexen map format?
|
||||
{
|
||||
activation.Visible = true;
|
||||
activationlabel.Visible = true;
|
||||
taglabel.Visible = false;
|
||||
tag.Visible = false;
|
||||
|
||||
//set activation
|
||||
foreach(LinedefActivateInfo ai in General.Map.Config.LinedefActivates) {
|
||||
if(l.Activate == ai.Index) {
|
||||
foreach(LinedefActivateInfo ai in General.Map.Config.LinedefActivates)
|
||||
{
|
||||
if(l.Activate == ai.Index)
|
||||
{
|
||||
activation.Text = ai.Title;
|
||||
break;
|
||||
}
|
||||
|
@ -118,8 +120,9 @@ namespace CodeImp.DoomBuilder.Controls
|
|||
anglelabel.Top = labelPositionsY[2];
|
||||
backoffset.Top = labelPositionsY[2];
|
||||
backoffsetlabel.Top = labelPositionsY[2];
|
||||
|
||||
} else {
|
||||
}
|
||||
else
|
||||
{
|
||||
activation.Visible = false;
|
||||
activationlabel.Visible = false;
|
||||
taglabel.Visible = true;
|
||||
|
@ -187,11 +190,10 @@ namespace CodeImp.DoomBuilder.Controls
|
|||
arg5.Enabled = act.Args[4].Used;
|
||||
|
||||
//mxd
|
||||
if (hasArg0Str) {
|
||||
if (hasArg0Str)
|
||||
arg1.Text = '"' + l.Fields["arg0str"].Value.ToString() + '"';
|
||||
} else {
|
||||
else
|
||||
setArgumentText(act.Args[0], arg1, l.Args[0]);
|
||||
}
|
||||
setArgumentText(act.Args[1], arg2, l.Args[1]);
|
||||
setArgumentText(act.Args[2], arg3, l.Args[2]);
|
||||
setArgumentText(act.Args[3], arg4, l.Args[3]);
|
||||
|
@ -210,7 +212,8 @@ namespace CodeImp.DoomBuilder.Controls
|
|||
frontsector.Visible = true;
|
||||
|
||||
//mxd
|
||||
if(General.Map.UDMF) {
|
||||
if(General.Map.UDMF)
|
||||
{
|
||||
//light
|
||||
frontoffsetlabel.Text = "Front light:";
|
||||
setUDMFLight(l.Front, frontoffsetlabel, frontoffset);
|
||||
|
@ -249,7 +252,9 @@ namespace CodeImp.DoomBuilder.Controls
|
|||
if(hasTopFields) addedWidth = 64;
|
||||
if(hasMiddleFields) addedWidth += 64;
|
||||
if(hasBottomFields) addedWidth += 64;
|
||||
} else {
|
||||
}
|
||||
else
|
||||
{
|
||||
frontoffsetlabel.Text = "Front offset:";
|
||||
frontoffset.Text = l.Front.OffsetX + ", " + l.Front.OffsetY;
|
||||
frontoffsetlabel.Enabled = true;
|
||||
|
@ -264,12 +269,10 @@ namespace CodeImp.DoomBuilder.Controls
|
|||
frontpanel.Width = defaultPanelWidth + addedWidth + 12;
|
||||
flowLayoutPanelFront.Width = defaultPanelWidth + addedWidth;
|
||||
|
||||
fronthighname.Text = l.Front.HighTexture;
|
||||
frontmidname.Text = l.Front.MiddleTexture;
|
||||
frontlowname.Text = l.Front.LowTexture;
|
||||
DisplaySidedefTexture(fronthightex, labelTextureFrontTop, l.Front.HighTexture, l.Front.HighRequired());
|
||||
DisplaySidedefTexture(frontmidtex, labelTextureFrontMid, l.Front.MiddleTexture, l.Front.MiddleRequired());
|
||||
DisplaySidedefTexture(frontlowtex, labelTextureFrontBottom, l.Front.LowTexture, l.Front.LowRequired());
|
||||
// Show textures
|
||||
DisplaySidedefTexture(fronthightex, fronthighname, labelTextureFrontTop, l.Front.HighTexture, l.Front.HighRequired());
|
||||
DisplaySidedefTexture(frontmidtex, frontmidname, labelTextureFrontMid, l.Front.MiddleTexture, l.Front.MiddleRequired());
|
||||
DisplaySidedefTexture(frontlowtex, frontlowname, labelTextureFrontBottom, l.Front.LowTexture, l.Front.LowRequired());
|
||||
|
||||
//mxd. Position label
|
||||
frontsector.Left = frontpanel.Width - frontsector.Width - 12;
|
||||
|
@ -277,11 +280,13 @@ namespace CodeImp.DoomBuilder.Controls
|
|||
else
|
||||
{
|
||||
// Show no info
|
||||
//mxd
|
||||
if(General.Map.UDMF) {
|
||||
if(General.Map.UDMF) //mxd
|
||||
{
|
||||
frontoffsetlabel.Text = "Front light:";
|
||||
frontoffset.Text = "--";
|
||||
} else {
|
||||
}
|
||||
else
|
||||
{
|
||||
frontoffsetlabel.Text = "Front offset:";
|
||||
frontoffset.Text = "--, --";
|
||||
}
|
||||
|
@ -362,12 +367,10 @@ namespace CodeImp.DoomBuilder.Controls
|
|||
backpanel.Width = defaultPanelWidth + addedWidth + 12;
|
||||
flowLayoutPanelBack.Width = defaultPanelWidth + addedWidth;
|
||||
|
||||
backhighname.Text = l.Back.HighTexture;
|
||||
backmidname.Text = l.Back.MiddleTexture;
|
||||
backlowname.Text = l.Back.LowTexture;
|
||||
DisplaySidedefTexture(backhightex, labelTextureBackTop, l.Back.HighTexture, l.Back.HighRequired());
|
||||
DisplaySidedefTexture(backmidtex, labelTextureBackMid, l.Back.MiddleTexture, l.Back.MiddleRequired());
|
||||
DisplaySidedefTexture(backlowtex, labelTextureBackBottom, l.Back.LowTexture, l.Back.LowRequired());
|
||||
// Show textures
|
||||
DisplaySidedefTexture(backhightex, backhighname, labelTextureBackTop, l.Back.HighTexture, l.Back.HighRequired());
|
||||
DisplaySidedefTexture(backmidtex, backmidname, labelTextureBackMid, l.Back.MiddleTexture, l.Back.MiddleRequired());
|
||||
DisplaySidedefTexture(backlowtex, backlowname, labelTextureBackBottom, l.Back.LowTexture, l.Back.LowRequired());
|
||||
|
||||
//mxd. Position label
|
||||
backsector.Left = backpanel.Width - backsector.Width - 12;
|
||||
|
@ -375,11 +378,13 @@ namespace CodeImp.DoomBuilder.Controls
|
|||
else
|
||||
{
|
||||
// Show no info
|
||||
//mxd
|
||||
if(General.Map.UDMF) {
|
||||
if(General.Map.UDMF) //mxd
|
||||
{
|
||||
backoffsetlabel.Text = "Back light:";
|
||||
backoffset.Text = "--";
|
||||
} else {
|
||||
}
|
||||
else
|
||||
{
|
||||
backoffsetlabel.Text = "Back offset:";
|
||||
backoffset.Text = "--, --";
|
||||
}
|
||||
|
@ -396,21 +401,21 @@ namespace CodeImp.DoomBuilder.Controls
|
|||
|
||||
//mxd. Flags
|
||||
Dictionary<string, string> activations = new Dictionary<string, string>(StringComparer.Ordinal);
|
||||
foreach(LinedefActivateInfo ai in General.Map.Config.LinedefActivates) {
|
||||
foreach(LinedefActivateInfo ai in General.Map.Config.LinedefActivates)
|
||||
activations.Add(ai.Key, ai.Title);
|
||||
}
|
||||
|
||||
flags.Items.Clear();
|
||||
foreach(KeyValuePair<string, bool> group in l.Flags) {
|
||||
if(group.Value) {
|
||||
foreach(KeyValuePair<string, bool> group in l.Flags)
|
||||
{
|
||||
if(group.Value)
|
||||
{
|
||||
ListViewItem item;
|
||||
if (General.Map.Config.LinedefFlags.ContainsKey(group.Key)) {
|
||||
if (General.Map.Config.LinedefFlags.ContainsKey(group.Key))
|
||||
item = new ListViewItem(General.Map.Config.LinedefFlags[group.Key]);
|
||||
} else if (activations.ContainsKey(group.Key)) {
|
||||
else if (activations.ContainsKey(group.Key))
|
||||
item = new ListViewItem(activations[group.Key]);
|
||||
} else {
|
||||
else
|
||||
item = new ListViewItem(group.Key);
|
||||
}
|
||||
|
||||
item.Checked = true;
|
||||
flags.Items.Add(item);
|
||||
|
@ -419,7 +424,8 @@ namespace CodeImp.DoomBuilder.Controls
|
|||
|
||||
//mxd. Flags panel visibility and size
|
||||
flagsPanel.Visible = (flags.Items.Count > 0);
|
||||
if(flags.Items.Count > 0) {
|
||||
if(flags.Items.Count > 0)
|
||||
{
|
||||
int itemWidth = flags.Items[0].GetBounds(ItemBoundsPortion.Entire).Width;
|
||||
if(itemWidth == 0) itemWidth = 96;
|
||||
flags.Width = itemWidth * (int)Math.Ceiling(flags.Items.Count / 5.0f);
|
||||
|
@ -432,7 +438,8 @@ namespace CodeImp.DoomBuilder.Controls
|
|||
}
|
||||
|
||||
//mxd
|
||||
private bool checkPairedUDMFFields(UniFields fields, string paramX, string paramY, Label label, Label value) {
|
||||
private bool checkPairedUDMFFields(UniFields fields, string paramX, string paramY, Label label, Label value)
|
||||
{
|
||||
float dx = getDefaultUDMFValue(paramX);
|
||||
float dy = getDefaultUDMFValue(paramY);
|
||||
float x = dx;
|
||||
|
@ -443,7 +450,8 @@ namespace CodeImp.DoomBuilder.Controls
|
|||
if(fields.ContainsKey(paramY))
|
||||
y = (float)fields[paramY].Value;
|
||||
|
||||
if(x != dx || y != dy) {
|
||||
if(x != dx || y != dy)
|
||||
{
|
||||
value.Text = String.Format("{0:0.##}", x) + ", " + String.Format("{0:0.##}", y);
|
||||
value.Enabled = true;
|
||||
label.Enabled = true;
|
||||
|
@ -459,7 +467,8 @@ namespace CodeImp.DoomBuilder.Controls
|
|||
//mxd
|
||||
private static void setUDMFLight(Sidedef sd, Label label, Label value)
|
||||
{
|
||||
if(sd.Fields.ContainsKey("light")) {
|
||||
if(sd.Fields.ContainsKey("light"))
|
||||
{
|
||||
int light = (int)sd.Fields["light"].Value;
|
||||
|
||||
if (sd.Fields.ContainsKey("lightabsolute") && Boolean.Parse(sd.Fields["lightabsolute"].Value.ToString()))
|
||||
|
@ -469,7 +478,9 @@ namespace CodeImp.DoomBuilder.Controls
|
|||
|
||||
value.Enabled = true;
|
||||
label.Enabled = true;
|
||||
} else {
|
||||
}
|
||||
else
|
||||
{
|
||||
value.Text = "--";
|
||||
label.Enabled = false;
|
||||
value.Enabled = false;
|
||||
|
@ -479,9 +490,8 @@ namespace CodeImp.DoomBuilder.Controls
|
|||
//mxd
|
||||
private float getDefaultUDMFValue(string valueName)
|
||||
{
|
||||
foreach (UniversalFieldInfo fi in fieldInfos) {
|
||||
foreach (UniversalFieldInfo fi in fieldInfos)
|
||||
if (fi.Name == valueName) return (float)fi.Default;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@ -494,9 +504,8 @@ namespace CodeImp.DoomBuilder.Controls
|
|||
|
||||
if(value < 1 || !General.Map.Options.TagLabels.ContainsKey(value)) return;
|
||||
|
||||
if(th is ThingTagHandler || th is LinedefTagHandler || th is SectorTagHandler) {
|
||||
if(th is ThingTagHandler || th is LinedefTagHandler || th is SectorTagHandler)
|
||||
label.Text += " (" + General.Map.Options.TagLabels[value] + ")";
|
||||
}
|
||||
}
|
||||
|
||||
// When visible changed
|
||||
|
@ -518,29 +527,39 @@ namespace CodeImp.DoomBuilder.Controls
|
|||
}
|
||||
|
||||
// This shows a sidedef texture in a panel
|
||||
private static void DisplaySidedefTexture(Panel panel, Label label, string name, bool required)
|
||||
private static void DisplaySidedefTexture(Panel panel, Label namelabel, Label sizelabel, string name, bool required)
|
||||
{
|
||||
// Check if name is a "none" texture
|
||||
if((name.Length < 1) || (name == "-"))
|
||||
{
|
||||
label.Visible = false; //mxd
|
||||
sizelabel.Visible = false; //mxd
|
||||
|
||||
// Determine image to show
|
||||
if(required)
|
||||
General.DisplayZoomedImage(panel, Properties.Resources.MissingTexture);
|
||||
else
|
||||
panel.BackgroundImage = null;
|
||||
|
||||
// Set texture name
|
||||
namelabel.Text = "-";
|
||||
}
|
||||
else
|
||||
{
|
||||
//mxd
|
||||
ImageData texture = General.Map.Data.GetTextureImage(name);
|
||||
if(General.Settings.ShowTextureSizes && texture.ImageState == ImageLoadState.Ready && !(texture is UnknownImage)) {
|
||||
label.Visible = true;
|
||||
label.Text = texture.ScaledWidth + "x" + texture.ScaledHeight;
|
||||
} else {
|
||||
label.Visible = false;
|
||||
bool unknowntexture = texture is UnknownImage;
|
||||
if(General.Settings.ShowTextureSizes && texture.ImageState == ImageLoadState.Ready && !unknowntexture)
|
||||
{
|
||||
sizelabel.Visible = true;
|
||||
sizelabel.Text = texture.ScaledWidth + "x" + texture.ScaledHeight;
|
||||
}
|
||||
else
|
||||
{
|
||||
sizelabel.Visible = false;
|
||||
}
|
||||
|
||||
// Set texture name
|
||||
namelabel.Text = (unknowntexture ? name : texture.DisplayName);
|
||||
|
||||
// Set the image
|
||||
General.DisplayZoomedImage(panel, texture.GetPreview());
|
||||
|
|
|
@ -170,13 +170,11 @@ namespace CodeImp.DoomBuilder.Controls
|
|||
// This adds a normal item
|
||||
private void AddItem(DataLocation rl)
|
||||
{
|
||||
int index;
|
||||
|
||||
// Start editing list
|
||||
resourceitems.BeginUpdate();
|
||||
|
||||
// Add item
|
||||
index = resourceitems.Items.Count;
|
||||
int index = resourceitems.Items.Count;
|
||||
resourceitems.Items.Add(new ListViewItem(rl.location));
|
||||
resourceitems.Items[index].Tag = rl;
|
||||
resourceitems.Items[index].ImageIndex = GetIconIndex(rl.type, false);
|
||||
|
@ -189,22 +187,30 @@ namespace CodeImp.DoomBuilder.Controls
|
|||
}
|
||||
|
||||
//mxd
|
||||
internal void DropItem(IDataObject data) {
|
||||
internal void DropItem(IDataObject data)
|
||||
{
|
||||
if(!data.GetDataPresent(DataFormats.FileDrop)) return;
|
||||
|
||||
string[] paths = (string[])data.GetData(DataFormats.FileDrop);
|
||||
foreach(string path in paths) {
|
||||
if(File.Exists(path)) {
|
||||
foreach(string path in paths)
|
||||
{
|
||||
if(File.Exists(path))
|
||||
{
|
||||
string ext = Path.GetExtension(path);
|
||||
if(string.IsNullOrEmpty(ext))
|
||||
continue;
|
||||
if(string.IsNullOrEmpty(ext)) continue;
|
||||
|
||||
ext = ext.ToLower();
|
||||
if(ext == ".wad") {
|
||||
if(ext == ".wad")
|
||||
{
|
||||
AddItem(new DataLocation(DataLocation.RESOURCE_WAD, path, false, false, false));
|
||||
} else if(ext == ".pk3" || ext == ".pk7") {
|
||||
}
|
||||
else if(ext == ".pk3" || ext == ".pk7")
|
||||
{
|
||||
AddItem(new DataLocation(DataLocation.RESOURCE_PK3, path, false, false, false));
|
||||
}
|
||||
} else if(Directory.Exists(path)) {
|
||||
}
|
||||
else if(Directory.Exists(path))
|
||||
{
|
||||
AddItem(new DataLocation(DataLocation.RESOURCE_DIRECTORY, path, false, false, false));
|
||||
}
|
||||
}
|
||||
|
@ -227,13 +233,10 @@ namespace CodeImp.DoomBuilder.Controls
|
|||
// Add a resource
|
||||
private void addresource_Click(object sender, EventArgs e)
|
||||
{
|
||||
ResourceOptionsForm resoptions;
|
||||
Rectangle startposition;
|
||||
|
||||
// Open resource options dialog
|
||||
resoptions = new ResourceOptionsForm(new DataLocation(), "Add Resource", StartPath);
|
||||
ResourceOptionsForm resoptions = new ResourceOptionsForm(new DataLocation(), "Add Resource", StartPath);
|
||||
resoptions.StartPosition = FormStartPosition.Manual;
|
||||
startposition = new Rectangle(dialogoffset.X, dialogoffset.Y, 1, 1);
|
||||
Rectangle startposition = new Rectangle(dialogoffset.X, dialogoffset.Y, 1, 1);
|
||||
startposition = this.RectangleToScreen(startposition);
|
||||
Screen screen = Screen.FromPoint(startposition.Location);
|
||||
if(startposition.X + resoptions.Size.Width > screen.WorkingArea.Right)
|
||||
|
@ -254,21 +257,16 @@ namespace CodeImp.DoomBuilder.Controls
|
|||
// Edit resource
|
||||
private void editresource_Click(object sender, EventArgs e)
|
||||
{
|
||||
ResourceOptionsForm resoptions;
|
||||
Rectangle startposition;
|
||||
ListViewItem selecteditem;
|
||||
DataLocation rl;
|
||||
|
||||
// Anything selected?
|
||||
if(resourceitems.SelectedItems.Count > 0)
|
||||
{
|
||||
// Get selected item
|
||||
selecteditem = resourceitems.SelectedItems[0];
|
||||
ListViewItem selecteditem = resourceitems.SelectedItems[0];
|
||||
|
||||
// Open resource options dialog
|
||||
resoptions = new ResourceOptionsForm((DataLocation)selecteditem.Tag, "Resource Options", StartPath);
|
||||
ResourceOptionsForm resoptions = new ResourceOptionsForm((DataLocation)selecteditem.Tag, "Resource Options", StartPath);
|
||||
resoptions.StartPosition = FormStartPosition.Manual;
|
||||
startposition = new Rectangle(dialogoffset.X, dialogoffset.Y, 1, 1);
|
||||
Rectangle startposition = new Rectangle(dialogoffset.X, dialogoffset.Y, 1, 1);
|
||||
startposition = this.RectangleToScreen(startposition);
|
||||
Screen screen = Screen.FromPoint(startposition.Location);
|
||||
if(startposition.X + resoptions.Size.Width > screen.WorkingArea.Right)
|
||||
|
@ -282,7 +280,7 @@ namespace CodeImp.DoomBuilder.Controls
|
|||
resourceitems.BeginUpdate();
|
||||
|
||||
// Update item
|
||||
rl = resoptions.ResourceLocation;
|
||||
DataLocation rl = resoptions.ResourceLocation;
|
||||
selecteditem.Text = rl.location;
|
||||
selecteditem.Tag = rl;
|
||||
selecteditem.ImageIndex = GetIconIndex(rl.type, false);
|
||||
|
|
|
@ -29,7 +29,7 @@ namespace CodeImp.DoomBuilder.Controls
|
|||
{
|
||||
internal partial class SectorInfoPanel : UserControl
|
||||
{
|
||||
private int fullWidth; //mxd
|
||||
private readonly int fullWidth; //mxd
|
||||
|
||||
// Constructor
|
||||
public SectorInfoPanel()
|
||||
|
@ -55,57 +55,74 @@ namespace CodeImp.DoomBuilder.Controls
|
|||
tag.Text = s.Tag + (General.Map.Options.TagLabels.ContainsKey(s.Tag) ? " (" + General.Map.Options.TagLabels[s.Tag] + ")" : string.Empty);
|
||||
height.Text = sheight.ToString();
|
||||
brightness.Text = s.Brightness.ToString();
|
||||
floorname.Text = s.FloorTexture;
|
||||
ceilingname.Text = s.CeilTexture;
|
||||
|
||||
//mxd. Texture info
|
||||
if (s.LongFloorTexture == MapSet.EmptyLongName){
|
||||
if (s.LongFloorTexture == MapSet.EmptyLongName)
|
||||
{
|
||||
labelFloorTextureSize.Visible = false;
|
||||
General.DisplayZoomedImage(floortex, Properties.Resources.MissingTexture);
|
||||
} else {
|
||||
ImageData floorImage = General.Map.Data.GetFlatImage(s.FloorTexture);
|
||||
DisplayTextureSize(labelFloorTextureSize, floorImage);
|
||||
General.DisplayZoomedImage(floortex, floorImage.GetPreview());
|
||||
floorname.Text = s.FloorTexture;
|
||||
}
|
||||
else
|
||||
{
|
||||
ImageData image = General.Map.Data.GetFlatImage(s.FloorTexture);
|
||||
DisplayTextureSize(labelFloorTextureSize, image);
|
||||
General.DisplayZoomedImage(floortex, image.GetPreview());
|
||||
floorname.Text = (image is UnknownImage ? s.FloorTexture : image.DisplayName);
|
||||
}
|
||||
|
||||
if (s.LongCeilTexture == MapSet.EmptyLongName) {
|
||||
if (s.LongCeilTexture == MapSet.EmptyLongName)
|
||||
{
|
||||
labelCeilTextureSize.Visible = false;
|
||||
General.DisplayZoomedImage(ceilingtex, Properties.Resources.MissingTexture);
|
||||
} else {
|
||||
ImageData ceilingImage = General.Map.Data.GetFlatImage(s.CeilTexture);
|
||||
DisplayTextureSize(labelCeilTextureSize, ceilingImage); //mxd
|
||||
General.DisplayZoomedImage(ceilingtex, ceilingImage.GetPreview());
|
||||
ceilingname.Text = s.CeilTexture;
|
||||
}
|
||||
else
|
||||
{
|
||||
ImageData image = General.Map.Data.GetFlatImage(s.CeilTexture);
|
||||
DisplayTextureSize(labelCeilTextureSize, image); //mxd
|
||||
General.DisplayZoomedImage(ceilingtex, image.GetPreview());
|
||||
ceilingname.Text = (image is UnknownImage ? s.CeilTexture : image.DisplayName);
|
||||
}
|
||||
|
||||
//mxd
|
||||
bool showExtededFloorInfo = false;
|
||||
bool showExtededCeilingInfo = false;
|
||||
if(General.Map.UDMF) {
|
||||
if(s.Fields != null) {
|
||||
if(General.Map.UDMF)
|
||||
{
|
||||
if(s.Fields != null)
|
||||
{
|
||||
//sector colors
|
||||
labelLight.Visible = true;
|
||||
labelFade.Visible = true;
|
||||
panelLightColor.Visible = true;
|
||||
panelFadeColor.Visible = true;
|
||||
|
||||
if(s.Fields.ContainsKey("lightcolor")) {
|
||||
if(s.Fields.ContainsKey("lightcolor"))
|
||||
{
|
||||
panelLightColor.BackColor = PixelColor.FromInt(s.Fields.GetValue("lightcolor", 0xFFFFFF)).WithAlpha(255).ToColor();
|
||||
labelLight.Enabled = true;
|
||||
} else {
|
||||
}
|
||||
else
|
||||
{
|
||||
panelLightColor.BackColor = System.Drawing.SystemColors.Control;
|
||||
labelLight.Enabled = false;
|
||||
}
|
||||
|
||||
if(s.Fields.ContainsKey("fadecolor")) {
|
||||
if(s.Fields.ContainsKey("fadecolor"))
|
||||
{
|
||||
panelFadeColor.BackColor = PixelColor.FromInt(s.Fields.GetValue("fadecolor", 0)).WithAlpha(255).ToColor();
|
||||
labelFade.Enabled = true;
|
||||
} else {
|
||||
}
|
||||
else
|
||||
{
|
||||
panelFadeColor.BackColor = System.Drawing.SystemColors.Control;
|
||||
labelFade.Enabled = false;
|
||||
}
|
||||
|
||||
//light
|
||||
if(s.Fields.ContainsKey("lightceiling") || s.Fields.ContainsKey("lightceilingabsolute")) {
|
||||
if(s.Fields.ContainsKey("lightceiling") || s.Fields.ContainsKey("lightceilingabsolute"))
|
||||
{
|
||||
showExtededCeilingInfo = true;
|
||||
ceilingLight.Enabled = true;
|
||||
ceilingLightLabel.Enabled = true;
|
||||
|
@ -117,13 +134,16 @@ namespace CodeImp.DoomBuilder.Controls
|
|||
else
|
||||
ceilingLight.Text = cl + " (" + Math.Min(255, Math.Max(0, (cl + s.Brightness))) + ")";
|
||||
|
||||
} else {
|
||||
}
|
||||
else
|
||||
{
|
||||
ceilingLight.Text = "--";
|
||||
ceilingLight.Enabled = false;
|
||||
ceilingLightLabel.Enabled = false;
|
||||
}
|
||||
|
||||
if(s.Fields.ContainsKey("lightfloor") || s.Fields.ContainsKey("lightfloorabsolute")) {
|
||||
if(s.Fields.ContainsKey("lightfloor") || s.Fields.ContainsKey("lightfloorabsolute"))
|
||||
{
|
||||
showExtededFloorInfo = true;
|
||||
floorLight.Enabled = true;
|
||||
floorLightLabel.Enabled = true;
|
||||
|
@ -135,7 +155,9 @@ namespace CodeImp.DoomBuilder.Controls
|
|||
else
|
||||
floorLight.Text = fl + " (" + Math.Min(255, Math.Max(0, (fl + s.Brightness))) + ")";
|
||||
|
||||
} else {
|
||||
}
|
||||
else
|
||||
{
|
||||
floorLight.Text = "--";
|
||||
floorLight.Enabled = false;
|
||||
floorLightLabel.Enabled = false;
|
||||
|
@ -145,12 +167,15 @@ namespace CodeImp.DoomBuilder.Controls
|
|||
float panX = s.Fields.GetValue("xpanningceiling", 0f);
|
||||
float panY = s.Fields.GetValue("ypanningceiling", 0f);
|
||||
|
||||
if(panX != 0 || panY != 0) {
|
||||
if(panX != 0 || panY != 0)
|
||||
{
|
||||
showExtededCeilingInfo = true;
|
||||
ceilingOffset.Enabled = true;
|
||||
ceilingOffsetLabel.Enabled = true;
|
||||
ceilingOffset.Text = String.Format("{0:0.##}", panX) + ", " + String.Format("{0:0.##}", panY);
|
||||
} else {
|
||||
}
|
||||
else
|
||||
{
|
||||
ceilingOffset.Text = "--, --";
|
||||
ceilingOffset.Enabled = false;
|
||||
ceilingOffsetLabel.Enabled = false;
|
||||
|
@ -160,12 +185,15 @@ namespace CodeImp.DoomBuilder.Controls
|
|||
panX = s.Fields.GetValue("xpanningfloor", 0f);
|
||||
panY = s.Fields.GetValue("ypanningfloor", 0f);
|
||||
|
||||
if(panX != 0 || panY != 0) {
|
||||
if(panX != 0 || panY != 0)
|
||||
{
|
||||
showExtededFloorInfo = true;
|
||||
floorOffset.Enabled = true;
|
||||
floorOffsetLabel.Enabled = true;
|
||||
floorOffset.Text = String.Format("{0:0.##}", panX) + ", " + String.Format("{0:0.##}", panY);
|
||||
} else {
|
||||
}
|
||||
else
|
||||
{
|
||||
floorOffset.Text = "--, --";
|
||||
floorOffset.Enabled = false;
|
||||
floorOffsetLabel.Enabled = false;
|
||||
|
@ -175,12 +203,15 @@ namespace CodeImp.DoomBuilder.Controls
|
|||
float scaleX = s.Fields.GetValue("xscaleceiling", 1.0f);//1.0f;
|
||||
float scaleY = s.Fields.GetValue("yscaleceiling", 1.0f);
|
||||
|
||||
if(scaleX != 1.0f || scaleY != 1.0f) {
|
||||
if(scaleX != 1.0f || scaleY != 1.0f)
|
||||
{
|
||||
showExtededCeilingInfo = true;
|
||||
ceilingScale.Enabled = true;
|
||||
ceilingScaleLabel.Enabled = true;
|
||||
ceilingScale.Text = String.Format("{0:0.##}", scaleX) + ", " + String.Format("{0:0.##}", scaleY);
|
||||
} else {
|
||||
}
|
||||
else
|
||||
{
|
||||
ceilingScale.Text = "--, --";
|
||||
ceilingScale.Enabled = false;
|
||||
ceilingScaleLabel.Enabled = false;
|
||||
|
@ -190,35 +221,44 @@ namespace CodeImp.DoomBuilder.Controls
|
|||
scaleX = s.Fields.GetValue("xscalefloor", 1.0f);
|
||||
scaleY = s.Fields.GetValue("yscalefloor", 1.0f);
|
||||
|
||||
if(scaleX != 1.0f || scaleY != 1.0f) {
|
||||
if(scaleX != 1.0f || scaleY != 1.0f)
|
||||
{
|
||||
showExtededFloorInfo = true;
|
||||
floorScale.Enabled = true;
|
||||
floorScaleLabel.Enabled = true;
|
||||
floorScale.Text = String.Format("{0:0.##}", scaleX) + ", " + String.Format("{0:0.##}", scaleY);
|
||||
} else {
|
||||
}
|
||||
else
|
||||
{
|
||||
floorScale.Text = "--, --";
|
||||
floorScale.Enabled = false;
|
||||
floorScaleLabel.Enabled = false;
|
||||
}
|
||||
|
||||
//rotation
|
||||
if(s.Fields.ContainsKey("rotationceiling")) {
|
||||
if(s.Fields.ContainsKey("rotationceiling"))
|
||||
{
|
||||
showExtededCeilingInfo = true;
|
||||
ceilingAngle.Enabled = true;
|
||||
ceilingAngleLabel.Enabled = true;
|
||||
ceilingAngle.Text = s.Fields["rotationceiling"].Value + "\u00B0";
|
||||
} else {
|
||||
}
|
||||
else
|
||||
{
|
||||
ceilingAngle.Text = "-";
|
||||
ceilingAngle.Enabled = false;
|
||||
ceilingAngleLabel.Enabled = false;
|
||||
}
|
||||
|
||||
if(s.Fields.ContainsKey("rotationfloor")) {
|
||||
if(s.Fields.ContainsKey("rotationfloor"))
|
||||
{
|
||||
showExtededFloorInfo = true;
|
||||
floorAngle.Enabled = true;
|
||||
floorAngleLabel.Enabled = true;
|
||||
floorAngle.Text = s.Fields["rotationfloor"].Value + "\u00B0";
|
||||
} else {
|
||||
}
|
||||
else
|
||||
{
|
||||
floorAngle.Text = "-";
|
||||
floorAngle.Enabled = false;
|
||||
floorAngleLabel.Enabled = false;
|
||||
|
@ -227,8 +267,10 @@ namespace CodeImp.DoomBuilder.Controls
|
|||
|
||||
//Flags
|
||||
flags.Items.Clear();
|
||||
foreach(KeyValuePair<string, bool> group in s.Flags) {
|
||||
if(group.Value) {
|
||||
foreach(KeyValuePair<string, bool> group in s.Flags)
|
||||
{
|
||||
if(group.Value)
|
||||
{
|
||||
ListViewItem item = new ListViewItem(General.Map.Config.SectorFlags.ContainsKey(group.Key) ? General.Map.Config.SectorFlags[group.Key] : group.Key);
|
||||
item.Checked = true;
|
||||
flags.Items.Add(item);
|
||||
|
@ -237,14 +279,17 @@ namespace CodeImp.DoomBuilder.Controls
|
|||
|
||||
//mxd. Flags panel visibility and size
|
||||
flagsPanel.Visible = (flags.Items.Count > 0);
|
||||
if(flags.Items.Count > 0) {
|
||||
if(flags.Items.Count > 0)
|
||||
{
|
||||
int itemWidth = flags.Items[0].GetBounds(ItemBoundsPortion.Entire).Width;
|
||||
if(itemWidth == 0) itemWidth = 96;
|
||||
flags.Width = itemWidth * (int)Math.Ceiling(flags.Items.Count / 5.0f);
|
||||
flagsPanel.Width = flags.Width + flags.Left * 2;
|
||||
}
|
||||
|
||||
} else {
|
||||
}
|
||||
else
|
||||
{
|
||||
panelFadeColor.Visible = false;
|
||||
panelLightColor.Visible = false;
|
||||
labelFade.Visible = false;
|
||||
|
@ -253,18 +298,24 @@ namespace CodeImp.DoomBuilder.Controls
|
|||
}
|
||||
|
||||
//panels size
|
||||
if(showExtededCeilingInfo) {
|
||||
if(showExtededCeilingInfo)
|
||||
{
|
||||
ceilingpanel.Width = fullWidth;
|
||||
ceilingInfo.Visible = true;
|
||||
} else {
|
||||
}
|
||||
else
|
||||
{
|
||||
ceilingInfo.Visible = false;
|
||||
ceilingpanel.Width = 84;
|
||||
}
|
||||
|
||||
if(showExtededFloorInfo) {
|
||||
if(showExtededFloorInfo)
|
||||
{
|
||||
floorpanel.Width = fullWidth;
|
||||
floorInfo.Visible = true;
|
||||
} else {
|
||||
}
|
||||
else
|
||||
{
|
||||
floorInfo.Visible = false;
|
||||
floorpanel.Width = 84;
|
||||
}
|
||||
|
@ -275,11 +326,16 @@ namespace CodeImp.DoomBuilder.Controls
|
|||
this.Update();
|
||||
}
|
||||
|
||||
protected void DisplayTextureSize(Label label, ImageData texture) {
|
||||
if(General.Settings.ShowTextureSizes && texture.ImageState == ImageLoadState.Ready && !string.IsNullOrEmpty(texture.Name) && !(texture is UnknownImage)) {
|
||||
private void DisplayTextureSize(Label label, ImageData texture)
|
||||
{
|
||||
if(General.Settings.ShowTextureSizes && texture.ImageState == ImageLoadState.Ready
|
||||
&& !string.IsNullOrEmpty(texture.Name) && !(texture is UnknownImage))
|
||||
{
|
||||
label.Visible = true;
|
||||
label.Text = texture.ScaledWidth + "x" + texture.ScaledHeight;
|
||||
} else {
|
||||
}
|
||||
else
|
||||
{
|
||||
label.Visible = false;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -50,7 +50,8 @@ namespace CodeImp.DoomBuilder.Controls
|
|||
timer.Stop(); //mxd
|
||||
|
||||
// Check if name is a "none" texture
|
||||
if(string.IsNullOrEmpty(imagename)) {
|
||||
if(string.IsNullOrEmpty(imagename))
|
||||
{
|
||||
DisplayImageSize(0, 0); //mxd
|
||||
|
||||
//mxd. Determine image to show
|
||||
|
@ -70,15 +71,16 @@ namespace CodeImp.DoomBuilder.Controls
|
|||
|
||||
if(string.IsNullOrEmpty(texture.FullName) || texture is UnknownImage) DisplayImageSize(0, 0); //mxd
|
||||
else DisplayImageSize(texture.ScaledWidth, texture.ScaledHeight); //mxd
|
||||
if(!texture.IsPreviewLoaded) timer.Start(); //mxd
|
||||
if(usepreviews ? !texture.IsPreviewLoaded : !texture.IsImageLoaded) timer.Start(); //mxd
|
||||
|
||||
// Set the image
|
||||
return texture.GetPreview();
|
||||
return (usepreviews ? texture.GetPreview() : texture.GetBitmap());
|
||||
}
|
||||
}
|
||||
|
||||
// This browses for a texture
|
||||
protected override string BrowseImage(string imagename) {
|
||||
protected override string BrowseImage(string imagename)
|
||||
{
|
||||
// Browse for texture
|
||||
string result = TextureBrowserForm.Browse(this.ParentForm, imagename, false);
|
||||
return result ?? imagename;
|
||||
|
|
|
@ -45,29 +45,24 @@ namespace CodeImp.DoomBuilder.Data
|
|||
// This loads the image
|
||||
protected override void LocalLoadImage()
|
||||
{
|
||||
Stream lumpdata;
|
||||
MemoryStream mem;
|
||||
IImageReader reader;
|
||||
byte[] membytes;
|
||||
|
||||
// Leave when already loaded
|
||||
if(this.IsImageLoaded) return;
|
||||
|
||||
lock(this)
|
||||
{
|
||||
// Get the lump data stream
|
||||
lumpdata = General.Map.Data.GetColormapData(Name);
|
||||
Stream lumpdata = General.Map.Data.GetColormapData(Name);
|
||||
if(lumpdata != null)
|
||||
{
|
||||
// Copy lump data to memory
|
||||
lumpdata.Seek(0, SeekOrigin.Begin);
|
||||
membytes = new byte[(int)lumpdata.Length];
|
||||
byte[] membytes = new byte[(int)lumpdata.Length];
|
||||
lumpdata.Read(membytes, 0, (int)lumpdata.Length);
|
||||
mem = new MemoryStream(membytes);
|
||||
MemoryStream mem = new MemoryStream(membytes);
|
||||
mem.Seek(0, SeekOrigin.Begin);
|
||||
|
||||
// Get a reader for the data
|
||||
reader = ImageDataFormat.GetImageReader(mem, ImageDataFormat.DOOMCOLORMAP, General.Map.Data.Palette);
|
||||
IImageReader reader = ImageDataFormat.GetImageReader(mem, ImageDataFormat.DOOMCOLORMAP, General.Map.Data.Palette);
|
||||
if(reader is UnknownImageReader)
|
||||
{
|
||||
// Data is in an unknown format!
|
||||
|
|
|
@ -39,6 +39,7 @@ namespace CodeImp.DoomBuilder.Data
|
|||
#region ================== Constants
|
||||
|
||||
public const string INTERNAL_PREFIX = "internal:";
|
||||
public const int CLASIC_IMAGE_NAME_LENGTH = 8; //mxd
|
||||
|
||||
#endregion
|
||||
|
||||
|
@ -53,8 +54,10 @@ namespace CodeImp.DoomBuilder.Data
|
|||
|
||||
// Textures, Flats and Sprites
|
||||
private Dictionary<long, ImageData> textures;
|
||||
private Dictionary<long, long> texturenamesshorttofull; //mxd
|
||||
private List<string> texturenames;
|
||||
private Dictionary<long, ImageData> flats;
|
||||
private Dictionary<long, long> flatnamesshorttofull; //mxd
|
||||
private List<string> flatnames;
|
||||
private Dictionary<long, ImageData> sprites;
|
||||
private List<MatchingTextureSet> texturesets;
|
||||
|
@ -237,6 +240,8 @@ namespace CodeImp.DoomBuilder.Data
|
|||
sprites = new Dictionary<long, ImageData>();
|
||||
texturenames = new List<string>();
|
||||
flatnames = new List<string>();
|
||||
texturenamesshorttofull = new Dictionary<long, long>(); //mxd
|
||||
flatnamesshorttofull = new Dictionary<long, long>(); //mxd
|
||||
imageque = new Queue<ImageData>();
|
||||
previews = new PreviewManager();
|
||||
texturesets = new List<MatchingTextureSet>();
|
||||
|
@ -320,7 +325,6 @@ namespace CodeImp.DoomBuilder.Data
|
|||
Dictionary<string, int> actorsByClass = createActorsByClassList();
|
||||
loadModeldefs(actorsByClass);
|
||||
loadGldefs(actorsByClass);
|
||||
actorsByClass = null; //don't need them any more
|
||||
foreach (Thing t in General.Map.Map.Things) t.UpdateCache();
|
||||
General.MainWindow.DisplayReady();
|
||||
|
||||
|
@ -386,6 +390,10 @@ namespace CodeImp.DoomBuilder.Data
|
|||
// Sort things
|
||||
foreach(ThingCategory tc in thingcategories) tc.SortIfNeeded();
|
||||
|
||||
//mxd. Create texture name translation lists
|
||||
texturenamesshorttofull = CreateShortTextureNamesCollection(textures);
|
||||
flatnamesshorttofull = CreateShortTextureNamesCollection(flats);
|
||||
|
||||
// Update the used textures
|
||||
General.Map.Data.UpdateUsedTextures();
|
||||
|
||||
|
@ -417,6 +425,33 @@ namespace CodeImp.DoomBuilder.Data
|
|||
// Output info
|
||||
General.WriteLogLine("Loaded " + texcount + " textures, " + flatcount + " flats, " + colormapcount + " colormaps, " + spritecount + " sprites, " + thingcount + " decorate things, " + modeldefEntries.Count + " model deinitions, " + gldefsEntries.Count + " dynamic light definitions");
|
||||
}
|
||||
|
||||
//mxd
|
||||
private Dictionary<long, long> CreateShortTextureNamesCollection(Dictionary<long, ImageData> images)
|
||||
{
|
||||
Dictionary<long, long> names = new Dictionary<long, long>();
|
||||
|
||||
foreach(KeyValuePair<long, ImageData> pair in images)
|
||||
{
|
||||
if(pair.Value.FullName.Length > CLASIC_IMAGE_NAME_LENGTH)
|
||||
{
|
||||
string shortname = pair.Value.DisplayName.ToUpperInvariant();
|
||||
if(shortname.Length > CLASIC_IMAGE_NAME_LENGTH) shortname = shortname.Substring(0, CLASIC_IMAGE_NAME_LENGTH);
|
||||
long hash = MurmurHash2.Hash(shortname);
|
||||
|
||||
if(names.ContainsKey(hash))
|
||||
{
|
||||
names[hash] = pair.Value.LongName;
|
||||
}
|
||||
else
|
||||
{
|
||||
names.Add(hash, pair.Value.LongName);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return names;
|
||||
}
|
||||
|
||||
// This unloads all data
|
||||
internal void Unload()
|
||||
|
@ -854,7 +889,7 @@ namespace CodeImp.DoomBuilder.Data
|
|||
}
|
||||
|
||||
// This returns a specific patch stream
|
||||
internal Stream GetPatchData(string pname)
|
||||
internal Stream GetPatchData(string pname, bool longname)
|
||||
{
|
||||
Stream patch;
|
||||
|
||||
|
@ -862,7 +897,7 @@ namespace CodeImp.DoomBuilder.Data
|
|||
for(int i = containers.Count - 1; i > -1; i--)
|
||||
{
|
||||
// This contain provides this patch?
|
||||
patch = containers[i].GetPatchData(pname);
|
||||
patch = containers[i].GetPatchData(pname, longname);
|
||||
if(patch != null) return patch;
|
||||
}
|
||||
|
||||
|
@ -870,21 +905,8 @@ namespace CodeImp.DoomBuilder.Data
|
|||
return null;
|
||||
}
|
||||
|
||||
//mxd
|
||||
internal string GetPatchLocation(string pname) {
|
||||
string fullName = pname;
|
||||
// Go for all opened containers
|
||||
for (int i = containers.Count - 1; i >= 0; i--) {
|
||||
// This contain provides this patch?
|
||||
fullName = containers[i].GetPatchLocation(pname);
|
||||
if (fullName != pname) return fullName;
|
||||
}
|
||||
|
||||
return pname;
|
||||
}
|
||||
|
||||
// This returns a specific texture stream
|
||||
internal Stream GetTextureData(string pname)
|
||||
internal Stream GetTextureData(string pname, bool longname)
|
||||
{
|
||||
Stream patch;
|
||||
|
||||
|
@ -892,7 +914,7 @@ namespace CodeImp.DoomBuilder.Data
|
|||
for(int i = containers.Count - 1; i >= 0; i--)
|
||||
{
|
||||
// This contain provides this patch?
|
||||
patch = containers[i].GetTextureData(pname);
|
||||
patch = containers[i].GetTextureData(pname, longname);
|
||||
if(patch != null) return patch;
|
||||
}
|
||||
|
||||
|
@ -934,6 +956,17 @@ namespace CodeImp.DoomBuilder.Data
|
|||
// Return null image
|
||||
return unknownimage; //mxd
|
||||
}
|
||||
|
||||
//mxd
|
||||
public string GetFullTextureName(string name)
|
||||
{
|
||||
if (Path.GetFileNameWithoutExtension(name) == name && name.Length > CLASIC_IMAGE_NAME_LENGTH)
|
||||
name = name.Substring(0, CLASIC_IMAGE_NAME_LENGTH);
|
||||
long hash = MurmurHash2.Hash(name.Trim().ToUpperInvariant());
|
||||
if(textures.ContainsKey(hash)) return textures[hash].Name;
|
||||
if(texturenamesshorttofull.ContainsKey(hash)) return textures[texturenamesshorttofull[hash]].Name;
|
||||
return name;
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
|
@ -962,7 +995,6 @@ namespace CodeImp.DoomBuilder.Data
|
|||
|
||||
// Add to preview manager
|
||||
previews.AddImage(img);
|
||||
img.IsFlat = true; //mxd
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -972,7 +1004,7 @@ namespace CodeImp.DoomBuilder.Data
|
|||
}
|
||||
|
||||
// This returns a specific flat stream
|
||||
internal Stream GetFlatData(string pname)
|
||||
internal Stream GetFlatData(string pname, bool longname)
|
||||
{
|
||||
Stream flat;
|
||||
|
||||
|
@ -980,7 +1012,7 @@ namespace CodeImp.DoomBuilder.Data
|
|||
for(int i = containers.Count - 1; i >= 0; i--)
|
||||
{
|
||||
// This contain provides this flat?
|
||||
flat = containers[i].GetFlatData(pname);
|
||||
flat = containers[i].GetFlatData(pname, longname);
|
||||
if(flat != null) return flat;
|
||||
}
|
||||
|
||||
|
@ -1025,6 +1057,17 @@ namespace CodeImp.DoomBuilder.Data
|
|||
// Return flat
|
||||
return flats[longname];
|
||||
}
|
||||
|
||||
//mxd. Gets full flat name by short flat name
|
||||
public string GetFullFlatName(string name)
|
||||
{
|
||||
if(Path.GetFileNameWithoutExtension(name) == name && name.Length > CLASIC_IMAGE_NAME_LENGTH)
|
||||
name = name.Substring(0, CLASIC_IMAGE_NAME_LENGTH);
|
||||
long hash = MurmurHash2.Hash(name.ToUpperInvariant());
|
||||
if(flats.ContainsKey(hash)) return flats[hash].Name;
|
||||
if(flatnamesshorttofull.ContainsKey(hash)) return flats[flatnamesshorttofull[hash]].Name;
|
||||
return name;
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
|
@ -1064,7 +1107,7 @@ namespace CodeImp.DoomBuilder.Data
|
|||
foreach(ThingTypeInfo ti in General.Map.Data.ThingTypes)
|
||||
{
|
||||
// Valid sprite name?
|
||||
if(ti.Sprite.Length == 0 || ti.Sprite.Length > 8) continue; //mxd
|
||||
if(ti.Sprite.Length == 0 || ti.Sprite.Length > CLASIC_IMAGE_NAME_LENGTH) continue; //mxd
|
||||
|
||||
ImageData image = null;
|
||||
|
||||
|
@ -1145,7 +1188,7 @@ namespace CodeImp.DoomBuilder.Data
|
|||
string[] files = Directory.GetFiles(General.SpritesPath, "*.png", SearchOption.TopDirectoryOnly);
|
||||
foreach(string spritefile in files)
|
||||
{
|
||||
ImageData img = new FileImage(Path.GetFileNameWithoutExtension(spritefile).ToLowerInvariant(), spritefile, false);
|
||||
ImageData img = new FileImage(Path.GetFileNameWithoutExtension(spritefile).ToLowerInvariant(), spritefile);
|
||||
img.LoadImage();
|
||||
img.AllowUnload = false;
|
||||
internalsprites.Add(img.Name, img);
|
||||
|
@ -1542,7 +1585,7 @@ namespace CodeImp.DoomBuilder.Data
|
|||
// Valid sprite name?
|
||||
string sprite;
|
||||
|
||||
if(ti.Sprite.Length == 0 || ti.Sprite.Length > 8) {
|
||||
if(ti.Sprite.Length == 0 || ti.Sprite.Length > CLASIC_IMAGE_NAME_LENGTH) {
|
||||
if(ti.Actor == null) continue;
|
||||
sprite = ti.Actor.FindSuitableVoxel(voxelNames);
|
||||
} else {
|
||||
|
@ -1721,12 +1764,6 @@ namespace CodeImp.DoomBuilder.Data
|
|||
updatedusedtextures = true;
|
||||
}
|
||||
}
|
||||
|
||||
// This returns the long name for a string
|
||||
public long GetLongImageName(string name)
|
||||
{
|
||||
return Lump.MakeLongName(name);
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
|
|
|
@ -117,13 +117,10 @@ namespace CodeImp.DoomBuilder.Data
|
|||
public virtual PatchNames LoadPatchNames() { return null; }
|
||||
|
||||
// When implemented, this returns the patch lump
|
||||
public virtual Stream GetPatchData(string pname) { return null; }
|
||||
|
||||
//mxd. When implemented, this returns a path to patch (like /patches/walls/WALL001.png)
|
||||
public virtual string GetPatchLocation(string pname) { return pname; }
|
||||
public virtual Stream GetPatchData(string pname, bool longname) { return null; }
|
||||
|
||||
// When implemented, this returns the texture lump
|
||||
public virtual Stream GetTextureData(string pname) { return null; }
|
||||
public virtual Stream GetTextureData(string pname, bool longname) { return null; }
|
||||
|
||||
// When implemented, this loads the textures
|
||||
public virtual ICollection<ImageData> LoadTextures(PatchNames pnames) { return null; }
|
||||
|
@ -136,7 +133,7 @@ namespace CodeImp.DoomBuilder.Data
|
|||
public virtual ICollection<ImageData> LoadFlats() { return null; }
|
||||
|
||||
// When implemented, this returns the flat lump
|
||||
public virtual Stream GetFlatData(string pname) { return null; }
|
||||
public virtual Stream GetFlatData(string pname, bool longname) { return null; }
|
||||
|
||||
#endregion
|
||||
|
||||
|
@ -179,7 +176,6 @@ namespace CodeImp.DoomBuilder.Data
|
|||
|
||||
//mxd
|
||||
internal virtual MemoryStream LoadFile(string name) { return null; }
|
||||
//mxd
|
||||
internal virtual bool FileExists(string filename) { return false; }
|
||||
|
||||
#endregion
|
||||
|
|
|
@ -65,22 +65,31 @@ namespace CodeImp.DoomBuilder.Data
|
|||
#region ================== Textures
|
||||
|
||||
// This finds and returns a patch stream
|
||||
public override Stream GetPatchData(string pname)
|
||||
public override Stream GetPatchData(string pname, bool longname)
|
||||
{
|
||||
// Error when suspended
|
||||
if(issuspended) throw new Exception("Data reader is suspended");
|
||||
|
||||
// Find in any of the wad files
|
||||
// Note the backward order, because the last wad's images have priority
|
||||
for(int i = wads.Count - 1; i > -1; i--)
|
||||
if(!longname) //mxd. Patches with long names can't be in wads
|
||||
{
|
||||
Stream data = wads[i].GetPatchData(pname);
|
||||
if(data != null) return data;
|
||||
for (int i = wads.Count - 1; i > -1; i--)
|
||||
{
|
||||
Stream data = wads[i].GetPatchData(pname, false);
|
||||
if (data != null) return data;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
try
|
||||
{
|
||||
if (General.Map.Config.MixTexturesFlats)
|
||||
if(longname)
|
||||
{
|
||||
//mxd. Long names are absolute
|
||||
pname = pname.Replace(Path.AltDirectorySeparatorChar, Path.DirectorySeparatorChar);
|
||||
return (FileExists(pname) ? LoadFile(pname) : null);
|
||||
}
|
||||
else if (General.Map.Config.MixTexturesFlats)
|
||||
{
|
||||
//mxd. Find in directories ZDoom expects them to be
|
||||
string dir = Path.GetDirectoryName(pname);
|
||||
|
@ -112,21 +121,31 @@ namespace CodeImp.DoomBuilder.Data
|
|||
}
|
||||
|
||||
// This finds and returns a textue stream
|
||||
public override Stream GetTextureData(string pname)
|
||||
public override Stream GetTextureData(string pname, bool longname)
|
||||
{
|
||||
// Error when suspended
|
||||
if(issuspended) throw new Exception("Data reader is suspended");
|
||||
|
||||
// Find in any of the wad files
|
||||
// Note the backward order, because the last wad's images have priority
|
||||
for(int i = wads.Count - 1; i >= 0; i--)
|
||||
if (!longname) //mxd. Textures with long names can't be in wads
|
||||
{
|
||||
Stream data = wads[i].GetTextureData(pname);
|
||||
if(data != null) return data;
|
||||
for (int i = wads.Count - 1; i >= 0; i--)
|
||||
{
|
||||
Stream data = wads[i].GetTextureData(pname, false);
|
||||
if (data != null) return data;
|
||||
}
|
||||
}
|
||||
|
||||
try
|
||||
{
|
||||
//mxd. Long names are absolute
|
||||
if(General.Map.Options.UseLongTextureNames && !string.IsNullOrEmpty(Path.GetExtension(pname)))
|
||||
{
|
||||
pname = pname.Replace(Path.AltDirectorySeparatorChar, Path.DirectorySeparatorChar);
|
||||
return (FileExists(pname) ? LoadFile(pname) : null);
|
||||
}
|
||||
|
||||
// Find in textures directory
|
||||
string path = Path.Combine(TEXTURES_DIR, Path.GetDirectoryName(pname));
|
||||
string filename = FindFirstFile(path, Path.GetFileName(pname), true);
|
||||
|
@ -283,18 +302,18 @@ namespace CodeImp.DoomBuilder.Data
|
|||
}
|
||||
|
||||
// This creates an image
|
||||
protected override ImageData CreateImage(string name, string filename, int imagetype)
|
||||
protected override ImageData CreateImage(string filename, int imagetype)
|
||||
{
|
||||
switch(imagetype)
|
||||
{
|
||||
case ImageDataFormat.DOOMFLAT:
|
||||
return new FileImage(name, Path.Combine(location.location, filename), true);
|
||||
return new FileImage(filename, Path.Combine(location.location, filename), true);
|
||||
|
||||
case ImageDataFormat.DOOMPICTURE:
|
||||
return new FileImage(name, Path.Combine(location.location, filename), false);
|
||||
return new FileImage(filename, Path.Combine(location.location, filename), false);
|
||||
|
||||
case ImageDataFormat.DOOMCOLORMAP:
|
||||
return new ColormapImage(name);
|
||||
return new ColormapImage(Path.GetFileNameWithoutExtension(filename));
|
||||
|
||||
default:
|
||||
throw new ArgumentException("Invalid image format specified!");
|
||||
|
@ -320,7 +339,8 @@ namespace CodeImp.DoomBuilder.Data
|
|||
}
|
||||
|
||||
//mxd. This returns all files in a given directory which title starts with given title
|
||||
protected override string[] GetAllFilesWhichTitleStartsWith(string path, string title) {
|
||||
protected override string[] GetAllFilesWhichTitleStartsWith(string path, string title)
|
||||
{
|
||||
return files.GetAllFilesWhichTitleStartsWith(path, title).ToArray();
|
||||
}
|
||||
|
||||
|
@ -357,9 +377,12 @@ namespace CodeImp.DoomBuilder.Data
|
|||
{
|
||||
MemoryStream s = null;
|
||||
|
||||
try {
|
||||
try
|
||||
{
|
||||
s = new MemoryStream(File.ReadAllBytes(Path.Combine(location.location, filename)));
|
||||
} catch(Exception e) {
|
||||
}
|
||||
catch(Exception e)
|
||||
{
|
||||
General.ErrorLogger.Add(ErrorType.Error, "Unable to load file: "+e.Message);
|
||||
}
|
||||
return s;
|
||||
|
|
|
@ -27,9 +27,6 @@ namespace CodeImp.DoomBuilder.Data
|
|||
{
|
||||
#region ================== Variables
|
||||
|
||||
// Image source
|
||||
//private Bitmap img;
|
||||
|
||||
#endregion
|
||||
|
||||
#region ================== Constructor / Disposer
|
||||
|
|
|
@ -28,7 +28,7 @@ namespace CodeImp.DoomBuilder.Data
|
|||
{
|
||||
#region ================== Variables
|
||||
|
||||
private int probableformat;
|
||||
private readonly int probableformat;
|
||||
|
||||
#endregion
|
||||
|
||||
|
@ -38,8 +38,8 @@ namespace CodeImp.DoomBuilder.Data
|
|||
public FileImage(string name, string filepathname, bool asflat)
|
||||
{
|
||||
// Initialize
|
||||
SetName(name);
|
||||
this.fullName = filepathname; //mxd
|
||||
this.isFlat = asflat; //mxd
|
||||
SetName(name, filepathname);
|
||||
|
||||
if(asflat)
|
||||
{
|
||||
|
@ -62,15 +62,24 @@ namespace CodeImp.DoomBuilder.Data
|
|||
public FileImage(string name, string filepathname, bool asflat, float scalex, float scaley)
|
||||
{
|
||||
// Initialize
|
||||
this.fullName = filepathname; //mxd
|
||||
this.scale.x = scalex;
|
||||
this.scale.y = scaley;
|
||||
SetName(name);
|
||||
this.isFlat = asflat; //mxd
|
||||
SetName(name, filepathname);
|
||||
|
||||
if(asflat)
|
||||
probableformat = ImageDataFormat.DOOMFLAT;
|
||||
else
|
||||
probableformat = ImageDataFormat.DOOMPICTURE;
|
||||
probableformat = (asflat ? ImageDataFormat.DOOMFLAT : ImageDataFormat.DOOMPICTURE);
|
||||
|
||||
// We have no destructor
|
||||
GC.SuppressFinalize(this);
|
||||
}
|
||||
|
||||
//mxd. Constructor for loading internal images
|
||||
internal FileImage(string name, string filepathname)
|
||||
{
|
||||
// Initialize
|
||||
SetName(name, filepathname, true);
|
||||
|
||||
probableformat = ImageDataFormat.DOOMPICTURE;
|
||||
|
||||
// We have no destructor
|
||||
GC.SuppressFinalize(this);
|
||||
|
@ -80,6 +89,43 @@ namespace CodeImp.DoomBuilder.Data
|
|||
|
||||
#region ================== Methods
|
||||
|
||||
//mxd: name is relative path to the image ("\Textures\sometexture.png")
|
||||
//mxd: filepathname is absolute path to the image ("D:\Doom\MyCoolProject\Textures\sometexture.png")
|
||||
//mxd: also, zdoom uses '/' as directory separator char.
|
||||
private void SetName(string name, string filepathname)
|
||||
{
|
||||
SetName(name, filepathname, General.Map.Options.UseLongTextureNames);
|
||||
}
|
||||
|
||||
private void SetName(string name, string filepathname, bool uselongtexturenames)
|
||||
{
|
||||
name = name.Replace(Path.DirectorySeparatorChar, Path.AltDirectorySeparatorChar);
|
||||
|
||||
if(!uselongtexturenames)
|
||||
{
|
||||
this.name = Path.GetFileNameWithoutExtension(name.ToUpperInvariant());
|
||||
if(this.name.Length > DataManager.CLASIC_IMAGE_NAME_LENGTH)
|
||||
this.name = this.name.Substring(0, DataManager.CLASIC_IMAGE_NAME_LENGTH);
|
||||
this.virtualname = Path.Combine(Path.GetDirectoryName(name), this.name).Replace(Path.DirectorySeparatorChar, Path.AltDirectorySeparatorChar);
|
||||
this.displayname = this.name;
|
||||
this.longname = Lump.MakeLongName(this.name); //mxd
|
||||
}
|
||||
else
|
||||
{
|
||||
this.name = name;
|
||||
this.virtualname = name;
|
||||
this.displayname = Path.GetFileNameWithoutExtension(name);
|
||||
this.longname = Lump.MakeLongName(name);
|
||||
hasLongName = true;
|
||||
}
|
||||
|
||||
this.fullname = filepathname;
|
||||
if(General.Settings.CapitalizeTextureNames && !string.IsNullOrEmpty(this.displayname))
|
||||
{
|
||||
this.displayname = this.displayname.ToUpperInvariant();
|
||||
}
|
||||
}
|
||||
|
||||
// This loads the image
|
||||
protected override void LocalLoadImage()
|
||||
{
|
||||
|
@ -91,24 +137,30 @@ namespace CodeImp.DoomBuilder.Data
|
|||
// Load file data
|
||||
if(bitmap != null) bitmap.Dispose(); bitmap = null;
|
||||
|
||||
MemoryStream filedata = new MemoryStream(File.ReadAllBytes(fullName));
|
||||
MemoryStream filedata = new MemoryStream(File.ReadAllBytes(fullname));
|
||||
|
||||
// Get a reader for the data
|
||||
IImageReader reader = ImageDataFormat.GetImageReader(filedata, probableformat, General.Map.Data.Palette);
|
||||
if(!(reader is UnknownImageReader)) {
|
||||
if(!(reader is UnknownImageReader))
|
||||
{
|
||||
// Load the image
|
||||
filedata.Seek(0, SeekOrigin.Begin);
|
||||
try { bitmap = reader.ReadAsBitmap(filedata); } catch(InvalidDataException) {
|
||||
try { bitmap = reader.ReadAsBitmap(filedata); }
|
||||
catch(InvalidDataException)
|
||||
{
|
||||
// Data cannot be read!
|
||||
bitmap = null;
|
||||
}
|
||||
}
|
||||
|
||||
// Not loaded?
|
||||
if(bitmap == null) {
|
||||
General.ErrorLogger.Add(ErrorType.Error, "Image file '" + fullName + "' data format could not be read, while loading image '" + this.Name + "'. Is this a valid picture file at all?");
|
||||
if(bitmap == null)
|
||||
{
|
||||
General.ErrorLogger.Add(ErrorType.Error, "Image file '" + fullname + "' data format could not be read, while loading image '" + this.Name + "'. Is this a valid picture file at all?");
|
||||
loadfailed = true;
|
||||
} else {
|
||||
}
|
||||
else
|
||||
{
|
||||
// Get width and height
|
||||
width = bitmap.Size.Width;
|
||||
height = bitmap.Size.Height;
|
||||
|
|
|
@ -33,6 +33,7 @@ namespace CodeImp.DoomBuilder.Data
|
|||
{
|
||||
// Initialize
|
||||
SetName(name);
|
||||
isFlat = true; //mxd
|
||||
|
||||
// We have no destructor
|
||||
GC.SuppressFinalize(this);
|
||||
|
@ -51,7 +52,7 @@ namespace CodeImp.DoomBuilder.Data
|
|||
lock(this)
|
||||
{
|
||||
// Get the lump data stream
|
||||
Stream lumpdata = General.Map.Data.GetFlatData(Name);
|
||||
Stream lumpdata = General.Map.Data.GetFlatData(Name, hasLongName);
|
||||
if(lumpdata != null)
|
||||
{
|
||||
// Copy lump data to memory
|
||||
|
|
|
@ -32,15 +32,14 @@ namespace CodeImp.DoomBuilder.Data
|
|||
{
|
||||
#region ================== Variables
|
||||
|
||||
private List<TexturePatch> patches; //mxd
|
||||
private string type;
|
||||
private readonly List<TexturePatch> patches; //mxd
|
||||
|
||||
#endregion
|
||||
|
||||
#region ================== Constructor / Disposer
|
||||
|
||||
// Constructor
|
||||
public HighResImage(string name, string type, int width, int height, float scalex, float scaley, bool worldpanning)
|
||||
public HighResImage(string name, int width, int height, float scalex, float scaley, bool worldpanning, bool isflat)
|
||||
{
|
||||
// Initialize
|
||||
this.width = width;
|
||||
|
@ -49,9 +48,18 @@ namespace CodeImp.DoomBuilder.Data
|
|||
this.scale.y = scaley;
|
||||
this.worldpanning = worldpanning;
|
||||
this.patches = new List<TexturePatch>(1);
|
||||
this.type = type;
|
||||
|
||||
//mxd
|
||||
if (!General.Map.Options.UseLongTextureNames)
|
||||
{
|
||||
if(name.Length > DataManager.CLASIC_IMAGE_NAME_LENGTH)
|
||||
name = name.Substring(0, DataManager.CLASIC_IMAGE_NAME_LENGTH);
|
||||
name = name.ToUpperInvariant();
|
||||
}
|
||||
|
||||
SetName(name);
|
||||
this.fullName = "[TEXTURES]\\" + type + "s\\" + name; //mxd
|
||||
this.virtualname = "[TEXTURES]/" + this.name; //mxd
|
||||
this.isFlat = isflat; //mxd
|
||||
|
||||
// We have no destructor
|
||||
GC.SuppressFinalize(this);
|
||||
|
@ -109,7 +117,7 @@ namespace CodeImp.DoomBuilder.Data
|
|||
foreach(TexturePatch p in patches)
|
||||
{
|
||||
// Get the patch data stream
|
||||
Stream patchdata = General.Map.Data.GetPatchData(p.lumpname);
|
||||
Stream patchdata = General.Map.Data.GetPatchData(p.lumpname, p.haslongname);
|
||||
|
||||
if(patchdata != null)
|
||||
{
|
||||
|
|
|
@ -42,15 +42,18 @@ namespace CodeImp.DoomBuilder.Data
|
|||
#region ================== Variables
|
||||
|
||||
// Properties
|
||||
private string name;
|
||||
private long longname;
|
||||
protected string name;
|
||||
protected long longname;
|
||||
protected int width;
|
||||
protected int height;
|
||||
protected Vector2D scale;
|
||||
protected bool worldpanning;
|
||||
protected bool usecolorcorrection;
|
||||
protected string fullName; //mxd. name with path;
|
||||
private bool usecolorcorrection;
|
||||
protected string fullname; //mxd. name with path;
|
||||
protected string virtualname; //mxd
|
||||
protected string displayname; //mxd
|
||||
protected bool isFlat; //mxd. if false, it's a texture
|
||||
protected bool hasLongName; //mxd. Texture name is longer than DataManager.CLASIC_IMAGE_NAME_LENGTH
|
||||
protected bool hasPatchWithSameName; //mxd
|
||||
|
||||
// Loading
|
||||
|
@ -81,8 +84,10 @@ namespace CodeImp.DoomBuilder.Data
|
|||
|
||||
public string Name { get { return name; } }
|
||||
public long LongName { get { return longname; } }
|
||||
public string FullName { get { return fullName; } } //mxd
|
||||
public bool IsFlat { get { return isFlat; } internal set { isFlat = value; } } //mxd
|
||||
public string FullName { get { return fullname; } } //mxd
|
||||
public string VirtualName { get { return virtualname; } } //mxd
|
||||
public string DisplayName { get { return displayname; } } //mxd
|
||||
public bool IsFlat { get { return isFlat; } } //mxd
|
||||
public bool HasPatchWithSameName { get { return hasPatchWithSameName; } } //mxd
|
||||
public bool UseColorCorrection { get { return usecolorcorrection; } set { usecolorcorrection = value; } }
|
||||
public Texture Texture { get { lock(this) { return texture; } } }
|
||||
|
@ -175,11 +180,13 @@ namespace CodeImp.DoomBuilder.Data
|
|||
}
|
||||
|
||||
// This sets the name
|
||||
protected void SetName(string name)
|
||||
protected virtual void SetName(string name)
|
||||
{
|
||||
this.name = name;
|
||||
this.longname = Lump.MakeLongName(name);
|
||||
fullName = name; //mxd
|
||||
this.fullname = name; //mxd
|
||||
this.virtualname = name; //mxd
|
||||
this.displayname = name; //mxd
|
||||
this.longname = Lump.MakeLongName(name); //mxd
|
||||
}
|
||||
|
||||
// This unloads the image
|
||||
|
@ -200,18 +207,10 @@ namespace CodeImp.DoomBuilder.Data
|
|||
{
|
||||
// Image loaded successfully?
|
||||
if(!loadfailed && (imagestate == ImageLoadState.Ready) && (bitmap != null))
|
||||
{
|
||||
return bitmap;
|
||||
}
|
||||
|
||||
// Image loading failed?
|
||||
else if(loadfailed)
|
||||
{
|
||||
return Properties.Resources.Failed;
|
||||
}
|
||||
else
|
||||
{
|
||||
return Properties.Resources.Hourglass;
|
||||
}
|
||||
return (loadfailed ? Properties.Resources.Failed : Properties.Resources.Hourglass);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -229,8 +228,6 @@ namespace CodeImp.DoomBuilder.Data
|
|||
// This requests loading the image
|
||||
protected virtual void LocalLoadImage()
|
||||
{
|
||||
BitmapData bmpdata = null;
|
||||
|
||||
lock(this)
|
||||
{
|
||||
// Bitmap loaded successfully?
|
||||
|
@ -269,6 +266,8 @@ namespace CodeImp.DoomBuilder.Data
|
|||
// This applies brightness correction on the image
|
||||
if(usecolorcorrection)
|
||||
{
|
||||
BitmapData bmpdata = null;
|
||||
|
||||
try
|
||||
{
|
||||
// Try locking the bitmap
|
||||
|
@ -333,8 +332,6 @@ namespace CodeImp.DoomBuilder.Data
|
|||
// This creates the Direct3D texture
|
||||
public virtual void CreateTexture()
|
||||
{
|
||||
MemoryStream memstream;
|
||||
|
||||
lock(this)
|
||||
{
|
||||
// Only do this when texture is not created yet
|
||||
|
@ -344,7 +341,7 @@ namespace CodeImp.DoomBuilder.Data
|
|||
if(loadfailed) img = Properties.Resources.Failed;
|
||||
|
||||
// Write to memory stream and read from memory
|
||||
memstream = new MemoryStream((img.Size.Width * img.Size.Height * 4) + 4096);
|
||||
MemoryStream memstream = new MemoryStream((img.Size.Width * img.Size.Height * 4) + 4096);
|
||||
img.Save(memstream, ImageFormat.Bmp);
|
||||
memstream.Seek(0, SeekOrigin.Begin);
|
||||
if(dynamictexture)
|
||||
|
|
|
@ -32,19 +32,22 @@ namespace CodeImp.DoomBuilder.Data
|
|||
public const int DOOMCOLORMAP = 3; // Could be Doom Colormap format (raw 8-bit pixel palette mapping)
|
||||
|
||||
// File format signatures
|
||||
private static readonly int[] PNG_SIGNATURE = new int[] { 137, 80, 78, 71, 13, 10, 26, 10 };
|
||||
private static readonly int[] GIF_SIGNATURE = new int[] { 71, 73, 70 };
|
||||
private static readonly int[] BMP_SIGNATURE = new int[] { 66, 77 };
|
||||
private static readonly int[] DDS_SIGNATURE = new int[] { 68, 68, 83, 32 };
|
||||
private static readonly int[] JPG_SIGNATURE = new int[] { 255, 216, 255 }; //mxd
|
||||
private static readonly int[] TGA_SIGNATURE = new int[] { 0, 0, 2, 0 }; //mxd
|
||||
private static readonly int[] PCX_SIGNATURE = new int[] { 10, 5, 1, 8 }; //mxd
|
||||
private static readonly int[] PNG_SIGNATURE = new[] { 137, 80, 78, 71, 13, 10, 26, 10 };
|
||||
private static readonly int[] GIF_SIGNATURE = new[] { 71, 73, 70 };
|
||||
private static readonly int[] BMP_SIGNATURE = new[] { 66, 77 };
|
||||
private static readonly int[] DDS_SIGNATURE = new[] { 68, 68, 83, 32 };
|
||||
private static readonly int[] JPG_SIGNATURE = new[] { 255, 216, 255 }; //mxd
|
||||
private static readonly int[] TGA_SIGNATURE = new[] { 0, 0, 2, 0 }; //mxd
|
||||
private static readonly int[] PCX_SIGNATURE = new[] { 10, 5, 1, 8 }; //mxd
|
||||
|
||||
// This check image data and returns the appropriate image reader
|
||||
public static IImageReader GetImageReader(Stream data, int guessformat, Playpal palette)
|
||||
{
|
||||
if(data == null) return new UnknownImageReader(); //mxd
|
||||
|
||||
// Data long enough to check for signatures?
|
||||
if(data.Length > 10) {
|
||||
if(data.Length > 10)
|
||||
{
|
||||
// Check for PNG signature
|
||||
data.Seek(0, SeekOrigin.Begin);
|
||||
if(CheckSignature(data, PNG_SIGNATURE))
|
||||
|
@ -82,7 +85,8 @@ namespace CodeImp.DoomBuilder.Data
|
|||
}
|
||||
|
||||
// Could it be a doom picture?
|
||||
switch(guessformat) {
|
||||
switch(guessformat)
|
||||
{
|
||||
case DOOMPICTURE:
|
||||
// Check if data is valid for a doom picture
|
||||
data.Seek(0, SeekOrigin.Begin);
|
||||
|
|
|
@ -28,20 +28,20 @@ namespace CodeImp.DoomBuilder.Data
|
|||
{
|
||||
#region ================== Variables
|
||||
|
||||
private PK3Reader datareader;
|
||||
private int probableformat;
|
||||
private readonly PK3Reader datareader;
|
||||
private readonly int probableformat;
|
||||
|
||||
#endregion
|
||||
|
||||
#region ================== Constructor / Disposer
|
||||
|
||||
// Constructor
|
||||
internal PK3FileImage(PK3Reader datareader, string name, string filepathname, bool asflat)
|
||||
internal PK3FileImage(PK3Reader datareader, string filepathname, bool asflat)
|
||||
{
|
||||
// Initialize
|
||||
this.datareader = datareader;
|
||||
SetName(name);
|
||||
this.fullName = filepathname;
|
||||
this.isFlat = asflat; //mxd
|
||||
SetName(filepathname);
|
||||
|
||||
if(asflat)
|
||||
{
|
||||
|
@ -64,6 +64,33 @@ namespace CodeImp.DoomBuilder.Data
|
|||
|
||||
#region ================== Methods
|
||||
|
||||
//mxd: filepathname is relative path to the image ("Textures\sometexture.png")
|
||||
protected override void SetName(string filepathname)
|
||||
{
|
||||
if(!General.Map.Options.UseLongTextureNames)
|
||||
{
|
||||
this.name = Path.GetFileNameWithoutExtension(filepathname.ToUpperInvariant());
|
||||
if(this.name.Length > DataManager.CLASIC_IMAGE_NAME_LENGTH)
|
||||
this.name = this.name.Substring(0, DataManager.CLASIC_IMAGE_NAME_LENGTH);
|
||||
this.displayname = this.name;
|
||||
this.longname = Lump.MakeLongName(this.name); //mxd
|
||||
}
|
||||
else
|
||||
{
|
||||
this.name = filepathname.Replace(Path.DirectorySeparatorChar, Path.AltDirectorySeparatorChar);
|
||||
this.displayname = Path.GetFileNameWithoutExtension(name);
|
||||
this.longname = Lump.MakeLongName(this.name);
|
||||
this.hasLongName = true;
|
||||
}
|
||||
|
||||
this.virtualname = filepathname.Replace(Path.DirectorySeparatorChar, Path.AltDirectorySeparatorChar);
|
||||
this.fullname = filepathname;
|
||||
if(General.Settings.CapitalizeTextureNames && !string.IsNullOrEmpty(this.displayname))
|
||||
{
|
||||
this.displayname = this.displayname.ToUpperInvariant();
|
||||
}
|
||||
}
|
||||
|
||||
// This loads the image
|
||||
protected override void LocalLoadImage()
|
||||
{
|
||||
|
@ -74,37 +101,44 @@ namespace CodeImp.DoomBuilder.Data
|
|||
{
|
||||
// Load file data
|
||||
if(bitmap != null) bitmap.Dispose(); bitmap = null;
|
||||
MemoryStream filedata = datareader.LoadFile(fullName); //mxd
|
||||
|
||||
// Get a reader for the data
|
||||
IImageReader reader = ImageDataFormat.GetImageReader(filedata, probableformat, General.Map.Data.Palette);
|
||||
if(!(reader is UnknownImageReader))
|
||||
MemoryStream filedata = datareader.LoadFile(fullname); //mxd
|
||||
|
||||
if(filedata != null)
|
||||
{
|
||||
// Load the image
|
||||
filedata.Seek(0, SeekOrigin.Begin);
|
||||
try { bitmap = reader.ReadAsBitmap(filedata); }
|
||||
catch(InvalidDataException)
|
||||
// Get a reader for the data
|
||||
IImageReader reader = ImageDataFormat.GetImageReader(filedata, probableformat, General.Map.Data.Palette);
|
||||
if(!(reader is UnknownImageReader))
|
||||
{
|
||||
// Data cannot be read!
|
||||
bitmap = null;
|
||||
// Load the image
|
||||
filedata.Seek(0, SeekOrigin.Begin);
|
||||
try
|
||||
{
|
||||
bitmap = reader.ReadAsBitmap(filedata);
|
||||
}
|
||||
catch (InvalidDataException)
|
||||
{
|
||||
// Data cannot be read!
|
||||
bitmap = null;
|
||||
}
|
||||
}
|
||||
|
||||
// Not loaded?
|
||||
if(bitmap == null)
|
||||
{
|
||||
General.ErrorLogger.Add(ErrorType.Error, "Image file '" + fullname + "' data format could not be read, while loading texture '" + this.Name + "'");
|
||||
loadfailed = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
// Get width and height from image
|
||||
width = bitmap.Size.Width;
|
||||
height = bitmap.Size.Height;
|
||||
}
|
||||
|
||||
filedata.Dispose();
|
||||
}
|
||||
|
||||
// Not loaded?
|
||||
if(bitmap == null)
|
||||
{
|
||||
General.ErrorLogger.Add(ErrorType.Error, "Image file '" + fullName + "' data format could not be read, while loading texture '" + this.Name + "'");
|
||||
loadfailed = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
// Get width and height from image
|
||||
width = bitmap.Size.Width;
|
||||
height = bitmap.Size.Height;
|
||||
}
|
||||
|
||||
|
||||
// Pass on to base
|
||||
filedata.Dispose();
|
||||
base.LocalLoadImage();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -75,7 +75,7 @@ namespace CodeImp.DoomBuilder.Data
|
|||
|
||||
MemoryStream s = new MemoryStream();
|
||||
reader.WriteEntryTo(s);
|
||||
sevenzipentries.Add(reader.Entry.FilePath.Replace(Path.AltDirectorySeparatorChar, Path.DirectorySeparatorChar), s.ToArray());
|
||||
sevenzipentries.Add(reader.Entry.FilePath.ToLowerInvariant(), s.ToArray());
|
||||
fileentries.Add(new DirectoryFileEntry(reader.Entry.FilePath));
|
||||
}
|
||||
|
||||
|
@ -142,17 +142,25 @@ namespace CodeImp.DoomBuilder.Data
|
|||
#region ================== Textures
|
||||
|
||||
// This finds and returns a patch stream
|
||||
public override Stream GetPatchData(string pname)
|
||||
public override Stream GetPatchData(string pname, bool longname)
|
||||
{
|
||||
// Error when suspended
|
||||
if(issuspended) throw new Exception("Data reader is suspended");
|
||||
|
||||
// Find in any of the wad files
|
||||
// Note the backward order, because the last wad's images have priority
|
||||
for(int i = wads.Count - 1; i >= 0; i--)
|
||||
if (!longname) //mxd. Patches with long names can't be in wads
|
||||
{
|
||||
Stream data = wads[i].GetPatchData(pname);
|
||||
if(data != null) return data;
|
||||
for (int i = wads.Count - 1; i >= 0; i--)
|
||||
{
|
||||
Stream data = wads[i].GetPatchData(pname, false);
|
||||
if (data != null) return data;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
//mxd. Long names are absolute
|
||||
return (FileExists(pname) ? LoadFile(pname) : null);
|
||||
}
|
||||
|
||||
if (General.Map.Config.MixTexturesFlats)
|
||||
|
@ -178,17 +186,25 @@ namespace CodeImp.DoomBuilder.Data
|
|||
}
|
||||
|
||||
// This finds and returns a textue stream
|
||||
public override Stream GetTextureData(string pname)
|
||||
public override Stream GetTextureData(string pname, bool longname)
|
||||
{
|
||||
// Error when suspended
|
||||
if(issuspended) throw new Exception("Data reader is suspended");
|
||||
|
||||
// Find in any of the wad files
|
||||
// Note the backward order, because the last wad's images have priority
|
||||
for(int i = wads.Count - 1; i >= 0; i--)
|
||||
if (!longname) //mxd. Textures with long names can't be in wads
|
||||
{
|
||||
Stream data = wads[i].GetTextureData(pname);
|
||||
if(data != null) return data;
|
||||
for (int i = wads.Count - 1; i >= 0; i--)
|
||||
{
|
||||
Stream data = wads[i].GetTextureData(pname, false);
|
||||
if (data != null) return data;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
//mxd. Long names are absolute
|
||||
return (FileExists(pname) ? LoadFile(pname) : null);
|
||||
}
|
||||
|
||||
// Find in textures directory
|
||||
|
@ -285,12 +301,14 @@ namespace CodeImp.DoomBuilder.Data
|
|||
#region ================== Voxels (mxd)
|
||||
|
||||
//mxd. This finds and returns a voxel stream or null if no voxel was found
|
||||
public override Stream GetVoxelData(string name) {
|
||||
public override Stream GetVoxelData(string name)
|
||||
{
|
||||
// Error when suspended
|
||||
if(issuspended) throw new Exception("Data reader is suspended");
|
||||
|
||||
// Find in any of the wad files
|
||||
for(int i = wads.Count - 1; i >= 0; i--) {
|
||||
for(int i = wads.Count - 1; i >= 0; i--)
|
||||
{
|
||||
Stream voxel = wads[i].GetVoxelData(name);
|
||||
if(voxel != null) return voxel;
|
||||
}
|
||||
|
@ -299,7 +317,8 @@ namespace CodeImp.DoomBuilder.Data
|
|||
|
||||
// Find in sprites directory
|
||||
string filename = FindFirstFile(VOXELS_DIR, pfilename, true);
|
||||
if((filename != null) && FileExists(filename)) {
|
||||
if((filename != null) && FileExists(filename))
|
||||
{
|
||||
return LoadFile(filename);
|
||||
}
|
||||
|
||||
|
@ -318,18 +337,18 @@ namespace CodeImp.DoomBuilder.Data
|
|||
}
|
||||
|
||||
// This creates an image
|
||||
protected override ImageData CreateImage(string name, string filename, int imagetype)
|
||||
protected override ImageData CreateImage(string filename, int imagetype)
|
||||
{
|
||||
switch(imagetype)
|
||||
{
|
||||
case ImageDataFormat.DOOMFLAT:
|
||||
return new PK3FileImage(this, name, filename, true);
|
||||
return new PK3FileImage(this, filename, true);
|
||||
|
||||
case ImageDataFormat.DOOMPICTURE:
|
||||
return new PK3FileImage(this, name, filename, false);
|
||||
return new PK3FileImage(this, filename, false);
|
||||
|
||||
case ImageDataFormat.DOOMCOLORMAP:
|
||||
return new ColormapImage(name);
|
||||
return new ColormapImage(Path.GetFileNameWithoutExtension(filename));
|
||||
|
||||
default:
|
||||
throw new ArgumentException("Invalid image format specified!");
|
||||
|
@ -355,7 +374,8 @@ namespace CodeImp.DoomBuilder.Data
|
|||
}
|
||||
|
||||
//mxd. This returns all files in a given directory which title starts with given title
|
||||
protected override string[] GetAllFilesWhichTitleStartsWith(string path, string title) {
|
||||
protected override string[] GetAllFilesWhichTitleStartsWith(string path, string title)
|
||||
{
|
||||
return files.GetAllFilesWhichTitleStartsWith(path, title).ToArray();
|
||||
}
|
||||
|
||||
|
@ -391,24 +411,24 @@ namespace CodeImp.DoomBuilder.Data
|
|||
internal override MemoryStream LoadFile(string filename)
|
||||
{
|
||||
MemoryStream filedata = null;
|
||||
string fn = filename.Replace(Path.DirectorySeparatorChar, Path.AltDirectorySeparatorChar); //mxd
|
||||
|
||||
//mxd. This works waaaaaay faster with 7z archive
|
||||
if (archivetype == ArchiveType.SevenZip)
|
||||
if (archivetype == ArchiveType.SevenZip)
|
||||
{
|
||||
if (sevenzipentries.ContainsKey(filename))
|
||||
filedata = new MemoryStream(sevenzipentries[filename]);
|
||||
fn = fn.ToLowerInvariant();
|
||||
if (sevenzipentries.ContainsKey(fn)) filedata = new MemoryStream(sevenzipentries[fn]);
|
||||
}
|
||||
else
|
||||
{
|
||||
UpdateArchive(true);
|
||||
|
||||
|
||||
foreach (var entry in archive.Entries)
|
||||
{
|
||||
if (entry.IsDirectory) continue;
|
||||
|
||||
// Is this the entry we are looking for?
|
||||
string entryname = entry.FilePath.Replace(Path.AltDirectorySeparatorChar, Path.DirectorySeparatorChar);
|
||||
if (string.Compare(entryname, filename, true) == 0)
|
||||
if(string.Compare(entry.FilePath, fn, true) == 0)
|
||||
{
|
||||
filedata = new MemoryStream();
|
||||
entry.WriteTo(filedata);
|
||||
|
|
|
@ -261,34 +261,6 @@ namespace CodeImp.DoomBuilder.Data
|
|||
|
||||
return null;
|
||||
}
|
||||
|
||||
//mxd
|
||||
public override string GetPatchLocation(string pname) {
|
||||
// Error when suspended
|
||||
if (issuspended) throw new Exception("Data reader is suspended");
|
||||
|
||||
if (General.Map.Config.MixTexturesFlats)
|
||||
{
|
||||
// Find in directories ZDoom expects them to be
|
||||
foreach (string loc in PatchLocations)
|
||||
{
|
||||
string path = Path.Combine(loc, Path.GetDirectoryName(pname));
|
||||
string filename = FindFirstFile(path, Path.GetFileName(pname), true);
|
||||
if (!string.IsNullOrEmpty(filename) && FileExists(filename))
|
||||
return filename;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
// Find in patches directory
|
||||
string path = Path.Combine(PATCHES_DIR, Path.GetDirectoryName(pname));
|
||||
string filename = FindFirstFile(path, Path.GetFileName(pname), true);
|
||||
if (!string.IsNullOrEmpty(filename) && FileExists(filename))
|
||||
return filename;
|
||||
}
|
||||
|
||||
return pname;
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
|
@ -346,15 +318,20 @@ namespace CodeImp.DoomBuilder.Data
|
|||
}
|
||||
|
||||
//mxd.
|
||||
public override Stream GetFlatData(string pname) {
|
||||
public override Stream GetFlatData(string pname, bool longname)
|
||||
{
|
||||
// Error when suspended
|
||||
if(issuspended) throw new Exception("Data reader is suspended");
|
||||
|
||||
// Find in any of the wad files
|
||||
// Note the backward order, because the last wad's images have priority
|
||||
for(int i = wads.Count - 1; i > -1; i--) {
|
||||
Stream data = wads[i].GetFlatData(pname);
|
||||
if(data != null) return data;
|
||||
if(!longname) //mxd. Flats with long names can't be in wads
|
||||
{
|
||||
for (int i = wads.Count - 1; i > -1; i--)
|
||||
{
|
||||
Stream data = wads[i].GetFlatData(pname, false);
|
||||
if (data != null) return data;
|
||||
}
|
||||
}
|
||||
|
||||
// Nothing found
|
||||
|
@ -488,18 +465,18 @@ namespace CodeImp.DoomBuilder.Data
|
|||
#region ================== Modeldef (mxd)
|
||||
|
||||
//mxd
|
||||
public override Dictionary<string, Stream> GetModeldefData() {
|
||||
public override Dictionary<string, Stream> GetModeldefData()
|
||||
{
|
||||
// Error when suspended
|
||||
if (issuspended) throw new Exception("Data reader is suspended");
|
||||
|
||||
//modedef should be in root folder
|
||||
string[] allFiles = GetAllFiles("", false);
|
||||
string[] files = GetAllFiles("", false);
|
||||
Dictionary<string, Stream> streams = new Dictionary<string, Stream>(StringComparer.Ordinal);
|
||||
|
||||
foreach (string s in allFiles) {
|
||||
if (s.ToLowerInvariant().IndexOf("modeldef") != -1) {
|
||||
foreach (string s in files) {
|
||||
if (s.ToLowerInvariant().IndexOf("modeldef") != -1)
|
||||
streams.Add(s, LoadFile(s));
|
||||
}
|
||||
}
|
||||
|
||||
return streams;
|
||||
|
@ -510,34 +487,37 @@ namespace CodeImp.DoomBuilder.Data
|
|||
#region ================== Voxeldef (mxd)
|
||||
|
||||
//mxd. This returns the list of voxels, which can be used without VOXELDEF definition
|
||||
public override string[] GetVoxelNames() {
|
||||
public override string[] GetVoxelNames()
|
||||
{
|
||||
// Error when suspended
|
||||
if(issuspended) throw new Exception("Data reader is suspended");
|
||||
|
||||
string[] files = GetAllFiles("voxels", false);
|
||||
List<string> voxels = new List<string>();
|
||||
Regex spriteName = new Regex(SPRITE_NAME_PATTERN);
|
||||
Regex spritename = new Regex(SPRITE_NAME_PATTERN);
|
||||
|
||||
for(int i = 0; i < files.Length; i++) {
|
||||
string s = Path.GetFileNameWithoutExtension(files[i]).ToUpperInvariant();
|
||||
if(spriteName.IsMatch(s)) voxels.Add(s);
|
||||
foreach (string t in files)
|
||||
{
|
||||
string s = Path.GetFileNameWithoutExtension(t).ToUpperInvariant();
|
||||
if(spritename.IsMatch(s)) voxels.Add(s);
|
||||
}
|
||||
|
||||
return voxels.ToArray();
|
||||
}
|
||||
|
||||
//mxd
|
||||
public override KeyValuePair<string, Stream> GetVoxeldefData() {
|
||||
public override KeyValuePair<string, Stream> GetVoxeldefData()
|
||||
{
|
||||
// Error when suspended
|
||||
if(issuspended) throw new Exception("Data reader is suspended");
|
||||
|
||||
//voxeldef should be in root folder
|
||||
string[] files = GetAllFiles("", false);
|
||||
|
||||
foreach(string s in files) {
|
||||
if(Path.GetFileNameWithoutExtension(s).ToUpperInvariant() == "VOXELDEF") {
|
||||
foreach(string s in files)
|
||||
{
|
||||
if(Path.GetFileNameWithoutExtension(s).ToUpperInvariant() == "VOXELDEF")
|
||||
return new KeyValuePair<string,Stream>(s, LoadFile(s));
|
||||
}
|
||||
}
|
||||
|
||||
return new KeyValuePair<string,Stream>();
|
||||
|
@ -548,19 +528,21 @@ namespace CodeImp.DoomBuilder.Data
|
|||
#region ================== (Z)MAPINFO (mxd)
|
||||
|
||||
//mxd
|
||||
public override Dictionary<string, Stream> GetMapinfoData() {
|
||||
Dictionary<string, Stream> streams = new Dictionary<string, Stream>(StringComparer.Ordinal);
|
||||
public override Dictionary<string, Stream> GetMapinfoData()
|
||||
{
|
||||
// Error when suspended
|
||||
if (issuspended) throw new Exception("Data reader is suspended");
|
||||
|
||||
//mapinfo should be in root folder
|
||||
string[] allFiles = GetAllFiles("", false);
|
||||
string fileName;
|
||||
Dictionary<string, Stream> streams = new Dictionary<string, Stream>(StringComparer.Ordinal);
|
||||
string[] files = GetAllFiles("", false);
|
||||
string filename;
|
||||
|
||||
//try to find (z)mapinfo
|
||||
foreach (string s in allFiles) {
|
||||
fileName = s.ToLowerInvariant();
|
||||
if (fileName.IndexOf("zmapinfo") != -1 || fileName.IndexOf("mapinfo") != -1)
|
||||
foreach (string s in files)
|
||||
{
|
||||
filename = Path.GetFileNameWithoutExtension(s.ToLowerInvariant());
|
||||
if(filename == "zmapinfo" || filename == "mapinfo")
|
||||
streams.Add(s, LoadFile(s));
|
||||
}
|
||||
|
||||
|
@ -572,29 +554,31 @@ namespace CodeImp.DoomBuilder.Data
|
|||
#region ================== GLDEFS (mxd)
|
||||
|
||||
//mxd
|
||||
public override Dictionary<string, Stream> GetGldefsData(GameType gameType) {
|
||||
public override Dictionary<string, Stream> GetGldefsData(GameType gametype)
|
||||
{
|
||||
// Error when suspended
|
||||
if (issuspended) throw new Exception("Data reader is suspended");
|
||||
|
||||
Dictionary<string, Stream> streams = new Dictionary<string, Stream>(StringComparer.Ordinal);
|
||||
|
||||
//at least one of gldefs should be in root folder
|
||||
string[] allFiles = GetAllFiles("", false);
|
||||
string[] files = GetAllFiles("", false);
|
||||
|
||||
//try to load game specific GLDEFS first
|
||||
string lumpName;
|
||||
if (gameType != GameType.UNKNOWN) {
|
||||
lumpName = Gldefs.GLDEFS_LUMPS_PER_GAME[(int)gameType].ToLowerInvariant();
|
||||
foreach (string s in allFiles) {
|
||||
if (s.ToLowerInvariant().IndexOf(lumpName) != -1)
|
||||
if (gametype != GameType.UNKNOWN)
|
||||
{
|
||||
string lumpname = Gldefs.GLDEFS_LUMPS_PER_GAME[(int)gametype].ToLowerInvariant();
|
||||
foreach (string s in files)
|
||||
{
|
||||
if (s.ToLowerInvariant().IndexOf(lumpname) != -1)
|
||||
streams.Add(s, LoadFile(s));
|
||||
}
|
||||
}
|
||||
|
||||
//can be several entries
|
||||
lumpName = "gldefs";
|
||||
foreach (string s in allFiles) {
|
||||
if (s.ToLowerInvariant().IndexOf(lumpName) != -1)
|
||||
// Can be several entries
|
||||
foreach (string s in files)
|
||||
{
|
||||
if(s.ToLowerInvariant().IndexOf("gldefs") != -1)
|
||||
streams.Add(s, LoadFile(s));
|
||||
}
|
||||
|
||||
|
@ -602,7 +586,8 @@ namespace CodeImp.DoomBuilder.Data
|
|||
}
|
||||
|
||||
//mxd
|
||||
public override Dictionary<string, Stream> GetGldefsData(string location) {
|
||||
public override Dictionary<string, Stream> GetGldefsData(string location)
|
||||
{
|
||||
// Error when suspended
|
||||
if (issuspended) throw new Exception("Data reader is suspended");
|
||||
|
||||
|
@ -620,30 +605,24 @@ namespace CodeImp.DoomBuilder.Data
|
|||
private ICollection<ImageData> LoadDirectoryImages(string path, int imagetype, bool includesubdirs)
|
||||
{
|
||||
List<ImageData> images = new List<ImageData>();
|
||||
string name;
|
||||
|
||||
// Go for all files
|
||||
string[] files = GetAllFiles(path, includesubdirs);
|
||||
foreach(string f in files)
|
||||
{
|
||||
//mxd. Skip IMGZ files
|
||||
if(Path.GetExtension(f).ToUpperInvariant() == ".IMGZ") continue;
|
||||
string ext = Path.GetExtension(f);
|
||||
if(!string.IsNullOrEmpty(ext) && ext.ToUpperInvariant() == ".IMGZ") continue;
|
||||
|
||||
// Make the texture name from filename without extension
|
||||
name = Path.GetFileNameWithoutExtension(f);
|
||||
|
||||
if (string.IsNullOrEmpty(name))
|
||||
if(string.IsNullOrEmpty(Path.GetFileNameWithoutExtension(f)))
|
||||
{
|
||||
// Can't load image without name
|
||||
General.ErrorLogger.Add(ErrorType.Error, "Can't load an unnamed texture from \"" + path + "\". Please consider giving names to your resources.");
|
||||
}
|
||||
else
|
||||
{
|
||||
if(name.Length > General.Map.Config.MaxTextureNameLength) name = name.Substring(0, General.Map.Config.MaxTextureNameLength);
|
||||
if(General.Settings.CapitalizeTextureNames) name = name.ToUpperInvariant(); //mxd
|
||||
|
||||
// Add image to list
|
||||
images.Add(CreateImage(name, f, imagetype));
|
||||
images.Add(CreateImage(f, imagetype));
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -664,7 +643,7 @@ namespace CodeImp.DoomBuilder.Data
|
|||
}
|
||||
|
||||
// This must create an image
|
||||
protected abstract ImageData CreateImage(string name, string filename, int imagetype);
|
||||
protected abstract ImageData CreateImage(string filename, int imagetype);
|
||||
|
||||
// This must return all files in a given directory
|
||||
protected abstract string[] GetAllFiles(string path, bool subfolders);
|
||||
|
|
|
@ -70,7 +70,7 @@ namespace CodeImp.DoomBuilder.Data
|
|||
{
|
||||
// Get the patch data stream
|
||||
if(bitmap != null) bitmap.Dispose(); bitmap = null;
|
||||
patchdata = General.Map.Data.GetTextureData(lumpname);
|
||||
patchdata = General.Map.Data.GetTextureData(lumpname, hasLongName);
|
||||
if(patchdata != null)
|
||||
{
|
||||
// Copy patch data to memory
|
||||
|
|
|
@ -106,7 +106,7 @@ namespace CodeImp.DoomBuilder.Data
|
|||
foreach(TexturePatch p in patches)
|
||||
{
|
||||
// Get the patch data stream
|
||||
patchdata = General.Map.Data.GetPatchData(p.lumpname);
|
||||
patchdata = General.Map.Data.GetPatchData(p.lumpname, p.haslongname);
|
||||
if(patchdata != null)
|
||||
{
|
||||
// Copy patch data to memory
|
||||
|
|
|
@ -16,6 +16,7 @@
|
|||
|
||||
#region ================== Namespaces
|
||||
|
||||
using System.IO;
|
||||
using CodeImp.DoomBuilder.Rendering;
|
||||
using CodeImp.DoomBuilder.ZDoom;
|
||||
|
||||
|
@ -45,17 +46,18 @@ namespace CodeImp.DoomBuilder.Data
|
|||
|
||||
internal struct TexturePatch
|
||||
{
|
||||
public string lumpname;
|
||||
public int x;
|
||||
public int y;
|
||||
public bool flipx;
|
||||
public bool flipy;
|
||||
public int rotate;
|
||||
public readonly string lumpname;
|
||||
public readonly int x;
|
||||
public readonly int y;
|
||||
public readonly bool flipx;
|
||||
public readonly bool flipy;
|
||||
public readonly bool haslongname; //mxd
|
||||
public readonly int rotate;
|
||||
public PixelColor blend;
|
||||
public float alpha;
|
||||
public TexturePathRenderStyle style;
|
||||
public TexturePathBlendStyle blendstyle; //mxd
|
||||
public float tintammount;//mxd
|
||||
public readonly float alpha;
|
||||
public readonly TexturePathRenderStyle style;
|
||||
public readonly TexturePathBlendStyle blendstyle; //mxd
|
||||
public readonly float tintammount;//mxd
|
||||
|
||||
// Constructor for simple patches
|
||||
public TexturePatch(string lumpname, int x, int y)
|
||||
|
@ -72,6 +74,7 @@ namespace CodeImp.DoomBuilder.Data
|
|||
this.style = TexturePathRenderStyle.Copy;
|
||||
this.blendstyle = TexturePathBlendStyle.None;//mxd
|
||||
this.tintammount = 0; //mxd
|
||||
this.haslongname = false; //mxd
|
||||
}
|
||||
|
||||
//mxd. Constructor for hires patches
|
||||
|
@ -88,9 +91,11 @@ namespace CodeImp.DoomBuilder.Data
|
|||
this.style = patch.RenderStyle;
|
||||
this.blendstyle = patch.BlendStyle;
|
||||
this.tintammount = patch.TintAmmount;
|
||||
this.haslongname = (Path.GetFileNameWithoutExtension(this.lumpname) != this.lumpname);
|
||||
|
||||
//mxd. Check data so we don't perform unneeded operations later on
|
||||
if(this.alpha == 1.0f) {
|
||||
if(this.alpha == 1.0f)
|
||||
{
|
||||
if(this.style == TexturePathRenderStyle.Blend || this.style == TexturePathRenderStyle.CopyAlpha || this.style == TexturePathRenderStyle.CopyNewAlpha || this.style == TexturePathRenderStyle.Overlay)
|
||||
this.style = TexturePathRenderStyle.Copy;
|
||||
}
|
||||
|
|
|
@ -536,28 +536,32 @@ namespace CodeImp.DoomBuilder.Data
|
|||
}
|
||||
|
||||
// This finds and returns a patch stream
|
||||
public override Stream GetPatchData(string pname)
|
||||
public override Stream GetPatchData(string pname, bool longname)
|
||||
{
|
||||
Lump lump;
|
||||
|
||||
// Error when suspended
|
||||
if(issuspended) throw new Exception("Data reader is suspended");
|
||||
if(longname) return null; //mxd
|
||||
Lump lump;
|
||||
|
||||
// mxd. First strictly read patches between P_START and P_END
|
||||
foreach(LumpRange range in patchranges) {
|
||||
foreach(LumpRange range in patchranges)
|
||||
{
|
||||
lump = file.FindLump(pname, range.start, range.end);
|
||||
if(lump != null) return lump.Stream;
|
||||
}
|
||||
|
||||
if (!strictpatches) {
|
||||
if (!strictpatches)
|
||||
{
|
||||
//mxd. Find the lump anywhere EXCEPT flat ranges (the way it's done in ZDoom)
|
||||
foreach (LumpRange range in invertedflatranges) {
|
||||
foreach (LumpRange range in invertedflatranges)
|
||||
{
|
||||
lump = file.FindLump(pname, range.start, range.end);
|
||||
if(lump != null) return lump.Stream;
|
||||
}
|
||||
|
||||
// Find the lump anywhere IN flat ranges
|
||||
foreach (LumpRange range in flatranges) {
|
||||
foreach (LumpRange range in flatranges)
|
||||
{
|
||||
lump = file.FindLump(pname, range.start, range.end);
|
||||
if(lump != null) return lump.Stream;
|
||||
}
|
||||
|
@ -567,12 +571,12 @@ namespace CodeImp.DoomBuilder.Data
|
|||
}
|
||||
|
||||
// This finds and returns a texture stream
|
||||
public override Stream GetTextureData(string pname)
|
||||
public override Stream GetTextureData(string pname, bool longname)
|
||||
{
|
||||
Lump lump;
|
||||
|
||||
// Error when suspended
|
||||
if(issuspended) throw new Exception("Data reader is suspended");
|
||||
if(longname) return null; //mxd
|
||||
Lump lump;
|
||||
|
||||
// Find the lump in ranges
|
||||
foreach(LumpRange range in textureranges)
|
||||
|
@ -589,19 +593,23 @@ namespace CodeImp.DoomBuilder.Data
|
|||
#region ================== Flats
|
||||
|
||||
//mxd. This loads the flats
|
||||
public override ICollection<ImageData> LoadFlats() {
|
||||
public override ICollection<ImageData> LoadFlats()
|
||||
{
|
||||
// Error when suspended
|
||||
if(issuspended) throw new Exception("Data reader is suspended");
|
||||
|
||||
List<ImageData> images = new List<ImageData>();
|
||||
FlatImage image;
|
||||
|
||||
foreach(LumpRange range in flatranges){
|
||||
foreach(LumpRange range in flatranges)
|
||||
{
|
||||
if(range.end < range.start + 2) continue;
|
||||
|
||||
for(int i = range.start + 1; i < range.end; i++) {
|
||||
for(int i = range.start + 1; i < range.end; i++)
|
||||
{
|
||||
// Lump not zero-length?
|
||||
if(file.Lumps[i].Length > 0) {
|
||||
if(file.Lumps[i].Length > 0)
|
||||
{
|
||||
// Make the image object
|
||||
image = new FlatImage(file.Lumps[i].Name);
|
||||
|
||||
|
@ -613,7 +621,8 @@ namespace CodeImp.DoomBuilder.Data
|
|||
|
||||
// Load TEXTURES lump file
|
||||
int lumpindex = file.FindLumpIndex("TEXTURES");
|
||||
while(lumpindex > -1) {
|
||||
while(lumpindex > -1)
|
||||
{
|
||||
MemoryStream filedata = new MemoryStream(file.Lumps[lumpindex].Stream.ReadAllBytes());
|
||||
WADReader.LoadHighresFlats(filedata, "TEXTURES", ref images, null, null);
|
||||
filedata.Dispose();
|
||||
|
@ -654,11 +663,11 @@ namespace CodeImp.DoomBuilder.Data
|
|||
}
|
||||
|
||||
// This finds and returns a patch stream
|
||||
public override Stream GetFlatData(string pname)
|
||||
public override Stream GetFlatData(string pname, bool longname)
|
||||
{
|
||||
// Error when suspended
|
||||
if(issuspended) throw new Exception("Data reader is suspended");
|
||||
|
||||
if(longname) return null; //mxd
|
||||
Lump lump;
|
||||
|
||||
// Find the lump in ranges
|
||||
|
|
|
@ -230,7 +230,7 @@ namespace CodeImp.DoomBuilder.Editing
|
|||
// Write data to stream
|
||||
MemoryStream memstream = new MemoryStream();
|
||||
ClipboardStreamWriter writer = new ClipboardStreamWriter(); //mxd
|
||||
writer.Write(copyset, memstream);
|
||||
writer.Write(copyset, memstream, General.Map.Options.UseLongTextureNames);
|
||||
|
||||
// Set on clipboard
|
||||
Clipboard.SetData(CLIPBOARD_DATA_FORMAT, memstream);
|
||||
|
@ -293,6 +293,10 @@ namespace CodeImp.DoomBuilder.Editing
|
|||
|
||||
// Convert UDMF fields back to flags and activations, if needed
|
||||
if(!(General.Map.FormatInterface is UniversalMapSetIO)) General.Map.Map.TranslateFromUDMF();
|
||||
|
||||
//mxd. Translate texture names if needed
|
||||
if(reader.UseLongTextureNames != General.Map.Options.UseLongTextureNames)
|
||||
General.Map.Map.TranslateTextureNames(General.Map.Options.UseLongTextureNames, true);
|
||||
|
||||
// Modify tags and actions if preferred
|
||||
if(options.ChangeTags == PasteOptions.TAGS_REMOVE) Tools.RemoveMarkedTags();
|
||||
|
|
|
@ -17,7 +17,9 @@
|
|||
#region ================== Namespaces
|
||||
|
||||
using System;
|
||||
using System.IO;
|
||||
using System.Windows.Forms;
|
||||
using CodeImp.DoomBuilder.Map;
|
||||
using CodeImp.DoomBuilder.Windows;
|
||||
using CodeImp.DoomBuilder.IO;
|
||||
using CodeImp.DoomBuilder.Actions;
|
||||
|
@ -129,7 +131,7 @@ namespace CodeImp.DoomBuilder.Editing
|
|||
}
|
||||
|
||||
// Read settings from configuration
|
||||
internal void ReadFromConfig(Configuration cfg, string path)
|
||||
internal void ReadFromConfig(Configuration cfg, string path, bool uselongtexturenames)
|
||||
{
|
||||
// Read settings
|
||||
background = cfg.ReadSetting(path + ".background", "");
|
||||
|
@ -140,6 +142,9 @@ namespace CodeImp.DoomBuilder.Editing
|
|||
backscaley = cfg.ReadSetting(path + ".backscaley", 100) / 100.0f;
|
||||
gridsize = cfg.ReadSetting(path + ".gridsize", DEFAULT_GRID_SIZE);
|
||||
|
||||
//mxd. Translate background name?
|
||||
TranslateBackgroundName(uselongtexturenames);
|
||||
|
||||
// Setup
|
||||
SetGridSize(gridsize);
|
||||
LinkBackground();
|
||||
|
@ -172,6 +177,23 @@ namespace CodeImp.DoomBuilder.Editing
|
|||
LinkBackground();
|
||||
}
|
||||
|
||||
//mxd
|
||||
internal void TranslateBackgroundName(bool uselongtexturenames)
|
||||
{
|
||||
if(string.IsNullOrEmpty(background)) return;
|
||||
|
||||
switch(backsource)
|
||||
{
|
||||
case SOURCE_TEXTURES:
|
||||
background = (uselongtexturenames ? General.Map.Data.GetFullTextureName(background) : MapSet.GetShortTextureName(background));
|
||||
break;
|
||||
|
||||
case SOURCE_FLATS:
|
||||
background = (uselongtexturenames ? General.Map.Data.GetFullFlatName(background) : MapSet.GetShortTextureName(background));
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
// This sets the background view
|
||||
internal void SetBackgroundView(int offsetx, int offsety, float scalex, float scaley)
|
||||
{
|
||||
|
@ -200,7 +222,7 @@ namespace CodeImp.DoomBuilder.Editing
|
|||
break;
|
||||
|
||||
case SOURCE_FILE:
|
||||
backimage = new FileImage(background, background, false, 1.0f, 1.0f);
|
||||
backimage = new FileImage(Path.GetFileNameWithoutExtension(background), background, false, 1.0f, 1.0f);
|
||||
break;
|
||||
}
|
||||
|
||||
|
|
|
@ -908,6 +908,7 @@ namespace CodeImp.DoomBuilder.GZBuilder.Controls
|
|||
{
|
||||
components = new System.ComponentModel.Container();
|
||||
DoubleBuffered = true; //mxd
|
||||
SetStyle(ControlStyles.OptimizedDoubleBuffer, true); //mxd
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
|
|
@ -26,20 +26,32 @@
|
|||
/// </summary>
|
||||
private void InitializeComponent() {
|
||||
this.label = new System.Windows.Forms.Label();
|
||||
this.bReset = new System.Windows.Forms.Button();
|
||||
this.value1 = new CodeImp.DoomBuilder.Controls.ButtonsNumericTextbox();
|
||||
this.value2 = new CodeImp.DoomBuilder.Controls.ButtonsNumericTextbox();
|
||||
this.bReset = new System.Windows.Forms.Button();
|
||||
this.SuspendLayout();
|
||||
//
|
||||
// label
|
||||
//
|
||||
this.label.Location = new System.Drawing.Point(0, 6);
|
||||
this.label.Name = "label";
|
||||
this.label.Size = new System.Drawing.Size(87, 14);
|
||||
this.label.Size = new System.Drawing.Size(86, 14);
|
||||
this.label.TabIndex = 40;
|
||||
this.label.Text = "Upper Offset:";
|
||||
this.label.TextAlign = System.Drawing.ContentAlignment.TopRight;
|
||||
//
|
||||
// bReset
|
||||
//
|
||||
this.bReset.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
|
||||
this.bReset.Image = global::CodeImp.DoomBuilder.Properties.Resources.Reset;
|
||||
this.bReset.Location = new System.Drawing.Point(220, 1);
|
||||
this.bReset.Name = "bReset";
|
||||
this.bReset.Size = new System.Drawing.Size(23, 23);
|
||||
this.bReset.TabIndex = 43;
|
||||
this.bReset.UseVisualStyleBackColor = true;
|
||||
this.bReset.Visible = false;
|
||||
this.bReset.Click += new System.EventHandler(this.bReset_Click);
|
||||
//
|
||||
// value1
|
||||
//
|
||||
this.value1.AllowDecimal = false;
|
||||
|
@ -48,7 +60,8 @@
|
|||
this.value1.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
|
||||
this.value1.ButtonStep = 1;
|
||||
this.value1.ButtonStepFloat = 1F;
|
||||
this.value1.Location = new System.Drawing.Point(89, 1);
|
||||
this.value1.ButtonStepsWrapAround = false;
|
||||
this.value1.Location = new System.Drawing.Point(87, 1);
|
||||
this.value1.Name = "value1";
|
||||
this.value1.Size = new System.Drawing.Size(62, 24);
|
||||
this.value1.StepValues = null;
|
||||
|
@ -64,7 +77,8 @@
|
|||
this.value2.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
|
||||
this.value2.ButtonStep = 1;
|
||||
this.value2.ButtonStepFloat = 1F;
|
||||
this.value2.Location = new System.Drawing.Point(157, 1);
|
||||
this.value2.ButtonStepsWrapAround = false;
|
||||
this.value2.Location = new System.Drawing.Point(155, 1);
|
||||
this.value2.Name = "value2";
|
||||
this.value2.Size = new System.Drawing.Size(62, 24);
|
||||
this.value2.StepValues = null;
|
||||
|
@ -72,28 +86,16 @@
|
|||
this.value2.Tag = "offsety_top";
|
||||
this.value2.WhenTextChanged += new System.EventHandler(this.value1_WhenTextChanged);
|
||||
//
|
||||
// bReset
|
||||
//
|
||||
this.bReset.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
|
||||
this.bReset.Image = global::CodeImp.DoomBuilder.Properties.Resources.Reset;
|
||||
this.bReset.Location = new System.Drawing.Point(222, 1);
|
||||
this.bReset.Name = "bReset";
|
||||
this.bReset.Size = new System.Drawing.Size(23, 23);
|
||||
this.bReset.TabIndex = 43;
|
||||
this.bReset.UseVisualStyleBackColor = true;
|
||||
this.bReset.Visible = false;
|
||||
this.bReset.Click += new System.EventHandler(this.bReset_Click);
|
||||
//
|
||||
// PairedIntControl
|
||||
//
|
||||
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
|
||||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
||||
this.AutoScaleDimensions = new System.Drawing.SizeF(96F, 96F);
|
||||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Dpi;
|
||||
this.Controls.Add(this.bReset);
|
||||
this.Controls.Add(this.value1);
|
||||
this.Controls.Add(this.value2);
|
||||
this.Controls.Add(this.label);
|
||||
this.Name = "PairedIntControl";
|
||||
this.Size = new System.Drawing.Size(249, 26);
|
||||
this.Size = new System.Drawing.Size(268, 26);
|
||||
this.ResumeLayout(false);
|
||||
|
||||
}
|
||||
|
|
|
@ -87,18 +87,23 @@ namespace CodeImp.DoomBuilder
|
|||
case ErrorType.Error:
|
||||
erroradded = true;
|
||||
prefix = "ERROR: ";
|
||||
#if DEBUG
|
||||
DebugConsole.WriteLine(DebugMessageType.Error, message);
|
||||
#endif
|
||||
break;
|
||||
|
||||
case ErrorType.Warning:
|
||||
warningadded = true;
|
||||
prefix = "WARNING: ";
|
||||
#if DEBUG
|
||||
DebugConsole.WriteLine(DebugMessageType.Warning, message);
|
||||
#endif
|
||||
break;
|
||||
}
|
||||
changed = true;
|
||||
|
||||
General.WriteLogLine(prefix + message);
|
||||
|
||||
//mxd
|
||||
General.MainWindow.SetWarningsCount(errors.Count, erroradded);
|
||||
General.MainWindow.SetWarningsCount(errors.Count, erroradded); //mxd
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -998,14 +998,14 @@ namespace CodeImp.DoomBuilder
|
|||
internal static void NewMap()
|
||||
{
|
||||
//mxd
|
||||
if(map != null && map.Launcher.GameEngineRunning) {
|
||||
if(map != null && map.Launcher.GameEngineRunning)
|
||||
{
|
||||
ShowWarningMessage("Cannot create a map while game engine is running" + Environment.NewLine + "Please close '" + map.ConfigSettings.TestProgram + "' first.", MessageBoxButtons.OK);
|
||||
return;
|
||||
}
|
||||
|
||||
MapOptions newoptions = new MapOptions();
|
||||
MapOptionsForm optionswindow;
|
||||
|
||||
|
||||
// Cancel volatile mode, if any
|
||||
editing.DisengageVolatileMode();
|
||||
|
||||
|
@ -1013,7 +1013,7 @@ namespace CodeImp.DoomBuilder
|
|||
if(AskSaveMap())
|
||||
{
|
||||
// Open map options dialog
|
||||
optionswindow = new MapOptionsForm(newoptions, true);
|
||||
MapOptionsForm optionswindow = new MapOptionsForm(newoptions, true);
|
||||
if(optionswindow.ShowDialog(mainwindow) == DialogResult.OK)
|
||||
{
|
||||
// Display status
|
||||
|
@ -1030,9 +1030,8 @@ namespace CodeImp.DoomBuilder
|
|||
// Let the plugins know
|
||||
plugins.OnMapNewBegin();
|
||||
|
||||
// Set this to false so we can see if errors are added
|
||||
//General.ErrorLogger.IsErrorAdded = false;
|
||||
errorlogger.Clear(); //mxd
|
||||
// Clear old errors (mxd)
|
||||
errorlogger.Clear();
|
||||
|
||||
// Create map manager with given options
|
||||
map = new MapManager();
|
||||
|
@ -1195,6 +1194,26 @@ namespace CodeImp.DoomBuilder
|
|||
ChangeMapForm changemapwindow = new ChangeMapForm(map.FilePathName, map.Options);
|
||||
if(changemapwindow.ShowDialog(mainwindow) != DialogResult.OK) return;
|
||||
|
||||
// If resources don't match, perform regular map loading
|
||||
bool resourcesmismatch = changemapwindow.Options.Resources.Count != map.Options.Resources.Count;
|
||||
if (!resourcesmismatch)
|
||||
{
|
||||
for(int i = 0; i < changemapwindow.Options.Resources.Count; i++)
|
||||
{
|
||||
if(changemapwindow.Options.Resources[i].location != map.Options.Resources[i].location)
|
||||
{
|
||||
resourcesmismatch = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if(resourcesmismatch)
|
||||
{
|
||||
OpenMapFileWithOptions(map.FilePathName, changemapwindow.Options);
|
||||
return;
|
||||
}
|
||||
|
||||
// Display status
|
||||
mainwindow.DisplayStatus(StatusType.Busy, "Switching to map '" + changemapwindow.Options.CurrentName + "'...");
|
||||
WriteLogLine("Switching to map '" + changemapwindow.Options.CurrentName + "'...");
|
||||
|
@ -1363,7 +1382,7 @@ namespace CodeImp.DoomBuilder
|
|||
result = map.SaveSettingsFile(map.FilePathName);
|
||||
|
||||
// Display status
|
||||
mainwindow.DisplayStatus(StatusType.Info, "Map is up to date. No saving required.");
|
||||
mainwindow.DisplayStatus(StatusType.Info, "Map is up to date. Updated map settings file.");
|
||||
|
||||
// All done
|
||||
mainwindow.UpdateInterface();
|
||||
|
@ -1894,24 +1913,14 @@ namespace CodeImp.DoomBuilder
|
|||
// This shows an image in a panel either zoomed or centered depending on size
|
||||
public static void DisplayZoomedImage(Panel panel, Image image)
|
||||
{
|
||||
// Set the image
|
||||
panel.BackgroundImage = image;
|
||||
|
||||
// Image not null?
|
||||
if(image != null)
|
||||
{
|
||||
// Small enough to fit in panel?
|
||||
if((image.Size.Width < panel.ClientRectangle.Width) &&
|
||||
(image.Size.Height < panel.ClientRectangle.Height))
|
||||
{
|
||||
// Display centered
|
||||
panel.BackgroundImageLayout = ImageLayout.Center;
|
||||
}
|
||||
else
|
||||
{
|
||||
// Display zoomed
|
||||
panel.BackgroundImageLayout = ImageLayout.Zoom;
|
||||
}
|
||||
// Set the image
|
||||
panel.BackgroundImage = image;
|
||||
|
||||
// Display zoomed
|
||||
panel.BackgroundImageLayout = ImageLayout.Zoom;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -413,6 +413,17 @@ namespace CodeImp.DoomBuilder {
|
|||
// Remove unused sectors
|
||||
map.RemoveUnusedSectors(true);
|
||||
|
||||
//mxd. Translate to long or short texture names.
|
||||
bool nameschanged = map.TranslateTextureNames(options.UseLongTextureNames, false);
|
||||
grid.TranslateBackgroundName(options.UseLongTextureNames);
|
||||
|
||||
//mxd. Sector textures may've been changed
|
||||
if (nameschanged)
|
||||
{
|
||||
data.UpdateUsedTextures();
|
||||
General.Map.IsChanged = true;
|
||||
}
|
||||
|
||||
// Update structures
|
||||
options.ApplyGridSettings();
|
||||
map.UpdateConfiguration();
|
||||
|
@ -445,8 +456,23 @@ namespace CodeImp.DoomBuilder {
|
|||
}
|
||||
|
||||
//mxd. This switches to another map in the same wad
|
||||
internal bool InitializeSwitchMap(MapOptions options)
|
||||
internal bool InitializeSwitchMap(MapOptions options)
|
||||
{
|
||||
bool uselongtexturenames = this.options.UseLongTextureNames;
|
||||
|
||||
// Does not compute! (we don't reload resources, so it can potentially
|
||||
// lead to texture lookup FIALS if there are non-WAD resources)
|
||||
if(uselongtexturenames != options.UseLongTextureNames &&
|
||||
MessageBox.Show(General.MainWindow,
|
||||
"Texture names in the map you are opening will be translated to "
|
||||
+ (uselongtexturenames ? "long" : "short") + " texture names."
|
||||
+ (!uselongtexturenames ? " This may lead to texture and flat name conflicts." : "")
|
||||
+ " Do you want to continue?",
|
||||
Application.ProductName, MessageBoxButtons.YesNo, MessageBoxIcon.Warning, MessageBoxDefaultButton.Button2) == DialogResult.No)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
this.changed = false;
|
||||
this.options = options;
|
||||
|
||||
|
@ -508,7 +534,16 @@ namespace CodeImp.DoomBuilder {
|
|||
|
||||
ChangeMapSet(newmap);
|
||||
|
||||
data.UpdateUsedTextures();
|
||||
//mxd. Translate texture names
|
||||
bool nameschanged = map.TranslateTextureNames(uselongtexturenames, false);
|
||||
grid.TranslateBackgroundName(uselongtexturenames);
|
||||
|
||||
//mxd. Sector textures may've been changed
|
||||
if (nameschanged)
|
||||
{
|
||||
data.UpdateUsedTextures();
|
||||
General.Map.IsChanged = true;
|
||||
}
|
||||
|
||||
//mxd. check script names
|
||||
UpdateScriptNames();
|
||||
|
@ -1875,7 +1910,7 @@ namespace CodeImp.DoomBuilder {
|
|||
foreach (Thing t in General.Map.Map.Things)
|
||||
for(int i = 0; i < t.Args.Length; i++) t.Args[i] = 0;
|
||||
}
|
||||
General.Map.Map.UpdateCustomLinedefColors();
|
||||
map.UpdateCustomLinedefColors();
|
||||
|
||||
// Update interface
|
||||
General.MainWindow.SetupInterface();
|
||||
|
@ -1886,6 +1921,17 @@ namespace CodeImp.DoomBuilder {
|
|||
ReloadResources();
|
||||
UpdateScriptNames(); //mxd
|
||||
|
||||
//mxd. Translate texture names
|
||||
bool nameschanged = map.TranslateTextureNames(options.UseLongTextureNames, false);
|
||||
grid.TranslateBackgroundName(options.UseLongTextureNames);
|
||||
|
||||
//mxd. Sector textures may've been changed
|
||||
if (nameschanged)
|
||||
{
|
||||
data.UpdateUsedTextures();
|
||||
General.Map.IsChanged = true;
|
||||
}
|
||||
|
||||
// Done
|
||||
General.MainWindow.DisplayReady();
|
||||
General.MainWindow.RedrawDisplay(); //mxd
|
||||
|
@ -1950,7 +1996,7 @@ namespace CodeImp.DoomBuilder {
|
|||
Cursor.Current = Cursors.AppStarting;
|
||||
|
||||
// Make undo for the snapping
|
||||
General.Map.UndoRedo.CreateUndo("Snap vertices");
|
||||
undoredo.CreateUndo("Snap vertices");
|
||||
|
||||
int snappedCount = 0;
|
||||
List<Vertex> movedVerts = new List<Vertex>();
|
||||
|
|
|
@ -29,6 +29,14 @@ namespace CodeImp.DoomBuilder.IO
|
|||
public Dictionary<string, bool> Flags;
|
||||
}
|
||||
|
||||
private bool uselongtexturenames; //mxd
|
||||
|
||||
#endregion
|
||||
|
||||
#region ================== Properties
|
||||
|
||||
public bool UseLongTextureNames { get { return uselongtexturenames; } } //mxd
|
||||
|
||||
#endregion
|
||||
|
||||
#region ================== Reading
|
||||
|
@ -38,6 +46,7 @@ namespace CodeImp.DoomBuilder.IO
|
|||
BinaryReader reader = new BinaryReader(stream);
|
||||
|
||||
// Read the map
|
||||
uselongtexturenames = reader.ReadBoolean(); //mxd
|
||||
Dictionary<int, Vertex> vertexlink = ReadVertices(map, reader);
|
||||
Dictionary<int, Sector> sectorlink = ReadSectors(map, reader);
|
||||
Dictionary<int, SidedefData> sidedeflink = ReadSidedefs(reader);
|
||||
|
|
|
@ -80,12 +80,12 @@ namespace CodeImp.DoomBuilder.IO
|
|||
|
||||
#region ================== Writing
|
||||
|
||||
public void Write(MapSet map, Stream stream) {
|
||||
Write(map.Vertices, map.Linedefs, map.Sidedefs, map.Sectors, map.Things, stream);
|
||||
public void Write(MapSet map, Stream stream, bool longtexturenames) {
|
||||
Write(map.Vertices, map.Linedefs, map.Sidedefs, map.Sectors, map.Things, stream, longtexturenames);
|
||||
}
|
||||
|
||||
public void Write(ICollection<Vertex> vertices, ICollection<Linedef> linedefs, ICollection<Sidedef> sidedefs,
|
||||
ICollection<Sector> sectors, ICollection<Thing> things, Stream stream) {
|
||||
ICollection<Sector> sectors, ICollection<Thing> things, Stream stream, bool longtexturenames) {
|
||||
// Create collections
|
||||
Dictionary<Vertex, int> vertexids = new Dictionary<Vertex, int>();
|
||||
Dictionary<Sidedef, int> sidedefids = new Dictionary<Sidedef, int>();
|
||||
|
@ -98,6 +98,7 @@ namespace CodeImp.DoomBuilder.IO
|
|||
|
||||
BinaryWriter writer = new BinaryWriter(stream);
|
||||
// Write the data structures to stream
|
||||
writer.Write(longtexturenames); //mxd
|
||||
WriteVertices(vertices, writer);
|
||||
WriteSectors(sectors, writer);
|
||||
WriteSidedefs(sidedefs, writer, sectorids);
|
||||
|
|
|
@ -19,6 +19,7 @@
|
|||
using System;
|
||||
using System.Text;
|
||||
using System.IO;
|
||||
using CodeImp.DoomBuilder.Data;
|
||||
|
||||
#endregion
|
||||
|
||||
|
@ -107,7 +108,7 @@ namespace CodeImp.DoomBuilder.IO
|
|||
#region ================== Methods
|
||||
|
||||
// This returns the long value for a 8 byte texture name
|
||||
public static unsafe long MakeLongName(string name)
|
||||
/*public static unsafe long MakeLongName(string name)
|
||||
{
|
||||
long value = 0;
|
||||
byte[] namebytes = Encoding.ASCII.GetBytes(name.Trim().ToUpper());
|
||||
|
@ -120,6 +121,17 @@ namespace CodeImp.DoomBuilder.IO
|
|||
}
|
||||
|
||||
return value;
|
||||
}*/
|
||||
|
||||
//mxd. This returns (hopefully) unique hash value for a texture name of any length
|
||||
public static long MakeLongName(string name)
|
||||
{
|
||||
name = name.Trim().ToUpper();
|
||||
if(name.Length > DataManager.CLASIC_IMAGE_NAME_LENGTH && General.Map != null && General.Map.Options != null && !General.Map.Options.UseLongTextureNames)
|
||||
{
|
||||
name = name.Substring(0, DataManager.CLASIC_IMAGE_NAME_LENGTH);
|
||||
}
|
||||
return MurmurHash2.Hash(name);
|
||||
}
|
||||
|
||||
// This makes the normal name from fixed name
|
||||
|
|
|
@ -392,7 +392,7 @@ namespace CodeImp.DoomBuilder.IO
|
|||
// Add it to struct
|
||||
UniversalEntry entry = new UniversalEntry(key.ToString().Trim().ToLowerInvariant(), ival);
|
||||
cs.Add(entry);
|
||||
matches.Add(data[line], entry);
|
||||
if(!matches.ContainsKey(data[line])) matches.Add(data[line], entry);
|
||||
}
|
||||
catch(OverflowException)
|
||||
{
|
||||
|
@ -405,7 +405,7 @@ namespace CodeImp.DoomBuilder.IO
|
|||
// Add it to struct
|
||||
UniversalEntry entry = new UniversalEntry(key.ToString().Trim().ToLowerInvariant(), lval);
|
||||
cs.Add(entry);
|
||||
matches.Add(data[line], entry);
|
||||
if(!matches.ContainsKey(data[line])) matches.Add(data[line], entry);
|
||||
}
|
||||
catch(OverflowException)
|
||||
{
|
||||
|
@ -440,7 +440,7 @@ namespace CodeImp.DoomBuilder.IO
|
|||
// Add it to struct
|
||||
UniversalEntry entry = new UniversalEntry(key.ToString().Trim().ToLowerInvariant(), fval);
|
||||
cs.Add(entry);
|
||||
matches.Add(data[line], entry);
|
||||
if(!matches.ContainsKey(data[line])) matches.Add(data[line], entry);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -453,7 +453,7 @@ namespace CodeImp.DoomBuilder.IO
|
|||
// Add it to struct
|
||||
UniversalEntry entry = new UniversalEntry(key.ToString().Trim().ToLowerInvariant(), ival);
|
||||
cs.Add(entry);
|
||||
matches.Add(data[line], entry);
|
||||
if(!matches.ContainsKey(data[line])) matches.Add(data[line], entry);
|
||||
}
|
||||
catch(OverflowException)
|
||||
{
|
||||
|
@ -466,7 +466,7 @@ namespace CodeImp.DoomBuilder.IO
|
|||
// Add it to struct
|
||||
UniversalEntry entry = new UniversalEntry(key.ToString().Trim().ToLowerInvariant(), lval);
|
||||
cs.Add(entry);
|
||||
matches.Add(data[line], entry);
|
||||
if(!matches.ContainsKey(data[line])) matches.Add(data[line], entry);
|
||||
}
|
||||
catch(OverflowException)
|
||||
{
|
||||
|
@ -574,7 +574,7 @@ namespace CodeImp.DoomBuilder.IO
|
|||
// Add string to struct
|
||||
UniversalEntry entry = new UniversalEntry(key.ToString().Trim().ToLowerInvariant(), val.ToString());
|
||||
cs.Add(entry);
|
||||
matches.Add(data[line], entry);
|
||||
if(!matches.ContainsKey(data[line])) matches.Add(data[line], entry);
|
||||
|
||||
// End of assignment
|
||||
pm = PM_ASSIGNMENT;
|
||||
|
@ -611,14 +611,14 @@ namespace CodeImp.DoomBuilder.IO
|
|||
// Add boolean true
|
||||
UniversalEntry t = new UniversalEntry(key.ToString().Trim().ToLowerInvariant(), true);
|
||||
cs.Add(t);
|
||||
matches.Add(data[line], t);
|
||||
if(!matches.ContainsKey(data[line])) matches.Add(data[line], t);
|
||||
break;
|
||||
|
||||
case "false":
|
||||
// Add boolean false
|
||||
UniversalEntry f = new UniversalEntry(key.ToString().Trim().ToLowerInvariant(), false);
|
||||
cs.Add(f);
|
||||
matches.Add(data[line], f);
|
||||
if(!matches.ContainsKey(data[line])) matches.Add(data[line], f);
|
||||
break;
|
||||
|
||||
default:
|
||||
|
|
|
@ -133,13 +133,13 @@ namespace CodeImp.DoomBuilder.IO
|
|||
public MapSet Read(MapSet map, Stream stream)
|
||||
{
|
||||
StreamReader reader = new StreamReader(stream, Encoding.ASCII);
|
||||
Dictionary<int, Vertex> vertexlink;
|
||||
Dictionary<int, Sector> sectorlink;
|
||||
UniversalParser textmap = new UniversalParser();
|
||||
textmap.StrictChecking = strictchecking;
|
||||
|
||||
#if !DEBUG
|
||||
try
|
||||
{
|
||||
#endif
|
||||
// Read UDMF from stream
|
||||
List<string> data = new List<string>(100);
|
||||
while(!reader.EndOfStream)
|
||||
|
@ -160,16 +160,18 @@ namespace CodeImp.DoomBuilder.IO
|
|||
else
|
||||
{
|
||||
// Read the map
|
||||
vertexlink = ReadVertices(map, textmap);
|
||||
sectorlink = ReadSectors(map, textmap);
|
||||
Dictionary<int, Vertex> vertexlink = ReadVertices(map, textmap);
|
||||
Dictionary<int, Sector> sectorlink = ReadSectors(map, textmap);
|
||||
ReadLinedefs(map, textmap, vertexlink, sectorlink);
|
||||
ReadThings(map, textmap);
|
||||
}
|
||||
#if !DEBUG
|
||||
}
|
||||
catch(Exception e)
|
||||
{
|
||||
General.ShowErrorMessage("Unexpected error reading UDMF map data. " + e.GetType().Name + ": " + e.Message, MessageBoxButtons.OK);
|
||||
}
|
||||
#endif
|
||||
|
||||
return map;
|
||||
}
|
||||
|
@ -326,12 +328,12 @@ namespace CodeImp.DoomBuilder.IO
|
|||
{
|
||||
// Read fields
|
||||
string where = "linedef " + ld.Index + (front ? " front sidedef " : " back sidedef ") + index;
|
||||
int offsetx = GetCollectionEntry<int>(sc, "offsetx", false, 0, where);
|
||||
int offsety = GetCollectionEntry<int>(sc, "offsety", false, 0, where);
|
||||
string thigh = GetCollectionEntry<string>(sc, "texturetop", false, "-", where);
|
||||
string tlow = GetCollectionEntry<string>(sc, "texturebottom", false, "-", where);
|
||||
string tmid = GetCollectionEntry<string>(sc, "texturemiddle", false, "-", where);
|
||||
int sector = GetCollectionEntry<int>(sc, "sector", true, 0, where);
|
||||
int offsetx = GetCollectionEntry(sc, "offsetx", false, 0, where);
|
||||
int offsety = GetCollectionEntry(sc, "offsety", false, 0, where);
|
||||
string thigh = GetCollectionEntry(sc, "texturetop", false, "-", where);
|
||||
string tlow = GetCollectionEntry(sc, "texturebottom", false, "-", where);
|
||||
string tmid = GetCollectionEntry(sc, "texturemiddle", false, "-", where);
|
||||
int sector = GetCollectionEntry(sc, "sector", true, 0, where);
|
||||
|
||||
//mxd. Flags
|
||||
Dictionary<string, bool> stringflags = new Dictionary<string, bool>(StringComparer.Ordinal);
|
||||
|
@ -359,13 +361,11 @@ namespace CodeImp.DoomBuilder.IO
|
|||
// This reads the sectors
|
||||
private Dictionary<int, Sector> ReadSectors(MapSet map, UniversalParser textmap)
|
||||
{
|
||||
Dictionary<int, Sector> link;
|
||||
|
||||
// Get list of entries
|
||||
List<UniversalCollection> collections = GetNamedCollections(textmap.Root, "sector");
|
||||
|
||||
// Create lookup table
|
||||
link = new Dictionary<int, Sector>(collections.Count);
|
||||
Dictionary<int, Sector> link = new Dictionary<int, Sector>(collections.Count);
|
||||
|
||||
// Go for all collections
|
||||
map.SetCapacity(0, 0, 0, map.Sectors.Count + collections.Count, 0);
|
||||
|
@ -419,13 +419,11 @@ namespace CodeImp.DoomBuilder.IO
|
|||
// This reads the vertices
|
||||
private Dictionary<int, Vertex> ReadVertices(MapSet map, UniversalParser textmap)
|
||||
{
|
||||
Dictionary<int, Vertex> link;
|
||||
|
||||
// Get list of entries
|
||||
List<UniversalCollection> collections = GetNamedCollections(textmap.Root, "vertex");
|
||||
|
||||
// Create lookup table
|
||||
link = new Dictionary<int, Vertex>(collections.Count);
|
||||
Dictionary<int, Vertex> link = new Dictionary<int, Vertex>(collections.Count);
|
||||
|
||||
// Go for all collections
|
||||
map.SetCapacity(map.Vertices.Count + collections.Count, 0, 0, 0, 0);
|
||||
|
|
|
@ -79,6 +79,8 @@ namespace CodeImp.DoomBuilder.Map
|
|||
private bool overridefloorheight;
|
||||
private bool overrideceilheight;
|
||||
private bool overridebrightness;
|
||||
|
||||
private bool uselongtexturenames; //mxd
|
||||
|
||||
#endregion
|
||||
|
||||
|
@ -129,6 +131,8 @@ namespace CodeImp.DoomBuilder.Map
|
|||
public bool OverrideFloorHeight { get { return overridefloorheight; } set { overridefloorheight = value; } }
|
||||
public bool OverrideCeilingHeight { get { return overrideceilheight; } set { overrideceilheight = value; } }
|
||||
public bool OverrideBrightness { get { return overridebrightness; } set { overridebrightness = value; } }
|
||||
|
||||
public bool UseLongTextureNames { get { return uselongtexturenames; } set { uselongtexturenames = value; } } //mxd
|
||||
|
||||
#endregion
|
||||
|
||||
|
@ -211,6 +215,8 @@ namespace CodeImp.DoomBuilder.Map
|
|||
overrideceilheight = this.mapconfig.ReadSetting("overrideceilheight", false);
|
||||
overridebrightness = this.mapconfig.ReadSetting("overridebrightness", false);
|
||||
|
||||
uselongtexturenames = this.mapconfig.ReadSetting("uselongtexturenames", false); //mxd
|
||||
|
||||
// Resources
|
||||
IDictionary reslist = this.mapconfig.ReadSetting("resources", new Hashtable());
|
||||
foreach(DictionaryEntry mp in reslist)
|
||||
|
@ -295,11 +301,13 @@ namespace CodeImp.DoomBuilder.Map
|
|||
General.Map.Map.WriteSelectionGroups(mapconfig);
|
||||
|
||||
//mxd. Save Tag Labels
|
||||
if(tagLabels.Count > 0) {
|
||||
if(tagLabels.Count > 0)
|
||||
{
|
||||
ListDictionary tagLabelsData = new ListDictionary();
|
||||
int counter = 1;
|
||||
|
||||
foreach(KeyValuePair<int, string> group in tagLabels){
|
||||
foreach(KeyValuePair<int, string> group in tagLabels)
|
||||
{
|
||||
ListDictionary data = new ListDictionary();
|
||||
data.Add("tag", group.Key);
|
||||
data.Add("label", group.Value);
|
||||
|
@ -330,6 +338,8 @@ namespace CodeImp.DoomBuilder.Map
|
|||
mapconfig.WriteSetting("overrideceilheight", overrideceilheight);
|
||||
mapconfig.WriteSetting("overridebrightness", overridebrightness);
|
||||
|
||||
mapconfig.WriteSetting("uselongtexturenames", uselongtexturenames); //mxd
|
||||
|
||||
//mxd. Write script compiler
|
||||
if(!string.IsNullOrEmpty(scriptcompiler))
|
||||
mapconfig.WriteSetting("scriptcompiler", scriptcompiler);
|
||||
|
@ -416,7 +426,7 @@ namespace CodeImp.DoomBuilder.Map
|
|||
// This loads the grid settings
|
||||
internal void ApplyGridSettings()
|
||||
{
|
||||
General.Map.Grid.ReadFromConfig(mapconfig, "grid");
|
||||
General.Map.Grid.ReadFromConfig(mapconfig, "grid", uselongtexturenames);
|
||||
}
|
||||
|
||||
//mxd. This reads stored selection groups from the map configuration
|
||||
|
|
|
@ -28,6 +28,7 @@ using CodeImp.DoomBuilder.IO;
|
|||
using CodeImp.DoomBuilder.Types;
|
||||
using CodeImp.DoomBuilder.Windows;
|
||||
using CodeImp.DoomBuilder.VisualModes;
|
||||
using CodeImp.DoomBuilder.Data;
|
||||
|
||||
#endregion
|
||||
|
||||
|
@ -3204,6 +3205,151 @@ namespace CodeImp.DoomBuilder.Map
|
|||
foreach(Thing t in things) if(t.Marked) t.TranslateFromUDMF();
|
||||
}
|
||||
|
||||
//mxd
|
||||
internal bool TranslateTextureNames(bool uselongnames, bool markedonly)
|
||||
{
|
||||
if (markedonly)
|
||||
{
|
||||
List<Sector> markedsectors = GetMarkedSectors(true);
|
||||
List<Sidedef> markedsides = GetMarkedSidedefs(true);
|
||||
if(uselongnames) return TranslateToLongTextureNames(markedsectors, markedsides);
|
||||
return TranslateToShortTextureNames(markedsectors, markedsides);
|
||||
}
|
||||
else
|
||||
{
|
||||
if(uselongnames) return TranslateToLongTextureNames(sectors, sidedefs);
|
||||
return TranslateToShortTextureNames(sectors, sidedefs);
|
||||
}
|
||||
}
|
||||
|
||||
//mxd
|
||||
private bool TranslateToLongTextureNames(IEnumerable<Sector> sectors, IEnumerable<Sidedef> sidedefs)
|
||||
{
|
||||
bool changed = false;
|
||||
|
||||
foreach (Sector s in sectors)
|
||||
{
|
||||
if (s.FloorTexture != "-")
|
||||
{
|
||||
string ft = General.Map.Data.GetFullFlatName(s.FloorTexture);
|
||||
if (ft != s.FloorTexture)
|
||||
{
|
||||
s.SetFloorTexture(ft);
|
||||
changed = true;
|
||||
}
|
||||
}
|
||||
if (s.CeilTexture != "-")
|
||||
{
|
||||
string ct = General.Map.Data.GetFullFlatName(s.CeilTexture);
|
||||
if (ct != s.CeilTexture)
|
||||
{
|
||||
s.SetCeilTexture(ct);
|
||||
changed = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
foreach (Sidedef s in sidedefs)
|
||||
{
|
||||
if (s.HighTexture != "-")
|
||||
{
|
||||
string ht = General.Map.Data.GetFullTextureName(s.HighTexture);
|
||||
if (ht != s.HighTexture)
|
||||
{
|
||||
s.SetTextureHigh(ht);
|
||||
changed = true;
|
||||
}
|
||||
}
|
||||
if (s.MiddleTexture != "-")
|
||||
{
|
||||
string mt = General.Map.Data.GetFullTextureName(s.MiddleTexture);
|
||||
if (mt != s.MiddleTexture)
|
||||
{
|
||||
s.SetTextureMid(mt);
|
||||
changed = true;
|
||||
}
|
||||
}
|
||||
if (s.LowTexture != "-")
|
||||
{
|
||||
string lt = General.Map.Data.GetFullTextureName(s.LowTexture);
|
||||
if (lt != s.LowTexture)
|
||||
{
|
||||
s.SetTextureLow(lt);
|
||||
changed = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return changed;
|
||||
}
|
||||
|
||||
private bool TranslateToShortTextureNames(IEnumerable<Sector> sectors, IEnumerable<Sidedef> sidedefs)
|
||||
{
|
||||
bool changed = false;
|
||||
|
||||
foreach(Sector s in sectors)
|
||||
{
|
||||
if(s.FloorTexture != "-")
|
||||
{
|
||||
string ft = GetShortTextureName(s.FloorTexture);
|
||||
if (ft != s.FloorTexture)
|
||||
{
|
||||
s.SetFloorTexture(ft);
|
||||
changed = true;
|
||||
}
|
||||
}
|
||||
if(s.CeilTexture != "-")
|
||||
{
|
||||
string ct = GetShortTextureName(s.CeilTexture);
|
||||
if (ct != s.CeilTexture)
|
||||
{
|
||||
s.SetCeilTexture(ct);
|
||||
changed = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
foreach(Sidedef s in sidedefs)
|
||||
{
|
||||
if(s.HighTexture != "-")
|
||||
{
|
||||
string ht = GetShortTextureName(s.HighTexture);
|
||||
if (ht != s.HighTexture)
|
||||
{
|
||||
s.SetTextureHigh(ht);
|
||||
changed = true;
|
||||
}
|
||||
}
|
||||
if(s.MiddleTexture != "-")
|
||||
{
|
||||
string mt = GetShortTextureName(s.MiddleTexture);
|
||||
if (mt != s.MiddleTexture)
|
||||
{
|
||||
s.SetTextureMid(mt);
|
||||
changed = true;
|
||||
}
|
||||
}
|
||||
if(s.LowTexture != "-")
|
||||
{
|
||||
string lt = GetShortTextureName(s.LowTexture);
|
||||
if (lt != s.LowTexture)
|
||||
{
|
||||
s.SetTextureLow(lt);
|
||||
changed = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return changed;
|
||||
}
|
||||
|
||||
internal static string GetShortTextureName(string name)
|
||||
{
|
||||
string shortname = Path.GetFileNameWithoutExtension(name).ToUpperInvariant();
|
||||
if (shortname.Length > DataManager.CLASIC_IMAGE_NAME_LENGTH) shortname = shortname.Substring(0, DataManager.CLASIC_IMAGE_NAME_LENGTH);
|
||||
return shortname;
|
||||
}
|
||||
|
||||
/// <summary>This removes unused vertices.</summary>
|
||||
public void RemoveUnusedVertices()
|
||||
{
|
||||
|
|
|
@ -11,7 +11,8 @@ namespace CodeImp.DoomBuilder.Windows
|
|||
{
|
||||
public partial class ChangeMapForm : DelayedForm
|
||||
{
|
||||
private readonly MapOptions options;
|
||||
private MapOptions options;
|
||||
private Configuration mapsettings;
|
||||
private readonly string filepathname;
|
||||
|
||||
public MapOptions Options { get { return options; } }
|
||||
|
@ -58,19 +59,36 @@ namespace CodeImp.DoomBuilder.Windows
|
|||
// Make an array for the map names
|
||||
List<ListViewItem> mapnames = new List<ListViewItem>();
|
||||
|
||||
// Open the Map Settings configuration
|
||||
string dbsfile = filepathname.Substring(0, filepathname.Length - 4) + ".dbs";
|
||||
if (File.Exists(dbsfile))
|
||||
{
|
||||
try
|
||||
{
|
||||
mapsettings = new Configuration(dbsfile, true);
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
mapsettings = new Configuration(true);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
mapsettings = new Configuration(true);
|
||||
}
|
||||
|
||||
//mxd. Get Proper configuration
|
||||
ConfigurationInfo ci = General.GetConfigurationInfo(options.ConfigFile);
|
||||
Configuration cfg = ci.Configuration;
|
||||
|
||||
|
||||
// Get the map lump names
|
||||
IDictionary maplumpnames = cfg.ReadSetting("maplumpnames", new Hashtable());
|
||||
IDictionary maplumpnames = ci.Configuration.ReadSetting("maplumpnames", new Hashtable());
|
||||
|
||||
// Count how many required lumps we have to find
|
||||
foreach(DictionaryEntry ml in maplumpnames) {
|
||||
// Ignore the map header (it will not be found because the name is different)
|
||||
if(ml.Key.ToString() != MapManager.CONFIG_MAP_HEADER) {
|
||||
// Read lump setting and count it
|
||||
if(cfg.ReadSetting("maplumpnames." + ml.Key + ".required", false))
|
||||
if(ci.Configuration.ReadSetting("maplumpnames." + ml.Key + ".required", false))
|
||||
lumpsrequired++;
|
||||
}
|
||||
}
|
||||
|
@ -88,7 +106,7 @@ namespace CodeImp.DoomBuilder.Windows
|
|||
maplumpnames.Contains(wadfile.Lumps[scanindex + checkoffset].Name)) {
|
||||
// Count the lump when it is marked as required
|
||||
lumpname = wadfile.Lumps[scanindex + checkoffset].Name;
|
||||
if(cfg.ReadSetting("maplumpnames." + lumpname + ".required", false))
|
||||
if(ci.Configuration.ReadSetting("maplumpnames." + lumpname + ".required", false))
|
||||
lumpsfound++;
|
||||
|
||||
// Check the next lump
|
||||
|
@ -147,9 +165,9 @@ namespace CodeImp.DoomBuilder.Windows
|
|||
General.ShowWarningMessage("Map '" + options.LevelName + "' is already loaded!", MessageBoxButtons.OK);
|
||||
return;
|
||||
}
|
||||
|
||||
options.CurrentName = mapslist.SelectedItems[0].Text;
|
||||
options.PreviousName = string.Empty;
|
||||
|
||||
// Create new map options
|
||||
options = new MapOptions(mapsettings, mapslist.SelectedItems[0].Text);
|
||||
|
||||
// Hide window
|
||||
this.DialogResult = DialogResult.OK;
|
||||
|
|
|
@ -18,6 +18,7 @@
|
|||
|
||||
using System;
|
||||
using System.Drawing;
|
||||
using System.IO;
|
||||
using System.Windows.Forms;
|
||||
using CodeImp.DoomBuilder.Data;
|
||||
using CodeImp.DoomBuilder.Editing;
|
||||
|
@ -84,10 +85,8 @@ namespace CodeImp.DoomBuilder.Windows
|
|||
// Browse texture
|
||||
private void selecttexture_Click(object sender, EventArgs e)
|
||||
{
|
||||
string result;
|
||||
|
||||
// Browse for texture
|
||||
result = TextureBrowserForm.Browse(this, backgroundname, false);
|
||||
string result = TextureBrowserForm.Browse(this, backgroundname, false);
|
||||
if(result != null)
|
||||
{
|
||||
// Set this texture as background
|
||||
|
@ -102,10 +101,8 @@ namespace CodeImp.DoomBuilder.Windows
|
|||
// Browse flat
|
||||
private void selectflat_Click(object sender, EventArgs e)
|
||||
{
|
||||
string result;
|
||||
|
||||
// Browse for flat
|
||||
result = TextureBrowserForm.Browse(this, backgroundname, true); //mxd. was FlatBrowserForm
|
||||
string result = TextureBrowserForm.Browse(this, backgroundname, true);
|
||||
if(result != null)
|
||||
{
|
||||
// Set this flat as background
|
||||
|
@ -126,7 +123,7 @@ namespace CodeImp.DoomBuilder.Windows
|
|||
// Set this file as background
|
||||
backgroundname = browsefile.FileName;
|
||||
backgroundsource = GridSetup.SOURCE_FILE;
|
||||
ImageData img = new FileImage(backgroundname, backgroundname, false, 1.0f, 1.0f);
|
||||
ImageData img = new FileImage(Path.GetFileNameWithoutExtension(backgroundname), backgroundname, false, 1.0f, 1.0f);
|
||||
img.LoadImage();
|
||||
General.DisplayZoomedImage(backgroundimage, new Bitmap(img.GetBitmap()));
|
||||
img.Dispose();
|
||||
|
|
9
Source/Core/Windows/LinedefEditForm.Designer.cs
generated
9
Source/Core/Windows/LinedefEditForm.Designer.cs
generated
|
@ -451,12 +451,12 @@ namespace CodeImp.DoomBuilder.Windows
|
|||
this.frontgroup.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
|
||||
| System.Windows.Forms.AnchorStyles.Right)));
|
||||
this.frontgroup.Controls.Add(this.frontside);
|
||||
this.frontgroup.Controls.Add(this.frontTextureOffset);
|
||||
this.frontgroup.Controls.Add(this.frontsector);
|
||||
this.frontgroup.Controls.Add(label11);
|
||||
this.frontgroup.Controls.Add(this.frontlow);
|
||||
this.frontgroup.Controls.Add(this.frontmid);
|
||||
this.frontgroup.Controls.Add(this.fronthigh);
|
||||
this.frontgroup.Controls.Add(this.frontTextureOffset);
|
||||
this.frontgroup.Controls.Add(label5);
|
||||
this.frontgroup.Controls.Add(label4);
|
||||
this.frontgroup.Controls.Add(label3);
|
||||
|
@ -475,7 +475,7 @@ namespace CodeImp.DoomBuilder.Windows
|
|||
this.frontTextureOffset.Label = "Texture Offset:";
|
||||
this.frontTextureOffset.Location = new System.Drawing.Point(3, 65);
|
||||
this.frontTextureOffset.Name = "frontTextureOffset";
|
||||
this.frontTextureOffset.Size = new System.Drawing.Size(247, 26);
|
||||
this.frontTextureOffset.Size = new System.Drawing.Size(268, 26);
|
||||
this.frontTextureOffset.TabIndex = 41;
|
||||
this.frontTextureOffset.OnValuesChanged += new System.EventHandler(this.frontTextureOffset_OnValuesChanged);
|
||||
//
|
||||
|
@ -541,13 +541,13 @@ namespace CodeImp.DoomBuilder.Windows
|
|||
//
|
||||
this.backgroup.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
|
||||
| System.Windows.Forms.AnchorStyles.Right)));
|
||||
this.backgroup.Controls.Add(this.backTextureOffset);
|
||||
this.backgroup.Controls.Add(this.backside);
|
||||
this.backgroup.Controls.Add(this.backsector);
|
||||
this.backgroup.Controls.Add(label12);
|
||||
this.backgroup.Controls.Add(this.backlow);
|
||||
this.backgroup.Controls.Add(this.backmid);
|
||||
this.backgroup.Controls.Add(this.backhigh);
|
||||
this.backgroup.Controls.Add(this.backTextureOffset);
|
||||
this.backgroup.Controls.Add(label8);
|
||||
this.backgroup.Controls.Add(label9);
|
||||
this.backgroup.Controls.Add(label10);
|
||||
|
@ -566,7 +566,7 @@ namespace CodeImp.DoomBuilder.Windows
|
|||
this.backTextureOffset.Label = "Texture Offset:";
|
||||
this.backTextureOffset.Location = new System.Drawing.Point(3, 65);
|
||||
this.backTextureOffset.Name = "backTextureOffset";
|
||||
this.backTextureOffset.Size = new System.Drawing.Size(247, 28);
|
||||
this.backTextureOffset.Size = new System.Drawing.Size(268, 28);
|
||||
this.backTextureOffset.TabIndex = 42;
|
||||
this.backTextureOffset.OnValuesChanged += new System.EventHandler(this.backTextureOffset_OnValuesChanged);
|
||||
//
|
||||
|
@ -648,7 +648,6 @@ namespace CodeImp.DoomBuilder.Windows
|
|||
this.MaximizeBox = false;
|
||||
this.MinimizeBox = false;
|
||||
this.Name = "LinedefEditForm";
|
||||
this.Opacity = 0;
|
||||
this.ShowIcon = false;
|
||||
this.ShowInTaskbar = false;
|
||||
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent;
|
||||
|
|
1070
Source/Core/Windows/LinedefEditFormUDMF.Designer.cs
generated
1070
Source/Core/Windows/LinedefEditFormUDMF.Designer.cs
generated
File diff suppressed because it is too large
Load diff
|
@ -69,8 +69,6 @@ namespace CodeImp.DoomBuilder.Windows
|
|||
//mxd. Window setup stuff
|
||||
private static Point location = Point.Empty;
|
||||
private static int activeTab;
|
||||
private static int activeFrontTab;
|
||||
private static int activeBackTab;
|
||||
|
||||
private struct LinedefProperties //mxd
|
||||
{
|
||||
|
@ -173,8 +171,6 @@ namespace CodeImp.DoomBuilder.Windows
|
|||
{
|
||||
activeTab = 0;
|
||||
}
|
||||
if(activeFrontTab > 0) udmfPropertiesFront.SelectTab(activeFrontTab);
|
||||
if(activeBackTab > 0) udmfPropertiesBack.SelectTab(activeBackTab);
|
||||
}
|
||||
|
||||
// Fill flags lists
|
||||
|
@ -278,8 +274,16 @@ namespace CodeImp.DoomBuilder.Windows
|
|||
labelLightBack.Visible = false;
|
||||
lightBack.Visible = false;
|
||||
cbLightAbsoluteBack.Visible = false;
|
||||
udmfPropertiesFront.Visible = false;
|
||||
udmfPropertiesBack.Visible = false;
|
||||
frontflagsgroup.Enabled = false;
|
||||
backflagsgroup.Enabled = false;
|
||||
frontscalegroup.Enabled = false;
|
||||
backscalegroup.Enabled = false;
|
||||
pfcFrontOffsetTop.Enabled = false;
|
||||
pfcFrontOffsetMid.Enabled = false;
|
||||
pfcFrontOffsetBottom.Enabled = false;
|
||||
pfcBackOffsetTop.Enabled = false;
|
||||
pfcBackOffsetMid.Enabled = false;
|
||||
pfcBackOffsetBottom.Enabled = false;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -925,6 +929,7 @@ namespace CodeImp.DoomBuilder.Windows
|
|||
// Enable/disable panel
|
||||
// NOTE: Also enabled when checkbox is grayed!
|
||||
frontgroup.Enabled = (frontside.CheckState != CheckState.Unchecked);
|
||||
tabfront.ImageIndex = (frontside.CheckState == CheckState.Unchecked ? 1 : 0);
|
||||
}
|
||||
|
||||
// Back side (un)checked
|
||||
|
@ -933,6 +938,7 @@ namespace CodeImp.DoomBuilder.Windows
|
|||
// Enable/disable panel
|
||||
// NOTE: Also enabled when checkbox is grayed!
|
||||
backgroup.Enabled = (backside.CheckState != CheckState.Unchecked);
|
||||
tabback.ImageIndex = (backside.CheckState == CheckState.Unchecked ? 1 : 0);
|
||||
}
|
||||
|
||||
// Action changes
|
||||
|
@ -1020,8 +1026,6 @@ namespace CodeImp.DoomBuilder.Windows
|
|||
{
|
||||
location = this.Location;
|
||||
activeTab = tabs.SelectedIndex;
|
||||
activeFrontTab = udmfPropertiesFront.SelectedIndex;
|
||||
activeBackTab = udmfPropertiesBack.SelectedIndex;
|
||||
}
|
||||
|
||||
// Help!
|
||||
|
|
|
@ -123,42 +123,6 @@
|
|||
<metadata name="label2.GenerateMember" type="System.Boolean, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>False</value>
|
||||
</metadata>
|
||||
<metadata name="label3.Locked" type="System.Boolean, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>True</value>
|
||||
</metadata>
|
||||
<metadata name="label3.GenerateMember" type="System.Boolean, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>False</value>
|
||||
</metadata>
|
||||
<metadata name="label4.Locked" type="System.Boolean, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>True</value>
|
||||
</metadata>
|
||||
<metadata name="label4.GenerateMember" type="System.Boolean, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>False</value>
|
||||
</metadata>
|
||||
<metadata name="label5.Locked" type="System.Boolean, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>True</value>
|
||||
</metadata>
|
||||
<metadata name="label5.GenerateMember" type="System.Boolean, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>False</value>
|
||||
</metadata>
|
||||
<metadata name="label8.Locked" type="System.Boolean, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>True</value>
|
||||
</metadata>
|
||||
<metadata name="label8.GenerateMember" type="System.Boolean, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>False</value>
|
||||
</metadata>
|
||||
<metadata name="label9.Locked" type="System.Boolean, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>True</value>
|
||||
</metadata>
|
||||
<metadata name="label9.GenerateMember" type="System.Boolean, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>False</value>
|
||||
</metadata>
|
||||
<metadata name="label10.Locked" type="System.Boolean, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>True</value>
|
||||
</metadata>
|
||||
<metadata name="label10.GenerateMember" type="System.Boolean, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>False</value>
|
||||
</metadata>
|
||||
<metadata name="label11.GenerateMember" type="System.Boolean, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>False</value>
|
||||
</metadata>
|
||||
|
@ -183,31 +147,55 @@
|
|||
<metadata name="tooltip.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
|
||||
<value>17, 17</value>
|
||||
</metadata>
|
||||
<metadata name="frontside.Locked" type="System.Boolean, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>True</value>
|
||||
</metadata>
|
||||
<metadata name="frontlow.Locked" type="System.Boolean, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>True</value>
|
||||
</metadata>
|
||||
<metadata name="frontmid.Locked" type="System.Boolean, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>True</value>
|
||||
</metadata>
|
||||
<metadata name="fronthigh.Locked" type="System.Boolean, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>True</value>
|
||||
</metadata>
|
||||
<metadata name="backside.Locked" type="System.Boolean, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>True</value>
|
||||
</metadata>
|
||||
<metadata name="backlow.Locked" type="System.Boolean, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>True</value>
|
||||
</metadata>
|
||||
<metadata name="backmid.Locked" type="System.Boolean, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>True</value>
|
||||
</metadata>
|
||||
<metadata name="backhigh.Locked" type="System.Boolean, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>True</value>
|
||||
</metadata>
|
||||
<metadata name="tabcustom.Locked" type="System.Boolean, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>True</value>
|
||||
</metadata>
|
||||
<metadata name="imagelist.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
|
||||
<value>105, 17</value>
|
||||
</metadata>
|
||||
<data name="imagelist.ImageStream" mimetype="application/x-microsoft.net.object.binary.base64">
|
||||
<value>
|
||||
AAEAAAD/////AQAAAAAAAAAMAgAAAFdTeXN0ZW0uV2luZG93cy5Gb3JtcywgVmVyc2lvbj0yLjAuMC4w
|
||||
LCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPWI3N2E1YzU2MTkzNGUwODkFAQAAACZTeXN0
|
||||
ZW0uV2luZG93cy5Gb3Jtcy5JbWFnZUxpc3RTdHJlYW1lcgEAAAAERGF0YQcCAgAAAAkDAAAADwMAAADM
|
||||
CAAAAk1TRnQBSQFMAgEBAgEAARgBAAEYAQABEAEAARABAAT/AQkBAAj/AUIBTQE2AQQGAAE2AQQCAAEo
|
||||
AwABQAMAARADAAEBAQABCAYAAQQYAAGAAgABgAMAAoABAAGAAwABgAEAAYABAAKAAgADwAEAAcAB3AHA
|
||||
AQAB8AHKAaYBAAEzBQABMwEAATMBAAEzAQACMwIAAxYBAAMcAQADIgEAAykBAANVAQADTQEAA0IBAAM5
|
||||
AQABgAF8Af8BAAJQAf8BAAGTAQAB1gEAAf8B7AHMAQABxgHWAe8BAAHWAucBAAGQAakBrQIAAf8BMwMA
|
||||
AWYDAAGZAwABzAIAATMDAAIzAgABMwFmAgABMwGZAgABMwHMAgABMwH/AgABZgMAAWYBMwIAAmYCAAFm
|
||||
AZkCAAFmAcwCAAFmAf8CAAGZAwABmQEzAgABmQFmAgACmQIAAZkBzAIAAZkB/wIAAcwDAAHMATMCAAHM
|
||||
AWYCAAHMAZkCAALMAgABzAH/AgAB/wFmAgAB/wGZAgAB/wHMAQABMwH/AgAB/wEAATMBAAEzAQABZgEA
|
||||
ATMBAAGZAQABMwEAAcwBAAEzAQAB/wEAAf8BMwIAAzMBAAIzAWYBAAIzAZkBAAIzAcwBAAIzAf8BAAEz
|
||||
AWYCAAEzAWYBMwEAATMCZgEAATMBZgGZAQABMwFmAcwBAAEzAWYB/wEAATMBmQIAATMBmQEzAQABMwGZ
|
||||
AWYBAAEzApkBAAEzAZkBzAEAATMBmQH/AQABMwHMAgABMwHMATMBAAEzAcwBZgEAATMBzAGZAQABMwLM
|
||||
AQABMwHMAf8BAAEzAf8BMwEAATMB/wFmAQABMwH/AZkBAAEzAf8BzAEAATMC/wEAAWYDAAFmAQABMwEA
|
||||
AWYBAAFmAQABZgEAAZkBAAFmAQABzAEAAWYBAAH/AQABZgEzAgABZgIzAQABZgEzAWYBAAFmATMBmQEA
|
||||
AWYBMwHMAQABZgEzAf8BAAJmAgACZgEzAQADZgEAAmYBmQEAAmYBzAEAAWYBmQIAAWYBmQEzAQABZgGZ
|
||||
AWYBAAFmApkBAAFmAZkBzAEAAWYBmQH/AQABZgHMAgABZgHMATMBAAFmAcwBmQEAAWYCzAEAAWYBzAH/
|
||||
AQABZgH/AgABZgH/ATMBAAFmAf8BmQEAAWYB/wHMAQABzAEAAf8BAAH/AQABzAEAApkCAAGZATMBmQEA
|
||||
AZkBAAGZAQABmQEAAcwBAAGZAwABmQIzAQABmQEAAWYBAAGZATMBzAEAAZkBAAH/AQABmQFmAgABmQFm
|
||||
ATMBAAGZATMBZgEAAZkBZgGZAQABmQFmAcwBAAGZATMB/wEAApkBMwEAApkBZgEAA5kBAAKZAcwBAAKZ
|
||||
Af8BAAGZAcwCAAGZAcwBMwEAAWYBzAFmAQABmQHMAZkBAAGZAswBAAGZAcwB/wEAAZkB/wIAAZkB/wEz
|
||||
AQABmQHMAWYBAAGZAf8BmQEAAZkB/wHMAQABmQL/AQABzAMAAZkBAAEzAQABzAEAAWYBAAHMAQABmQEA
|
||||
AcwBAAHMAQABmQEzAgABzAIzAQABzAEzAWYBAAHMATMBmQEAAcwBMwHMAQABzAEzAf8BAAHMAWYCAAHM
|
||||
AWYBMwEAAZkCZgEAAcwBZgGZAQABzAFmAcwBAAGZAWYB/wEAAcwBmQIAAcwBmQEzAQABzAGZAWYBAAHM
|
||||
ApkBAAHMAZkBzAEAAcwBmQH/AQACzAIAAswBMwEAAswBZgEAAswBmQEAA8wBAALMAf8BAAHMAf8CAAHM
|
||||
Af8BMwEAAZkB/wFmAQABzAH/AZkBAAHMAf8BzAEAAcwC/wEAAcwBAAEzAQAB/wEAAWYBAAH/AQABmQEA
|
||||
AcwBMwIAAf8CMwEAAf8BMwFmAQAB/wEzAZkBAAH/ATMBzAEAAf8BMwH/AQAB/wFmAgAB/wFmATMBAAHM
|
||||
AmYBAAH/AWYBmQEAAf8BZgHMAQABzAFmAf8BAAH/AZkCAAH/AZkBMwEAAf8BmQFmAQAB/wKZAQAB/wGZ
|
||||
AcwBAAH/AZkB/wEAAf8BzAIAAf8BzAEzAQAB/wHMAWYBAAH/AcwBmQEAAf8CzAEAAf8BzAH/AQAC/wEz
|
||||
AQABzAH/AWYBAAL/AZkBAAL/AcwBAAJmAf8BAAFmAf8BZgEAAWYC/wEAAf8CZgEAAf8BZgH/AQAC/wFm
|
||||
AQABIQEAAaUBAANfAQADdwEAA4YBAAOWAQADywEAA7IBAAPXAQAD3QEAA+MBAAPqAQAD8QEAA/gBAAHw
|
||||
AfsB/wEAAaQCoAEAA4ADAAH/AgAB/wMAAv8BAAH/AwAB/wEAAf8BAAL/AgAD/1QAAh8GAAIfKAAB/wHx
|
||||
Af8KAAEfAiYBHwQAAR8CJgEfJgAB/wG7AYsBswH/CAABHwQmAR8CAAEfBCYBHyQAAf8BuwOLAbMB/wcA
|
||||
ASUB3gQmAh8EJgHeASUjAAH/AbsBigOLAa0BswH/BwABJQHeCCYB3gElIwAB/wG7AooDiwKtAbMB/wcA
|
||||
ASUB3gYmAd4BJSMAAf8BtQOKAYsBswGLA60BswH/BwABJQYmASUkAAHzA4oBiwHyAf8BtAKtA7MB/wYA
|
||||
AR8GJgEfJAAB/wG1AYoBtAH/AgAB/wG0Aa0EswH/BAABHwgsAR8kAAH/AfEB/wQAAf8BtAWzAf8CAAEf
|
||||
Ak0CLALeAiwCTQEfKwAB/wG0BLMB8wEAAR8CUwJNAd4CJQHeAk0CUwEfKwAB/wG0ArMBGQIAASUB3gJT
|
||||
Ad4BJQIAASUB3gJTAd4BJSwAAf8BugEZBAABJQLeASUEAAElAt4BJTUAAiUGAAIlYwABQgFNAT4HAAE+
|
||||
AwABKAMAAUADAAEQAwABAQEAAQEFAAGAFwAD/wEABP8EAAL/AucEAAH4Af8CwwQAAfABfwKBBAAB4AE/
|
||||
AYABAQQAAcABHwHAAQMEAAGAAQ8B4AEHBQABBwHwAQ8FAAEDAfABDwQAAQYBAQHgAQcEAAGPAQABwAED
|
||||
BAAB/wKAAQEEAAH/AcECgQQAAf8B4wLDBAAC/wLnBAAE/wQACw==
|
||||
</value>
|
||||
</data>
|
||||
</root>
|
4
Source/Core/Windows/MainForm.Designer.cs
generated
4
Source/Core/Windows/MainForm.Designer.cs
generated
|
@ -413,7 +413,7 @@ namespace CodeImp.DoomBuilder.Windows
|
|||
this.itemopenmapincurwad.Name = "itemopenmapincurwad";
|
||||
this.itemopenmapincurwad.Size = new System.Drawing.Size(223, 22);
|
||||
this.itemopenmapincurwad.Tag = "builder_openmapincurrentwad";
|
||||
this.itemopenmapincurwad.Text = "Open Map in current &WAD...";
|
||||
this.itemopenmapincurwad.Text = "Open Map in Current &WAD...";
|
||||
this.itemopenmapincurwad.Click += new System.EventHandler(this.InvokeTaggedAction);
|
||||
//
|
||||
// itemclosemap
|
||||
|
@ -869,7 +869,7 @@ namespace CodeImp.DoomBuilder.Windows
|
|||
this.itemfittoscreen.Name = "itemfittoscreen";
|
||||
this.itemfittoscreen.Size = new System.Drawing.Size(209, 22);
|
||||
this.itemfittoscreen.Tag = "builder_centerinscreen";
|
||||
this.itemfittoscreen.Text = "Fit to screen";
|
||||
this.itemfittoscreen.Text = "Fit to Screen";
|
||||
this.itemfittoscreen.Click += new System.EventHandler(this.InvokeTaggedAction);
|
||||
//
|
||||
// itemtoggleinfo
|
||||
|
|
35
Source/Core/Windows/MapOptionsForm.Designer.cs
generated
35
Source/Core/Windows/MapOptionsForm.Designer.cs
generated
|
@ -41,6 +41,7 @@ namespace CodeImp.DoomBuilder.Windows
|
|||
this.apply = new System.Windows.Forms.Button();
|
||||
this.cancel = new System.Windows.Forms.Button();
|
||||
this.panelres = new System.Windows.Forms.GroupBox();
|
||||
this.uselongtexturenames = new System.Windows.Forms.CheckBox();
|
||||
this.strictpatches = new System.Windows.Forms.CheckBox();
|
||||
this.datalocations = new CodeImp.DoomBuilder.Controls.ResourceListEditor();
|
||||
label3 = new System.Windows.Forms.Label();
|
||||
|
@ -63,12 +64,12 @@ namespace CodeImp.DoomBuilder.Windows
|
|||
//
|
||||
// label2
|
||||
//
|
||||
label2.AutoSize = true;
|
||||
label2.Location = new System.Drawing.Point(58, 83);
|
||||
label2.Location = new System.Drawing.Point(13, 83);
|
||||
label2.Name = "label2";
|
||||
label2.Size = new System.Drawing.Size(65, 14);
|
||||
label2.Size = new System.Drawing.Size(110, 14);
|
||||
label2.TabIndex = 7;
|
||||
label2.Text = "Level name:";
|
||||
label2.TextAlign = System.Drawing.ContentAlignment.TopRight;
|
||||
//
|
||||
// label1
|
||||
//
|
||||
|
@ -76,7 +77,7 @@ namespace CodeImp.DoomBuilder.Windows
|
|||
label1.Name = "label1";
|
||||
label1.Size = new System.Drawing.Size(110, 14);
|
||||
label1.TabIndex = 5;
|
||||
label1.Text = "Game Configuration:";
|
||||
label1.Text = "Game configuration:";
|
||||
label1.TextAlign = System.Drawing.ContentAlignment.TopRight;
|
||||
//
|
||||
// panelsettings
|
||||
|
@ -124,7 +125,7 @@ namespace CodeImp.DoomBuilder.Windows
|
|||
this.scriptcompilerlabel.Name = "scriptcompilerlabel";
|
||||
this.scriptcompilerlabel.Size = new System.Drawing.Size(110, 14);
|
||||
this.scriptcompilerlabel.TabIndex = 11;
|
||||
this.scriptcompilerlabel.Text = "Script Type:";
|
||||
this.scriptcompilerlabel.Text = "Script type:";
|
||||
this.scriptcompilerlabel.TextAlign = System.Drawing.ContentAlignment.TopRight;
|
||||
//
|
||||
// levelname
|
||||
|
@ -152,7 +153,7 @@ namespace CodeImp.DoomBuilder.Windows
|
|||
// label4
|
||||
//
|
||||
label4.AutoSize = true;
|
||||
label4.Location = new System.Drawing.Point(15, 190);
|
||||
label4.Location = new System.Drawing.Point(15, 210);
|
||||
label4.Name = "label4";
|
||||
label4.Size = new System.Drawing.Size(312, 42);
|
||||
label4.TabIndex = 17;
|
||||
|
@ -163,7 +164,7 @@ namespace CodeImp.DoomBuilder.Windows
|
|||
// apply
|
||||
//
|
||||
this.apply.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
|
||||
this.apply.Location = new System.Drawing.Point(297, 378);
|
||||
this.apply.Location = new System.Drawing.Point(297, 400);
|
||||
this.apply.Name = "apply";
|
||||
this.apply.Size = new System.Drawing.Size(112, 25);
|
||||
this.apply.TabIndex = 2;
|
||||
|
@ -175,7 +176,7 @@ namespace CodeImp.DoomBuilder.Windows
|
|||
//
|
||||
this.cancel.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
|
||||
this.cancel.DialogResult = System.Windows.Forms.DialogResult.Cancel;
|
||||
this.cancel.Location = new System.Drawing.Point(179, 378);
|
||||
this.cancel.Location = new System.Drawing.Point(179, 400);
|
||||
this.cancel.Name = "cancel";
|
||||
this.cancel.Size = new System.Drawing.Size(112, 25);
|
||||
this.cancel.TabIndex = 3;
|
||||
|
@ -187,16 +188,27 @@ namespace CodeImp.DoomBuilder.Windows
|
|||
//
|
||||
this.panelres.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
|
||||
| System.Windows.Forms.AnchorStyles.Right)));
|
||||
this.panelres.Controls.Add(this.uselongtexturenames);
|
||||
this.panelres.Controls.Add(this.strictpatches);
|
||||
this.panelres.Controls.Add(this.datalocations);
|
||||
this.panelres.Controls.Add(label4);
|
||||
this.panelres.Location = new System.Drawing.Point(12, 130);
|
||||
this.panelres.Name = "panelres";
|
||||
this.panelres.Size = new System.Drawing.Size(397, 240);
|
||||
this.panelres.Size = new System.Drawing.Size(397, 260);
|
||||
this.panelres.TabIndex = 1;
|
||||
this.panelres.TabStop = false;
|
||||
this.panelres.Text = " Resources ";
|
||||
//
|
||||
// uselongtexturenames
|
||||
//
|
||||
this.uselongtexturenames.AutoSize = true;
|
||||
this.uselongtexturenames.Location = new System.Drawing.Point(15, 51);
|
||||
this.uselongtexturenames.Name = "uselongtexturenames";
|
||||
this.uselongtexturenames.Size = new System.Drawing.Size(140, 18);
|
||||
this.uselongtexturenames.TabIndex = 21;
|
||||
this.uselongtexturenames.Text = "Use long texture names";
|
||||
this.uselongtexturenames.UseVisualStyleBackColor = true;
|
||||
//
|
||||
// strictpatches
|
||||
//
|
||||
this.strictpatches.AutoSize = true;
|
||||
|
@ -212,7 +224,7 @@ namespace CodeImp.DoomBuilder.Windows
|
|||
this.datalocations.AllowDrop = true;
|
||||
this.datalocations.DialogOffset = new System.Drawing.Point(40, 20);
|
||||
this.datalocations.Font = new System.Drawing.Font("Arial", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
|
||||
this.datalocations.Location = new System.Drawing.Point(15, 57);
|
||||
this.datalocations.Location = new System.Drawing.Point(15, 75);
|
||||
this.datalocations.Name = "datalocations";
|
||||
this.datalocations.Size = new System.Drawing.Size(368, 130);
|
||||
this.datalocations.TabIndex = 0;
|
||||
|
@ -223,7 +235,7 @@ namespace CodeImp.DoomBuilder.Windows
|
|||
this.AutoScaleDimensions = new System.Drawing.SizeF(96F, 96F);
|
||||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Dpi;
|
||||
this.CancelButton = this.cancel;
|
||||
this.ClientSize = new System.Drawing.Size(421, 411);
|
||||
this.ClientSize = new System.Drawing.Size(421, 433);
|
||||
this.Controls.Add(this.panelres);
|
||||
this.Controls.Add(this.cancel);
|
||||
this.Controls.Add(this.apply);
|
||||
|
@ -259,6 +271,7 @@ namespace CodeImp.DoomBuilder.Windows
|
|||
private System.Windows.Forms.ComboBox scriptcompiler;
|
||||
private System.Windows.Forms.Label scriptcompilerlabel;
|
||||
private System.Windows.Forms.Label examplelabel;
|
||||
private System.Windows.Forms.CheckBox uselongtexturenames;
|
||||
|
||||
|
||||
}
|
||||
|
|
|
@ -32,8 +32,8 @@ namespace CodeImp.DoomBuilder.Windows
|
|||
internal partial class MapOptionsForm : DelayedForm
|
||||
{
|
||||
// Variables
|
||||
private MapOptions options;
|
||||
private bool newmap;
|
||||
private readonly MapOptions options;
|
||||
private readonly bool newmap;
|
||||
private string previousdefaultmaplumpname; //mxd
|
||||
|
||||
// Properties
|
||||
|
@ -169,6 +169,16 @@ namespace CodeImp.DoomBuilder.Windows
|
|||
return;
|
||||
}
|
||||
|
||||
//mxd. Long texture names
|
||||
if(!newmap && !uselongtexturenames.Checked && options.UseLongTextureNames &&
|
||||
MessageBox.Show(this, "Switching to short texture names may lead to texture and flat name conflicts. Do you want to continue?",
|
||||
Application.ProductName, MessageBoxButtons.YesNo, MessageBoxIcon.Warning, MessageBoxDefaultButton.Button2) == DialogResult.No)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
options.UseLongTextureNames = uselongtexturenames.Checked;
|
||||
|
||||
// Collect information
|
||||
ConfigurationInfo configinfo = config.SelectedItem as ConfigurationInfo; //mxd
|
||||
DataLocationList locations = datalocations.GetResources();
|
||||
|
@ -312,6 +322,10 @@ namespace CodeImp.DoomBuilder.Windows
|
|||
{
|
||||
scriptcompiler.SelectedIndex = -1;
|
||||
}
|
||||
|
||||
//mxd. Long texture names
|
||||
uselongtexturenames.Enabled = ci.SupportsLongTextureNames;
|
||||
uselongtexturenames.Checked = (ci.SupportsLongTextureNames && options.UseLongTextureNames);
|
||||
|
||||
// Show resources
|
||||
datalocations.FixedResourceLocationList(ci.Resources);
|
||||
|
|
|
@ -129,16 +129,7 @@
|
|||
<metadata name="panelsettings.GenerateMember" type="System.Boolean, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>False</value>
|
||||
</metadata>
|
||||
<metadata name="label4.Locked" type="System.Boolean, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>True</value>
|
||||
</metadata>
|
||||
<metadata name="label4.GenerateMember" type="System.Boolean, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>False</value>
|
||||
</metadata>
|
||||
<metadata name="strictpatches.Locked" type="System.Boolean, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>True</value>
|
||||
</metadata>
|
||||
<metadata name="datalocations.Locked" type="System.Boolean, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>True</value>
|
||||
</metadata>
|
||||
</root>
|
29
Source/Core/Windows/OpenMapOptionsForm.Designer.cs
generated
29
Source/Core/Windows/OpenMapOptionsForm.Designer.cs
generated
|
@ -33,6 +33,7 @@ namespace CodeImp.DoomBuilder.Windows
|
|||
System.Windows.Forms.Label label2;
|
||||
System.Windows.Forms.Label label3;
|
||||
this.panelres = new System.Windows.Forms.GroupBox();
|
||||
this.uselongtexturenames = new System.Windows.Forms.CheckBox();
|
||||
this.strictpatches = new System.Windows.Forms.CheckBox();
|
||||
this.datalocations = new CodeImp.DoomBuilder.Controls.ResourceListEditor();
|
||||
this.apply = new System.Windows.Forms.Button();
|
||||
|
@ -58,7 +59,7 @@ namespace CodeImp.DoomBuilder.Windows
|
|||
label1.Name = "label1";
|
||||
label1.Size = new System.Drawing.Size(120, 14);
|
||||
label1.TabIndex = 14;
|
||||
label1.Text = "Game Configuration:";
|
||||
label1.Text = "Game configuration:";
|
||||
label1.TextAlign = System.Drawing.ContentAlignment.TopRight;
|
||||
//
|
||||
// label2
|
||||
|
@ -73,7 +74,7 @@ namespace CodeImp.DoomBuilder.Windows
|
|||
// label3
|
||||
//
|
||||
label3.AutoSize = true;
|
||||
label3.Location = new System.Drawing.Point(14, 191);
|
||||
label3.Location = new System.Drawing.Point(14, 210);
|
||||
label3.Name = "label3";
|
||||
label3.Size = new System.Drawing.Size(312, 42);
|
||||
label3.TabIndex = 17;
|
||||
|
@ -85,16 +86,27 @@ namespace CodeImp.DoomBuilder.Windows
|
|||
//
|
||||
this.panelres.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)
|
||||
| System.Windows.Forms.AnchorStyles.Right)));
|
||||
this.panelres.Controls.Add(this.uselongtexturenames);
|
||||
this.panelres.Controls.Add(this.strictpatches);
|
||||
this.panelres.Controls.Add(this.datalocations);
|
||||
this.panelres.Controls.Add(label3);
|
||||
this.panelres.Location = new System.Drawing.Point(12, 246);
|
||||
this.panelres.Name = "panelres";
|
||||
this.panelres.Size = new System.Drawing.Size(396, 240);
|
||||
this.panelres.Size = new System.Drawing.Size(396, 264);
|
||||
this.panelres.TabIndex = 2;
|
||||
this.panelres.TabStop = false;
|
||||
this.panelres.Text = " Resources ";
|
||||
//
|
||||
// uselongtexturenames
|
||||
//
|
||||
this.uselongtexturenames.AutoSize = true;
|
||||
this.uselongtexturenames.Location = new System.Drawing.Point(14, 51);
|
||||
this.uselongtexturenames.Name = "uselongtexturenames";
|
||||
this.uselongtexturenames.Size = new System.Drawing.Size(140, 18);
|
||||
this.uselongtexturenames.TabIndex = 20;
|
||||
this.uselongtexturenames.Text = "Use long texture names";
|
||||
this.uselongtexturenames.UseVisualStyleBackColor = true;
|
||||
//
|
||||
// strictpatches
|
||||
//
|
||||
this.strictpatches.AutoSize = true;
|
||||
|
@ -110,7 +122,7 @@ namespace CodeImp.DoomBuilder.Windows
|
|||
this.datalocations.AllowDrop = true;
|
||||
this.datalocations.DialogOffset = new System.Drawing.Point(40, 20);
|
||||
this.datalocations.Font = new System.Drawing.Font("Arial", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
|
||||
this.datalocations.Location = new System.Drawing.Point(14, 58);
|
||||
this.datalocations.Location = new System.Drawing.Point(14, 75);
|
||||
this.datalocations.Name = "datalocations";
|
||||
this.datalocations.Size = new System.Drawing.Size(368, 127);
|
||||
this.datalocations.TabIndex = 0;
|
||||
|
@ -118,7 +130,7 @@ namespace CodeImp.DoomBuilder.Windows
|
|||
// apply
|
||||
//
|
||||
this.apply.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
|
||||
this.apply.Location = new System.Drawing.Point(296, 496);
|
||||
this.apply.Location = new System.Drawing.Point(296, 517);
|
||||
this.apply.Name = "apply";
|
||||
this.apply.Size = new System.Drawing.Size(112, 25);
|
||||
this.apply.TabIndex = 3;
|
||||
|
@ -130,7 +142,7 @@ namespace CodeImp.DoomBuilder.Windows
|
|||
//
|
||||
this.cancel.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
|
||||
this.cancel.DialogResult = System.Windows.Forms.DialogResult.Cancel;
|
||||
this.cancel.Location = new System.Drawing.Point(178, 495);
|
||||
this.cancel.Location = new System.Drawing.Point(178, 516);
|
||||
this.cancel.Name = "cancel";
|
||||
this.cancel.Size = new System.Drawing.Size(112, 25);
|
||||
this.cancel.TabIndex = 4;
|
||||
|
@ -191,7 +203,7 @@ namespace CodeImp.DoomBuilder.Windows
|
|||
this.scriptcompilerlabel.Name = "scriptcompilerlabel";
|
||||
this.scriptcompilerlabel.Size = new System.Drawing.Size(120, 14);
|
||||
this.scriptcompilerlabel.TabIndex = 18;
|
||||
this.scriptcompilerlabel.Text = "Script Type:";
|
||||
this.scriptcompilerlabel.Text = "Script type:";
|
||||
this.scriptcompilerlabel.TextAlign = System.Drawing.ContentAlignment.TopRight;
|
||||
//
|
||||
// OpenMapOptionsForm
|
||||
|
@ -200,7 +212,7 @@ namespace CodeImp.DoomBuilder.Windows
|
|||
this.AutoScaleDimensions = new System.Drawing.SizeF(96F, 96F);
|
||||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Dpi;
|
||||
this.CancelButton = this.cancel;
|
||||
this.ClientSize = new System.Drawing.Size(420, 530);
|
||||
this.ClientSize = new System.Drawing.Size(420, 551);
|
||||
this.Controls.Add(this.scriptcompiler);
|
||||
this.Controls.Add(this.scriptcompilerlabel);
|
||||
this.Controls.Add(this.mapslist);
|
||||
|
@ -239,6 +251,7 @@ namespace CodeImp.DoomBuilder.Windows
|
|||
private System.Windows.Forms.CheckBox strictpatches;
|
||||
private System.Windows.Forms.ComboBox scriptcompiler;
|
||||
private System.Windows.Forms.Label scriptcompilerlabel;
|
||||
private System.Windows.Forms.CheckBox uselongtexturenames;
|
||||
|
||||
|
||||
}
|
||||
|
|
|
@ -324,6 +324,10 @@ namespace CodeImp.DoomBuilder.Windows
|
|||
scriptcompilerlabel.Enabled = false;
|
||||
}
|
||||
|
||||
//mxd. Long texture names
|
||||
uselongtexturenames.Enabled = ci.SupportsLongTextureNames;
|
||||
uselongtexturenames.Checked = (ci.SupportsLongTextureNames && options.UseLongTextureNames);
|
||||
|
||||
// Show configuration resources
|
||||
datalocations.FixedResourceLocationList(ci.Resources);
|
||||
}
|
||||
|
@ -339,6 +343,15 @@ namespace CodeImp.DoomBuilder.Windows
|
|||
config.Focus();
|
||||
return;
|
||||
}
|
||||
|
||||
//mxd. Use long texture names?
|
||||
if (uselongtexturenames.Enabled && !options.UseLongTextureNames && uselongtexturenames.Checked &&
|
||||
MessageBox.Show(this, "Switching to long texture names can make the map incompatible with some map editors and game engines. Do you want to continue?",
|
||||
Application.ProductName, MessageBoxButtons.YesNo, MessageBoxIcon.Warning, MessageBoxDefaultButton.Button2) == DialogResult.No)
|
||||
{
|
||||
return;
|
||||
}
|
||||
options.UseLongTextureNames = uselongtexturenames.Checked;
|
||||
|
||||
// Collect information
|
||||
ConfigurationInfo configinfo = (config.SelectedItem as ConfigurationInfo); //mxd
|
||||
|
@ -464,7 +477,8 @@ namespace CodeImp.DoomBuilder.Windows
|
|||
datalocations.EditResourceLocationList(listedlocations);
|
||||
|
||||
//mxd. Select script compiler
|
||||
if (!string.IsNullOrEmpty(options.ScriptCompiler) && General.CompiledScriptConfigs.ContainsKey(options.ScriptCompiler)) {
|
||||
if (!string.IsNullOrEmpty(options.ScriptCompiler) && General.CompiledScriptConfigs.ContainsKey(options.ScriptCompiler))
|
||||
{
|
||||
scriptconfig = options.ScriptCompiler;
|
||||
}
|
||||
else
|
||||
|
@ -473,6 +487,9 @@ namespace CodeImp.DoomBuilder.Windows
|
|||
if(!string.IsNullOrEmpty(defaultscriptconfig) && General.CompiledScriptConfigs.ContainsKey(defaultscriptconfig))
|
||||
scriptconfig = defaultscriptconfig;
|
||||
}
|
||||
|
||||
//mxd. Long texture names
|
||||
if(uselongtexturenames.Enabled) uselongtexturenames.Checked = options.UseLongTextureNames;
|
||||
}
|
||||
|
||||
//mxd. Select proper script compiler
|
||||
|
|
|
@ -126,19 +126,7 @@
|
|||
<metadata name="label2.GenerateMember" type="System.Boolean, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>False</value>
|
||||
</metadata>
|
||||
<metadata name="label3.Locked" type="System.Boolean, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>True</value>
|
||||
</metadata>
|
||||
<metadata name="label3.GenerateMember" type="System.Boolean, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>False</value>
|
||||
</metadata>
|
||||
<metadata name="panelres.Locked" type="System.Boolean, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>True</value>
|
||||
</metadata>
|
||||
<metadata name="strictpatches.Locked" type="System.Boolean, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>True</value>
|
||||
</metadata>
|
||||
<metadata name="datalocations.Locked" type="System.Boolean, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>True</value>
|
||||
</metadata>
|
||||
</root>
|
1
Source/Core/Windows/PreferencesForm.Designer.cs
generated
1
Source/Core/Windows/PreferencesForm.Designer.cs
generated
|
@ -1892,6 +1892,7 @@ namespace CodeImp.DoomBuilder.Windows
|
|||
this.MaximizeBox = false;
|
||||
this.MinimizeBox = false;
|
||||
this.Name = "PreferencesForm";
|
||||
this.Opacity = 0;
|
||||
this.ShowIcon = false;
|
||||
this.ShowInTaskbar = false;
|
||||
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent;
|
||||
|
|
115
Source/Core/Windows/SectorEditFormUDMF.Designer.cs
generated
115
Source/Core/Windows/SectorEditFormUDMF.Designer.cs
generated
|
@ -129,7 +129,7 @@
|
|||
groupaction.Controls.Add(this.tagSelector);
|
||||
groupaction.Location = new System.Drawing.Point(7, 341);
|
||||
groupaction.Name = "groupaction";
|
||||
groupaction.Size = new System.Drawing.Size(436, 71);
|
||||
groupaction.Size = new System.Drawing.Size(490, 71);
|
||||
groupaction.TabIndex = 2;
|
||||
groupaction.TabStop = false;
|
||||
groupaction.Text = " Identification: ";
|
||||
|
@ -138,7 +138,7 @@
|
|||
//
|
||||
this.tagSelector.Location = new System.Drawing.Point(6, 21);
|
||||
this.tagSelector.Name = "tagSelector";
|
||||
this.tagSelector.Size = new System.Drawing.Size(424, 35);
|
||||
this.tagSelector.Size = new System.Drawing.Size(478, 35);
|
||||
this.tagSelector.TabIndex = 0;
|
||||
//
|
||||
// groupeffect
|
||||
|
@ -160,7 +160,7 @@
|
|||
groupeffect.Controls.Add(label8);
|
||||
groupeffect.Location = new System.Drawing.Point(7, 160);
|
||||
groupeffect.Name = "groupeffect";
|
||||
groupeffect.Size = new System.Drawing.Size(436, 175);
|
||||
groupeffect.Size = new System.Drawing.Size(490, 175);
|
||||
groupeffect.TabIndex = 1;
|
||||
groupeffect.TabStop = false;
|
||||
groupeffect.Text = " Effects: ";
|
||||
|
@ -170,7 +170,7 @@
|
|||
this.fadeColor.DefaultValue = 0;
|
||||
this.fadeColor.Field = "fadecolor";
|
||||
this.fadeColor.Label = "Fade:";
|
||||
this.fadeColor.Location = new System.Drawing.Point(223, 111);
|
||||
this.fadeColor.Location = new System.Drawing.Point(241, 111);
|
||||
this.fadeColor.Name = "fadeColor";
|
||||
this.fadeColor.Size = new System.Drawing.Size(207, 31);
|
||||
this.fadeColor.TabIndex = 30;
|
||||
|
@ -181,7 +181,7 @@
|
|||
this.lightColor.DefaultValue = 16777215;
|
||||
this.lightColor.Field = "lightcolor";
|
||||
this.lightColor.Label = "Light:";
|
||||
this.lightColor.Location = new System.Drawing.Point(223, 82);
|
||||
this.lightColor.Location = new System.Drawing.Point(241, 82);
|
||||
this.lightColor.Name = "lightColor";
|
||||
this.lightColor.Size = new System.Drawing.Size(207, 29);
|
||||
this.lightColor.TabIndex = 29;
|
||||
|
@ -247,7 +247,7 @@
|
|||
//
|
||||
this.soundSequence.Location = new System.Drawing.Point(125, 55);
|
||||
this.soundSequence.Name = "soundSequence";
|
||||
this.soundSequence.Size = new System.Drawing.Size(271, 20);
|
||||
this.soundSequence.Size = new System.Drawing.Size(325, 20);
|
||||
this.soundSequence.TabIndex = 2;
|
||||
//
|
||||
// gravity
|
||||
|
@ -276,7 +276,7 @@
|
|||
// browseeffect
|
||||
//
|
||||
this.browseeffect.Image = global::CodeImp.DoomBuilder.Properties.Resources.List;
|
||||
this.browseeffect.Location = new System.Drawing.Point(402, 26);
|
||||
this.browseeffect.Location = new System.Drawing.Point(456, 26);
|
||||
this.browseeffect.Name = "browseeffect";
|
||||
this.browseeffect.Size = new System.Drawing.Size(28, 25);
|
||||
this.browseeffect.TabIndex = 1;
|
||||
|
@ -293,7 +293,7 @@
|
|||
this.effect.GeneralizedOptions = null;
|
||||
this.effect.Location = new System.Drawing.Point(68, 28);
|
||||
this.effect.Name = "effect";
|
||||
this.effect.Size = new System.Drawing.Size(328, 21);
|
||||
this.effect.Size = new System.Drawing.Size(382, 21);
|
||||
this.effect.TabIndex = 0;
|
||||
this.effect.Value = 402;
|
||||
//
|
||||
|
@ -320,7 +320,7 @@
|
|||
groupfloorceiling.Controls.Add(this.floorheight);
|
||||
groupfloorceiling.Location = new System.Drawing.Point(7, 6);
|
||||
groupfloorceiling.Name = "groupfloorceiling";
|
||||
groupfloorceiling.Size = new System.Drawing.Size(188, 148);
|
||||
groupfloorceiling.Size = new System.Drawing.Size(242, 148);
|
||||
groupfloorceiling.TabIndex = 0;
|
||||
groupfloorceiling.TabStop = false;
|
||||
groupfloorceiling.Text = " Heights: ";
|
||||
|
@ -432,7 +432,7 @@
|
|||
this.tabs.Margin = new System.Windows.Forms.Padding(1);
|
||||
this.tabs.Name = "tabs";
|
||||
this.tabs.SelectedIndex = 0;
|
||||
this.tabs.Size = new System.Drawing.Size(457, 445);
|
||||
this.tabs.Size = new System.Drawing.Size(511, 445);
|
||||
this.tabs.SizeMode = System.Windows.Forms.TabSizeMode.Fixed;
|
||||
this.tabs.TabIndex = 1;
|
||||
//
|
||||
|
@ -446,7 +446,7 @@
|
|||
this.tabproperties.Location = new System.Drawing.Point(4, 23);
|
||||
this.tabproperties.Name = "tabproperties";
|
||||
this.tabproperties.Padding = new System.Windows.Forms.Padding(3);
|
||||
this.tabproperties.Size = new System.Drawing.Size(449, 418);
|
||||
this.tabproperties.Size = new System.Drawing.Size(503, 418);
|
||||
this.tabproperties.TabIndex = 0;
|
||||
this.tabproperties.Text = "Properties";
|
||||
this.tabproperties.UseVisualStyleBackColor = true;
|
||||
|
@ -456,7 +456,7 @@
|
|||
this.groupBox3.Controls.Add(this.flags);
|
||||
this.groupBox3.Location = new System.Drawing.Point(201, 6);
|
||||
this.groupBox3.Name = "groupBox3";
|
||||
this.groupBox3.Size = new System.Drawing.Size(242, 148);
|
||||
this.groupBox3.Size = new System.Drawing.Size(296, 148);
|
||||
this.groupBox3.TabIndex = 3;
|
||||
this.groupBox3.TabStop = false;
|
||||
this.groupBox3.Text = " Flags: ";
|
||||
|
@ -467,7 +467,7 @@
|
|||
this.flags.Columns = 1;
|
||||
this.flags.Location = new System.Drawing.Point(15, 21);
|
||||
this.flags.Name = "flags";
|
||||
this.flags.Size = new System.Drawing.Size(222, 121);
|
||||
this.flags.Size = new System.Drawing.Size(275, 121);
|
||||
this.flags.TabIndex = 5;
|
||||
this.flags.VerticalSpacing = 2;
|
||||
//
|
||||
|
@ -478,7 +478,7 @@
|
|||
this.tabSurfaces.Font = new System.Drawing.Font("Arial", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
|
||||
this.tabSurfaces.Location = new System.Drawing.Point(4, 23);
|
||||
this.tabSurfaces.Name = "tabSurfaces";
|
||||
this.tabSurfaces.Size = new System.Drawing.Size(449, 418);
|
||||
this.tabSurfaces.Size = new System.Drawing.Size(503, 418);
|
||||
this.tabSurfaces.TabIndex = 2;
|
||||
this.tabSurfaces.Text = "Surfaces";
|
||||
this.tabSurfaces.UseVisualStyleBackColor = true;
|
||||
|
@ -503,7 +503,7 @@
|
|||
this.groupBox2.Controls.Add(this.floortex);
|
||||
this.groupBox2.Location = new System.Drawing.Point(3, 212);
|
||||
this.groupBox2.Name = "groupBox2";
|
||||
this.groupBox2.Size = new System.Drawing.Size(443, 203);
|
||||
this.groupBox2.Size = new System.Drawing.Size(497, 203);
|
||||
this.groupBox2.TabIndex = 55;
|
||||
this.groupBox2.TabStop = false;
|
||||
this.groupBox2.Text = " Floor: ";
|
||||
|
@ -511,7 +511,7 @@
|
|||
// cbUseFloorLineAngles
|
||||
//
|
||||
this.cbUseFloorLineAngles.AutoSize = true;
|
||||
this.cbUseFloorLineAngles.Location = new System.Drawing.Point(236, 147);
|
||||
this.cbUseFloorLineAngles.Location = new System.Drawing.Point(181, 147);
|
||||
this.cbUseFloorLineAngles.Name = "cbUseFloorLineAngles";
|
||||
this.cbUseFloorLineAngles.Size = new System.Drawing.Size(115, 18);
|
||||
this.cbUseFloorLineAngles.TabIndex = 57;
|
||||
|
@ -522,9 +522,9 @@
|
|||
//
|
||||
// floorAngleControl
|
||||
//
|
||||
this.floorAngleControl.Angle = 0;
|
||||
this.floorAngleControl.Angle = -360;
|
||||
this.floorAngleControl.AngleOffset = 90;
|
||||
this.floorAngleControl.Location = new System.Drawing.Point(186, 132);
|
||||
this.floorAngleControl.Location = new System.Drawing.Point(6, 132);
|
||||
this.floorAngleControl.Name = "floorAngleControl";
|
||||
this.floorAngleControl.Size = new System.Drawing.Size(44, 44);
|
||||
this.floorAngleControl.TabIndex = 56;
|
||||
|
@ -532,7 +532,7 @@
|
|||
//
|
||||
// label7
|
||||
//
|
||||
this.label7.Location = new System.Drawing.Point(29, 88);
|
||||
this.label7.Location = new System.Drawing.Point(24, 88);
|
||||
this.label7.Name = "label7";
|
||||
this.label7.Size = new System.Drawing.Size(80, 14);
|
||||
this.label7.TabIndex = 54;
|
||||
|
@ -542,7 +542,7 @@
|
|||
//
|
||||
// label10
|
||||
//
|
||||
this.label10.Location = new System.Drawing.Point(29, 178);
|
||||
this.label10.Location = new System.Drawing.Point(24, 178);
|
||||
this.label10.Name = "label10";
|
||||
this.label10.Size = new System.Drawing.Size(80, 14);
|
||||
this.label10.TabIndex = 52;
|
||||
|
@ -558,7 +558,7 @@
|
|||
this.floorAlpha.ButtonStep = 1;
|
||||
this.floorAlpha.ButtonStepFloat = 0.1F;
|
||||
this.floorAlpha.ButtonStepsWrapAround = false;
|
||||
this.floorAlpha.Location = new System.Drawing.Point(118, 173);
|
||||
this.floorAlpha.Location = new System.Drawing.Point(113, 173);
|
||||
this.floorAlpha.Name = "floorAlpha";
|
||||
this.floorAlpha.Size = new System.Drawing.Size(62, 24);
|
||||
this.floorAlpha.StepValues = null;
|
||||
|
@ -567,7 +567,7 @@
|
|||
//
|
||||
// label11
|
||||
//
|
||||
this.label11.Location = new System.Drawing.Point(29, 148);
|
||||
this.label11.Location = new System.Drawing.Point(24, 148);
|
||||
this.label11.Name = "label11";
|
||||
this.label11.Size = new System.Drawing.Size(80, 14);
|
||||
this.label11.TabIndex = 50;
|
||||
|
@ -583,7 +583,7 @@
|
|||
this.floorRotation.ButtonStep = 5;
|
||||
this.floorRotation.ButtonStepFloat = 1F;
|
||||
this.floorRotation.ButtonStepsWrapAround = false;
|
||||
this.floorRotation.Location = new System.Drawing.Point(118, 143);
|
||||
this.floorRotation.Location = new System.Drawing.Point(113, 143);
|
||||
this.floorRotation.Name = "floorRotation";
|
||||
this.floorRotation.Size = new System.Drawing.Size(62, 24);
|
||||
this.floorRotation.StepValues = null;
|
||||
|
@ -594,7 +594,7 @@
|
|||
// floorLightAbsolute
|
||||
//
|
||||
this.floorLightAbsolute.AutoSize = true;
|
||||
this.floorLightAbsolute.Location = new System.Drawing.Point(186, 117);
|
||||
this.floorLightAbsolute.Location = new System.Drawing.Point(181, 117);
|
||||
this.floorLightAbsolute.Name = "floorLightAbsolute";
|
||||
this.floorLightAbsolute.Size = new System.Drawing.Size(69, 18);
|
||||
this.floorLightAbsolute.TabIndex = 49;
|
||||
|
@ -604,7 +604,7 @@
|
|||
//
|
||||
// label12
|
||||
//
|
||||
this.label12.Location = new System.Drawing.Point(29, 118);
|
||||
this.label12.Location = new System.Drawing.Point(24, 118);
|
||||
this.label12.Name = "label12";
|
||||
this.label12.Size = new System.Drawing.Size(80, 14);
|
||||
this.label12.TabIndex = 47;
|
||||
|
@ -620,7 +620,7 @@
|
|||
this.floorBrightness.ButtonStep = 16;
|
||||
this.floorBrightness.ButtonStepFloat = 1F;
|
||||
this.floorBrightness.ButtonStepsWrapAround = false;
|
||||
this.floorBrightness.Location = new System.Drawing.Point(118, 113);
|
||||
this.floorBrightness.Location = new System.Drawing.Point(113, 113);
|
||||
this.floorBrightness.Name = "floorBrightness";
|
||||
this.floorBrightness.Size = new System.Drawing.Size(62, 24);
|
||||
this.floorBrightness.StepValues = null;
|
||||
|
@ -632,7 +632,7 @@
|
|||
//
|
||||
this.floorRenderStyle.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
|
||||
this.floorRenderStyle.FormattingEnabled = true;
|
||||
this.floorRenderStyle.Location = new System.Drawing.Point(118, 85);
|
||||
this.floorRenderStyle.Location = new System.Drawing.Point(113, 85);
|
||||
this.floorRenderStyle.Name = "floorRenderStyle";
|
||||
this.floorRenderStyle.Size = new System.Drawing.Size(130, 22);
|
||||
this.floorRenderStyle.TabIndex = 46;
|
||||
|
@ -649,7 +649,7 @@
|
|||
this.floorScale.Font = new System.Drawing.Font("Arial", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(204)));
|
||||
this.floorScale.Label = "Texture Scale:";
|
||||
this.floorScale.LinkValues = false;
|
||||
this.floorScale.Location = new System.Drawing.Point(23, 51);
|
||||
this.floorScale.Location = new System.Drawing.Point(18, 51);
|
||||
this.floorScale.Name = "floorScale";
|
||||
this.floorScale.Size = new System.Drawing.Size(276, 28);
|
||||
this.floorScale.TabIndex = 17;
|
||||
|
@ -667,7 +667,7 @@
|
|||
this.floorOffsets.Font = new System.Drawing.Font("Arial", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(204)));
|
||||
this.floorOffsets.Label = "Texture Offsets:";
|
||||
this.floorOffsets.LinkValues = false;
|
||||
this.floorOffsets.Location = new System.Drawing.Point(23, 19);
|
||||
this.floorOffsets.Location = new System.Drawing.Point(18, 19);
|
||||
this.floorOffsets.Name = "floorOffsets";
|
||||
this.floorOffsets.Size = new System.Drawing.Size(276, 26);
|
||||
this.floorOffsets.TabIndex = 16;
|
||||
|
@ -675,12 +675,13 @@
|
|||
//
|
||||
// floortex
|
||||
//
|
||||
this.floortex.Location = new System.Drawing.Point(305, 19);
|
||||
this.floortex.Location = new System.Drawing.Point(300, 13);
|
||||
this.floortex.MultipleTextures = false;
|
||||
this.floortex.Name = "floortex";
|
||||
this.floortex.Size = new System.Drawing.Size(132, 105);
|
||||
this.floortex.Size = new System.Drawing.Size(190, 184);
|
||||
this.floortex.TabIndex = 15;
|
||||
this.floortex.TextureName = "";
|
||||
this.floortex.UsePreviews = false;
|
||||
this.floortex.OnValueChanged += new System.EventHandler(this.floortex_OnValueChanged);
|
||||
//
|
||||
// groupBox1
|
||||
|
@ -703,7 +704,7 @@
|
|||
this.groupBox1.Controls.Add(this.ceilingtex);
|
||||
this.groupBox1.Location = new System.Drawing.Point(3, 3);
|
||||
this.groupBox1.Name = "groupBox1";
|
||||
this.groupBox1.Size = new System.Drawing.Size(443, 203);
|
||||
this.groupBox1.Size = new System.Drawing.Size(497, 203);
|
||||
this.groupBox1.TabIndex = 0;
|
||||
this.groupBox1.TabStop = false;
|
||||
this.groupBox1.Text = " Ceiling: ";
|
||||
|
@ -711,7 +712,7 @@
|
|||
// cbUseCeilLineAngles
|
||||
//
|
||||
this.cbUseCeilLineAngles.AutoSize = true;
|
||||
this.cbUseCeilLineAngles.Location = new System.Drawing.Point(236, 147);
|
||||
this.cbUseCeilLineAngles.Location = new System.Drawing.Point(181, 147);
|
||||
this.cbUseCeilLineAngles.Name = "cbUseCeilLineAngles";
|
||||
this.cbUseCeilLineAngles.Size = new System.Drawing.Size(115, 18);
|
||||
this.cbUseCeilLineAngles.TabIndex = 56;
|
||||
|
@ -722,9 +723,9 @@
|
|||
//
|
||||
// ceilAngleControl
|
||||
//
|
||||
this.ceilAngleControl.Angle = 0;
|
||||
this.ceilAngleControl.Angle = -360;
|
||||
this.ceilAngleControl.AngleOffset = 90;
|
||||
this.ceilAngleControl.Location = new System.Drawing.Point(186, 132);
|
||||
this.ceilAngleControl.Location = new System.Drawing.Point(6, 132);
|
||||
this.ceilAngleControl.Name = "ceilAngleControl";
|
||||
this.ceilAngleControl.Size = new System.Drawing.Size(44, 44);
|
||||
this.ceilAngleControl.TabIndex = 55;
|
||||
|
@ -732,7 +733,7 @@
|
|||
//
|
||||
// label3
|
||||
//
|
||||
this.label3.Location = new System.Drawing.Point(29, 88);
|
||||
this.label3.Location = new System.Drawing.Point(24, 88);
|
||||
this.label3.Name = "label3";
|
||||
this.label3.Size = new System.Drawing.Size(80, 14);
|
||||
this.label3.TabIndex = 54;
|
||||
|
@ -742,7 +743,7 @@
|
|||
//
|
||||
// label4
|
||||
//
|
||||
this.label4.Location = new System.Drawing.Point(29, 178);
|
||||
this.label4.Location = new System.Drawing.Point(24, 178);
|
||||
this.label4.Name = "label4";
|
||||
this.label4.Size = new System.Drawing.Size(80, 14);
|
||||
this.label4.TabIndex = 52;
|
||||
|
@ -758,7 +759,7 @@
|
|||
this.ceilAlpha.ButtonStep = 1;
|
||||
this.ceilAlpha.ButtonStepFloat = 0.1F;
|
||||
this.ceilAlpha.ButtonStepsWrapAround = false;
|
||||
this.ceilAlpha.Location = new System.Drawing.Point(118, 173);
|
||||
this.ceilAlpha.Location = new System.Drawing.Point(113, 173);
|
||||
this.ceilAlpha.Name = "ceilAlpha";
|
||||
this.ceilAlpha.Size = new System.Drawing.Size(62, 24);
|
||||
this.ceilAlpha.StepValues = null;
|
||||
|
@ -767,7 +768,7 @@
|
|||
//
|
||||
// label1
|
||||
//
|
||||
this.label1.Location = new System.Drawing.Point(29, 148);
|
||||
this.label1.Location = new System.Drawing.Point(24, 148);
|
||||
this.label1.Name = "label1";
|
||||
this.label1.Size = new System.Drawing.Size(80, 14);
|
||||
this.label1.TabIndex = 50;
|
||||
|
@ -783,7 +784,7 @@
|
|||
this.ceilRotation.ButtonStep = 5;
|
||||
this.ceilRotation.ButtonStepFloat = 1F;
|
||||
this.ceilRotation.ButtonStepsWrapAround = false;
|
||||
this.ceilRotation.Location = new System.Drawing.Point(118, 143);
|
||||
this.ceilRotation.Location = new System.Drawing.Point(113, 143);
|
||||
this.ceilRotation.Name = "ceilRotation";
|
||||
this.ceilRotation.Size = new System.Drawing.Size(62, 24);
|
||||
this.ceilRotation.StepValues = null;
|
||||
|
@ -794,7 +795,7 @@
|
|||
// ceilLightAbsolute
|
||||
//
|
||||
this.ceilLightAbsolute.AutoSize = true;
|
||||
this.ceilLightAbsolute.Location = new System.Drawing.Point(186, 117);
|
||||
this.ceilLightAbsolute.Location = new System.Drawing.Point(181, 117);
|
||||
this.ceilLightAbsolute.Name = "ceilLightAbsolute";
|
||||
this.ceilLightAbsolute.Size = new System.Drawing.Size(69, 18);
|
||||
this.ceilLightAbsolute.TabIndex = 49;
|
||||
|
@ -805,7 +806,7 @@
|
|||
//
|
||||
// labelLightFront
|
||||
//
|
||||
this.labelLightFront.Location = new System.Drawing.Point(29, 118);
|
||||
this.labelLightFront.Location = new System.Drawing.Point(24, 118);
|
||||
this.labelLightFront.Name = "labelLightFront";
|
||||
this.labelLightFront.Size = new System.Drawing.Size(80, 14);
|
||||
this.labelLightFront.TabIndex = 47;
|
||||
|
@ -821,7 +822,7 @@
|
|||
this.ceilBrightness.ButtonStep = 16;
|
||||
this.ceilBrightness.ButtonStepFloat = 1F;
|
||||
this.ceilBrightness.ButtonStepsWrapAround = false;
|
||||
this.ceilBrightness.Location = new System.Drawing.Point(118, 113);
|
||||
this.ceilBrightness.Location = new System.Drawing.Point(113, 113);
|
||||
this.ceilBrightness.Name = "ceilBrightness";
|
||||
this.ceilBrightness.Size = new System.Drawing.Size(62, 24);
|
||||
this.ceilBrightness.StepValues = null;
|
||||
|
@ -833,7 +834,7 @@
|
|||
//
|
||||
this.ceilRenderStyle.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
|
||||
this.ceilRenderStyle.FormattingEnabled = true;
|
||||
this.ceilRenderStyle.Location = new System.Drawing.Point(118, 85);
|
||||
this.ceilRenderStyle.Location = new System.Drawing.Point(113, 85);
|
||||
this.ceilRenderStyle.Name = "ceilRenderStyle";
|
||||
this.ceilRenderStyle.Size = new System.Drawing.Size(130, 22);
|
||||
this.ceilRenderStyle.TabIndex = 46;
|
||||
|
@ -850,7 +851,7 @@
|
|||
this.ceilScale.Font = new System.Drawing.Font("Arial", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(204)));
|
||||
this.ceilScale.Label = "Texture Scale:";
|
||||
this.ceilScale.LinkValues = false;
|
||||
this.ceilScale.Location = new System.Drawing.Point(23, 51);
|
||||
this.ceilScale.Location = new System.Drawing.Point(18, 51);
|
||||
this.ceilScale.Name = "ceilScale";
|
||||
this.ceilScale.Size = new System.Drawing.Size(276, 28);
|
||||
this.ceilScale.TabIndex = 17;
|
||||
|
@ -868,7 +869,7 @@
|
|||
this.ceilOffsets.Font = new System.Drawing.Font("Arial", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(204)));
|
||||
this.ceilOffsets.Label = "Texture Offsets:";
|
||||
this.ceilOffsets.LinkValues = false;
|
||||
this.ceilOffsets.Location = new System.Drawing.Point(23, 19);
|
||||
this.ceilOffsets.Location = new System.Drawing.Point(18, 19);
|
||||
this.ceilOffsets.Name = "ceilOffsets";
|
||||
this.ceilOffsets.Size = new System.Drawing.Size(276, 26);
|
||||
this.ceilOffsets.TabIndex = 16;
|
||||
|
@ -876,12 +877,13 @@
|
|||
//
|
||||
// ceilingtex
|
||||
//
|
||||
this.ceilingtex.Location = new System.Drawing.Point(305, 19);
|
||||
this.ceilingtex.Location = new System.Drawing.Point(300, 13);
|
||||
this.ceilingtex.MultipleTextures = false;
|
||||
this.ceilingtex.Name = "ceilingtex";
|
||||
this.ceilingtex.Size = new System.Drawing.Size(132, 105);
|
||||
this.ceilingtex.Size = new System.Drawing.Size(190, 184);
|
||||
this.ceilingtex.TabIndex = 15;
|
||||
this.ceilingtex.TextureName = "";
|
||||
this.ceilingtex.UsePreviews = false;
|
||||
this.ceilingtex.OnValueChanged += new System.EventHandler(this.ceilingtex_OnValueChanged);
|
||||
//
|
||||
// tabslopes
|
||||
|
@ -891,7 +893,7 @@
|
|||
this.tabslopes.Font = new System.Drawing.Font("Arial", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
|
||||
this.tabslopes.Location = new System.Drawing.Point(4, 23);
|
||||
this.tabslopes.Name = "tabslopes";
|
||||
this.tabslopes.Size = new System.Drawing.Size(449, 418);
|
||||
this.tabslopes.Size = new System.Drawing.Size(503, 418);
|
||||
this.tabslopes.TabIndex = 3;
|
||||
this.tabslopes.Text = "Slopes";
|
||||
this.tabslopes.UseVisualStyleBackColor = true;
|
||||
|
@ -901,7 +903,7 @@
|
|||
this.groupBox5.Controls.Add(this.floorslopecontrol);
|
||||
this.groupBox5.Location = new System.Drawing.Point(3, 212);
|
||||
this.groupBox5.Name = "groupBox5";
|
||||
this.groupBox5.Size = new System.Drawing.Size(443, 203);
|
||||
this.groupBox5.Size = new System.Drawing.Size(497, 203);
|
||||
this.groupBox5.TabIndex = 1;
|
||||
this.groupBox5.TabStop = false;
|
||||
this.groupBox5.Text = " Floor: ";
|
||||
|
@ -923,7 +925,7 @@
|
|||
this.groupBox4.Controls.Add(this.ceilingslopecontrol);
|
||||
this.groupBox4.Location = new System.Drawing.Point(3, 3);
|
||||
this.groupBox4.Name = "groupBox4";
|
||||
this.groupBox4.Size = new System.Drawing.Size(443, 203);
|
||||
this.groupBox4.Size = new System.Drawing.Size(497, 203);
|
||||
this.groupBox4.TabIndex = 0;
|
||||
this.groupBox4.TabStop = false;
|
||||
this.groupBox4.Text = " Ceiling: ";
|
||||
|
@ -947,7 +949,7 @@
|
|||
this.tabcustom.Location = new System.Drawing.Point(4, 23);
|
||||
this.tabcustom.Name = "tabcustom";
|
||||
this.tabcustom.Padding = new System.Windows.Forms.Padding(3);
|
||||
this.tabcustom.Size = new System.Drawing.Size(449, 418);
|
||||
this.tabcustom.Size = new System.Drawing.Size(503, 418);
|
||||
this.tabcustom.TabIndex = 1;
|
||||
this.tabcustom.Text = "Custom";
|
||||
this.tabcustom.UseVisualStyleBackColor = true;
|
||||
|
@ -967,7 +969,7 @@
|
|||
this.fieldslist.Name = "fieldslist";
|
||||
this.fieldslist.PropertyColumnVisible = true;
|
||||
this.fieldslist.PropertyColumnWidth = 150;
|
||||
this.fieldslist.Size = new System.Drawing.Size(427, 397);
|
||||
this.fieldslist.Size = new System.Drawing.Size(481, 397);
|
||||
this.fieldslist.TabIndex = 1;
|
||||
this.fieldslist.TypeColumnVisible = true;
|
||||
this.fieldslist.TypeColumnWidth = 100;
|
||||
|
@ -977,7 +979,7 @@
|
|||
//
|
||||
this.cancel.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
|
||||
this.cancel.DialogResult = System.Windows.Forms.DialogResult.Cancel;
|
||||
this.cancel.Location = new System.Drawing.Point(235, 459);
|
||||
this.cancel.Location = new System.Drawing.Point(289, 459);
|
||||
this.cancel.Name = "cancel";
|
||||
this.cancel.Size = new System.Drawing.Size(112, 25);
|
||||
this.cancel.TabIndex = 4;
|
||||
|
@ -988,7 +990,7 @@
|
|||
// apply
|
||||
//
|
||||
this.apply.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
|
||||
this.apply.Location = new System.Drawing.Point(353, 459);
|
||||
this.apply.Location = new System.Drawing.Point(407, 459);
|
||||
this.apply.Name = "apply";
|
||||
this.apply.Size = new System.Drawing.Size(112, 25);
|
||||
this.apply.TabIndex = 3;
|
||||
|
@ -1009,7 +1011,7 @@
|
|||
this.AutoScaleDimensions = new System.Drawing.SizeF(96F, 96F);
|
||||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Dpi;
|
||||
this.CancelButton = this.cancel;
|
||||
this.ClientSize = new System.Drawing.Size(477, 489);
|
||||
this.ClientSize = new System.Drawing.Size(531, 489);
|
||||
this.Controls.Add(this.cancel);
|
||||
this.Controls.Add(this.apply);
|
||||
this.Controls.Add(this.tabs);
|
||||
|
@ -1018,7 +1020,6 @@
|
|||
this.MaximizeBox = false;
|
||||
this.MinimizeBox = false;
|
||||
this.Name = "SectorEditFormUDMF";
|
||||
this.Opacity = 0;
|
||||
this.ShowIcon = false;
|
||||
this.ShowInTaskbar = false;
|
||||
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent;
|
||||
|
|
|
@ -162,4 +162,7 @@
|
|||
<metadata name="fieldslist.Locked" type="System.Boolean, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>True</value>
|
||||
</metadata>
|
||||
<metadata name="tooltip.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
|
||||
<value>17, 17</value>
|
||||
</metadata>
|
||||
</root>
|
|
@ -19,6 +19,7 @@
|
|||
using System;
|
||||
using System.Drawing;
|
||||
using System.Windows.Forms;
|
||||
using CodeImp.DoomBuilder.Controls;
|
||||
using CodeImp.DoomBuilder.IO;
|
||||
using CodeImp.DoomBuilder.Data;
|
||||
using CodeImp.DoomBuilder.Config;
|
||||
|
@ -34,11 +35,11 @@ namespace CodeImp.DoomBuilder.Windows
|
|||
private string selectedname;
|
||||
private Point lastposition;
|
||||
private Size lastsize;
|
||||
private ListViewGroup usedgroup;
|
||||
private ListViewGroup availgroup;
|
||||
private readonly ListViewGroup usedgroup;
|
||||
private readonly ListViewGroup availgroup;
|
||||
private TreeNode selectedset; //mxd
|
||||
private string selecttextureonfill;
|
||||
private bool browseFlats;
|
||||
private readonly bool browseFlats;
|
||||
|
||||
// Properties
|
||||
public string SelectedName { get { return selectedname; } }
|
||||
|
@ -119,17 +120,22 @@ namespace CodeImp.DoomBuilder.Windows
|
|||
//mxd. Select the last one that was selected
|
||||
string selectname = General.Settings.ReadSetting("browserwindow.textureset", "");
|
||||
TreeNode match;
|
||||
if (string.IsNullOrEmpty(selectname)) {
|
||||
if (string.IsNullOrEmpty(selectname))
|
||||
{
|
||||
match = tvTextureSets.Nodes[tvTextureSets.Nodes.Count - 1];
|
||||
} else {
|
||||
}
|
||||
else
|
||||
{
|
||||
match = findNodeByName(tvTextureSets.Nodes, selectname);
|
||||
}
|
||||
|
||||
if (match != null) {
|
||||
if (match != null)
|
||||
{
|
||||
IFilledTextureSet set = (match.Tag as IFilledTextureSet);
|
||||
|
||||
foreach (ImageData img in set.Textures) {
|
||||
if (img.LongName == longname) {
|
||||
foreach (ImageData img in set.Textures)
|
||||
{
|
||||
if (img.LongName == longname)
|
||||
{
|
||||
selectedset = match;
|
||||
break;
|
||||
}
|
||||
|
@ -137,8 +143,10 @@ namespace CodeImp.DoomBuilder.Windows
|
|||
}
|
||||
|
||||
//mxd. If the selected texture was not found in the last-selected set, try finding it in the other sets
|
||||
if (selectedset == null && selecttexture != "-") {
|
||||
foreach (TreeNode n in tvTextureSets.Nodes) {
|
||||
if (selectedset == null && selecttexture != "-")
|
||||
{
|
||||
foreach (TreeNode n in tvTextureSets.Nodes)
|
||||
{
|
||||
selectedset = findTextureByLongName(n, longname);
|
||||
if (selectedset != null) break;
|
||||
}
|
||||
|
@ -169,12 +177,15 @@ namespace CodeImp.DoomBuilder.Windows
|
|||
this.WindowState = (FormWindowState)General.Settings.ReadSetting("browserwindow.windowstate", (int)FormWindowState.Normal);
|
||||
|
||||
//mxd
|
||||
if (this.WindowState == FormWindowState.Normal) {
|
||||
if (this.WindowState == FormWindowState.Normal)
|
||||
{
|
||||
Point location = new Point(General.Settings.ReadSetting("browserwindow.positionx", int.MaxValue), General.Settings.ReadSetting("browserwindow.positiony", int.MaxValue));
|
||||
|
||||
if (location.X < int.MaxValue && location.Y < int.MaxValue) {
|
||||
if (location.X < int.MaxValue && location.Y < int.MaxValue)
|
||||
{
|
||||
this.Location = location;
|
||||
} else {
|
||||
}
|
||||
else
|
||||
{
|
||||
this.StartPosition = FormStartPosition.CenterParent;
|
||||
}
|
||||
}
|
||||
|
@ -194,7 +205,8 @@ namespace CodeImp.DoomBuilder.Windows
|
|||
//first search in child nodes
|
||||
TreeNode match;
|
||||
|
||||
foreach(TreeNode n in node.Nodes) {
|
||||
foreach(TreeNode n in node.Nodes)
|
||||
{
|
||||
match = findTextureByLongName(n, longname);
|
||||
if(match != null) return match;
|
||||
}
|
||||
|
@ -219,7 +231,8 @@ namespace CodeImp.DoomBuilder.Windows
|
|||
//mxd
|
||||
private static TreeNode findNodeByName(TreeNodeCollection nodes, string selectname)
|
||||
{
|
||||
foreach (TreeNode n in nodes) {
|
||||
foreach (TreeNode n in nodes)
|
||||
{
|
||||
if (n.Name == selectname) return n;
|
||||
|
||||
TreeNode match = findNodeByName(n.Nodes, selectname);
|
||||
|
@ -232,43 +245,47 @@ namespace CodeImp.DoomBuilder.Windows
|
|||
private void createNodes(TreeNode root)
|
||||
{
|
||||
ResourceTextureSet set = root.Tag as ResourceTextureSet;
|
||||
if (set == null) {
|
||||
if (set == null)
|
||||
{
|
||||
General.ErrorLogger.Add(ErrorType.Error, "Resource " + root.Name + " doesn't have TextureSet!");
|
||||
return;
|
||||
}
|
||||
|
||||
int imageIndex = set.Location.type + 4;
|
||||
string[] separator = new[] { Path.DirectorySeparatorChar.ToString() };
|
||||
char[] separator = new[] { Path.AltDirectorySeparatorChar };
|
||||
|
||||
ImageData[] textures;
|
||||
ImageData[] images;
|
||||
if (browseFlats)
|
||||
{
|
||||
textures = new ImageData[set.Flats.Count];
|
||||
set.Flats.CopyTo(textures, 0);
|
||||
images = new ImageData[set.Flats.Count];
|
||||
set.Flats.CopyTo(images, 0);
|
||||
}
|
||||
else
|
||||
{
|
||||
textures = new ImageData[set.Textures.Count];
|
||||
set.Textures.CopyTo(textures, 0);
|
||||
images = new ImageData[set.Textures.Count];
|
||||
set.Textures.CopyTo(images, 0);
|
||||
}
|
||||
Array.Sort(textures, sortImageData);
|
||||
Array.Sort(images, sortImageData);
|
||||
|
||||
foreach (ImageData image in textures) {
|
||||
string localName = image.FullName.Replace(set.Location.location, "");
|
||||
string[] parts = localName.Split(separator, StringSplitOptions.RemoveEmptyEntries);
|
||||
foreach(ImageData image in images)
|
||||
{
|
||||
string[] parts = image.VirtualName.Split(separator, StringSplitOptions.RemoveEmptyEntries);
|
||||
TreeNode curNode = root;
|
||||
|
||||
if (parts.Length == 1) continue;
|
||||
int localindex = parts[0] == "[TEXTURES]" ? 7 : imageIndex;
|
||||
|
||||
for (int i = 0; i < parts.Length - 1; i++) {
|
||||
for (int i = 0; i < parts.Length - 1; i++)
|
||||
{
|
||||
string category = parts[i];
|
||||
|
||||
//already got such category?
|
||||
if (curNode.Nodes.Count > 0 && curNode.Nodes.ContainsKey(category)) {
|
||||
if (curNode.Nodes.Count > 0 && curNode.Nodes.ContainsKey(category))
|
||||
{
|
||||
curNode = curNode.Nodes[category];
|
||||
|
||||
} else { //create a new one
|
||||
}
|
||||
else //create a new one
|
||||
{
|
||||
TreeNode n = new TreeNode(category) { Name = category, ImageIndex = localindex, SelectedImageIndex = localindex };
|
||||
|
||||
curNode.Nodes.Add(n);
|
||||
|
@ -279,9 +296,11 @@ namespace CodeImp.DoomBuilder.Windows
|
|||
}
|
||||
|
||||
//add to current and parent nodes
|
||||
if (i == parts.Length - 2) {
|
||||
if (i == parts.Length - 2)
|
||||
{
|
||||
TreeNode cn = curNode;
|
||||
while (cn != root) {
|
||||
while (cn != root)
|
||||
{
|
||||
ResourceTextureSet curTs = cn.Tag as ResourceTextureSet;
|
||||
if (image.IsFlat)
|
||||
curTs.AddFlat(image);
|
||||
|
@ -293,7 +312,8 @@ namespace CodeImp.DoomBuilder.Windows
|
|||
}
|
||||
}
|
||||
|
||||
if (root.Nodes.Count == 1 && root.Nodes[0].Nodes.Count > 0) {
|
||||
if (root.Nodes.Count == 1 && root.Nodes[0].Nodes.Count > 0)
|
||||
{
|
||||
TreeNode[] children = new TreeNode[root.Nodes[0].Nodes.Count];
|
||||
root.Nodes[0].Nodes.CopyTo(children, 0);
|
||||
root.Nodes.Clear();
|
||||
|
@ -335,7 +355,8 @@ namespace CodeImp.DoomBuilder.Windows
|
|||
// Set selected name and close
|
||||
if(browser.SelectedItem != null)
|
||||
{
|
||||
selectedname = browser.SelectedItem.Text;
|
||||
ImageBrowserItem item = browser.SelectedItem as ImageBrowserItem;
|
||||
selectedname = item.icon.Name;
|
||||
DialogResult = DialogResult.OK;
|
||||
}
|
||||
else
|
||||
|
@ -450,22 +471,25 @@ namespace CodeImp.DoomBuilder.Windows
|
|||
// Start adding
|
||||
browser.BeginAdding(false);
|
||||
|
||||
if (browseFlats) {
|
||||
if (browseFlats)
|
||||
{
|
||||
// Add all available flats
|
||||
foreach(ImageData img in set.Flats)
|
||||
browser.Add(img.Name, img, img, availgroup);
|
||||
browser.Add(img.DisplayName, img, img, availgroup);
|
||||
|
||||
// Add all used flats
|
||||
foreach(ImageData img in set.Flats)
|
||||
if(img.UsedInMap) browser.Add(img.Name, img, img, usedgroup);
|
||||
}else{
|
||||
if(img.UsedInMap) browser.Add(img.DisplayName, img, img, usedgroup);
|
||||
}
|
||||
else
|
||||
{
|
||||
// Add all available textures and mark the images for temporary loading
|
||||
foreach (ImageData img in set.Textures)
|
||||
browser.Add(img.Name, img, img, availgroup);
|
||||
browser.Add(img.DisplayName, img, img, availgroup);
|
||||
|
||||
// Add all used textures and mark the images for permanent loading
|
||||
foreach (ImageData img in set.Textures)
|
||||
if (img.UsedInMap) browser.Add(img.Name, img, img, usedgroup);
|
||||
if(img.UsedInMap) browser.Add(img.DisplayName, img, img, usedgroup);
|
||||
}
|
||||
|
||||
// Done adding
|
||||
|
@ -496,14 +520,17 @@ namespace CodeImp.DoomBuilder.Windows
|
|||
}
|
||||
|
||||
//mxd
|
||||
private void tvTextureSets_NodeMouseClick(object sender, TreeNodeMouseClickEventArgs e) {
|
||||
private void tvTextureSets_NodeMouseClick(object sender, TreeNodeMouseClickEventArgs e)
|
||||
{
|
||||
selectedset = e.Node;
|
||||
FillImagesList();
|
||||
}
|
||||
|
||||
//mxd
|
||||
private void tvTextureSets_KeyUp(object sender, KeyEventArgs e) {
|
||||
if(tvTextureSets.SelectedNode != selectedset) {
|
||||
private void tvTextureSets_KeyUp(object sender, KeyEventArgs e)
|
||||
{
|
||||
if(tvTextureSets.SelectedNode != selectedset)
|
||||
{
|
||||
selectedset = tvTextureSets.SelectedNode;
|
||||
FillImagesList();
|
||||
}
|
||||
|
|
|
@ -90,6 +90,9 @@ namespace CodeImp.DoomBuilder.ZDoom
|
|||
return;
|
||||
}
|
||||
|
||||
//mxd
|
||||
name = name.Replace(Path.AltDirectorySeparatorChar, Path.DirectorySeparatorChar);
|
||||
|
||||
// Now we should find a comma
|
||||
parser.SkipWhitespace(true);
|
||||
tokenstr = parser.ReadToken();
|
||||
|
|
|
@ -70,8 +70,6 @@ namespace CodeImp.DoomBuilder.ZDoom
|
|||
// Constructor
|
||||
internal TextureStructure(TexturesParser parser, string typename)
|
||||
{
|
||||
string tokenstr;
|
||||
|
||||
// Initialize
|
||||
this.typename = typename;
|
||||
patches = new List<PatchStructure>(4);
|
||||
|
@ -92,7 +90,7 @@ namespace CodeImp.DoomBuilder.ZDoom
|
|||
|
||||
// Now we should find a comma
|
||||
parser.SkipWhitespace(true);
|
||||
tokenstr = parser.ReadToken();
|
||||
string tokenstr = parser.ReadToken();
|
||||
if(tokenstr != ",")
|
||||
{
|
||||
parser.ReportError("Expected a comma");
|
||||
|
@ -264,7 +262,7 @@ namespace CodeImp.DoomBuilder.ZDoom
|
|||
if(yscale == 0.0f) scaley = defaultscale; else scaley = 1f / yscale;
|
||||
|
||||
// Make texture
|
||||
HighResImage tex = new HighResImage(name, typename, width, height, scalex, scaley, worldpanning);
|
||||
HighResImage tex = new HighResImage(name, width, height, scalex, scaley, worldpanning, typename == "flat");
|
||||
|
||||
// Add patches
|
||||
foreach(PatchStructure p in patches)
|
||||
|
|
|
@ -19,6 +19,7 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using CodeImp.DoomBuilder.Data;
|
||||
|
||||
#endregion
|
||||
|
||||
|
@ -36,9 +37,9 @@ namespace CodeImp.DoomBuilder.ZDoom
|
|||
|
||||
#region ================== Variables
|
||||
|
||||
private Dictionary<string, TextureStructure> textures;
|
||||
private Dictionary<string, TextureStructure> flats;
|
||||
private Dictionary<string, TextureStructure> sprites;
|
||||
private readonly Dictionary<string, TextureStructure> textures;
|
||||
private readonly Dictionary<string, TextureStructure> flats;
|
||||
private readonly Dictionary<string, TextureStructure> sprites;
|
||||
|
||||
#endregion
|
||||
|
||||
|
@ -90,7 +91,7 @@ namespace CodeImp.DoomBuilder.ZDoom
|
|||
if(this.HasError) break;
|
||||
|
||||
// if a limit for the texture name length is set make sure that it's not exceeded
|
||||
if((General.Map.Config.MaxTextureNameLength > 0) && (tx.Name.Length > General.Map.Config.MaxTextureNameLength))
|
||||
if(tx.Name.Length > General.Map.Config.MaxTextureNameLength)
|
||||
{
|
||||
General.ErrorLogger.Add(ErrorType.Error, "Texture name \"" + tx.Name + "\" too long. Texture names must have a length of " + General.Map.Config.MaxTextureNameLength + " characters or less");
|
||||
}
|
||||
|
@ -108,9 +109,9 @@ namespace CodeImp.DoomBuilder.ZDoom
|
|||
if(this.HasError) break;
|
||||
|
||||
// if a limit for the sprite name length is set make sure that it's not exceeded
|
||||
if((General.Map.Config.MaxTextureNameLength > 0) && (tx.Name.Length > General.Map.Config.MaxTextureNameLength))
|
||||
if(tx.Name.Length > DataManager.CLASIC_IMAGE_NAME_LENGTH)
|
||||
{
|
||||
General.ErrorLogger.Add(ErrorType.Error, "Sprite name \"" + tx.Name + "\" too long. Sprite names must have a length of " + General.Map.Config.MaxTextureNameLength + " characters or less");
|
||||
General.ErrorLogger.Add(ErrorType.Error, "Sprite name \"" + tx.Name + "\" too long. Sprite names must have a length of " + DataManager.CLASIC_IMAGE_NAME_LENGTH + " characters or less");
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -125,7 +126,7 @@ namespace CodeImp.DoomBuilder.ZDoom
|
|||
if(this.HasError) break;
|
||||
|
||||
// if a limit for the walltexture name length is set make sure that it's not exceeded
|
||||
if((General.Map.Config.MaxTextureNameLength > 0) && (tx.Name.Length > General.Map.Config.MaxTextureNameLength))
|
||||
if(tx.Name.Length > General.Map.Config.MaxTextureNameLength)
|
||||
{
|
||||
General.ErrorLogger.Add(ErrorType.Error, "WallTexture name \"" + tx.Name + "\" too long. WallTexture names must have a length of " + General.Map.Config.MaxTextureNameLength + " characters or less");
|
||||
}
|
||||
|
@ -143,7 +144,7 @@ namespace CodeImp.DoomBuilder.ZDoom
|
|||
if(this.HasError) break;
|
||||
|
||||
// if a limit for the flat name length is set make sure that it's not exceeded
|
||||
if((General.Map.Config.MaxTextureNameLength > 0) && (tx.Name.Length > General.Map.Config.MaxTextureNameLength))
|
||||
if(tx.Name.Length > General.Map.Config.MaxTextureNameLength)
|
||||
{
|
||||
General.ErrorLogger.Add(ErrorType.Error, "Flat name \"" + tx.Name + "\" too long. Flat names must have a length of " + General.Map.Config.MaxTextureNameLength + " characters or less");
|
||||
}
|
||||
|
|
|
@ -72,7 +72,7 @@ namespace CodeImp.DoomBuilder.BuilderModes
|
|||
List<FindReplaceObject> objs = new List<FindReplaceObject>();
|
||||
|
||||
// Interpret the replacement
|
||||
if(replace && (string.IsNullOrEmpty(replacewith) || replacewith.Length > 8))
|
||||
if(replace && (string.IsNullOrEmpty(replacewith) || replacewith.Length > General.Map.Config.MaxTextureNameLength))
|
||||
{
|
||||
MessageBox.Show("Invalid replace value for this search type!", "Find and Replace", MessageBoxButtons.OK, MessageBoxIcon.Error);
|
||||
return objs.ToArray();
|
||||
|
|
|
@ -65,7 +65,7 @@ namespace CodeImp.DoomBuilder.BuilderModes
|
|||
List<FindReplaceObject> objs = new List<FindReplaceObject>();
|
||||
|
||||
// Interpret the replacement
|
||||
if(replace && (string.IsNullOrEmpty(replacewith) || replacewith.Length > 8))
|
||||
if(replace && (string.IsNullOrEmpty(replacewith) || replacewith.Length > General.Map.Config.MaxTextureNameLength))
|
||||
{
|
||||
MessageBox.Show("Invalid replace value for this search type!", "Find and Replace", MessageBoxButtons.OK, MessageBoxIcon.Error);
|
||||
return objs.ToArray();
|
||||
|
|
|
@ -65,7 +65,7 @@ namespace CodeImp.DoomBuilder.BuilderModes
|
|||
List<FindReplaceObject> objs = new List<FindReplaceObject>();
|
||||
|
||||
// Interpret the replacement
|
||||
if(replace && (string.IsNullOrEmpty(replacewith) || replacewith.Length > 8))
|
||||
if(replace && (string.IsNullOrEmpty(replacewith) || replacewith.Length > General.Map.Config.MaxTextureNameLength))
|
||||
{
|
||||
MessageBox.Show("Invalid replace value for this search type!", "Find and Replace", MessageBoxButtons.OK, MessageBoxIcon.Error);
|
||||
return objs.ToArray();
|
||||
|
|
|
@ -485,7 +485,7 @@ namespace CodeImp.DoomBuilder.BuilderModes
|
|||
this.toolStripMenuItem5.Name = "toolStripMenuItem5";
|
||||
this.toolStripMenuItem5.Size = new System.Drawing.Size(229, 22);
|
||||
this.toolStripMenuItem5.Tag = "exporttoobj";
|
||||
this.toolStripMenuItem5.Text = "Selection To Wavefront .obj...";
|
||||
this.toolStripMenuItem5.Text = "Selection to Wavefront .obj...";
|
||||
this.toolStripMenuItem5.Click += new System.EventHandler(this.InvokeTaggedAction);
|
||||
//
|
||||
// buttoncopyproperties
|
||||
|
|
Loading…
Reference in a new issue