0
0
Fork 0
mirror of https://git.do.srb2.org/STJr/UltimateZoneBuilder.git synced 2025-02-27 22:31:23 +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:
MaxED 2014-11-25 11:52:01 +00:00
parent ecc4cd9281
commit 6b765f5a27
79 changed files with 2088 additions and 1453 deletions
Build
Source

View file

@ -21,10 +21,11 @@ topboundary = 32767;
bottomboundary = -32768; bottomboundary = -32768;
// Maximum length of texture name length in characters (0 for unlimited) // Enables support for long (> 8 chars) texture names
// WARNING: changing this may destroy your WAD file. Only change it when // (to use long texture names you must also enable "Use long texture names" in the Map Configuration window).
// you know what you're doing! // WARNING: this should only be enabled for UDMF game configurations!
maxtexturenamelength = 8; // WARNING: enabling this will make maps incompatible with Doom Builder 2 and can lead to problems in Slade 3!
longtexturenames = false;

View file

@ -313,10 +313,11 @@ mapformat_udmf
//mxd. The default script compiler to use //mxd. The default script compiler to use
defaultscriptcompiler = "zdoom_acs.cfg"; defaultscriptcompiler = "zdoom_acs.cfg";
// Maximum length of texture name length in characters (0 for unlimited) // Enables support for long (> 8 chars) texture names
// WARNING: changing this may destroy your WAD file. Only change it when // (to use long texture names you must also enable "Use long texture names" in the Map Configuration window).
// you know what you're doing! // WARNING: this should only be enabled for UDMF game configurations!
maxtexturenamelength = 2048; // WARNING: enabling this will make maps incompatible with Doom Builder 2 and can lead to problems in Slade 3!
longtexturenames = true;
// Default nodebuilder configurations // Default nodebuilder configurations
defaultsavecompiler = "zdbsp_udmf_normal"; defaultsavecompiler = "zdbsp_udmf_normal";

View file

@ -554,10 +554,10 @@ enums
generic_door_delays generic_door_delays
{ {
8 = "1 second"; 8 = "8: 1 second";
34 = "4 seconds"; 34 = "34: 4 seconds";
69 = "9 seconds"; 69 = "69: 9 seconds";
240 = "30 seconds"; 240 = "240: 30 seconds";
} }
donut donut

View file

@ -26,6 +26,12 @@ include("Includes\\ZDoom_common.cfg", "common");
// Settings common to text map format // Settings common to text map format
include("Includes\\ZDoom_common.cfg", "mapformat_udmf"); 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 // mxd. Default script compiler
defaultscriptcompiler = "zandronum_acs.cfg"; defaultscriptcompiler = "zandronum_acs.cfg";

View file

@ -26,6 +26,12 @@ include("Includes\\ZDoom_common.cfg", "common");
// Settings common to text map format // Settings common to text map format
include("Includes\\ZDoom_common.cfg", "mapformat_udmf"); 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 // mxd. Default script compiler
defaultscriptcompiler = "zandronum_acs.cfg"; defaultscriptcompiler = "zandronum_acs.cfg";

View file

@ -26,6 +26,12 @@ include("Includes\\ZDoom_common.cfg", "common");
// Settings common to text map format // Settings common to text map format
include("Includes\\ZDoom_common.cfg", "mapformat_udmf"); 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 // mxd. Default script compiler
defaultscriptcompiler = "zandronum_acs.cfg"; defaultscriptcompiler = "zandronum_acs.cfg";

View file

@ -26,6 +26,12 @@ include("Includes\\ZDoom_common.cfg", "common");
// Settings common to text map format // Settings common to text map format
include("Includes\\ZDoom_common.cfg", "mapformat_udmf"); 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 // mxd. Default script compiler
defaultscriptcompiler = "zandronum_acs.cfg"; defaultscriptcompiler = "zandronum_acs.cfg";

View file

@ -23,16 +23,16 @@ keywords
A_AlertMonsters = "A_AlertMonsters[(float maxrange = 0[, int flags = 0])]"; A_AlertMonsters = "A_AlertMonsters[(float maxrange = 0[, int flags = 0])]";
A_Burst = "A_Burst(string type)"; A_Burst = "A_Burst(string type)";
A_CentaurDefend = "A_CentaurDefend"; 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_ClearLastHeard = "A_ClearLastHeard";
A_ClearSoundTarget = "A_ClearSoundTarget"; A_ClearSoundTarget = "A_ClearSoundTarget";
A_ClearTarget = "A_ClearTarget"; 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_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_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_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_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_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_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_Die = "A_Die[(string damagetype)]";
A_FaceTarget = "A_FaceTarget[(float angle = 0[, float pitch = 0])]"; A_FaceTarget = "A_FaceTarget[(float angle = 0[, float pitch = 0])]";
A_FaceMaster = "A_FaceMaster[(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_Remove = "A_Remove(int pointer, int flags)\nflags: RMVF flags.";
A_SentinelBob = "A_SentinelBob"; A_SentinelBob = "A_SentinelBob";
A_TurretLook = "A_TurretLook"; 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_VileChase = "A_VileChase";
A_Wander = "A_Wander"; A_Wander = "A_Wander";
//Generic monster attacks //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_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_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_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_MonsterRefire = "A_MonsterRefire(int chancecontinue, string abortstate) ";
A_BasicAttack = "A_BasicAttack(int meleedamage, string meleesound, string missiletype, float missileheight)"; A_BasicAttack = "A_BasicAttack(int meleedamage, string meleesound, string missiletype, float missileheight)";
A_BulletAttack = "A_BulletAttack"; A_BulletAttack = "A_BulletAttack";
A_MonsterRail = "A_MonsterRail"; 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_RadiusThrust = "A_RadiusThrust(int force, int distance[, int flags[, int fullthrustdistance]])";
A_Detonate = "A_Detonate"; A_Detonate = "A_Detonate";
A_ThrowGrenade = "A_ThrowGrenade(string spawntype[, float spawnheight[, float throwspeed_horz[, float throwspeed_vert[, bool useammo]]]])"; 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 //Freeze death functions
A_FreezeDeath = "A_FreezeDeath"; A_FreezeDeath = "A_FreezeDeath";
A_GenericFreezeDeath = "A_GenericFreezeDeath"; A_GenericFreezeDeath = "A_GenericFreezeDeath";
@ -95,8 +95,8 @@ keywords
A_BrainAwake = "A_BrainAwake"; A_BrainAwake = "A_BrainAwake";
A_BFGSound = "A_BFGSound"; A_BFGSound = "A_BFGSound";
//Print actions //Print actions
A_Print = "A_Print(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_PrintBold = "A_PrintBold(string text[, float time = 0.0[, string fontname = \"SmallFont\"]])";
A_Log = "A_Log(string text)"; A_Log = "A_Log(string text)";
A_LogInt = "A_LogInt(int number)"; A_LogInt = "A_LogInt(int number)";
//Special actions //Special actions
@ -109,8 +109,8 @@ keywords
A_SetBlend = "A_SetBlend(string blendcolor, float alpha, int duration[, string fadecolor])"; A_SetBlend = "A_SetBlend(string blendcolor, float alpha, int duration[, string fadecolor])";
A_CheckPlayerDone = "A_CheckPlayerDone"; A_CheckPlayerDone = "A_CheckPlayerDone";
A_PlayerSkinCheck = "A_PlayerSkinCheck(string state)"; A_PlayerSkinCheck = "A_PlayerSkinCheck(string state)";
A_SkullPop = "A_SkullPop[(string type = 'BloodySkull')]"; A_SkullPop = "A_SkullPop[(string type = \"BloodySkull\")]";
A_Quake = "A_Quake (int intensity, int duration, int damageradius, int tremorradius[, string sound = 'world/quake'])"; A_Quake = "A_Quake (int intensity, int duration, int damageradius, int tremorradius[, string sound = \"world/quake\"])";
//Spawn functions //Spawn functions
A_TossGib = "A_TossGib"; A_TossGib = "A_TossGib";
A_SpawnDebris = "A_SpawnDebris(string type[, bool translation = false[, float horizontal_vel = 1.0[, float vertical_vel = 1.0]]])"; 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_Respawn = "A_Respawn[(int flags = RSF_FOG)]\nflags: RSF flags";
A_ScaleVelocity = "A_ScaleVelocity(float scale)"; A_ScaleVelocity = "A_ScaleVelocity(float scale)";
A_ScreamAndUnblock = "A_ScreamAndUnblock"; 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_SetArg = "A_SetArg(int position, int value)";
A_SetDamageType = "A_SetDamageType(string damagetype)"; A_SetDamageType = "A_SetDamageType(string damagetype)";
A_SetFloat = "A_SetFloat"; A_SetFloat = "A_SetFloat";
A_SetFloorClip = "A_SetFloorClip"; A_SetFloorClip = "A_SetFloorClip";
A_SetInvulnerable = "A_SetInvulnerable"; A_SetInvulnerable = "A_SetInvulnerable";
A_SetMass = "A_SetMass(int mass)"; 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_SetReflective = "A_SetReflective";
A_SetReflectiveInvulnerable = "A_SetReflectiveInvulnerable"; A_SetReflectiveInvulnerable = "A_SetReflectiveInvulnerable";
A_SetScale = "A_SetScale(float scaleX[, float scaleY = scaleX])"; 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_WeaponReady = "A_WeaponReady[(int flags = 0)]\nflags: WRF flags.";
A_Lower = "A_Lower"; A_Lower = "A_Lower";
A_Raise = "A_Raise"; A_Raise = "A_Raise";
A_ReFire = "A_ReFire[(string state = 'Hold')]"; A_ReFire = "A_ReFire[(string state = \"Hold\")]";
A_ClearReFire = "A_ClearReFire"; 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_CheckReload = "A_CheckReload";
A_CheckForReload = "A_CheckForReload(int counter, string state[, bool dontincrement = false])"; A_CheckForReload = "A_CheckForReload(int counter, string state[, bool dontincrement = false])";
A_ResetReloadCounter = "A_ResetReloadCounter"; A_ResetReloadCounter = "A_ResetReloadCounter";
@ -231,9 +231,9 @@ keywords
A_SetCrosshair = "A_SetCrosshair(int number)"; A_SetCrosshair = "A_SetCrosshair(int number)";
//Weapon attack functions //Weapon attack functions
A_Punch = "A_Punch"; 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_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_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_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_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_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"; A_FireAssaultGun = "A_FireAssaultGun";
@ -266,23 +266,23 @@ keywords
A_SkullAttack = "A_SkullAttack[(int speed = 20)]"; A_SkullAttack = "A_SkullAttack[(int speed = 20)]";
A_BspiAttack = "A_BspiAttack"; A_BspiAttack = "A_BspiAttack";
A_CyberAttack = "A_CyberAttack"; A_CyberAttack = "A_CyberAttack";
A_PainAttack = "A_PainAttack[(string spawntype = 'LostSoul'[, float angle = 0[, int flags = 0[, int limit = 21]]])]"; A_PainAttack = "A_PainAttack[(string spawntype = \"LostSoul\"[, float angle = 0[, int flags = 0[, int limit = 21]]])]";
A_DualPainAttack = "A_DualPainAttack[(string spawntype = 'LostSoul')]"; A_DualPainAttack = "A_DualPainAttack[(string spawntype = \"LostSoul\")]";
A_PainDie = "A_PainDie[(string spawntype = 'LostSoul')]"; A_PainDie = "A_PainDie[(string spawntype = \"LostSoul\")]";
A_SkelFist = "A_SkelFist"; A_SkelFist = "A_SkelFist";
A_SkelMissile = "A_SkelMissile"; A_SkelMissile = "A_SkelMissile";
A_FatAttack1 = "A_FatAttack1[(string spawntype = 'FatShot')]"; A_FatAttack1 = "A_FatAttack1[(string spawntype = \"FatShot\")]";
A_FatAttack2 = "A_FatAttack2[(string spawntype = 'FatShot')]"; A_FatAttack2 = "A_FatAttack2[(string spawntype = \"FatShot\")]";
A_FatAttack3 = "A_FatAttack3[(string spawntype = 'FatShot')]"; A_FatAttack3 = "A_FatAttack3[(string spawntype = \"FatShot\")]";
A_VileTarget = "A_VileTarget[(string type = 'ArchvileFire')]"; 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_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_BrainSpit = "A_BrainSpit[(string spawntype = \"SpawnShot\")]";
A_SpawnFly = "A_SpawnFly[(string fogactor = 'SpawnFire')]"; A_SpawnFly = "A_SpawnFly[(string fogactor = \"SpawnFire\")]";
A_SpawnSound = "A_SpawnSound"; A_SpawnSound = "A_SpawnSound";
A_BrainScream = "A_BrainScream"; A_BrainScream = "A_BrainScream";
A_BrainExplode = "A_BrainExplode"; 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_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_M_Saw = "A_M_Saw[(string fullsound = \"weapons/sawfull\"[, string hitsound = \"weapons/sawhit\"[, int damage = 0[, string pufftype = \"BulletPuff\"]]])]";
A_SentinelRefire = "A_SentinelRefire"; A_SentinelRefire = "A_SentinelRefire";
A_BetaSkullAttack = "A_BetaSkullAttack"; A_BetaSkullAttack = "A_BetaSkullAttack";
//Miscellaneous functions for Doom //Miscellaneous functions for Doom
@ -293,8 +293,21 @@ keywords
A_SkelWhoosh = "A_SkelWhoosh"; A_SkelWhoosh = "A_SkelWhoosh";
A_StartFire = "A_StartFire"; A_StartFire = "A_StartFire";
A_FireCrackle = "A_FireCrackle"; 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_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_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 //Mathematical functions
abs = "abs(x)\nreturns the absolute value of x."; abs = "abs(x)\nreturns the absolute value of x.";
sin = "sin(x)\ntrigonometry function, x must be in degrees."; sin = "sin(x)\ntrigonometry function, x must be in degrees.";
@ -606,6 +619,7 @@ constants
SPAWNSOUNDSOURCE; SPAWNSOUNDSOURCE;
PAINLESS; PAINLESS;
FORCEPAIN; FORCEPAIN;
CAUSEPAIN;
DONTSEEKINVISIBLE; DONTSEEKINVISIBLE;
STEPMISSILE; STEPMISSILE;
ADDITIVEPOISONDAMAGE; ADDITIVEPOISONDAMAGE;
@ -650,6 +664,7 @@ constants
NOTAUTOAIMED; NOTAUTOAIMED;
NOTONAUTOMAP; NOTONAUTOMAP;
WEAPONSPAWN; WEAPONSPAWN;
NOMENU;
PICKUP; PICKUP;
TOUCHY; TOUCHY;
VULNERABLE; VULNERABLE;
@ -713,6 +728,10 @@ constants
AMF_EMITFROMTARGET; AMF_EMITFROMTARGET;
AMF_TARGETEMITTER; AMF_TARGETEMITTER;
AMF_TARGETNONPLAYER; AMF_TARGETNONPLAYER;
BF_USEAMMO;
BF_DONTWARN;
BF_AFFECTBOSSES;
BF_NOIMPACTDAMAGE;
CBAF_AIMFACING; CBAF_AIMFACING;
CBAF_EXPLICITANGLE; CBAF_EXPLICITANGLE;
CBAF_NOPITCH; CBAF_NOPITCH;

View file

@ -699,6 +699,9 @@
<Compile Include="Controls\DockersTabsControl.cs"> <Compile Include="Controls\DockersTabsControl.cs">
<SubType>Component</SubType> <SubType>Component</SubType>
</Compile> </Compile>
<Compile Include="Controls\ConfigurablePictureBox.cs">
<SubType>Component</SubType>
</Compile>
<Compile Include="Controls\HintsPanel.cs"> <Compile Include="Controls\HintsPanel.cs">
<SubType>UserControl</SubType> <SubType>UserControl</SubType>
</Compile> </Compile>

View file

@ -59,6 +59,7 @@ namespace CodeImp.DoomBuilder.Config
private Configuration config; //mxd private Configuration config; //mxd
private bool enabled; //mxd private bool enabled; //mxd
private bool changed; //mxd private bool changed; //mxd
private bool longtexturenames; //mxd
private List<EngineInfo> testEngines; //mxd private List<EngineInfo> testEngines; //mxd
private int currentEngineIndex; //mxd private int currentEngineIndex; //mxd
@ -84,6 +85,7 @@ namespace CodeImp.DoomBuilder.Config
internal Configuration Configuration { get { return config; } } //mxd internal Configuration Configuration { get { return config; } } //mxd
public bool Enabled { get { return enabled; } internal set { enabled = value; } } //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 Changed { get { return changed; } internal set { changed = value; } } //mxd
public bool SupportsLongTextureNames { get { return longtexturenames; } internal set { longtexturenames = value; } } //mxd
//mxd //mxd
public string TestProgramName { get { return testEngines[currentEngineIndex].TestProgramName; } internal set { testEngines[currentEngineIndex].TestProgramName = value; } } 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 // Load settings from game configuration
this.name = config.ReadSetting("game", "<unnamed game>"); this.name = config.ReadSetting("game", "<unnamed game>");
this.defaultlumpname = config.ReadSetting("defaultlumpname", ""); this.defaultlumpname = config.ReadSetting("defaultlumpname", "");
this.longtexturenames = config.ReadSetting("longtexturenames", false); //mxd
// Load settings from program configuration // Load settings from program configuration
this.nodebuildersave = General.Settings.ReadSetting("configurations." + settingskey + ".nodebuildersave", MISSING_NODEBUILDER); 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); currentEngineIndex = General.Settings.ReadSetting("configurations." + settingskey + ".currentengineindex", 0);
//no engine list found? use old engine properties //no engine list found? use old engine properties
if (list.Count == 0) { if (list.Count == 0)
{
EngineInfo info = new EngineInfo(); EngineInfo info = new EngineInfo();
info.TestProgram = General.Settings.ReadSetting("configurations." + settingskey + ".testprogram", ""); info.TestProgram = General.Settings.ReadSetting("configurations." + settingskey + ".testprogram", "");
info.TestProgramName = General.Settings.ReadSetting("configurations." + settingskey + ".testprogramname", EngineInfo.DEFAULT_ENGINE_NAME); 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); info.TestSkill = General.Settings.ReadSetting("configurations." + settingskey + ".testskill", 3);
testEngines.Add(info); testEngines.Add(info);
currentEngineIndex = 0; currentEngineIndex = 0;
} else { }
else
{
//read engines settings from config //read engines settings from config
foreach (DictionaryEntry de in list) { foreach (DictionaryEntry de in list)
{
string path = "configurations." + settingskey + ".engines." + de.Key; string path = "configurations." + settingskey + ".engines." + de.Key;
EngineInfo info = new EngineInfo(); EngineInfo info = new EngineInfo();
info.TestProgram = General.Settings.ReadSetting(path + ".testprogram", ""); info.TestProgram = General.Settings.ReadSetting(path + ".testprogram", "");
@ -166,13 +173,17 @@ namespace CodeImp.DoomBuilder.Config
list = General.Settings.ReadSetting("configurations." + settingskey + ".linedefcolorpresets", new ListDictionary()); list = General.Settings.ReadSetting("configurations." + settingskey + ".linedefcolorpresets", new ListDictionary());
//no presets? add "classic" ones then. //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>()); LinedefColorPreset anyActionPreset = new LinedefColorPreset("Any action", PixelColor.FromColor(System.Drawing.Color.PaleGreen), -1, 0, new List<string>(), new List<string>());
anyActionPreset.SetValid(); anyActionPreset.SetValid();
colorPresets.Add(anyActionPreset); colorPresets.Add(anyActionPreset);
} else { }
else
{
//read custom linedef colors from config //read custom linedef colors from config
foreach(DictionaryEntry de in list) { foreach(DictionaryEntry de in list)
{
string path = "configurations." + settingskey + ".linedefcolorpresets." + de.Key; string path = "configurations." + settingskey + ".linedefcolorpresets." + de.Key;
string presetname = General.Settings.ReadSetting(path + ".name", "Unnamed"); string presetname = General.Settings.ReadSetting(path + ".name", "Unnamed");
PixelColor color = PixelColor.FromInt(General.Settings.ReadSetting(path + ".color", -1)); PixelColor color = PixelColor.FromInt(General.Settings.ReadSetting(path + ".color", -1));

View file

@ -25,6 +25,7 @@ using CodeImp.DoomBuilder.Map;
using CodeImp.DoomBuilder.Editing; using CodeImp.DoomBuilder.Editing;
using CodeImp.DoomBuilder.GZBuilder.Data; using CodeImp.DoomBuilder.GZBuilder.Data;
using CodeImp.DoomBuilder.Data;
#endregion #endregion
@ -311,7 +312,6 @@ namespace CodeImp.DoomBuilder.Config
linetagindicatesectors = cfg.ReadSetting("linetagindicatesectors", false); linetagindicatesectors = cfg.ReadSetting("linetagindicatesectors", false);
decorategames = cfg.ReadSetting("decorategames", ""); decorategames = cfg.ReadSetting("decorategames", "");
skyflatname = cfg.ReadSetting("skyflatname", "F_SKY1"); skyflatname = cfg.ReadSetting("skyflatname", "F_SKY1");
maxtexturenamelength = cfg.ReadSetting("maxtexturenamelength", 8);
leftboundary = cfg.ReadSetting("leftboundary", -32768); leftboundary = cfg.ReadSetting("leftboundary", -32768);
rightboundary = cfg.ReadSetting("rightboundary", 32767); rightboundary = cfg.ReadSetting("rightboundary", 32767);
topboundary = cfg.ReadSetting("topboundary", 32767); topboundary = cfg.ReadSetting("topboundary", 32767);
@ -320,6 +320,10 @@ namespace CodeImp.DoomBuilder.Config
defaultLinedefActivation = cfg.ReadSetting("defaultlinedefactivation", ""); //mxd defaultLinedefActivation = cfg.ReadSetting("defaultlinedefactivation", ""); //mxd
for(int i = 0; i < Linedef.NUM_ARGS; i++) makedoorargs[i] = cfg.ReadSetting("makedoorarg" + i.ToString(CultureInfo.InvariantCulture), 0); 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 // Flags have special (invariant culture) conversion
// because they are allowed to be written as integers in the configs // because they are allowed to be written as integers in the configs
object obj = cfg.ReadSettingObject("singlesidedflag", 0); object obj = cfg.ReadSettingObject("singlesidedflag", 0);

View 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);
}
}
}

View file

@ -27,15 +27,14 @@ namespace CodeImp.DoomBuilder
{ {
#region ================== Variables #region ================== Variables
private static readonly List<KeyValuePair<DebugMessageType, string>> messages = new List<KeyValuePair<DebugMessageType, string>>(1000); private const int MAX_MESSAGES = 1024;
private DebugMessageType filters; private static readonly List<KeyValuePair<DebugMessageType, string>> messages = new List<KeyValuePair<DebugMessageType, string>>(MAX_MESSAGES);
//Colors //Colors
private readonly Dictionary<DebugMessageType, Color> textcolors; private readonly Dictionary<DebugMessageType, Color> textcolors;
private readonly Dictionary<DebugMessageType, string> textheaders; private readonly Dictionary<DebugMessageType, string> textheaders;
private static int charcount; private DebugMessageType filters;
private const int MAX_CHARS = short.MaxValue;
private static long starttime = -1; private static long starttime = -1;
private static DebugConsole me; private static DebugConsole me;
@ -107,6 +106,7 @@ namespace CodeImp.DoomBuilder
} }
else else
{ {
if (messages.Count + 1 > MAX_MESSAGES) lock (messages) { messages.RemoveAt(0); }
messages.Add(new KeyValuePair<DebugMessageType, string>(type, text)); messages.Add(new KeyValuePair<DebugMessageType, string>(type, text));
if(me != null && (me.filters & type) == type) if(me != null && (me.filters & type) == type)
{ {
@ -130,7 +130,6 @@ namespace CodeImp.DoomBuilder
{ {
if (me != null) me.console.Clear(); if (me != null) me.console.Clear();
messages.Clear(); messages.Clear();
charcount = 0;
} }
} }
@ -163,18 +162,6 @@ namespace CodeImp.DoomBuilder
private void AddMessage(DebugMessageType type, string text, bool scroll) private void AddMessage(DebugMessageType type, string text, bool scroll)
{ {
text = textheaders[type] + text; 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.SelectionStart = console.TextLength;
console.SelectionColor = textcolors[type]; console.SelectionColor = textcolors[type];
console.AppendText(text); console.AppendText(text);
@ -197,7 +184,6 @@ namespace CodeImp.DoomBuilder
private void UpdateMessages() private void UpdateMessages()
{ {
console.Clear(); console.Clear();
charcount = 0;
console.SuspendLayout(); console.SuspendLayout();
foreach (KeyValuePair<DebugMessageType, string> pair in messages) foreach (KeyValuePair<DebugMessageType, string> pair in messages)

View file

@ -61,10 +61,10 @@ namespace CodeImp.DoomBuilder.Controls
if(string.IsNullOrEmpty(texture.FullName) || texture is UnknownImage) DisplayImageSize(0, 0); //mxd if(string.IsNullOrEmpty(texture.FullName) || texture is UnknownImage) DisplayImageSize(0, 0); //mxd
else DisplayImageSize(texture.ScaledWidth, texture.ScaledHeight); //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 // Set the image
return texture.GetPreview(); return (usepreviews ? texture.GetPreview() : texture.GetBitmap());
} }
} }

View file

@ -100,6 +100,7 @@ namespace CodeImp.DoomBuilder.Controls
// list // list
// //
this.list.Dock = System.Windows.Forms.DockStyle.Fill; 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.HideSelection = false;
this.list.Location = new System.Drawing.Point(0, 0); this.list.Location = new System.Drawing.Point(0, 0);
this.list.MultiSelect = false; this.list.MultiSelect = false;
@ -132,6 +133,7 @@ namespace CodeImp.DoomBuilder.Controls
this.filterHeight.AllowRelative = false; this.filterHeight.AllowRelative = false;
this.filterHeight.ButtonStep = 1; this.filterHeight.ButtonStep = 1;
this.filterHeight.ButtonStepFloat = 1F; this.filterHeight.ButtonStepFloat = 1F;
this.filterHeight.ButtonStepsWrapAround = false;
this.filterHeight.Location = new System.Drawing.Point(410, 4); this.filterHeight.Location = new System.Drawing.Point(410, 4);
this.filterHeight.Name = "filterHeight"; this.filterHeight.Name = "filterHeight";
this.filterHeight.Size = new System.Drawing.Size(54, 24); this.filterHeight.Size = new System.Drawing.Size(54, 24);
@ -156,6 +158,7 @@ namespace CodeImp.DoomBuilder.Controls
this.filterWidth.AllowRelative = false; this.filterWidth.AllowRelative = false;
this.filterWidth.ButtonStep = 1; this.filterWidth.ButtonStep = 1;
this.filterWidth.ButtonStepFloat = 1F; this.filterWidth.ButtonStepFloat = 1F;
this.filterWidth.ButtonStepsWrapAround = false;
this.filterWidth.Location = new System.Drawing.Point(308, 4); this.filterWidth.Location = new System.Drawing.Point(308, 4);
this.filterWidth.Name = "filterWidth"; this.filterWidth.Name = "filterWidth";
this.filterWidth.Size = new System.Drawing.Size(54, 24); this.filterWidth.Size = new System.Drawing.Size(54, 24);

View file

@ -69,7 +69,6 @@ namespace CodeImp.DoomBuilder.Controls
public bool PreventSelection { get { return preventselection; } set { preventselection = value; } } public bool PreventSelection { get { return preventselection; } set { preventselection = value; } }
public bool HideInputBox { get { return splitter.Panel2Collapsed; } set { splitter.Panel2Collapsed = value; } } public bool HideInputBox { get { return splitter.Panel2Collapsed; } set { splitter.Panel2Collapsed = value; } }
public bool BrowseFlats { get { return browseFlats; } set { browseFlats = value; } } //mxd 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; } } public ListViewItem SelectedItem { get { if(list.SelectedItems.Count > 0) return list.SelectedItems[0]; else return null; } }
#endregion #endregion
@ -108,9 +107,12 @@ namespace CodeImp.DoomBuilder.Controls
list.TileSize = new Size(itemwidth, itemheight); list.TileSize = new Size(itemwidth, itemheight);
//mxd //mxd
if(General.Map.Config.MixTexturesFlats) { if(General.Map.Config.MixTexturesFlats)
{
cbMixMode.SelectedIndex = mixMode; cbMixMode.SelectedIndex = mixMode;
} else { }
else
{
labelMixMode.Visible = false; labelMixMode.Visible = false;
cbMixMode.Visible = false; cbMixMode.Visible = false;
label.Left = labelMixMode.Left; label.Left = labelMixMode.Left;
@ -261,7 +263,8 @@ namespace CodeImp.DoomBuilder.Controls
} }
//mxd //mxd
private void cbMixMode_SelectedIndexChanged(object sender, EventArgs e) { private void cbMixMode_SelectedIndexChanged(object sender, EventArgs e)
{
mixMode = cbMixMode.SelectedIndex; mixMode = cbMixMode.SelectedIndex;
RefillList(false); RefillList(false);
} }
@ -278,9 +281,11 @@ namespace CodeImp.DoomBuilder.Controls
ListViewItem selected = list.SelectedItems[0]; ListViewItem selected = list.SelectedItems[0];
//mxd //mxd
foreach(ListViewItem n in visibleitems) { foreach(ListViewItem n in visibleitems)
{
if(n == selected) continue; if(n == selected) continue;
if(n.Text == selected.Text) { if(n.Text == selected.Text)
{
n.Selected = true; n.Selected = true;
n.Focused = true; n.Focused = true;
n.EnsureVisible(); n.EnsureVisible();
@ -293,7 +298,7 @@ namespace CodeImp.DoomBuilder.Controls
// This selects an item by name // This selects an item by name
public void SelectItem(string name, ListViewGroup preferredgroup) public void SelectItem(string name, ListViewGroup preferredgroup)
{ {
ListViewItem lvi = null; ImageBrowserItem lvi = null; //mxd
// Not when selecting is prevented // Not when selecting is prevented
if(preventselection) return; if(preventselection) return;
@ -303,9 +308,10 @@ namespace CodeImp.DoomBuilder.Controls
{ {
foreach(ListViewItem item in list.Items) 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; if(item.Group == preferredgroup) break;
} }
} }
@ -326,9 +332,6 @@ namespace CodeImp.DoomBuilder.Controls
// This performs item sleection by keys // This performs item sleection by keys
private void SelectNextItem(SearchDirectionHint dir) private void SelectNextItem(SearchDirectionHint dir)
{ {
ListViewItem lvi;
Point spos;
// Not when selecting is prevented // Not when selecting is prevented
if(preventselection) return; if(preventselection) return;
@ -341,9 +344,9 @@ namespace CodeImp.DoomBuilder.Controls
else else
{ {
// Get selected item // Get selected item
lvi = list.SelectedItems[0]; ListViewItem lvi = list.SelectedItems[0];
Rectangle lvirect = list.GetItemRect(lvi.Index, ItemBoundsPortion.Entire); 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 // Try finding 5 times in the given direction
for(int i = 0; i < 5; i++) for(int i = 0; i < 5; i++)
@ -378,8 +381,6 @@ namespace CodeImp.DoomBuilder.Controls
// This selectes the first item // This selectes the first item
private void SelectFirstItem() private void SelectFirstItem()
{ {
ListViewItem lvi;
// Not when selecting is prevented // Not when selecting is prevented
if(preventselection) return; if(preventselection) return;
@ -387,7 +388,7 @@ namespace CodeImp.DoomBuilder.Controls
if(list.Items.Count > 0) if(list.Items.Count > 0)
{ {
list.SelectedItems.Clear(); 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) if(lvi != null)
{ {
lvi.Selected = true; lvi.Selected = true;
@ -424,14 +425,6 @@ namespace CodeImp.DoomBuilder.Controls
// This ends adding items // This ends adding items
public void EndAdding() 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 // Fill list with items
RefillList(true); RefillList(true);

View file

@ -29,6 +29,12 @@ namespace CodeImp.DoomBuilder.Controls
{ {
internal class ImageBrowserItem : ListViewItem, IComparable<ImageBrowserItem> internal class ImageBrowserItem : ListViewItem, IComparable<ImageBrowserItem>
{ {
#region ================== Constants
private const int MAX_DISPLAY_NAME_LENGTH = 16; //mxd
#endregion
#region ================== Variables #region ================== Variables
// Display image and text // Display image and text
@ -58,6 +64,9 @@ namespace CodeImp.DoomBuilder.Controls
{ {
// Initialize // Initialize
this.Text = text; 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) if(General.Settings.ShowTextureSizes)
this.displaytext = text + "\n" + icon.ScaledWidth + " x " + icon.ScaledHeight; this.displaytext = text + "\n" + icon.ScaledWidth + " x " + icon.ScaledHeight;
else else

View file

@ -32,34 +32,32 @@ namespace CodeImp.DoomBuilder.Controls
this.components = new System.ComponentModel.Container(); this.components = new System.ComponentModel.Container();
this.preview = new System.Windows.Forms.Panel(); this.preview = new System.Windows.Forms.Panel();
this.labelSize = new System.Windows.Forms.Label(); 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.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(); this.preview.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.imagebox)).BeginInit();
this.SuspendLayout(); this.SuspendLayout();
// //
// preview // preview
// //
this.preview.BackColor = System.Drawing.SystemColors.AppWorkspace; this.preview.BackColor = System.Drawing.SystemColors.AppWorkspace;
this.preview.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Zoom; 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.labelSize);
this.preview.Controls.Add(this.imagebox);
this.preview.Location = new System.Drawing.Point(0, 0); this.preview.Location = new System.Drawing.Point(0, 0);
this.preview.Name = "preview"; this.preview.Name = "preview";
this.preview.Size = new System.Drawing.Size(68, 60); this.preview.Size = new System.Drawing.Size(68, 60);
this.preview.TabIndex = 1; 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 // labelSize
// //
this.labelSize.AutoSize = true; 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.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.Location = new System.Drawing.Point(1, 1);
this.labelSize.MaximumSize = new System.Drawing.Size(0, 13); this.labelSize.MaximumSize = new System.Drawing.Size(0, 13);
this.labelSize.Name = "labelSize"; this.labelSize.Name = "labelSize";
@ -68,6 +66,30 @@ namespace CodeImp.DoomBuilder.Controls
this.labelSize.Text = "128x128"; this.labelSize.Text = "128x128";
this.labelSize.Visible = false; 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 // name
// //
this.name.AutoCompleteMode = System.Windows.Forms.AutoCompleteMode.Suggest; this.name.AutoCompleteMode = System.Windows.Forms.AutoCompleteMode.Suggest;
@ -79,11 +101,6 @@ namespace CodeImp.DoomBuilder.Controls
this.name.TabIndex = 2; this.name.TabIndex = 2;
this.name.TextChanged += new System.EventHandler(this.name_TextChanged); this.name.TextChanged += new System.EventHandler(this.name_TextChanged);
// //
// timer
//
this.timer.Interval = 1000;
this.timer.Tick += new System.EventHandler(this.timer_Tick);
//
// ImageSelectorControl // ImageSelectorControl
// //
this.AutoScaleDimensions = new System.Drawing.SizeF(96F, 96F); 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.EnabledChanged += new System.EventHandler(this.ImageSelectorControl_EnabledChanged);
this.preview.ResumeLayout(false); this.preview.ResumeLayout(false);
this.preview.PerformLayout(); this.preview.PerformLayout();
((System.ComponentModel.ISupportInitialize)(this.imagebox)).EndInit();
this.ResumeLayout(false); this.ResumeLayout(false);
this.PerformLayout(); this.PerformLayout();
@ -108,6 +126,8 @@ namespace CodeImp.DoomBuilder.Controls
protected CodeImp.DoomBuilder.Controls.AutoSelectTextbox name; protected CodeImp.DoomBuilder.Controls.AutoSelectTextbox name;
private System.Windows.Forms.Label labelSize; private System.Windows.Forms.Label labelSize;
protected System.Windows.Forms.Timer timer; protected System.Windows.Forms.Timer timer;
private System.Windows.Forms.ToolTip tooltip;
private ConfigurablePictureBox imagebox;
} }
} }

View file

@ -36,16 +36,17 @@ namespace CodeImp.DoomBuilder.Controls
public event EventHandler OnValueChanged; //mxd public event EventHandler OnValueChanged; //mxd
private Bitmap bmp; private Bitmap bmp;
private bool ismouseinside;
private MouseButtons button; private MouseButtons button;
private string previousImageName; //mxd private string previousImageName; //mxd
protected bool multipletextures; //mxd protected bool multipletextures; //mxd
protected bool usepreviews = true; //mxd
#endregion #endregion
#region ================== Properties #region ================== Properties
public string TextureName { get { return name.Text; } set { name.Text = value; } } public string TextureName { get { return name.Text; } set { name.Text = value; } }
public bool UsePreviews { get { return usepreviews; } set { usepreviews = value; } } //mxd
[Browsable(false)] [Browsable(false)]
public bool MultipleTextures { get { return multipletextures; } set { multipletextures = value; } } public bool MultipleTextures { get { return multipletextures; } set { multipletextures = value; } }
@ -67,6 +68,7 @@ namespace CodeImp.DoomBuilder.Controls
// set the max length of texture names // set the max length of texture names
name.MaxLength = General.Map.Config.MaxTextureNameLength; name.MaxLength = General.Map.Config.MaxTextureNameLength;
if(General.Settings.CapitalizeTextureNames) this.name.CharacterCasing = CharacterCasing.Upper; //mxd if(General.Settings.CapitalizeTextureNames) this.name.CharacterCasing = CharacterCasing.Upper; //mxd
labelSize.BackColor = Color.FromArgb(196, labelSize.BackColor);
} }
#endregion #endregion
@ -92,8 +94,7 @@ namespace CodeImp.DoomBuilder.Controls
// Image clicked // Image clicked
private void preview_Click(object sender, EventArgs e) private void preview_Click(object sender, EventArgs e)
{ {
preview.BackColor = SystemColors.Highlight; imagebox.BackColor = SystemColors.Highlight;
ShowPreview(FindImage(name.Text));
if(button == MouseButtons.Right) if(button == MouseButtons.Right)
{ {
name.Text = "-"; name.Text = "-";
@ -109,6 +110,9 @@ namespace CodeImp.DoomBuilder.Controls
{ {
// Show it centered // Show it centered
ShowPreview(FindImage(name.Text)); ShowPreview(FindImage(name.Text));
// Update tooltip (mxd)
tooltip.SetToolTip(imagebox, name.Text);
} }
// Mouse pressed // Mouse pressed
@ -117,44 +121,20 @@ namespace CodeImp.DoomBuilder.Controls
button = e.Button; button = e.Button;
if((button == MouseButtons.Left) || ((button == MouseButtons.Right))) if((button == MouseButtons.Left) || ((button == MouseButtons.Right)))
{ {
//ispressed = true; imagebox.BackColor = AdjustedColor(SystemColors.Highlight, 0.2f);
preview.BackColor = AdjustedColor(SystemColors.Highlight, 0.2f);
ShowPreview(FindImage(name.Text));
} }
} }
// Mouse released
private void preview_MouseUp(object sender, MouseEventArgs e)
{
//ispressed = false;
ShowPreview(FindImage(name.Text));
}
// Mouse leaves // Mouse leaves
private void preview_MouseLeave(object sender, EventArgs e) private void preview_MouseLeave(object sender, EventArgs e)
{ {
//ispressed = false; imagebox.BackColor = SystemColors.AppWorkspace;
ismouseinside = false;
preview.BackColor = SystemColors.AppWorkspace;
} }
// Mouse enters // Mouse enters
private void preview_MouseEnter(object sender, EventArgs e) private void preview_MouseEnter(object sender, EventArgs e)
{ {
ismouseinside = true; imagebox.BackColor = SystemColors.Highlight;
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));
}
} }
//mxd //mxd
@ -185,7 +165,7 @@ namespace CodeImp.DoomBuilder.Controls
private void ShowPreview(Image image) private void ShowPreview(Image image)
{ {
// Dispose old image // Dispose old image
preview.BackgroundImage = null; imagebox.BackgroundImage = null;
if(bmp != null) if(bmp != null)
{ {
bmp.Dispose(); bmp.Dispose();
@ -195,12 +175,13 @@ namespace CodeImp.DoomBuilder.Controls
if(image != null) if(image != null)
{ {
// Show it centered // Show it centered
General.DisplayZoomedImage(preview, image); imagebox.Image = image;
preview.Refresh(); imagebox.Refresh();
} }
//mxd. Dispatch event //mxd. Dispatch event
if(OnValueChanged != null && previousImageName != name.Text) { if(OnValueChanged != null && previousImageName != name.Text)
{
previousImageName = name.Text; previousImageName = name.Text;
OnValueChanged(this, EventArgs.Empty); OnValueChanged(this, EventArgs.Empty);
} }

View file

@ -120,12 +120,15 @@
<metadata name="preview.Locked" type="System.Boolean, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> <metadata name="preview.Locked" type="System.Boolean, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value> <value>True</value>
</metadata> </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"> <metadata name="timer.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>17, 17</value> <value>17, 17</value>
</metadata> </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"> <metadata name="$this.Locked" type="System.Boolean, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value> <value>True</value>
</metadata> </metadata>

View file

@ -35,6 +35,7 @@ namespace CodeImp.DoomBuilder.Controls
private int doomformatwidth; private int doomformatwidth;
private List<UniversalFieldInfo> fieldInfos; private List<UniversalFieldInfo> fieldInfos;
private int[] labelPositionsY = new[] { 39, 58, 77 }; //mxd private int[] labelPositionsY = new[] { 39, 58, 77 }; //mxd
private const int defaultPanelWidth = 270; //mxd
// Constructor // Constructor
public LinedefInfoPanel() public LinedefInfoPanel()
@ -52,12 +53,10 @@ namespace CodeImp.DoomBuilder.Controls
{ {
bool upperunpegged, lowerunpegged; bool upperunpegged, lowerunpegged;
string peggedness; string peggedness;
int defaultPanelWidth = 270; //mxd
//mxd //mxd
if (General.Map.UDMF && fieldInfos == null) { if (General.Map.UDMF && fieldInfos == null)
fieldInfos = General.Map.Config.SidedefFields; fieldInfos = General.Map.Config.SidedefFields;
}
// Show/hide stuff depending on format // Show/hide stuff depending on format
if(!General.Map.FormatInterface.HasActionArgs) if(!General.Map.FormatInterface.HasActionArgs)
@ -90,15 +89,18 @@ namespace CodeImp.DoomBuilder.Controls
} }
//mxd. Hide activation or tag and rearrange labels //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; activation.Visible = true;
activationlabel.Visible = true; activationlabel.Visible = true;
taglabel.Visible = false; taglabel.Visible = false;
tag.Visible = false; tag.Visible = false;
//set activation //set activation
foreach(LinedefActivateInfo ai in General.Map.Config.LinedefActivates) { foreach(LinedefActivateInfo ai in General.Map.Config.LinedefActivates)
if(l.Activate == ai.Index) { {
if(l.Activate == ai.Index)
{
activation.Text = ai.Title; activation.Text = ai.Title;
break; break;
} }
@ -118,8 +120,9 @@ namespace CodeImp.DoomBuilder.Controls
anglelabel.Top = labelPositionsY[2]; anglelabel.Top = labelPositionsY[2];
backoffset.Top = labelPositionsY[2]; backoffset.Top = labelPositionsY[2];
backoffsetlabel.Top = labelPositionsY[2]; backoffsetlabel.Top = labelPositionsY[2];
}
} else { else
{
activation.Visible = false; activation.Visible = false;
activationlabel.Visible = false; activationlabel.Visible = false;
taglabel.Visible = true; taglabel.Visible = true;
@ -187,11 +190,10 @@ namespace CodeImp.DoomBuilder.Controls
arg5.Enabled = act.Args[4].Used; arg5.Enabled = act.Args[4].Used;
//mxd //mxd
if (hasArg0Str) { if (hasArg0Str)
arg1.Text = '"' + l.Fields["arg0str"].Value.ToString() + '"'; arg1.Text = '"' + l.Fields["arg0str"].Value.ToString() + '"';
} else { else
setArgumentText(act.Args[0], arg1, l.Args[0]); setArgumentText(act.Args[0], arg1, l.Args[0]);
}
setArgumentText(act.Args[1], arg2, l.Args[1]); setArgumentText(act.Args[1], arg2, l.Args[1]);
setArgumentText(act.Args[2], arg3, l.Args[2]); setArgumentText(act.Args[2], arg3, l.Args[2]);
setArgumentText(act.Args[3], arg4, l.Args[3]); setArgumentText(act.Args[3], arg4, l.Args[3]);
@ -210,7 +212,8 @@ namespace CodeImp.DoomBuilder.Controls
frontsector.Visible = true; frontsector.Visible = true;
//mxd //mxd
if(General.Map.UDMF) { if(General.Map.UDMF)
{
//light //light
frontoffsetlabel.Text = "Front light:"; frontoffsetlabel.Text = "Front light:";
setUDMFLight(l.Front, frontoffsetlabel, frontoffset); setUDMFLight(l.Front, frontoffsetlabel, frontoffset);
@ -249,7 +252,9 @@ namespace CodeImp.DoomBuilder.Controls
if(hasTopFields) addedWidth = 64; if(hasTopFields) addedWidth = 64;
if(hasMiddleFields) addedWidth += 64; if(hasMiddleFields) addedWidth += 64;
if(hasBottomFields) addedWidth += 64; if(hasBottomFields) addedWidth += 64;
} else { }
else
{
frontoffsetlabel.Text = "Front offset:"; frontoffsetlabel.Text = "Front offset:";
frontoffset.Text = l.Front.OffsetX + ", " + l.Front.OffsetY; frontoffset.Text = l.Front.OffsetX + ", " + l.Front.OffsetY;
frontoffsetlabel.Enabled = true; frontoffsetlabel.Enabled = true;
@ -264,12 +269,10 @@ namespace CodeImp.DoomBuilder.Controls
frontpanel.Width = defaultPanelWidth + addedWidth + 12; frontpanel.Width = defaultPanelWidth + addedWidth + 12;
flowLayoutPanelFront.Width = defaultPanelWidth + addedWidth; flowLayoutPanelFront.Width = defaultPanelWidth + addedWidth;
fronthighname.Text = l.Front.HighTexture; // Show textures
frontmidname.Text = l.Front.MiddleTexture; DisplaySidedefTexture(fronthightex, fronthighname, labelTextureFrontTop, l.Front.HighTexture, l.Front.HighRequired());
frontlowname.Text = l.Front.LowTexture; DisplaySidedefTexture(frontmidtex, frontmidname, labelTextureFrontMid, l.Front.MiddleTexture, l.Front.MiddleRequired());
DisplaySidedefTexture(fronthightex, labelTextureFrontTop, l.Front.HighTexture, l.Front.HighRequired()); DisplaySidedefTexture(frontlowtex, frontlowname, labelTextureFrontBottom, l.Front.LowTexture, l.Front.LowRequired());
DisplaySidedefTexture(frontmidtex, labelTextureFrontMid, l.Front.MiddleTexture, l.Front.MiddleRequired());
DisplaySidedefTexture(frontlowtex, labelTextureFrontBottom, l.Front.LowTexture, l.Front.LowRequired());
//mxd. Position label //mxd. Position label
frontsector.Left = frontpanel.Width - frontsector.Width - 12; frontsector.Left = frontpanel.Width - frontsector.Width - 12;
@ -277,11 +280,13 @@ namespace CodeImp.DoomBuilder.Controls
else else
{ {
// Show no info // Show no info
//mxd if(General.Map.UDMF) //mxd
if(General.Map.UDMF) { {
frontoffsetlabel.Text = "Front light:"; frontoffsetlabel.Text = "Front light:";
frontoffset.Text = "--"; frontoffset.Text = "--";
} else { }
else
{
frontoffsetlabel.Text = "Front offset:"; frontoffsetlabel.Text = "Front offset:";
frontoffset.Text = "--, --"; frontoffset.Text = "--, --";
} }
@ -362,12 +367,10 @@ namespace CodeImp.DoomBuilder.Controls
backpanel.Width = defaultPanelWidth + addedWidth + 12; backpanel.Width = defaultPanelWidth + addedWidth + 12;
flowLayoutPanelBack.Width = defaultPanelWidth + addedWidth; flowLayoutPanelBack.Width = defaultPanelWidth + addedWidth;
backhighname.Text = l.Back.HighTexture; // Show textures
backmidname.Text = l.Back.MiddleTexture; DisplaySidedefTexture(backhightex, backhighname, labelTextureBackTop, l.Back.HighTexture, l.Back.HighRequired());
backlowname.Text = l.Back.LowTexture; DisplaySidedefTexture(backmidtex, backmidname, labelTextureBackMid, l.Back.MiddleTexture, l.Back.MiddleRequired());
DisplaySidedefTexture(backhightex, labelTextureBackTop, l.Back.HighTexture, l.Back.HighRequired()); DisplaySidedefTexture(backlowtex, backlowname, labelTextureBackBottom, l.Back.LowTexture, l.Back.LowRequired());
DisplaySidedefTexture(backmidtex, labelTextureBackMid, l.Back.MiddleTexture, l.Back.MiddleRequired());
DisplaySidedefTexture(backlowtex, labelTextureBackBottom, l.Back.LowTexture, l.Back.LowRequired());
//mxd. Position label //mxd. Position label
backsector.Left = backpanel.Width - backsector.Width - 12; backsector.Left = backpanel.Width - backsector.Width - 12;
@ -375,11 +378,13 @@ namespace CodeImp.DoomBuilder.Controls
else else
{ {
// Show no info // Show no info
//mxd if(General.Map.UDMF) //mxd
if(General.Map.UDMF) { {
backoffsetlabel.Text = "Back light:"; backoffsetlabel.Text = "Back light:";
backoffset.Text = "--"; backoffset.Text = "--";
} else { }
else
{
backoffsetlabel.Text = "Back offset:"; backoffsetlabel.Text = "Back offset:";
backoffset.Text = "--, --"; backoffset.Text = "--, --";
} }
@ -396,21 +401,21 @@ namespace CodeImp.DoomBuilder.Controls
//mxd. Flags //mxd. Flags
Dictionary<string, string> activations = new Dictionary<string, string>(StringComparer.Ordinal); 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); activations.Add(ai.Key, ai.Title);
}
flags.Items.Clear(); flags.Items.Clear();
foreach(KeyValuePair<string, bool> group in l.Flags) { foreach(KeyValuePair<string, bool> group in l.Flags)
if(group.Value) { {
if(group.Value)
{
ListViewItem item; 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]); 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]); item = new ListViewItem(activations[group.Key]);
} else { else
item = new ListViewItem(group.Key); item = new ListViewItem(group.Key);
}
item.Checked = true; item.Checked = true;
flags.Items.Add(item); flags.Items.Add(item);
@ -419,7 +424,8 @@ namespace CodeImp.DoomBuilder.Controls
//mxd. Flags panel visibility and size //mxd. Flags panel visibility and size
flagsPanel.Visible = (flags.Items.Count > 0); 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; int itemWidth = flags.Items[0].GetBounds(ItemBoundsPortion.Entire).Width;
if(itemWidth == 0) itemWidth = 96; if(itemWidth == 0) itemWidth = 96;
flags.Width = itemWidth * (int)Math.Ceiling(flags.Items.Count / 5.0f); flags.Width = itemWidth * (int)Math.Ceiling(flags.Items.Count / 5.0f);
@ -432,7 +438,8 @@ namespace CodeImp.DoomBuilder.Controls
} }
//mxd //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 dx = getDefaultUDMFValue(paramX);
float dy = getDefaultUDMFValue(paramY); float dy = getDefaultUDMFValue(paramY);
float x = dx; float x = dx;
@ -443,7 +450,8 @@ namespace CodeImp.DoomBuilder.Controls
if(fields.ContainsKey(paramY)) if(fields.ContainsKey(paramY))
y = (float)fields[paramY].Value; 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.Text = String.Format("{0:0.##}", x) + ", " + String.Format("{0:0.##}", y);
value.Enabled = true; value.Enabled = true;
label.Enabled = true; label.Enabled = true;
@ -459,7 +467,8 @@ namespace CodeImp.DoomBuilder.Controls
//mxd //mxd
private static void setUDMFLight(Sidedef sd, Label label, Label value) 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; int light = (int)sd.Fields["light"].Value;
if (sd.Fields.ContainsKey("lightabsolute") && Boolean.Parse(sd.Fields["lightabsolute"].Value.ToString())) if (sd.Fields.ContainsKey("lightabsolute") && Boolean.Parse(sd.Fields["lightabsolute"].Value.ToString()))
@ -469,7 +478,9 @@ namespace CodeImp.DoomBuilder.Controls
value.Enabled = true; value.Enabled = true;
label.Enabled = true; label.Enabled = true;
} else { }
else
{
value.Text = "--"; value.Text = "--";
label.Enabled = false; label.Enabled = false;
value.Enabled = false; value.Enabled = false;
@ -479,9 +490,8 @@ namespace CodeImp.DoomBuilder.Controls
//mxd //mxd
private float getDefaultUDMFValue(string valueName) private float getDefaultUDMFValue(string valueName)
{ {
foreach (UniversalFieldInfo fi in fieldInfos) { foreach (UniversalFieldInfo fi in fieldInfos)
if (fi.Name == valueName) return (float)fi.Default; if (fi.Name == valueName) return (float)fi.Default;
}
return 0; return 0;
} }
@ -494,10 +504,9 @@ namespace CodeImp.DoomBuilder.Controls
if(value < 1 || !General.Map.Options.TagLabels.ContainsKey(value)) return; 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] + ")"; label.Text += " (" + General.Map.Options.TagLabels[value] + ")";
} }
}
// When visible changed // When visible changed
protected override void OnVisibleChanged(EventArgs e) protected override void OnVisibleChanged(EventArgs e)
@ -518,29 +527,39 @@ namespace CodeImp.DoomBuilder.Controls
} }
// This shows a sidedef texture in a panel // 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 // Check if name is a "none" texture
if((name.Length < 1) || (name == "-")) if((name.Length < 1) || (name == "-"))
{ {
label.Visible = false; //mxd sizelabel.Visible = false; //mxd
// Determine image to show // Determine image to show
if(required) if(required)
General.DisplayZoomedImage(panel, Properties.Resources.MissingTexture); General.DisplayZoomedImage(panel, Properties.Resources.MissingTexture);
else else
panel.BackgroundImage = null; panel.BackgroundImage = null;
// Set texture name
namelabel.Text = "-";
} }
else else
{ {
//mxd //mxd
ImageData texture = General.Map.Data.GetTextureImage(name); ImageData texture = General.Map.Data.GetTextureImage(name);
if(General.Settings.ShowTextureSizes && texture.ImageState == ImageLoadState.Ready && !(texture is UnknownImage)) { bool unknowntexture = texture is UnknownImage;
label.Visible = true; if(General.Settings.ShowTextureSizes && texture.ImageState == ImageLoadState.Ready && !unknowntexture)
label.Text = texture.ScaledWidth + "x" + texture.ScaledHeight; {
} else { sizelabel.Visible = true;
label.Visible = false; sizelabel.Text = texture.ScaledWidth + "x" + texture.ScaledHeight;
} }
else
{
sizelabel.Visible = false;
}
// Set texture name
namelabel.Text = (unknowntexture ? name : texture.DisplayName);
// Set the image // Set the image
General.DisplayZoomedImage(panel, texture.GetPreview()); General.DisplayZoomedImage(panel, texture.GetPreview());

View file

@ -170,13 +170,11 @@ namespace CodeImp.DoomBuilder.Controls
// This adds a normal item // This adds a normal item
private void AddItem(DataLocation rl) private void AddItem(DataLocation rl)
{ {
int index;
// Start editing list // Start editing list
resourceitems.BeginUpdate(); resourceitems.BeginUpdate();
// Add item // Add item
index = resourceitems.Items.Count; int index = resourceitems.Items.Count;
resourceitems.Items.Add(new ListViewItem(rl.location)); resourceitems.Items.Add(new ListViewItem(rl.location));
resourceitems.Items[index].Tag = rl; resourceitems.Items[index].Tag = rl;
resourceitems.Items[index].ImageIndex = GetIconIndex(rl.type, false); resourceitems.Items[index].ImageIndex = GetIconIndex(rl.type, false);
@ -189,22 +187,30 @@ namespace CodeImp.DoomBuilder.Controls
} }
//mxd //mxd
internal void DropItem(IDataObject data) { internal void DropItem(IDataObject data)
{
if(!data.GetDataPresent(DataFormats.FileDrop)) return; if(!data.GetDataPresent(DataFormats.FileDrop)) return;
string[] paths = (string[])data.GetData(DataFormats.FileDrop); string[] paths = (string[])data.GetData(DataFormats.FileDrop);
foreach(string path in paths) { foreach(string path in paths)
if(File.Exists(path)) { {
if(File.Exists(path))
{
string ext = Path.GetExtension(path); string ext = Path.GetExtension(path);
if(string.IsNullOrEmpty(ext)) if(string.IsNullOrEmpty(ext)) continue;
continue;
ext = ext.ToLower(); ext = ext.ToLower();
if(ext == ".wad") { if(ext == ".wad")
{
AddItem(new DataLocation(DataLocation.RESOURCE_WAD, path, false, false, false)); 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)); 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)); AddItem(new DataLocation(DataLocation.RESOURCE_DIRECTORY, path, false, false, false));
} }
} }
@ -227,13 +233,10 @@ namespace CodeImp.DoomBuilder.Controls
// Add a resource // Add a resource
private void addresource_Click(object sender, EventArgs e) private void addresource_Click(object sender, EventArgs e)
{ {
ResourceOptionsForm resoptions;
Rectangle startposition;
// Open resource options dialog // 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; 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); startposition = this.RectangleToScreen(startposition);
Screen screen = Screen.FromPoint(startposition.Location); Screen screen = Screen.FromPoint(startposition.Location);
if(startposition.X + resoptions.Size.Width > screen.WorkingArea.Right) if(startposition.X + resoptions.Size.Width > screen.WorkingArea.Right)
@ -254,21 +257,16 @@ namespace CodeImp.DoomBuilder.Controls
// Edit resource // Edit resource
private void editresource_Click(object sender, EventArgs e) private void editresource_Click(object sender, EventArgs e)
{ {
ResourceOptionsForm resoptions;
Rectangle startposition;
ListViewItem selecteditem;
DataLocation rl;
// Anything selected? // Anything selected?
if(resourceitems.SelectedItems.Count > 0) if(resourceitems.SelectedItems.Count > 0)
{ {
// Get selected item // Get selected item
selecteditem = resourceitems.SelectedItems[0]; ListViewItem selecteditem = resourceitems.SelectedItems[0];
// Open resource options dialog // 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; 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); startposition = this.RectangleToScreen(startposition);
Screen screen = Screen.FromPoint(startposition.Location); Screen screen = Screen.FromPoint(startposition.Location);
if(startposition.X + resoptions.Size.Width > screen.WorkingArea.Right) if(startposition.X + resoptions.Size.Width > screen.WorkingArea.Right)
@ -282,7 +280,7 @@ namespace CodeImp.DoomBuilder.Controls
resourceitems.BeginUpdate(); resourceitems.BeginUpdate();
// Update item // Update item
rl = resoptions.ResourceLocation; DataLocation rl = resoptions.ResourceLocation;
selecteditem.Text = rl.location; selecteditem.Text = rl.location;
selecteditem.Tag = rl; selecteditem.Tag = rl;
selecteditem.ImageIndex = GetIconIndex(rl.type, false); selecteditem.ImageIndex = GetIconIndex(rl.type, false);

View file

@ -29,7 +29,7 @@ namespace CodeImp.DoomBuilder.Controls
{ {
internal partial class SectorInfoPanel : UserControl internal partial class SectorInfoPanel : UserControl
{ {
private int fullWidth; //mxd private readonly int fullWidth; //mxd
// Constructor // Constructor
public SectorInfoPanel() 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); tag.Text = s.Tag + (General.Map.Options.TagLabels.ContainsKey(s.Tag) ? " (" + General.Map.Options.TagLabels[s.Tag] + ")" : string.Empty);
height.Text = sheight.ToString(); height.Text = sheight.ToString();
brightness.Text = s.Brightness.ToString(); brightness.Text = s.Brightness.ToString();
floorname.Text = s.FloorTexture;
ceilingname.Text = s.CeilTexture;
//mxd. Texture info //mxd. Texture info
if (s.LongFloorTexture == MapSet.EmptyLongName){ if (s.LongFloorTexture == MapSet.EmptyLongName)
{
labelFloorTextureSize.Visible = false; labelFloorTextureSize.Visible = false;
General.DisplayZoomedImage(floortex, Properties.Resources.MissingTexture); General.DisplayZoomedImage(floortex, Properties.Resources.MissingTexture);
} else { floorname.Text = s.FloorTexture;
ImageData floorImage = General.Map.Data.GetFlatImage(s.FloorTexture); }
DisplayTextureSize(labelFloorTextureSize, floorImage); else
General.DisplayZoomedImage(floortex, floorImage.GetPreview()); {
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; labelCeilTextureSize.Visible = false;
General.DisplayZoomedImage(ceilingtex, Properties.Resources.MissingTexture); General.DisplayZoomedImage(ceilingtex, Properties.Resources.MissingTexture);
} else { ceilingname.Text = s.CeilTexture;
ImageData ceilingImage = General.Map.Data.GetFlatImage(s.CeilTexture); }
DisplayTextureSize(labelCeilTextureSize, ceilingImage); //mxd else
General.DisplayZoomedImage(ceilingtex, ceilingImage.GetPreview()); {
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 //mxd
bool showExtededFloorInfo = false; bool showExtededFloorInfo = false;
bool showExtededCeilingInfo = false; bool showExtededCeilingInfo = false;
if(General.Map.UDMF) { if(General.Map.UDMF)
if(s.Fields != null) { {
if(s.Fields != null)
{
//sector colors //sector colors
labelLight.Visible = true; labelLight.Visible = true;
labelFade.Visible = true; labelFade.Visible = true;
panelLightColor.Visible = true; panelLightColor.Visible = true;
panelFadeColor.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(); panelLightColor.BackColor = PixelColor.FromInt(s.Fields.GetValue("lightcolor", 0xFFFFFF)).WithAlpha(255).ToColor();
labelLight.Enabled = true; labelLight.Enabled = true;
} else { }
else
{
panelLightColor.BackColor = System.Drawing.SystemColors.Control; panelLightColor.BackColor = System.Drawing.SystemColors.Control;
labelLight.Enabled = false; 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(); panelFadeColor.BackColor = PixelColor.FromInt(s.Fields.GetValue("fadecolor", 0)).WithAlpha(255).ToColor();
labelFade.Enabled = true; labelFade.Enabled = true;
} else { }
else
{
panelFadeColor.BackColor = System.Drawing.SystemColors.Control; panelFadeColor.BackColor = System.Drawing.SystemColors.Control;
labelFade.Enabled = false; labelFade.Enabled = false;
} }
//light //light
if(s.Fields.ContainsKey("lightceiling") || s.Fields.ContainsKey("lightceilingabsolute")) { if(s.Fields.ContainsKey("lightceiling") || s.Fields.ContainsKey("lightceilingabsolute"))
{
showExtededCeilingInfo = true; showExtededCeilingInfo = true;
ceilingLight.Enabled = true; ceilingLight.Enabled = true;
ceilingLightLabel.Enabled = true; ceilingLightLabel.Enabled = true;
@ -117,13 +134,16 @@ namespace CodeImp.DoomBuilder.Controls
else else
ceilingLight.Text = cl + " (" + Math.Min(255, Math.Max(0, (cl + s.Brightness))) + ")"; ceilingLight.Text = cl + " (" + Math.Min(255, Math.Max(0, (cl + s.Brightness))) + ")";
} else { }
else
{
ceilingLight.Text = "--"; ceilingLight.Text = "--";
ceilingLight.Enabled = false; ceilingLight.Enabled = false;
ceilingLightLabel.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; showExtededFloorInfo = true;
floorLight.Enabled = true; floorLight.Enabled = true;
floorLightLabel.Enabled = true; floorLightLabel.Enabled = true;
@ -135,7 +155,9 @@ namespace CodeImp.DoomBuilder.Controls
else else
floorLight.Text = fl + " (" + Math.Min(255, Math.Max(0, (fl + s.Brightness))) + ")"; floorLight.Text = fl + " (" + Math.Min(255, Math.Max(0, (fl + s.Brightness))) + ")";
} else { }
else
{
floorLight.Text = "--"; floorLight.Text = "--";
floorLight.Enabled = false; floorLight.Enabled = false;
floorLightLabel.Enabled = false; floorLightLabel.Enabled = false;
@ -145,12 +167,15 @@ namespace CodeImp.DoomBuilder.Controls
float panX = s.Fields.GetValue("xpanningceiling", 0f); float panX = s.Fields.GetValue("xpanningceiling", 0f);
float panY = s.Fields.GetValue("ypanningceiling", 0f); float panY = s.Fields.GetValue("ypanningceiling", 0f);
if(panX != 0 || panY != 0) { if(panX != 0 || panY != 0)
{
showExtededCeilingInfo = true; showExtededCeilingInfo = true;
ceilingOffset.Enabled = true; ceilingOffset.Enabled = true;
ceilingOffsetLabel.Enabled = true; ceilingOffsetLabel.Enabled = true;
ceilingOffset.Text = String.Format("{0:0.##}", panX) + ", " + String.Format("{0:0.##}", panY); ceilingOffset.Text = String.Format("{0:0.##}", panX) + ", " + String.Format("{0:0.##}", panY);
} else { }
else
{
ceilingOffset.Text = "--, --"; ceilingOffset.Text = "--, --";
ceilingOffset.Enabled = false; ceilingOffset.Enabled = false;
ceilingOffsetLabel.Enabled = false; ceilingOffsetLabel.Enabled = false;
@ -160,12 +185,15 @@ namespace CodeImp.DoomBuilder.Controls
panX = s.Fields.GetValue("xpanningfloor", 0f); panX = s.Fields.GetValue("xpanningfloor", 0f);
panY = s.Fields.GetValue("ypanningfloor", 0f); panY = s.Fields.GetValue("ypanningfloor", 0f);
if(panX != 0 || panY != 0) { if(panX != 0 || panY != 0)
{
showExtededFloorInfo = true; showExtededFloorInfo = true;
floorOffset.Enabled = true; floorOffset.Enabled = true;
floorOffsetLabel.Enabled = true; floorOffsetLabel.Enabled = true;
floorOffset.Text = String.Format("{0:0.##}", panX) + ", " + String.Format("{0:0.##}", panY); floorOffset.Text = String.Format("{0:0.##}", panX) + ", " + String.Format("{0:0.##}", panY);
} else { }
else
{
floorOffset.Text = "--, --"; floorOffset.Text = "--, --";
floorOffset.Enabled = false; floorOffset.Enabled = false;
floorOffsetLabel.Enabled = false; floorOffsetLabel.Enabled = false;
@ -175,12 +203,15 @@ namespace CodeImp.DoomBuilder.Controls
float scaleX = s.Fields.GetValue("xscaleceiling", 1.0f);//1.0f; float scaleX = s.Fields.GetValue("xscaleceiling", 1.0f);//1.0f;
float scaleY = s.Fields.GetValue("yscaleceiling", 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; showExtededCeilingInfo = true;
ceilingScale.Enabled = true; ceilingScale.Enabled = true;
ceilingScaleLabel.Enabled = true; ceilingScaleLabel.Enabled = true;
ceilingScale.Text = String.Format("{0:0.##}", scaleX) + ", " + String.Format("{0:0.##}", scaleY); ceilingScale.Text = String.Format("{0:0.##}", scaleX) + ", " + String.Format("{0:0.##}", scaleY);
} else { }
else
{
ceilingScale.Text = "--, --"; ceilingScale.Text = "--, --";
ceilingScale.Enabled = false; ceilingScale.Enabled = false;
ceilingScaleLabel.Enabled = false; ceilingScaleLabel.Enabled = false;
@ -190,35 +221,44 @@ namespace CodeImp.DoomBuilder.Controls
scaleX = s.Fields.GetValue("xscalefloor", 1.0f); scaleX = s.Fields.GetValue("xscalefloor", 1.0f);
scaleY = s.Fields.GetValue("yscalefloor", 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; showExtededFloorInfo = true;
floorScale.Enabled = true; floorScale.Enabled = true;
floorScaleLabel.Enabled = true; floorScaleLabel.Enabled = true;
floorScale.Text = String.Format("{0:0.##}", scaleX) + ", " + String.Format("{0:0.##}", scaleY); floorScale.Text = String.Format("{0:0.##}", scaleX) + ", " + String.Format("{0:0.##}", scaleY);
} else { }
else
{
floorScale.Text = "--, --"; floorScale.Text = "--, --";
floorScale.Enabled = false; floorScale.Enabled = false;
floorScaleLabel.Enabled = false; floorScaleLabel.Enabled = false;
} }
//rotation //rotation
if(s.Fields.ContainsKey("rotationceiling")) { if(s.Fields.ContainsKey("rotationceiling"))
{
showExtededCeilingInfo = true; showExtededCeilingInfo = true;
ceilingAngle.Enabled = true; ceilingAngle.Enabled = true;
ceilingAngleLabel.Enabled = true; ceilingAngleLabel.Enabled = true;
ceilingAngle.Text = s.Fields["rotationceiling"].Value + "\u00B0"; ceilingAngle.Text = s.Fields["rotationceiling"].Value + "\u00B0";
} else { }
else
{
ceilingAngle.Text = "-"; ceilingAngle.Text = "-";
ceilingAngle.Enabled = false; ceilingAngle.Enabled = false;
ceilingAngleLabel.Enabled = false; ceilingAngleLabel.Enabled = false;
} }
if(s.Fields.ContainsKey("rotationfloor")) { if(s.Fields.ContainsKey("rotationfloor"))
{
showExtededFloorInfo = true; showExtededFloorInfo = true;
floorAngle.Enabled = true; floorAngle.Enabled = true;
floorAngleLabel.Enabled = true; floorAngleLabel.Enabled = true;
floorAngle.Text = s.Fields["rotationfloor"].Value + "\u00B0"; floorAngle.Text = s.Fields["rotationfloor"].Value + "\u00B0";
} else { }
else
{
floorAngle.Text = "-"; floorAngle.Text = "-";
floorAngle.Enabled = false; floorAngle.Enabled = false;
floorAngleLabel.Enabled = false; floorAngleLabel.Enabled = false;
@ -227,8 +267,10 @@ namespace CodeImp.DoomBuilder.Controls
//Flags //Flags
flags.Items.Clear(); flags.Items.Clear();
foreach(KeyValuePair<string, bool> group in s.Flags) { foreach(KeyValuePair<string, bool> group in s.Flags)
if(group.Value) { {
if(group.Value)
{
ListViewItem item = new ListViewItem(General.Map.Config.SectorFlags.ContainsKey(group.Key) ? General.Map.Config.SectorFlags[group.Key] : group.Key); ListViewItem item = new ListViewItem(General.Map.Config.SectorFlags.ContainsKey(group.Key) ? General.Map.Config.SectorFlags[group.Key] : group.Key);
item.Checked = true; item.Checked = true;
flags.Items.Add(item); flags.Items.Add(item);
@ -237,14 +279,17 @@ namespace CodeImp.DoomBuilder.Controls
//mxd. Flags panel visibility and size //mxd. Flags panel visibility and size
flagsPanel.Visible = (flags.Items.Count > 0); 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; int itemWidth = flags.Items[0].GetBounds(ItemBoundsPortion.Entire).Width;
if(itemWidth == 0) itemWidth = 96; if(itemWidth == 0) itemWidth = 96;
flags.Width = itemWidth * (int)Math.Ceiling(flags.Items.Count / 5.0f); flags.Width = itemWidth * (int)Math.Ceiling(flags.Items.Count / 5.0f);
flagsPanel.Width = flags.Width + flags.Left * 2; flagsPanel.Width = flags.Width + flags.Left * 2;
} }
} else { }
else
{
panelFadeColor.Visible = false; panelFadeColor.Visible = false;
panelLightColor.Visible = false; panelLightColor.Visible = false;
labelFade.Visible = false; labelFade.Visible = false;
@ -253,18 +298,24 @@ namespace CodeImp.DoomBuilder.Controls
} }
//panels size //panels size
if(showExtededCeilingInfo) { if(showExtededCeilingInfo)
{
ceilingpanel.Width = fullWidth; ceilingpanel.Width = fullWidth;
ceilingInfo.Visible = true; ceilingInfo.Visible = true;
} else { }
else
{
ceilingInfo.Visible = false; ceilingInfo.Visible = false;
ceilingpanel.Width = 84; ceilingpanel.Width = 84;
} }
if(showExtededFloorInfo) { if(showExtededFloorInfo)
{
floorpanel.Width = fullWidth; floorpanel.Width = fullWidth;
floorInfo.Visible = true; floorInfo.Visible = true;
} else { }
else
{
floorInfo.Visible = false; floorInfo.Visible = false;
floorpanel.Width = 84; floorpanel.Width = 84;
} }
@ -275,11 +326,16 @@ namespace CodeImp.DoomBuilder.Controls
this.Update(); this.Update();
} }
protected void DisplayTextureSize(Label label, ImageData texture) { private void DisplayTextureSize(Label label, ImageData texture)
if(General.Settings.ShowTextureSizes && texture.ImageState == ImageLoadState.Ready && !string.IsNullOrEmpty(texture.Name) && !(texture is UnknownImage)) { {
if(General.Settings.ShowTextureSizes && texture.ImageState == ImageLoadState.Ready
&& !string.IsNullOrEmpty(texture.Name) && !(texture is UnknownImage))
{
label.Visible = true; label.Visible = true;
label.Text = texture.ScaledWidth + "x" + texture.ScaledHeight; label.Text = texture.ScaledWidth + "x" + texture.ScaledHeight;
} else { }
else
{
label.Visible = false; label.Visible = false;
} }
} }

View file

@ -50,7 +50,8 @@ namespace CodeImp.DoomBuilder.Controls
timer.Stop(); //mxd timer.Stop(); //mxd
// Check if name is a "none" texture // Check if name is a "none" texture
if(string.IsNullOrEmpty(imagename)) { if(string.IsNullOrEmpty(imagename))
{
DisplayImageSize(0, 0); //mxd DisplayImageSize(0, 0); //mxd
//mxd. Determine image to show //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 if(string.IsNullOrEmpty(texture.FullName) || texture is UnknownImage) DisplayImageSize(0, 0); //mxd
else DisplayImageSize(texture.ScaledWidth, texture.ScaledHeight); //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 // Set the image
return texture.GetPreview(); return (usepreviews ? texture.GetPreview() : texture.GetBitmap());
} }
} }
// This browses for a texture // This browses for a texture
protected override string BrowseImage(string imagename) { protected override string BrowseImage(string imagename)
{
// Browse for texture // Browse for texture
string result = TextureBrowserForm.Browse(this.ParentForm, imagename, false); string result = TextureBrowserForm.Browse(this.ParentForm, imagename, false);
return result ?? imagename; return result ?? imagename;

View file

@ -45,29 +45,24 @@ namespace CodeImp.DoomBuilder.Data
// This loads the image // This loads the image
protected override void LocalLoadImage() protected override void LocalLoadImage()
{ {
Stream lumpdata;
MemoryStream mem;
IImageReader reader;
byte[] membytes;
// Leave when already loaded // Leave when already loaded
if(this.IsImageLoaded) return; if(this.IsImageLoaded) return;
lock(this) lock(this)
{ {
// Get the lump data stream // Get the lump data stream
lumpdata = General.Map.Data.GetColormapData(Name); Stream lumpdata = General.Map.Data.GetColormapData(Name);
if(lumpdata != null) if(lumpdata != null)
{ {
// Copy lump data to memory // Copy lump data to memory
lumpdata.Seek(0, SeekOrigin.Begin); 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); lumpdata.Read(membytes, 0, (int)lumpdata.Length);
mem = new MemoryStream(membytes); MemoryStream mem = new MemoryStream(membytes);
mem.Seek(0, SeekOrigin.Begin); mem.Seek(0, SeekOrigin.Begin);
// Get a reader for the data // 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) if(reader is UnknownImageReader)
{ {
// Data is in an unknown format! // Data is in an unknown format!

View file

@ -39,6 +39,7 @@ namespace CodeImp.DoomBuilder.Data
#region ================== Constants #region ================== Constants
public const string INTERNAL_PREFIX = "internal:"; public const string INTERNAL_PREFIX = "internal:";
public const int CLASIC_IMAGE_NAME_LENGTH = 8; //mxd
#endregion #endregion
@ -53,8 +54,10 @@ namespace CodeImp.DoomBuilder.Data
// Textures, Flats and Sprites // Textures, Flats and Sprites
private Dictionary<long, ImageData> textures; private Dictionary<long, ImageData> textures;
private Dictionary<long, long> texturenamesshorttofull; //mxd
private List<string> texturenames; private List<string> texturenames;
private Dictionary<long, ImageData> flats; private Dictionary<long, ImageData> flats;
private Dictionary<long, long> flatnamesshorttofull; //mxd
private List<string> flatnames; private List<string> flatnames;
private Dictionary<long, ImageData> sprites; private Dictionary<long, ImageData> sprites;
private List<MatchingTextureSet> texturesets; private List<MatchingTextureSet> texturesets;
@ -237,6 +240,8 @@ namespace CodeImp.DoomBuilder.Data
sprites = new Dictionary<long, ImageData>(); sprites = new Dictionary<long, ImageData>();
texturenames = new List<string>(); texturenames = new List<string>();
flatnames = new List<string>(); flatnames = new List<string>();
texturenamesshorttofull = new Dictionary<long, long>(); //mxd
flatnamesshorttofull = new Dictionary<long, long>(); //mxd
imageque = new Queue<ImageData>(); imageque = new Queue<ImageData>();
previews = new PreviewManager(); previews = new PreviewManager();
texturesets = new List<MatchingTextureSet>(); texturesets = new List<MatchingTextureSet>();
@ -320,7 +325,6 @@ namespace CodeImp.DoomBuilder.Data
Dictionary<string, int> actorsByClass = createActorsByClassList(); Dictionary<string, int> actorsByClass = createActorsByClassList();
loadModeldefs(actorsByClass); loadModeldefs(actorsByClass);
loadGldefs(actorsByClass); loadGldefs(actorsByClass);
actorsByClass = null; //don't need them any more
foreach (Thing t in General.Map.Map.Things) t.UpdateCache(); foreach (Thing t in General.Map.Map.Things) t.UpdateCache();
General.MainWindow.DisplayReady(); General.MainWindow.DisplayReady();
@ -386,6 +390,10 @@ namespace CodeImp.DoomBuilder.Data
// Sort things // Sort things
foreach(ThingCategory tc in thingcategories) tc.SortIfNeeded(); foreach(ThingCategory tc in thingcategories) tc.SortIfNeeded();
//mxd. Create texture name translation lists
texturenamesshorttofull = CreateShortTextureNamesCollection(textures);
flatnamesshorttofull = CreateShortTextureNamesCollection(flats);
// Update the used textures // Update the used textures
General.Map.Data.UpdateUsedTextures(); General.Map.Data.UpdateUsedTextures();
@ -418,6 +426,33 @@ namespace CodeImp.DoomBuilder.Data
General.WriteLogLine("Loaded " + texcount + " textures, " + flatcount + " flats, " + colormapcount + " colormaps, " + spritecount + " sprites, " + thingcount + " decorate things, " + modeldefEntries.Count + " model deinitions, " + gldefsEntries.Count + " dynamic light definitions"); 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 // This unloads all data
internal void Unload() internal void Unload()
{ {
@ -854,7 +889,7 @@ namespace CodeImp.DoomBuilder.Data
} }
// This returns a specific patch stream // This returns a specific patch stream
internal Stream GetPatchData(string pname) internal Stream GetPatchData(string pname, bool longname)
{ {
Stream patch; Stream patch;
@ -862,7 +897,7 @@ namespace CodeImp.DoomBuilder.Data
for(int i = containers.Count - 1; i > -1; i--) for(int i = containers.Count - 1; i > -1; i--)
{ {
// This contain provides this patch? // This contain provides this patch?
patch = containers[i].GetPatchData(pname); patch = containers[i].GetPatchData(pname, longname);
if(patch != null) return patch; if(patch != null) return patch;
} }
@ -870,21 +905,8 @@ namespace CodeImp.DoomBuilder.Data
return null; 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 // This returns a specific texture stream
internal Stream GetTextureData(string pname) internal Stream GetTextureData(string pname, bool longname)
{ {
Stream patch; Stream patch;
@ -892,7 +914,7 @@ namespace CodeImp.DoomBuilder.Data
for(int i = containers.Count - 1; i >= 0; i--) for(int i = containers.Count - 1; i >= 0; i--)
{ {
// This contain provides this patch? // This contain provides this patch?
patch = containers[i].GetTextureData(pname); patch = containers[i].GetTextureData(pname, longname);
if(patch != null) return patch; if(patch != null) return patch;
} }
@ -935,6 +957,17 @@ namespace CodeImp.DoomBuilder.Data
return unknownimage; //mxd 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 #endregion
#region ================== Flats #region ================== Flats
@ -962,7 +995,6 @@ namespace CodeImp.DoomBuilder.Data
// Add to preview manager // Add to preview manager
previews.AddImage(img); previews.AddImage(img);
img.IsFlat = true; //mxd
} }
} }
} }
@ -972,7 +1004,7 @@ namespace CodeImp.DoomBuilder.Data
} }
// This returns a specific flat stream // This returns a specific flat stream
internal Stream GetFlatData(string pname) internal Stream GetFlatData(string pname, bool longname)
{ {
Stream flat; Stream flat;
@ -980,7 +1012,7 @@ namespace CodeImp.DoomBuilder.Data
for(int i = containers.Count - 1; i >= 0; i--) for(int i = containers.Count - 1; i >= 0; i--)
{ {
// This contain provides this flat? // This contain provides this flat?
flat = containers[i].GetFlatData(pname); flat = containers[i].GetFlatData(pname, longname);
if(flat != null) return flat; if(flat != null) return flat;
} }
@ -1026,6 +1058,17 @@ namespace CodeImp.DoomBuilder.Data
return flats[longname]; 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 #endregion
#region ================== Sprites #region ================== Sprites
@ -1064,7 +1107,7 @@ namespace CodeImp.DoomBuilder.Data
foreach(ThingTypeInfo ti in General.Map.Data.ThingTypes) foreach(ThingTypeInfo ti in General.Map.Data.ThingTypes)
{ {
// Valid sprite name? // 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; ImageData image = null;
@ -1145,7 +1188,7 @@ namespace CodeImp.DoomBuilder.Data
string[] files = Directory.GetFiles(General.SpritesPath, "*.png", SearchOption.TopDirectoryOnly); string[] files = Directory.GetFiles(General.SpritesPath, "*.png", SearchOption.TopDirectoryOnly);
foreach(string spritefile in files) 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.LoadImage();
img.AllowUnload = false; img.AllowUnload = false;
internalsprites.Add(img.Name, img); internalsprites.Add(img.Name, img);
@ -1542,7 +1585,7 @@ namespace CodeImp.DoomBuilder.Data
// Valid sprite name? // Valid sprite name?
string sprite; 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; if(ti.Actor == null) continue;
sprite = ti.Actor.FindSuitableVoxel(voxelNames); sprite = ti.Actor.FindSuitableVoxel(voxelNames);
} else { } else {
@ -1722,12 +1765,6 @@ namespace CodeImp.DoomBuilder.Data
} }
} }
// This returns the long name for a string
public long GetLongImageName(string name)
{
return Lump.MakeLongName(name);
}
#endregion #endregion
} }
} }

View file

@ -117,13 +117,10 @@ namespace CodeImp.DoomBuilder.Data
public virtual PatchNames LoadPatchNames() { return null; } public virtual PatchNames LoadPatchNames() { return null; }
// When implemented, this returns the patch lump // When implemented, this returns the patch lump
public virtual Stream GetPatchData(string pname) { return null; } public virtual Stream GetPatchData(string pname, bool longname) { return null; }
//mxd. When implemented, this returns a path to patch (like /patches/walls/WALL001.png)
public virtual string GetPatchLocation(string pname) { return pname; }
// When implemented, this returns the texture lump // 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 // When implemented, this loads the textures
public virtual ICollection<ImageData> LoadTextures(PatchNames pnames) { return null; } public virtual ICollection<ImageData> LoadTextures(PatchNames pnames) { return null; }
@ -136,7 +133,7 @@ namespace CodeImp.DoomBuilder.Data
public virtual ICollection<ImageData> LoadFlats() { return null; } public virtual ICollection<ImageData> LoadFlats() { return null; }
// When implemented, this returns the flat lump // 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 #endregion
@ -179,7 +176,6 @@ namespace CodeImp.DoomBuilder.Data
//mxd //mxd
internal virtual MemoryStream LoadFile(string name) { return null; } internal virtual MemoryStream LoadFile(string name) { return null; }
//mxd
internal virtual bool FileExists(string filename) { return false; } internal virtual bool FileExists(string filename) { return false; }
#endregion #endregion

View file

@ -65,22 +65,31 @@ namespace CodeImp.DoomBuilder.Data
#region ================== Textures #region ================== Textures
// This finds and returns a patch stream // This finds and returns a patch stream
public override Stream GetPatchData(string pname) public override Stream GetPatchData(string pname, bool longname)
{ {
// Error when suspended // Error when suspended
if(issuspended) throw new Exception("Data reader is suspended"); if(issuspended) throw new Exception("Data reader is suspended");
// Find in any of the wad files // Find in any of the wad files
// Note the backward order, because the last wad's images have priority // Note the backward order, because the last wad's images have priority
if(!longname) //mxd. Patches with long names can't be in wads
{
for (int i = wads.Count - 1; i > -1; i--) for (int i = wads.Count - 1; i > -1; i--)
{ {
Stream data = wads[i].GetPatchData(pname); Stream data = wads[i].GetPatchData(pname, false);
if (data != null) return data; if (data != null) return data;
} }
}
try 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 //mxd. Find in directories ZDoom expects them to be
string dir = Path.GetDirectoryName(pname); string dir = Path.GetDirectoryName(pname);
@ -112,21 +121,31 @@ namespace CodeImp.DoomBuilder.Data
} }
// This finds and returns a textue stream // This finds and returns a textue stream
public override Stream GetTextureData(string pname) public override Stream GetTextureData(string pname, bool longname)
{ {
// Error when suspended // Error when suspended
if(issuspended) throw new Exception("Data reader is suspended"); if(issuspended) throw new Exception("Data reader is suspended");
// Find in any of the wad files // Find in any of the wad files
// Note the backward order, because the last wad's images have priority // Note the backward order, because the last wad's images have priority
if (!longname) //mxd. Textures with long names can't be in wads
{
for (int i = wads.Count - 1; i >= 0; i--) for (int i = wads.Count - 1; i >= 0; i--)
{ {
Stream data = wads[i].GetTextureData(pname); Stream data = wads[i].GetTextureData(pname, false);
if (data != null) return data; if (data != null) return data;
} }
}
try 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 // Find in textures directory
string path = Path.Combine(TEXTURES_DIR, Path.GetDirectoryName(pname)); string path = Path.Combine(TEXTURES_DIR, Path.GetDirectoryName(pname));
string filename = FindFirstFile(path, Path.GetFileName(pname), true); string filename = FindFirstFile(path, Path.GetFileName(pname), true);
@ -283,18 +302,18 @@ namespace CodeImp.DoomBuilder.Data
} }
// This creates an image // This creates an image
protected override ImageData CreateImage(string name, string filename, int imagetype) protected override ImageData CreateImage(string filename, int imagetype)
{ {
switch(imagetype) switch(imagetype)
{ {
case ImageDataFormat.DOOMFLAT: 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: 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: case ImageDataFormat.DOOMCOLORMAP:
return new ColormapImage(name); return new ColormapImage(Path.GetFileNameWithoutExtension(filename));
default: default:
throw new ArgumentException("Invalid image format specified!"); 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 //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(); return files.GetAllFilesWhichTitleStartsWith(path, title).ToArray();
} }
@ -357,9 +377,12 @@ namespace CodeImp.DoomBuilder.Data
{ {
MemoryStream s = null; MemoryStream s = null;
try { try
{
s = new MemoryStream(File.ReadAllBytes(Path.Combine(location.location, filename))); 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); General.ErrorLogger.Add(ErrorType.Error, "Unable to load file: "+e.Message);
} }
return s; return s;

View file

@ -27,9 +27,6 @@ namespace CodeImp.DoomBuilder.Data
{ {
#region ================== Variables #region ================== Variables
// Image source
//private Bitmap img;
#endregion #endregion
#region ================== Constructor / Disposer #region ================== Constructor / Disposer

View file

@ -28,7 +28,7 @@ namespace CodeImp.DoomBuilder.Data
{ {
#region ================== Variables #region ================== Variables
private int probableformat; private readonly int probableformat;
#endregion #endregion
@ -38,8 +38,8 @@ namespace CodeImp.DoomBuilder.Data
public FileImage(string name, string filepathname, bool asflat) public FileImage(string name, string filepathname, bool asflat)
{ {
// Initialize // Initialize
SetName(name); this.isFlat = asflat; //mxd
this.fullName = filepathname; //mxd SetName(name, filepathname);
if(asflat) if(asflat)
{ {
@ -62,14 +62,23 @@ namespace CodeImp.DoomBuilder.Data
public FileImage(string name, string filepathname, bool asflat, float scalex, float scaley) public FileImage(string name, string filepathname, bool asflat, float scalex, float scaley)
{ {
// Initialize // Initialize
this.fullName = filepathname; //mxd
this.scale.x = scalex; this.scale.x = scalex;
this.scale.y = scaley; this.scale.y = scaley;
SetName(name); this.isFlat = asflat; //mxd
SetName(name, filepathname);
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);
if(asflat)
probableformat = ImageDataFormat.DOOMFLAT;
else
probableformat = ImageDataFormat.DOOMPICTURE; probableformat = ImageDataFormat.DOOMPICTURE;
// We have no destructor // We have no destructor
@ -80,6 +89,43 @@ namespace CodeImp.DoomBuilder.Data
#region ================== Methods #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 // This loads the image
protected override void LocalLoadImage() protected override void LocalLoadImage()
{ {
@ -91,24 +137,30 @@ namespace CodeImp.DoomBuilder.Data
// Load file data // Load file data
if(bitmap != null) bitmap.Dispose(); bitmap = null; 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 // Get a reader for the data
IImageReader reader = ImageDataFormat.GetImageReader(filedata, probableformat, General.Map.Data.Palette); IImageReader reader = ImageDataFormat.GetImageReader(filedata, probableformat, General.Map.Data.Palette);
if(!(reader is UnknownImageReader)) { if(!(reader is UnknownImageReader))
{
// Load the image // Load the image
filedata.Seek(0, SeekOrigin.Begin); filedata.Seek(0, SeekOrigin.Begin);
try { bitmap = reader.ReadAsBitmap(filedata); } catch(InvalidDataException) { try { bitmap = reader.ReadAsBitmap(filedata); }
catch(InvalidDataException)
{
// Data cannot be read! // Data cannot be read!
bitmap = null; bitmap = null;
} }
} }
// Not loaded? // Not loaded?
if(bitmap == null) { 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?"); {
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; loadfailed = true;
} else { }
else
{
// Get width and height // Get width and height
width = bitmap.Size.Width; width = bitmap.Size.Width;
height = bitmap.Size.Height; height = bitmap.Size.Height;

View file

@ -33,6 +33,7 @@ namespace CodeImp.DoomBuilder.Data
{ {
// Initialize // Initialize
SetName(name); SetName(name);
isFlat = true; //mxd
// We have no destructor // We have no destructor
GC.SuppressFinalize(this); GC.SuppressFinalize(this);
@ -51,7 +52,7 @@ namespace CodeImp.DoomBuilder.Data
lock(this) lock(this)
{ {
// Get the lump data stream // Get the lump data stream
Stream lumpdata = General.Map.Data.GetFlatData(Name); Stream lumpdata = General.Map.Data.GetFlatData(Name, hasLongName);
if(lumpdata != null) if(lumpdata != null)
{ {
// Copy lump data to memory // Copy lump data to memory

View file

@ -32,15 +32,14 @@ namespace CodeImp.DoomBuilder.Data
{ {
#region ================== Variables #region ================== Variables
private List<TexturePatch> patches; //mxd private readonly List<TexturePatch> patches; //mxd
private string type;
#endregion #endregion
#region ================== Constructor / Disposer #region ================== Constructor / Disposer
// Constructor // 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 // Initialize
this.width = width; this.width = width;
@ -49,9 +48,18 @@ namespace CodeImp.DoomBuilder.Data
this.scale.y = scaley; this.scale.y = scaley;
this.worldpanning = worldpanning; this.worldpanning = worldpanning;
this.patches = new List<TexturePatch>(1); 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); SetName(name);
this.fullName = "[TEXTURES]\\" + type + "s\\" + name; //mxd this.virtualname = "[TEXTURES]/" + this.name; //mxd
this.isFlat = isflat; //mxd
// We have no destructor // We have no destructor
GC.SuppressFinalize(this); GC.SuppressFinalize(this);
@ -109,7 +117,7 @@ namespace CodeImp.DoomBuilder.Data
foreach(TexturePatch p in patches) foreach(TexturePatch p in patches)
{ {
// Get the patch data stream // 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) if(patchdata != null)
{ {

View file

@ -42,15 +42,18 @@ namespace CodeImp.DoomBuilder.Data
#region ================== Variables #region ================== Variables
// Properties // Properties
private string name; protected string name;
private long longname; protected long longname;
protected int width; protected int width;
protected int height; protected int height;
protected Vector2D scale; protected Vector2D scale;
protected bool worldpanning; protected bool worldpanning;
protected bool usecolorcorrection; private bool usecolorcorrection;
protected string fullName; //mxd. name with path; 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 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 protected bool hasPatchWithSameName; //mxd
// Loading // Loading
@ -81,8 +84,10 @@ namespace CodeImp.DoomBuilder.Data
public string Name { get { return name; } } public string Name { get { return name; } }
public long LongName { get { return longname; } } public long LongName { get { return longname; } }
public string FullName { get { return fullName; } } //mxd public string FullName { get { return fullname; } } //mxd
public bool IsFlat { get { return isFlat; } internal set { isFlat = value; } } //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 HasPatchWithSameName { get { return hasPatchWithSameName; } } //mxd
public bool UseColorCorrection { get { return usecolorcorrection; } set { usecolorcorrection = value; } } public bool UseColorCorrection { get { return usecolorcorrection; } set { usecolorcorrection = value; } }
public Texture Texture { get { lock(this) { return texture; } } } public Texture Texture { get { lock(this) { return texture; } } }
@ -175,11 +180,13 @@ namespace CodeImp.DoomBuilder.Data
} }
// This sets the name // This sets the name
protected void SetName(string name) protected virtual void SetName(string name)
{ {
this.name = name; this.name = name;
this.longname = Lump.MakeLongName(name); this.fullname = name; //mxd
fullName = name; //mxd this.virtualname = name; //mxd
this.displayname = name; //mxd
this.longname = Lump.MakeLongName(name); //mxd
} }
// This unloads the image // This unloads the image
@ -200,18 +207,10 @@ namespace CodeImp.DoomBuilder.Data
{ {
// Image loaded successfully? // Image loaded successfully?
if(!loadfailed && (imagestate == ImageLoadState.Ready) && (bitmap != null)) if(!loadfailed && (imagestate == ImageLoadState.Ready) && (bitmap != null))
{
return bitmap; return bitmap;
}
// Image loading failed? // Image loading failed?
else if(loadfailed) return (loadfailed ? Properties.Resources.Failed : Properties.Resources.Hourglass);
{
return Properties.Resources.Failed;
}
else
{
return Properties.Resources.Hourglass;
}
} }
} }
@ -229,8 +228,6 @@ namespace CodeImp.DoomBuilder.Data
// This requests loading the image // This requests loading the image
protected virtual void LocalLoadImage() protected virtual void LocalLoadImage()
{ {
BitmapData bmpdata = null;
lock(this) lock(this)
{ {
// Bitmap loaded successfully? // Bitmap loaded successfully?
@ -269,6 +266,8 @@ namespace CodeImp.DoomBuilder.Data
// This applies brightness correction on the image // This applies brightness correction on the image
if(usecolorcorrection) if(usecolorcorrection)
{ {
BitmapData bmpdata = null;
try try
{ {
// Try locking the bitmap // Try locking the bitmap
@ -333,8 +332,6 @@ namespace CodeImp.DoomBuilder.Data
// This creates the Direct3D texture // This creates the Direct3D texture
public virtual void CreateTexture() public virtual void CreateTexture()
{ {
MemoryStream memstream;
lock(this) lock(this)
{ {
// Only do this when texture is not created yet // Only do this when texture is not created yet
@ -344,7 +341,7 @@ namespace CodeImp.DoomBuilder.Data
if(loadfailed) img = Properties.Resources.Failed; if(loadfailed) img = Properties.Resources.Failed;
// Write to memory stream and read from memory // 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); img.Save(memstream, ImageFormat.Bmp);
memstream.Seek(0, SeekOrigin.Begin); memstream.Seek(0, SeekOrigin.Begin);
if(dynamictexture) if(dynamictexture)

View file

@ -32,19 +32,22 @@ namespace CodeImp.DoomBuilder.Data
public const int DOOMCOLORMAP = 3; // Could be Doom Colormap format (raw 8-bit pixel palette mapping) public const int DOOMCOLORMAP = 3; // Could be Doom Colormap format (raw 8-bit pixel palette mapping)
// File format signatures // File format signatures
private static readonly int[] PNG_SIGNATURE = new int[] { 137, 80, 78, 71, 13, 10, 26, 10 }; private static readonly int[] PNG_SIGNATURE = new[] { 137, 80, 78, 71, 13, 10, 26, 10 };
private static readonly int[] GIF_SIGNATURE = new int[] { 71, 73, 70 }; private static readonly int[] GIF_SIGNATURE = new[] { 71, 73, 70 };
private static readonly int[] BMP_SIGNATURE = new int[] { 66, 77 }; private static readonly int[] BMP_SIGNATURE = new[] { 66, 77 };
private static readonly int[] DDS_SIGNATURE = new int[] { 68, 68, 83, 32 }; private static readonly int[] DDS_SIGNATURE = new[] { 68, 68, 83, 32 };
private static readonly int[] JPG_SIGNATURE = new int[] { 255, 216, 255 }; //mxd private static readonly int[] JPG_SIGNATURE = new[] { 255, 216, 255 }; //mxd
private static readonly int[] TGA_SIGNATURE = new int[] { 0, 0, 2, 0 }; //mxd private static readonly int[] TGA_SIGNATURE = new[] { 0, 0, 2, 0 }; //mxd
private static readonly int[] PCX_SIGNATURE = new int[] { 10, 5, 1, 8 }; //mxd private static readonly int[] PCX_SIGNATURE = new[] { 10, 5, 1, 8 }; //mxd
// This check image data and returns the appropriate image reader // This check image data and returns the appropriate image reader
public static IImageReader GetImageReader(Stream data, int guessformat, Playpal palette) public static IImageReader GetImageReader(Stream data, int guessformat, Playpal palette)
{ {
if(data == null) return new UnknownImageReader(); //mxd
// Data long enough to check for signatures? // Data long enough to check for signatures?
if(data.Length > 10) { if(data.Length > 10)
{
// Check for PNG signature // Check for PNG signature
data.Seek(0, SeekOrigin.Begin); data.Seek(0, SeekOrigin.Begin);
if(CheckSignature(data, PNG_SIGNATURE)) if(CheckSignature(data, PNG_SIGNATURE))
@ -82,7 +85,8 @@ namespace CodeImp.DoomBuilder.Data
} }
// Could it be a doom picture? // Could it be a doom picture?
switch(guessformat) { switch(guessformat)
{
case DOOMPICTURE: case DOOMPICTURE:
// Check if data is valid for a doom picture // Check if data is valid for a doom picture
data.Seek(0, SeekOrigin.Begin); data.Seek(0, SeekOrigin.Begin);

View file

@ -28,20 +28,20 @@ namespace CodeImp.DoomBuilder.Data
{ {
#region ================== Variables #region ================== Variables
private PK3Reader datareader; private readonly PK3Reader datareader;
private int probableformat; private readonly int probableformat;
#endregion #endregion
#region ================== Constructor / Disposer #region ================== Constructor / Disposer
// Constructor // Constructor
internal PK3FileImage(PK3Reader datareader, string name, string filepathname, bool asflat) internal PK3FileImage(PK3Reader datareader, string filepathname, bool asflat)
{ {
// Initialize // Initialize
this.datareader = datareader; this.datareader = datareader;
SetName(name); this.isFlat = asflat; //mxd
this.fullName = filepathname; SetName(filepathname);
if(asflat) if(asflat)
{ {
@ -64,6 +64,33 @@ namespace CodeImp.DoomBuilder.Data
#region ================== Methods #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 // This loads the image
protected override void LocalLoadImage() protected override void LocalLoadImage()
{ {
@ -74,15 +101,20 @@ namespace CodeImp.DoomBuilder.Data
{ {
// Load file data // Load file data
if(bitmap != null) bitmap.Dispose(); bitmap = null; if(bitmap != null) bitmap.Dispose(); bitmap = null;
MemoryStream filedata = datareader.LoadFile(fullName); //mxd MemoryStream filedata = datareader.LoadFile(fullname); //mxd
if(filedata != null)
{
// Get a reader for the data // Get a reader for the data
IImageReader reader = ImageDataFormat.GetImageReader(filedata, probableformat, General.Map.Data.Palette); IImageReader reader = ImageDataFormat.GetImageReader(filedata, probableformat, General.Map.Data.Palette);
if(!(reader is UnknownImageReader)) if(!(reader is UnknownImageReader))
{ {
// Load the image // Load the image
filedata.Seek(0, SeekOrigin.Begin); filedata.Seek(0, SeekOrigin.Begin);
try { bitmap = reader.ReadAsBitmap(filedata); } try
{
bitmap = reader.ReadAsBitmap(filedata);
}
catch (InvalidDataException) catch (InvalidDataException)
{ {
// Data cannot be read! // Data cannot be read!
@ -93,7 +125,7 @@ namespace CodeImp.DoomBuilder.Data
// Not loaded? // Not loaded?
if(bitmap == null) if(bitmap == null)
{ {
General.ErrorLogger.Add(ErrorType.Error, "Image file '" + fullName + "' data format could not be read, while loading texture '" + this.Name + "'"); General.ErrorLogger.Add(ErrorType.Error, "Image file '" + fullname + "' data format could not be read, while loading texture '" + this.Name + "'");
loadfailed = true; loadfailed = true;
} }
else else
@ -103,8 +135,10 @@ namespace CodeImp.DoomBuilder.Data
height = bitmap.Size.Height; height = bitmap.Size.Height;
} }
// Pass on to base
filedata.Dispose(); filedata.Dispose();
}
// Pass on to base
base.LocalLoadImage(); base.LocalLoadImage();
} }
} }

View file

@ -75,7 +75,7 @@ namespace CodeImp.DoomBuilder.Data
MemoryStream s = new MemoryStream(); MemoryStream s = new MemoryStream();
reader.WriteEntryTo(s); 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)); fileentries.Add(new DirectoryFileEntry(reader.Entry.FilePath));
} }
@ -142,18 +142,26 @@ namespace CodeImp.DoomBuilder.Data
#region ================== Textures #region ================== Textures
// This finds and returns a patch stream // This finds and returns a patch stream
public override Stream GetPatchData(string pname) public override Stream GetPatchData(string pname, bool longname)
{ {
// Error when suspended // Error when suspended
if(issuspended) throw new Exception("Data reader is suspended"); if(issuspended) throw new Exception("Data reader is suspended");
// Find in any of the wad files // Find in any of the wad files
// Note the backward order, because the last wad's images have priority // Note the backward order, because the last wad's images have priority
if (!longname) //mxd. Patches with long names can't be in wads
{
for (int i = wads.Count - 1; i >= 0; i--) for (int i = wads.Count - 1; i >= 0; i--)
{ {
Stream data = wads[i].GetPatchData(pname); Stream data = wads[i].GetPatchData(pname, false);
if (data != null) return data; if (data != null) return data;
} }
}
else
{
//mxd. Long names are absolute
return (FileExists(pname) ? LoadFile(pname) : null);
}
if (General.Map.Config.MixTexturesFlats) if (General.Map.Config.MixTexturesFlats)
{ {
@ -178,18 +186,26 @@ namespace CodeImp.DoomBuilder.Data
} }
// This finds and returns a textue stream // This finds and returns a textue stream
public override Stream GetTextureData(string pname) public override Stream GetTextureData(string pname, bool longname)
{ {
// Error when suspended // Error when suspended
if(issuspended) throw new Exception("Data reader is suspended"); if(issuspended) throw new Exception("Data reader is suspended");
// Find in any of the wad files // Find in any of the wad files
// Note the backward order, because the last wad's images have priority // Note the backward order, because the last wad's images have priority
if (!longname) //mxd. Textures with long names can't be in wads
{
for (int i = wads.Count - 1; i >= 0; i--) for (int i = wads.Count - 1; i >= 0; i--)
{ {
Stream data = wads[i].GetTextureData(pname); Stream data = wads[i].GetTextureData(pname, false);
if (data != null) return data; if (data != null) return data;
} }
}
else
{
//mxd. Long names are absolute
return (FileExists(pname) ? LoadFile(pname) : null);
}
// Find in textures directory // Find in textures directory
string filename = FindFirstFile(TEXTURES_DIR, pname, true); string filename = FindFirstFile(TEXTURES_DIR, pname, true);
@ -285,12 +301,14 @@ namespace CodeImp.DoomBuilder.Data
#region ================== Voxels (mxd) #region ================== Voxels (mxd)
//mxd. This finds and returns a voxel stream or null if no voxel was found //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 // Error when suspended
if(issuspended) throw new Exception("Data reader is suspended"); if(issuspended) throw new Exception("Data reader is suspended");
// Find in any of the wad files // 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); Stream voxel = wads[i].GetVoxelData(name);
if(voxel != null) return voxel; if(voxel != null) return voxel;
} }
@ -299,7 +317,8 @@ namespace CodeImp.DoomBuilder.Data
// Find in sprites directory // Find in sprites directory
string filename = FindFirstFile(VOXELS_DIR, pfilename, true); string filename = FindFirstFile(VOXELS_DIR, pfilename, true);
if((filename != null) && FileExists(filename)) { if((filename != null) && FileExists(filename))
{
return LoadFile(filename); return LoadFile(filename);
} }
@ -318,18 +337,18 @@ namespace CodeImp.DoomBuilder.Data
} }
// This creates an image // This creates an image
protected override ImageData CreateImage(string name, string filename, int imagetype) protected override ImageData CreateImage(string filename, int imagetype)
{ {
switch(imagetype) switch(imagetype)
{ {
case ImageDataFormat.DOOMFLAT: case ImageDataFormat.DOOMFLAT:
return new PK3FileImage(this, name, filename, true); return new PK3FileImage(this, filename, true);
case ImageDataFormat.DOOMPICTURE: case ImageDataFormat.DOOMPICTURE:
return new PK3FileImage(this, name, filename, false); return new PK3FileImage(this, filename, false);
case ImageDataFormat.DOOMCOLORMAP: case ImageDataFormat.DOOMCOLORMAP:
return new ColormapImage(name); return new ColormapImage(Path.GetFileNameWithoutExtension(filename));
default: default:
throw new ArgumentException("Invalid image format specified!"); 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 //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(); return files.GetAllFilesWhichTitleStartsWith(path, title).ToArray();
} }
@ -391,12 +411,13 @@ namespace CodeImp.DoomBuilder.Data
internal override MemoryStream LoadFile(string filename) internal override MemoryStream LoadFile(string filename)
{ {
MemoryStream filedata = null; MemoryStream filedata = null;
string fn = filename.Replace(Path.DirectorySeparatorChar, Path.AltDirectorySeparatorChar); //mxd
//mxd. This works waaaaaay faster with 7z archive //mxd. This works waaaaaay faster with 7z archive
if (archivetype == ArchiveType.SevenZip) if (archivetype == ArchiveType.SevenZip)
{ {
if (sevenzipentries.ContainsKey(filename)) fn = fn.ToLowerInvariant();
filedata = new MemoryStream(sevenzipentries[filename]); if (sevenzipentries.ContainsKey(fn)) filedata = new MemoryStream(sevenzipentries[fn]);
} }
else else
{ {
@ -407,8 +428,7 @@ namespace CodeImp.DoomBuilder.Data
if (entry.IsDirectory) continue; if (entry.IsDirectory) continue;
// Is this the entry we are looking for? // Is this the entry we are looking for?
string entryname = entry.FilePath.Replace(Path.AltDirectorySeparatorChar, Path.DirectorySeparatorChar); if(string.Compare(entry.FilePath, fn, true) == 0)
if (string.Compare(entryname, filename, true) == 0)
{ {
filedata = new MemoryStream(); filedata = new MemoryStream();
entry.WriteTo(filedata); entry.WriteTo(filedata);

View file

@ -262,34 +262,6 @@ namespace CodeImp.DoomBuilder.Data
return null; 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 #endregion
#region ================== Flats #region ================== Flats
@ -346,16 +318,21 @@ namespace CodeImp.DoomBuilder.Data
} }
//mxd. //mxd.
public override Stream GetFlatData(string pname) { public override Stream GetFlatData(string pname, bool longname)
{
// Error when suspended // Error when suspended
if(issuspended) throw new Exception("Data reader is suspended"); if(issuspended) throw new Exception("Data reader is suspended");
// Find in any of the wad files // Find in any of the wad files
// Note the backward order, because the last wad's images have priority // Note the backward order, because the last wad's images have priority
for(int i = wads.Count - 1; i > -1; i--) { if(!longname) //mxd. Flats with long names can't be in wads
Stream data = wads[i].GetFlatData(pname); {
for (int i = wads.Count - 1; i > -1; i--)
{
Stream data = wads[i].GetFlatData(pname, false);
if (data != null) return data; if (data != null) return data;
} }
}
// Nothing found // Nothing found
return null; return null;
@ -488,19 +465,19 @@ namespace CodeImp.DoomBuilder.Data
#region ================== Modeldef (mxd) #region ================== Modeldef (mxd)
//mxd //mxd
public override Dictionary<string, Stream> GetModeldefData() { public override Dictionary<string, Stream> GetModeldefData()
{
// Error when suspended // Error when suspended
if (issuspended) throw new Exception("Data reader is suspended"); if (issuspended) throw new Exception("Data reader is suspended");
//modedef should be in root folder //modedef should be in root folder
string[] allFiles = GetAllFiles("", false); string[] files = GetAllFiles("", false);
Dictionary<string, Stream> streams = new Dictionary<string, Stream>(StringComparer.Ordinal); Dictionary<string, Stream> streams = new Dictionary<string, Stream>(StringComparer.Ordinal);
foreach (string s in allFiles) { foreach (string s in files) {
if (s.ToLowerInvariant().IndexOf("modeldef") != -1) { if (s.ToLowerInvariant().IndexOf("modeldef") != -1)
streams.Add(s, LoadFile(s)); streams.Add(s, LoadFile(s));
} }
}
return streams; return streams;
} }
@ -510,35 +487,38 @@ namespace CodeImp.DoomBuilder.Data
#region ================== Voxeldef (mxd) #region ================== Voxeldef (mxd)
//mxd. This returns the list of voxels, which can be used without VOXELDEF definition //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 // Error when suspended
if(issuspended) throw new Exception("Data reader is suspended"); if(issuspended) throw new Exception("Data reader is suspended");
string[] files = GetAllFiles("voxels", false); string[] files = GetAllFiles("voxels", false);
List<string> voxels = new List<string>(); 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++) { foreach (string t in files)
string s = Path.GetFileNameWithoutExtension(files[i]).ToUpperInvariant(); {
if(spriteName.IsMatch(s)) voxels.Add(s); string s = Path.GetFileNameWithoutExtension(t).ToUpperInvariant();
if(spritename.IsMatch(s)) voxels.Add(s);
} }
return voxels.ToArray(); return voxels.ToArray();
} }
//mxd //mxd
public override KeyValuePair<string, Stream> GetVoxeldefData() { public override KeyValuePair<string, Stream> GetVoxeldefData()
{
// Error when suspended // Error when suspended
if(issuspended) throw new Exception("Data reader is suspended"); if(issuspended) throw new Exception("Data reader is suspended");
//voxeldef should be in root folder //voxeldef should be in root folder
string[] files = GetAllFiles("", false); string[] files = GetAllFiles("", false);
foreach(string s in files) { foreach(string s in files)
if(Path.GetFileNameWithoutExtension(s).ToUpperInvariant() == "VOXELDEF") { {
if(Path.GetFileNameWithoutExtension(s).ToUpperInvariant() == "VOXELDEF")
return new KeyValuePair<string,Stream>(s, LoadFile(s)); return new KeyValuePair<string,Stream>(s, LoadFile(s));
} }
}
return new KeyValuePair<string,Stream>(); return new KeyValuePair<string,Stream>();
} }
@ -548,19 +528,21 @@ namespace CodeImp.DoomBuilder.Data
#region ================== (Z)MAPINFO (mxd) #region ================== (Z)MAPINFO (mxd)
//mxd //mxd
public override Dictionary<string, Stream> GetMapinfoData() { public override Dictionary<string, Stream> GetMapinfoData()
Dictionary<string, Stream> streams = new Dictionary<string, Stream>(StringComparer.Ordinal); {
// Error when suspended // Error when suspended
if (issuspended) throw new Exception("Data reader is suspended"); if (issuspended) throw new Exception("Data reader is suspended");
//mapinfo should be in root folder //mapinfo should be in root folder
string[] allFiles = GetAllFiles("", false); Dictionary<string, Stream> streams = new Dictionary<string, Stream>(StringComparer.Ordinal);
string fileName; string[] files = GetAllFiles("", false);
string filename;
//try to find (z)mapinfo //try to find (z)mapinfo
foreach (string s in allFiles) { foreach (string s in files)
fileName = s.ToLowerInvariant(); {
if (fileName.IndexOf("zmapinfo") != -1 || fileName.IndexOf("mapinfo") != -1) filename = Path.GetFileNameWithoutExtension(s.ToLowerInvariant());
if(filename == "zmapinfo" || filename == "mapinfo")
streams.Add(s, LoadFile(s)); streams.Add(s, LoadFile(s));
} }
@ -572,29 +554,31 @@ namespace CodeImp.DoomBuilder.Data
#region ================== GLDEFS (mxd) #region ================== GLDEFS (mxd)
//mxd //mxd
public override Dictionary<string, Stream> GetGldefsData(GameType gameType) { public override Dictionary<string, Stream> GetGldefsData(GameType gametype)
{
// Error when suspended // Error when suspended
if (issuspended) throw new Exception("Data reader is suspended"); if (issuspended) throw new Exception("Data reader is suspended");
Dictionary<string, Stream> streams = new Dictionary<string, Stream>(StringComparer.Ordinal); Dictionary<string, Stream> streams = new Dictionary<string, Stream>(StringComparer.Ordinal);
//at least one of gldefs should be in root folder //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 //try to load game specific GLDEFS first
string lumpName; if (gametype != GameType.UNKNOWN)
if (gameType != GameType.UNKNOWN) { {
lumpName = Gldefs.GLDEFS_LUMPS_PER_GAME[(int)gameType].ToLowerInvariant(); string lumpname = Gldefs.GLDEFS_LUMPS_PER_GAME[(int)gametype].ToLowerInvariant();
foreach (string s in allFiles) { foreach (string s in files)
if (s.ToLowerInvariant().IndexOf(lumpName) != -1) {
if (s.ToLowerInvariant().IndexOf(lumpname) != -1)
streams.Add(s, LoadFile(s)); streams.Add(s, LoadFile(s));
} }
} }
//can be several entries // Can be several entries
lumpName = "gldefs"; foreach (string s in files)
foreach (string s in allFiles) { {
if (s.ToLowerInvariant().IndexOf(lumpName) != -1) if(s.ToLowerInvariant().IndexOf("gldefs") != -1)
streams.Add(s, LoadFile(s)); streams.Add(s, LoadFile(s));
} }
@ -602,7 +586,8 @@ namespace CodeImp.DoomBuilder.Data
} }
//mxd //mxd
public override Dictionary<string, Stream> GetGldefsData(string location) { public override Dictionary<string, Stream> GetGldefsData(string location)
{
// Error when suspended // Error when suspended
if (issuspended) throw new Exception("Data reader is 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) private ICollection<ImageData> LoadDirectoryImages(string path, int imagetype, bool includesubdirs)
{ {
List<ImageData> images = new List<ImageData>(); List<ImageData> images = new List<ImageData>();
string name;
// Go for all files // Go for all files
string[] files = GetAllFiles(path, includesubdirs); string[] files = GetAllFiles(path, includesubdirs);
foreach(string f in files) foreach(string f in files)
{ {
//mxd. Skip IMGZ 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 if(string.IsNullOrEmpty(Path.GetFileNameWithoutExtension(f)))
name = Path.GetFileNameWithoutExtension(f);
if (string.IsNullOrEmpty(name))
{ {
// Can't load image without name // 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."); General.ErrorLogger.Add(ErrorType.Error, "Can't load an unnamed texture from \"" + path + "\". Please consider giving names to your resources.");
} }
else 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 // 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 // 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 // This must return all files in a given directory
protected abstract string[] GetAllFiles(string path, bool subfolders); protected abstract string[] GetAllFiles(string path, bool subfolders);

View file

@ -70,7 +70,7 @@ namespace CodeImp.DoomBuilder.Data
{ {
// Get the patch data stream // Get the patch data stream
if(bitmap != null) bitmap.Dispose(); bitmap = null; if(bitmap != null) bitmap.Dispose(); bitmap = null;
patchdata = General.Map.Data.GetTextureData(lumpname); patchdata = General.Map.Data.GetTextureData(lumpname, hasLongName);
if(patchdata != null) if(patchdata != null)
{ {
// Copy patch data to memory // Copy patch data to memory

View file

@ -106,7 +106,7 @@ namespace CodeImp.DoomBuilder.Data
foreach(TexturePatch p in patches) foreach(TexturePatch p in patches)
{ {
// Get the patch data stream // Get the patch data stream
patchdata = General.Map.Data.GetPatchData(p.lumpname); patchdata = General.Map.Data.GetPatchData(p.lumpname, p.haslongname);
if(patchdata != null) if(patchdata != null)
{ {
// Copy patch data to memory // Copy patch data to memory

View file

@ -16,6 +16,7 @@
#region ================== Namespaces #region ================== Namespaces
using System.IO;
using CodeImp.DoomBuilder.Rendering; using CodeImp.DoomBuilder.Rendering;
using CodeImp.DoomBuilder.ZDoom; using CodeImp.DoomBuilder.ZDoom;
@ -45,17 +46,18 @@ namespace CodeImp.DoomBuilder.Data
internal struct TexturePatch internal struct TexturePatch
{ {
public string lumpname; public readonly string lumpname;
public int x; public readonly int x;
public int y; public readonly int y;
public bool flipx; public readonly bool flipx;
public bool flipy; public readonly bool flipy;
public int rotate; public readonly bool haslongname; //mxd
public readonly int rotate;
public PixelColor blend; public PixelColor blend;
public float alpha; public readonly float alpha;
public TexturePathRenderStyle style; public readonly TexturePathRenderStyle style;
public TexturePathBlendStyle blendstyle; //mxd public readonly TexturePathBlendStyle blendstyle; //mxd
public float tintammount;//mxd public readonly float tintammount;//mxd
// Constructor for simple patches // Constructor for simple patches
public TexturePatch(string lumpname, int x, int y) public TexturePatch(string lumpname, int x, int y)
@ -72,6 +74,7 @@ namespace CodeImp.DoomBuilder.Data
this.style = TexturePathRenderStyle.Copy; this.style = TexturePathRenderStyle.Copy;
this.blendstyle = TexturePathBlendStyle.None;//mxd this.blendstyle = TexturePathBlendStyle.None;//mxd
this.tintammount = 0; //mxd this.tintammount = 0; //mxd
this.haslongname = false; //mxd
} }
//mxd. Constructor for hires patches //mxd. Constructor for hires patches
@ -88,9 +91,11 @@ namespace CodeImp.DoomBuilder.Data
this.style = patch.RenderStyle; this.style = patch.RenderStyle;
this.blendstyle = patch.BlendStyle; this.blendstyle = patch.BlendStyle;
this.tintammount = patch.TintAmmount; this.tintammount = patch.TintAmmount;
this.haslongname = (Path.GetFileNameWithoutExtension(this.lumpname) != this.lumpname);
//mxd. Check data so we don't perform unneeded operations later on //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) if(this.style == TexturePathRenderStyle.Blend || this.style == TexturePathRenderStyle.CopyAlpha || this.style == TexturePathRenderStyle.CopyNewAlpha || this.style == TexturePathRenderStyle.Overlay)
this.style = TexturePathRenderStyle.Copy; this.style = TexturePathRenderStyle.Copy;
} }

View file

@ -536,28 +536,32 @@ namespace CodeImp.DoomBuilder.Data
} }
// This finds and returns a patch stream // 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 // Error when suspended
if(issuspended) throw new Exception("Data reader is 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 // 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); lump = file.FindLump(pname, range.start, range.end);
if(lump != null) return lump.Stream; 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) //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); lump = file.FindLump(pname, range.start, range.end);
if(lump != null) return lump.Stream; if(lump != null) return lump.Stream;
} }
// Find the lump anywhere IN flat ranges // 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); lump = file.FindLump(pname, range.start, range.end);
if(lump != null) return lump.Stream; if(lump != null) return lump.Stream;
} }
@ -567,12 +571,12 @@ namespace CodeImp.DoomBuilder.Data
} }
// This finds and returns a texture stream // 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 // Error when suspended
if(issuspended) throw new Exception("Data reader is suspended"); if(issuspended) throw new Exception("Data reader is suspended");
if(longname) return null; //mxd
Lump lump;
// Find the lump in ranges // Find the lump in ranges
foreach(LumpRange range in textureranges) foreach(LumpRange range in textureranges)
@ -589,19 +593,23 @@ namespace CodeImp.DoomBuilder.Data
#region ================== Flats #region ================== Flats
//mxd. This loads the flats //mxd. This loads the flats
public override ICollection<ImageData> LoadFlats() { public override ICollection<ImageData> LoadFlats()
{
// Error when suspended // Error when suspended
if(issuspended) throw new Exception("Data reader is suspended"); if(issuspended) throw new Exception("Data reader is suspended");
List<ImageData> images = new List<ImageData>(); List<ImageData> images = new List<ImageData>();
FlatImage image; FlatImage image;
foreach(LumpRange range in flatranges){ foreach(LumpRange range in flatranges)
{
if(range.end < range.start + 2) continue; 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? // Lump not zero-length?
if(file.Lumps[i].Length > 0) { if(file.Lumps[i].Length > 0)
{
// Make the image object // Make the image object
image = new FlatImage(file.Lumps[i].Name); image = new FlatImage(file.Lumps[i].Name);
@ -613,7 +621,8 @@ namespace CodeImp.DoomBuilder.Data
// Load TEXTURES lump file // Load TEXTURES lump file
int lumpindex = file.FindLumpIndex("TEXTURES"); int lumpindex = file.FindLumpIndex("TEXTURES");
while(lumpindex > -1) { while(lumpindex > -1)
{
MemoryStream filedata = new MemoryStream(file.Lumps[lumpindex].Stream.ReadAllBytes()); MemoryStream filedata = new MemoryStream(file.Lumps[lumpindex].Stream.ReadAllBytes());
WADReader.LoadHighresFlats(filedata, "TEXTURES", ref images, null, null); WADReader.LoadHighresFlats(filedata, "TEXTURES", ref images, null, null);
filedata.Dispose(); filedata.Dispose();
@ -654,11 +663,11 @@ namespace CodeImp.DoomBuilder.Data
} }
// This finds and returns a patch stream // This finds and returns a patch stream
public override Stream GetFlatData(string pname) public override Stream GetFlatData(string pname, bool longname)
{ {
// Error when suspended // Error when suspended
if(issuspended) throw new Exception("Data reader is suspended"); if(issuspended) throw new Exception("Data reader is suspended");
if(longname) return null; //mxd
Lump lump; Lump lump;
// Find the lump in ranges // Find the lump in ranges

View file

@ -230,7 +230,7 @@ namespace CodeImp.DoomBuilder.Editing
// Write data to stream // Write data to stream
MemoryStream memstream = new MemoryStream(); MemoryStream memstream = new MemoryStream();
ClipboardStreamWriter writer = new ClipboardStreamWriter(); //mxd ClipboardStreamWriter writer = new ClipboardStreamWriter(); //mxd
writer.Write(copyset, memstream); writer.Write(copyset, memstream, General.Map.Options.UseLongTextureNames);
// Set on clipboard // Set on clipboard
Clipboard.SetData(CLIPBOARD_DATA_FORMAT, memstream); Clipboard.SetData(CLIPBOARD_DATA_FORMAT, memstream);
@ -294,6 +294,10 @@ namespace CodeImp.DoomBuilder.Editing
// Convert UDMF fields back to flags and activations, if needed // Convert UDMF fields back to flags and activations, if needed
if(!(General.Map.FormatInterface is UniversalMapSetIO)) General.Map.Map.TranslateFromUDMF(); 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 // Modify tags and actions if preferred
if(options.ChangeTags == PasteOptions.TAGS_REMOVE) Tools.RemoveMarkedTags(); if(options.ChangeTags == PasteOptions.TAGS_REMOVE) Tools.RemoveMarkedTags();
if(options.ChangeTags == PasteOptions.TAGS_RENUMBER) Tools.RenumberMarkedTags(); if(options.ChangeTags == PasteOptions.TAGS_RENUMBER) Tools.RenumberMarkedTags();

View file

@ -17,7 +17,9 @@
#region ================== Namespaces #region ================== Namespaces
using System; using System;
using System.IO;
using System.Windows.Forms; using System.Windows.Forms;
using CodeImp.DoomBuilder.Map;
using CodeImp.DoomBuilder.Windows; using CodeImp.DoomBuilder.Windows;
using CodeImp.DoomBuilder.IO; using CodeImp.DoomBuilder.IO;
using CodeImp.DoomBuilder.Actions; using CodeImp.DoomBuilder.Actions;
@ -129,7 +131,7 @@ namespace CodeImp.DoomBuilder.Editing
} }
// Read settings from configuration // Read settings from configuration
internal void ReadFromConfig(Configuration cfg, string path) internal void ReadFromConfig(Configuration cfg, string path, bool uselongtexturenames)
{ {
// Read settings // Read settings
background = cfg.ReadSetting(path + ".background", ""); background = cfg.ReadSetting(path + ".background", "");
@ -140,6 +142,9 @@ namespace CodeImp.DoomBuilder.Editing
backscaley = cfg.ReadSetting(path + ".backscaley", 100) / 100.0f; backscaley = cfg.ReadSetting(path + ".backscaley", 100) / 100.0f;
gridsize = cfg.ReadSetting(path + ".gridsize", DEFAULT_GRID_SIZE); gridsize = cfg.ReadSetting(path + ".gridsize", DEFAULT_GRID_SIZE);
//mxd. Translate background name?
TranslateBackgroundName(uselongtexturenames);
// Setup // Setup
SetGridSize(gridsize); SetGridSize(gridsize);
LinkBackground(); LinkBackground();
@ -172,6 +177,23 @@ namespace CodeImp.DoomBuilder.Editing
LinkBackground(); 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 // This sets the background view
internal void SetBackgroundView(int offsetx, int offsety, float scalex, float scaley) internal void SetBackgroundView(int offsetx, int offsety, float scalex, float scaley)
{ {
@ -200,7 +222,7 @@ namespace CodeImp.DoomBuilder.Editing
break; break;
case SOURCE_FILE: 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; break;
} }

View file

@ -908,6 +908,7 @@ namespace CodeImp.DoomBuilder.GZBuilder.Controls
{ {
components = new System.ComponentModel.Container(); components = new System.ComponentModel.Container();
DoubleBuffered = true; //mxd DoubleBuffered = true; //mxd
SetStyle(ControlStyles.OptimizedDoubleBuffer, true); //mxd
} }
#endregion #endregion

View file

@ -26,20 +26,32 @@
/// </summary> /// </summary>
private void InitializeComponent() { private void InitializeComponent() {
this.label = new System.Windows.Forms.Label(); this.label = new System.Windows.Forms.Label();
this.bReset = new System.Windows.Forms.Button();
this.value1 = new CodeImp.DoomBuilder.Controls.ButtonsNumericTextbox(); this.value1 = new CodeImp.DoomBuilder.Controls.ButtonsNumericTextbox();
this.value2 = new CodeImp.DoomBuilder.Controls.ButtonsNumericTextbox(); this.value2 = new CodeImp.DoomBuilder.Controls.ButtonsNumericTextbox();
this.bReset = new System.Windows.Forms.Button();
this.SuspendLayout(); this.SuspendLayout();
// //
// label // label
// //
this.label.Location = new System.Drawing.Point(0, 6); this.label.Location = new System.Drawing.Point(0, 6);
this.label.Name = "label"; 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.TabIndex = 40;
this.label.Text = "Upper Offset:"; this.label.Text = "Upper Offset:";
this.label.TextAlign = System.Drawing.ContentAlignment.TopRight; 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 // value1
// //
this.value1.AllowDecimal = false; 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.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
this.value1.ButtonStep = 1; this.value1.ButtonStep = 1;
this.value1.ButtonStepFloat = 1F; 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.Name = "value1";
this.value1.Size = new System.Drawing.Size(62, 24); this.value1.Size = new System.Drawing.Size(62, 24);
this.value1.StepValues = null; 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.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
this.value2.ButtonStep = 1; this.value2.ButtonStep = 1;
this.value2.ButtonStepFloat = 1F; 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.Name = "value2";
this.value2.Size = new System.Drawing.Size(62, 24); this.value2.Size = new System.Drawing.Size(62, 24);
this.value2.StepValues = null; this.value2.StepValues = null;
@ -72,28 +86,16 @@
this.value2.Tag = "offsety_top"; this.value2.Tag = "offsety_top";
this.value2.WhenTextChanged += new System.EventHandler(this.value1_WhenTextChanged); 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 // PairedIntControl
// //
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); this.AutoScaleDimensions = new System.Drawing.SizeF(96F, 96F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Dpi;
this.Controls.Add(this.bReset); this.Controls.Add(this.bReset);
this.Controls.Add(this.value1); this.Controls.Add(this.value1);
this.Controls.Add(this.value2); this.Controls.Add(this.value2);
this.Controls.Add(this.label); this.Controls.Add(this.label);
this.Name = "PairedIntControl"; this.Name = "PairedIntControl";
this.Size = new System.Drawing.Size(249, 26); this.Size = new System.Drawing.Size(268, 26);
this.ResumeLayout(false); this.ResumeLayout(false);
} }

View file

@ -87,18 +87,23 @@ namespace CodeImp.DoomBuilder
case ErrorType.Error: case ErrorType.Error:
erroradded = true; erroradded = true;
prefix = "ERROR: "; prefix = "ERROR: ";
#if DEBUG
DebugConsole.WriteLine(DebugMessageType.Error, message);
#endif
break; break;
case ErrorType.Warning: case ErrorType.Warning:
warningadded = true; warningadded = true;
prefix = "WARNING: "; prefix = "WARNING: ";
#if DEBUG
DebugConsole.WriteLine(DebugMessageType.Warning, message);
#endif
break; break;
} }
changed = true; changed = true;
General.WriteLogLine(prefix + message);
//mxd General.WriteLogLine(prefix + message);
General.MainWindow.SetWarningsCount(errors.Count, erroradded); General.MainWindow.SetWarningsCount(errors.Count, erroradded); //mxd
} }
} }

View file

@ -998,13 +998,13 @@ namespace CodeImp.DoomBuilder
internal static void NewMap() internal static void NewMap()
{ {
//mxd //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); ShowWarningMessage("Cannot create a map while game engine is running" + Environment.NewLine + "Please close '" + map.ConfigSettings.TestProgram + "' first.", MessageBoxButtons.OK);
return; return;
} }
MapOptions newoptions = new MapOptions(); MapOptions newoptions = new MapOptions();
MapOptionsForm optionswindow;
// Cancel volatile mode, if any // Cancel volatile mode, if any
editing.DisengageVolatileMode(); editing.DisengageVolatileMode();
@ -1013,7 +1013,7 @@ namespace CodeImp.DoomBuilder
if(AskSaveMap()) if(AskSaveMap())
{ {
// Open map options dialog // Open map options dialog
optionswindow = new MapOptionsForm(newoptions, true); MapOptionsForm optionswindow = new MapOptionsForm(newoptions, true);
if(optionswindow.ShowDialog(mainwindow) == DialogResult.OK) if(optionswindow.ShowDialog(mainwindow) == DialogResult.OK)
{ {
// Display status // Display status
@ -1030,9 +1030,8 @@ namespace CodeImp.DoomBuilder
// Let the plugins know // Let the plugins know
plugins.OnMapNewBegin(); plugins.OnMapNewBegin();
// Set this to false so we can see if errors are added // Clear old errors (mxd)
//General.ErrorLogger.IsErrorAdded = false; errorlogger.Clear();
errorlogger.Clear(); //mxd
// Create map manager with given options // Create map manager with given options
map = new MapManager(); map = new MapManager();
@ -1195,6 +1194,26 @@ namespace CodeImp.DoomBuilder
ChangeMapForm changemapwindow = new ChangeMapForm(map.FilePathName, map.Options); ChangeMapForm changemapwindow = new ChangeMapForm(map.FilePathName, map.Options);
if(changemapwindow.ShowDialog(mainwindow) != DialogResult.OK) return; 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 // Display status
mainwindow.DisplayStatus(StatusType.Busy, "Switching to map '" + changemapwindow.Options.CurrentName + "'..."); mainwindow.DisplayStatus(StatusType.Busy, "Switching to map '" + changemapwindow.Options.CurrentName + "'...");
WriteLogLine("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); result = map.SaveSettingsFile(map.FilePathName);
// Display status // 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 // All done
mainwindow.UpdateInterface(); mainwindow.UpdateInterface();
@ -1894,26 +1913,16 @@ namespace CodeImp.DoomBuilder
// This shows an image in a panel either zoomed or centered depending on size // This shows an image in a panel either zoomed or centered depending on size
public static void DisplayZoomedImage(Panel panel, Image image) public static void DisplayZoomedImage(Panel panel, Image image)
{ {
// Set the image
panel.BackgroundImage = image;
// Image not null? // Image not null?
if(image != null) if(image != null)
{ {
// Small enough to fit in panel? // Set the image
if((image.Size.Width < panel.ClientRectangle.Width) && panel.BackgroundImage = image;
(image.Size.Height < panel.ClientRectangle.Height))
{
// Display centered
panel.BackgroundImageLayout = ImageLayout.Center;
}
else
{
// Display zoomed // Display zoomed
panel.BackgroundImageLayout = ImageLayout.Zoom; panel.BackgroundImageLayout = ImageLayout.Zoom;
} }
} }
}
// This calculates the new rectangle when one is scaled into another keeping aspect ratio // This calculates the new rectangle when one is scaled into another keeping aspect ratio
public static RectangleF MakeZoomedRect(Size source, RectangleF target) public static RectangleF MakeZoomedRect(Size source, RectangleF target)

View file

@ -413,6 +413,17 @@ namespace CodeImp.DoomBuilder {
// Remove unused sectors // Remove unused sectors
map.RemoveUnusedSectors(true); 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 // Update structures
options.ApplyGridSettings(); options.ApplyGridSettings();
map.UpdateConfiguration(); map.UpdateConfiguration();
@ -447,6 +458,21 @@ namespace CodeImp.DoomBuilder {
//mxd. This switches to another map in the same wad //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.changed = false;
this.options = options; this.options = options;
@ -508,7 +534,16 @@ namespace CodeImp.DoomBuilder {
ChangeMapSet(newmap); ChangeMapSet(newmap);
//mxd. Translate texture names
bool nameschanged = map.TranslateTextureNames(uselongtexturenames, false);
grid.TranslateBackgroundName(uselongtexturenames);
//mxd. Sector textures may've been changed
if (nameschanged)
{
data.UpdateUsedTextures(); data.UpdateUsedTextures();
General.Map.IsChanged = true;
}
//mxd. check script names //mxd. check script names
UpdateScriptNames(); UpdateScriptNames();
@ -1875,7 +1910,7 @@ namespace CodeImp.DoomBuilder {
foreach (Thing t in General.Map.Map.Things) foreach (Thing t in General.Map.Map.Things)
for(int i = 0; i < t.Args.Length; i++) t.Args[i] = 0; for(int i = 0; i < t.Args.Length; i++) t.Args[i] = 0;
} }
General.Map.Map.UpdateCustomLinedefColors(); map.UpdateCustomLinedefColors();
// Update interface // Update interface
General.MainWindow.SetupInterface(); General.MainWindow.SetupInterface();
@ -1886,6 +1921,17 @@ namespace CodeImp.DoomBuilder {
ReloadResources(); ReloadResources();
UpdateScriptNames(); //mxd 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 // Done
General.MainWindow.DisplayReady(); General.MainWindow.DisplayReady();
General.MainWindow.RedrawDisplay(); //mxd General.MainWindow.RedrawDisplay(); //mxd
@ -1950,7 +1996,7 @@ namespace CodeImp.DoomBuilder {
Cursor.Current = Cursors.AppStarting; Cursor.Current = Cursors.AppStarting;
// Make undo for the snapping // Make undo for the snapping
General.Map.UndoRedo.CreateUndo("Snap vertices"); undoredo.CreateUndo("Snap vertices");
int snappedCount = 0; int snappedCount = 0;
List<Vertex> movedVerts = new List<Vertex>(); List<Vertex> movedVerts = new List<Vertex>();

View file

@ -29,6 +29,14 @@ namespace CodeImp.DoomBuilder.IO
public Dictionary<string, bool> Flags; public Dictionary<string, bool> Flags;
} }
private bool uselongtexturenames; //mxd
#endregion
#region ================== Properties
public bool UseLongTextureNames { get { return uselongtexturenames; } } //mxd
#endregion #endregion
#region ================== Reading #region ================== Reading
@ -38,6 +46,7 @@ namespace CodeImp.DoomBuilder.IO
BinaryReader reader = new BinaryReader(stream); BinaryReader reader = new BinaryReader(stream);
// Read the map // Read the map
uselongtexturenames = reader.ReadBoolean(); //mxd
Dictionary<int, Vertex> vertexlink = ReadVertices(map, reader); Dictionary<int, Vertex> vertexlink = ReadVertices(map, reader);
Dictionary<int, Sector> sectorlink = ReadSectors(map, reader); Dictionary<int, Sector> sectorlink = ReadSectors(map, reader);
Dictionary<int, SidedefData> sidedeflink = ReadSidedefs(reader); Dictionary<int, SidedefData> sidedeflink = ReadSidedefs(reader);

View file

@ -80,12 +80,12 @@ namespace CodeImp.DoomBuilder.IO
#region ================== Writing #region ================== Writing
public void Write(MapSet map, Stream stream) { public void Write(MapSet map, Stream stream, bool longtexturenames) {
Write(map.Vertices, map.Linedefs, map.Sidedefs, map.Sectors, map.Things, stream); 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, 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 // Create collections
Dictionary<Vertex, int> vertexids = new Dictionary<Vertex, int>(); Dictionary<Vertex, int> vertexids = new Dictionary<Vertex, int>();
Dictionary<Sidedef, int> sidedefids = new Dictionary<Sidedef, int>(); Dictionary<Sidedef, int> sidedefids = new Dictionary<Sidedef, int>();
@ -98,6 +98,7 @@ namespace CodeImp.DoomBuilder.IO
BinaryWriter writer = new BinaryWriter(stream); BinaryWriter writer = new BinaryWriter(stream);
// Write the data structures to stream // Write the data structures to stream
writer.Write(longtexturenames); //mxd
WriteVertices(vertices, writer); WriteVertices(vertices, writer);
WriteSectors(sectors, writer); WriteSectors(sectors, writer);
WriteSidedefs(sidedefs, writer, sectorids); WriteSidedefs(sidedefs, writer, sectorids);

View file

@ -19,6 +19,7 @@
using System; using System;
using System.Text; using System.Text;
using System.IO; using System.IO;
using CodeImp.DoomBuilder.Data;
#endregion #endregion
@ -107,7 +108,7 @@ namespace CodeImp.DoomBuilder.IO
#region ================== Methods #region ================== Methods
// This returns the long value for a 8 byte texture name // 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; long value = 0;
byte[] namebytes = Encoding.ASCII.GetBytes(name.Trim().ToUpper()); byte[] namebytes = Encoding.ASCII.GetBytes(name.Trim().ToUpper());
@ -120,6 +121,17 @@ namespace CodeImp.DoomBuilder.IO
} }
return value; 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 // This makes the normal name from fixed name

View file

@ -392,7 +392,7 @@ namespace CodeImp.DoomBuilder.IO
// Add it to struct // Add it to struct
UniversalEntry entry = new UniversalEntry(key.ToString().Trim().ToLowerInvariant(), ival); UniversalEntry entry = new UniversalEntry(key.ToString().Trim().ToLowerInvariant(), ival);
cs.Add(entry); cs.Add(entry);
matches.Add(data[line], entry); if(!matches.ContainsKey(data[line])) matches.Add(data[line], entry);
} }
catch(OverflowException) catch(OverflowException)
{ {
@ -405,7 +405,7 @@ namespace CodeImp.DoomBuilder.IO
// Add it to struct // Add it to struct
UniversalEntry entry = new UniversalEntry(key.ToString().Trim().ToLowerInvariant(), lval); UniversalEntry entry = new UniversalEntry(key.ToString().Trim().ToLowerInvariant(), lval);
cs.Add(entry); cs.Add(entry);
matches.Add(data[line], entry); if(!matches.ContainsKey(data[line])) matches.Add(data[line], entry);
} }
catch(OverflowException) catch(OverflowException)
{ {
@ -440,7 +440,7 @@ namespace CodeImp.DoomBuilder.IO
// Add it to struct // Add it to struct
UniversalEntry entry = new UniversalEntry(key.ToString().Trim().ToLowerInvariant(), fval); UniversalEntry entry = new UniversalEntry(key.ToString().Trim().ToLowerInvariant(), fval);
cs.Add(entry); cs.Add(entry);
matches.Add(data[line], entry); if(!matches.ContainsKey(data[line])) matches.Add(data[line], entry);
} }
else else
{ {
@ -453,7 +453,7 @@ namespace CodeImp.DoomBuilder.IO
// Add it to struct // Add it to struct
UniversalEntry entry = new UniversalEntry(key.ToString().Trim().ToLowerInvariant(), ival); UniversalEntry entry = new UniversalEntry(key.ToString().Trim().ToLowerInvariant(), ival);
cs.Add(entry); cs.Add(entry);
matches.Add(data[line], entry); if(!matches.ContainsKey(data[line])) matches.Add(data[line], entry);
} }
catch(OverflowException) catch(OverflowException)
{ {
@ -466,7 +466,7 @@ namespace CodeImp.DoomBuilder.IO
// Add it to struct // Add it to struct
UniversalEntry entry = new UniversalEntry(key.ToString().Trim().ToLowerInvariant(), lval); UniversalEntry entry = new UniversalEntry(key.ToString().Trim().ToLowerInvariant(), lval);
cs.Add(entry); cs.Add(entry);
matches.Add(data[line], entry); if(!matches.ContainsKey(data[line])) matches.Add(data[line], entry);
} }
catch(OverflowException) catch(OverflowException)
{ {
@ -574,7 +574,7 @@ namespace CodeImp.DoomBuilder.IO
// Add string to struct // Add string to struct
UniversalEntry entry = new UniversalEntry(key.ToString().Trim().ToLowerInvariant(), val.ToString()); UniversalEntry entry = new UniversalEntry(key.ToString().Trim().ToLowerInvariant(), val.ToString());
cs.Add(entry); cs.Add(entry);
matches.Add(data[line], entry); if(!matches.ContainsKey(data[line])) matches.Add(data[line], entry);
// End of assignment // End of assignment
pm = PM_ASSIGNMENT; pm = PM_ASSIGNMENT;
@ -611,14 +611,14 @@ namespace CodeImp.DoomBuilder.IO
// Add boolean true // Add boolean true
UniversalEntry t = new UniversalEntry(key.ToString().Trim().ToLowerInvariant(), true); UniversalEntry t = new UniversalEntry(key.ToString().Trim().ToLowerInvariant(), true);
cs.Add(t); cs.Add(t);
matches.Add(data[line], t); if(!matches.ContainsKey(data[line])) matches.Add(data[line], t);
break; break;
case "false": case "false":
// Add boolean false // Add boolean false
UniversalEntry f = new UniversalEntry(key.ToString().Trim().ToLowerInvariant(), false); UniversalEntry f = new UniversalEntry(key.ToString().Trim().ToLowerInvariant(), false);
cs.Add(f); cs.Add(f);
matches.Add(data[line], f); if(!matches.ContainsKey(data[line])) matches.Add(data[line], f);
break; break;
default: default:

View file

@ -133,13 +133,13 @@ namespace CodeImp.DoomBuilder.IO
public MapSet Read(MapSet map, Stream stream) public MapSet Read(MapSet map, Stream stream)
{ {
StreamReader reader = new StreamReader(stream, Encoding.ASCII); StreamReader reader = new StreamReader(stream, Encoding.ASCII);
Dictionary<int, Vertex> vertexlink;
Dictionary<int, Sector> sectorlink;
UniversalParser textmap = new UniversalParser(); UniversalParser textmap = new UniversalParser();
textmap.StrictChecking = strictchecking; textmap.StrictChecking = strictchecking;
#if !DEBUG
try try
{ {
#endif
// Read UDMF from stream // Read UDMF from stream
List<string> data = new List<string>(100); List<string> data = new List<string>(100);
while(!reader.EndOfStream) while(!reader.EndOfStream)
@ -160,16 +160,18 @@ namespace CodeImp.DoomBuilder.IO
else else
{ {
// Read the map // Read the map
vertexlink = ReadVertices(map, textmap); Dictionary<int, Vertex> vertexlink = ReadVertices(map, textmap);
sectorlink = ReadSectors(map, textmap); Dictionary<int, Sector> sectorlink = ReadSectors(map, textmap);
ReadLinedefs(map, textmap, vertexlink, sectorlink); ReadLinedefs(map, textmap, vertexlink, sectorlink);
ReadThings(map, textmap); ReadThings(map, textmap);
} }
#if !DEBUG
} }
catch(Exception e) catch(Exception e)
{ {
General.ShowErrorMessage("Unexpected error reading UDMF map data. " + e.GetType().Name + ": " + e.Message, MessageBoxButtons.OK); General.ShowErrorMessage("Unexpected error reading UDMF map data. " + e.GetType().Name + ": " + e.Message, MessageBoxButtons.OK);
} }
#endif
return map; return map;
} }
@ -326,12 +328,12 @@ namespace CodeImp.DoomBuilder.IO
{ {
// Read fields // Read fields
string where = "linedef " + ld.Index + (front ? " front sidedef " : " back sidedef ") + index; string where = "linedef " + ld.Index + (front ? " front sidedef " : " back sidedef ") + index;
int offsetx = GetCollectionEntry<int>(sc, "offsetx", false, 0, where); int offsetx = GetCollectionEntry(sc, "offsetx", false, 0, where);
int offsety = GetCollectionEntry<int>(sc, "offsety", false, 0, where); int offsety = GetCollectionEntry(sc, "offsety", false, 0, where);
string thigh = GetCollectionEntry<string>(sc, "texturetop", false, "-", where); string thigh = GetCollectionEntry(sc, "texturetop", false, "-", where);
string tlow = GetCollectionEntry<string>(sc, "texturebottom", false, "-", where); string tlow = GetCollectionEntry(sc, "texturebottom", false, "-", where);
string tmid = GetCollectionEntry<string>(sc, "texturemiddle", false, "-", where); string tmid = GetCollectionEntry(sc, "texturemiddle", false, "-", where);
int sector = GetCollectionEntry<int>(sc, "sector", true, 0, where); int sector = GetCollectionEntry(sc, "sector", true, 0, where);
//mxd. Flags //mxd. Flags
Dictionary<string, bool> stringflags = new Dictionary<string, bool>(StringComparer.Ordinal); Dictionary<string, bool> stringflags = new Dictionary<string, bool>(StringComparer.Ordinal);
@ -359,13 +361,11 @@ namespace CodeImp.DoomBuilder.IO
// This reads the sectors // This reads the sectors
private Dictionary<int, Sector> ReadSectors(MapSet map, UniversalParser textmap) private Dictionary<int, Sector> ReadSectors(MapSet map, UniversalParser textmap)
{ {
Dictionary<int, Sector> link;
// Get list of entries // Get list of entries
List<UniversalCollection> collections = GetNamedCollections(textmap.Root, "sector"); List<UniversalCollection> collections = GetNamedCollections(textmap.Root, "sector");
// Create lookup table // Create lookup table
link = new Dictionary<int, Sector>(collections.Count); Dictionary<int, Sector> link = new Dictionary<int, Sector>(collections.Count);
// Go for all collections // Go for all collections
map.SetCapacity(0, 0, 0, map.Sectors.Count + collections.Count, 0); map.SetCapacity(0, 0, 0, map.Sectors.Count + collections.Count, 0);
@ -419,13 +419,11 @@ namespace CodeImp.DoomBuilder.IO
// This reads the vertices // This reads the vertices
private Dictionary<int, Vertex> ReadVertices(MapSet map, UniversalParser textmap) private Dictionary<int, Vertex> ReadVertices(MapSet map, UniversalParser textmap)
{ {
Dictionary<int, Vertex> link;
// Get list of entries // Get list of entries
List<UniversalCollection> collections = GetNamedCollections(textmap.Root, "vertex"); List<UniversalCollection> collections = GetNamedCollections(textmap.Root, "vertex");
// Create lookup table // Create lookup table
link = new Dictionary<int, Vertex>(collections.Count); Dictionary<int, Vertex> link = new Dictionary<int, Vertex>(collections.Count);
// Go for all collections // Go for all collections
map.SetCapacity(map.Vertices.Count + collections.Count, 0, 0, 0, 0); map.SetCapacity(map.Vertices.Count + collections.Count, 0, 0, 0, 0);

View file

@ -80,6 +80,8 @@ namespace CodeImp.DoomBuilder.Map
private bool overrideceilheight; private bool overrideceilheight;
private bool overridebrightness; private bool overridebrightness;
private bool uselongtexturenames; //mxd
#endregion #endregion
#region ================== Properties #region ================== Properties
@ -130,6 +132,8 @@ namespace CodeImp.DoomBuilder.Map
public bool OverrideCeilingHeight { get { return overrideceilheight; } set { overrideceilheight = value; } } public bool OverrideCeilingHeight { get { return overrideceilheight; } set { overrideceilheight = value; } }
public bool OverrideBrightness { get { return overridebrightness; } set { overridebrightness = value; } } public bool OverrideBrightness { get { return overridebrightness; } set { overridebrightness = value; } }
public bool UseLongTextureNames { get { return uselongtexturenames; } set { uselongtexturenames = value; } } //mxd
#endregion #endregion
#region ================== Constructor / Disposer #region ================== Constructor / Disposer
@ -211,6 +215,8 @@ namespace CodeImp.DoomBuilder.Map
overrideceilheight = this.mapconfig.ReadSetting("overrideceilheight", false); overrideceilheight = this.mapconfig.ReadSetting("overrideceilheight", false);
overridebrightness = this.mapconfig.ReadSetting("overridebrightness", false); overridebrightness = this.mapconfig.ReadSetting("overridebrightness", false);
uselongtexturenames = this.mapconfig.ReadSetting("uselongtexturenames", false); //mxd
// Resources // Resources
IDictionary reslist = this.mapconfig.ReadSetting("resources", new Hashtable()); IDictionary reslist = this.mapconfig.ReadSetting("resources", new Hashtable());
foreach(DictionaryEntry mp in reslist) foreach(DictionaryEntry mp in reslist)
@ -295,11 +301,13 @@ namespace CodeImp.DoomBuilder.Map
General.Map.Map.WriteSelectionGroups(mapconfig); General.Map.Map.WriteSelectionGroups(mapconfig);
//mxd. Save Tag Labels //mxd. Save Tag Labels
if(tagLabels.Count > 0) { if(tagLabels.Count > 0)
{
ListDictionary tagLabelsData = new ListDictionary(); ListDictionary tagLabelsData = new ListDictionary();
int counter = 1; int counter = 1;
foreach(KeyValuePair<int, string> group in tagLabels){ foreach(KeyValuePair<int, string> group in tagLabels)
{
ListDictionary data = new ListDictionary(); ListDictionary data = new ListDictionary();
data.Add("tag", group.Key); data.Add("tag", group.Key);
data.Add("label", group.Value); data.Add("label", group.Value);
@ -330,6 +338,8 @@ namespace CodeImp.DoomBuilder.Map
mapconfig.WriteSetting("overrideceilheight", overrideceilheight); mapconfig.WriteSetting("overrideceilheight", overrideceilheight);
mapconfig.WriteSetting("overridebrightness", overridebrightness); mapconfig.WriteSetting("overridebrightness", overridebrightness);
mapconfig.WriteSetting("uselongtexturenames", uselongtexturenames); //mxd
//mxd. Write script compiler //mxd. Write script compiler
if(!string.IsNullOrEmpty(scriptcompiler)) if(!string.IsNullOrEmpty(scriptcompiler))
mapconfig.WriteSetting("scriptcompiler", scriptcompiler); mapconfig.WriteSetting("scriptcompiler", scriptcompiler);
@ -416,7 +426,7 @@ namespace CodeImp.DoomBuilder.Map
// This loads the grid settings // This loads the grid settings
internal void ApplyGridSettings() 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 //mxd. This reads stored selection groups from the map configuration

View file

@ -28,6 +28,7 @@ using CodeImp.DoomBuilder.IO;
using CodeImp.DoomBuilder.Types; using CodeImp.DoomBuilder.Types;
using CodeImp.DoomBuilder.Windows; using CodeImp.DoomBuilder.Windows;
using CodeImp.DoomBuilder.VisualModes; using CodeImp.DoomBuilder.VisualModes;
using CodeImp.DoomBuilder.Data;
#endregion #endregion
@ -3204,6 +3205,151 @@ namespace CodeImp.DoomBuilder.Map
foreach(Thing t in things) if(t.Marked) t.TranslateFromUDMF(); 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> /// <summary>This removes unused vertices.</summary>
public void RemoveUnusedVertices() public void RemoveUnusedVertices()
{ {

View file

@ -11,7 +11,8 @@ namespace CodeImp.DoomBuilder.Windows
{ {
public partial class ChangeMapForm : DelayedForm public partial class ChangeMapForm : DelayedForm
{ {
private readonly MapOptions options; private MapOptions options;
private Configuration mapsettings;
private readonly string filepathname; private readonly string filepathname;
public MapOptions Options { get { return options; } } public MapOptions Options { get { return options; } }
@ -58,19 +59,36 @@ namespace CodeImp.DoomBuilder.Windows
// Make an array for the map names // Make an array for the map names
List<ListViewItem> mapnames = new List<ListViewItem>(); 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 //mxd. Get Proper configuration
ConfigurationInfo ci = General.GetConfigurationInfo(options.ConfigFile); ConfigurationInfo ci = General.GetConfigurationInfo(options.ConfigFile);
Configuration cfg = ci.Configuration;
// Get the map lump names // 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 // Count how many required lumps we have to find
foreach(DictionaryEntry ml in maplumpnames) { foreach(DictionaryEntry ml in maplumpnames) {
// Ignore the map header (it will not be found because the name is different) // Ignore the map header (it will not be found because the name is different)
if(ml.Key.ToString() != MapManager.CONFIG_MAP_HEADER) { if(ml.Key.ToString() != MapManager.CONFIG_MAP_HEADER) {
// Read lump setting and count it // Read lump setting and count it
if(cfg.ReadSetting("maplumpnames." + ml.Key + ".required", false)) if(ci.Configuration.ReadSetting("maplumpnames." + ml.Key + ".required", false))
lumpsrequired++; lumpsrequired++;
} }
} }
@ -88,7 +106,7 @@ namespace CodeImp.DoomBuilder.Windows
maplumpnames.Contains(wadfile.Lumps[scanindex + checkoffset].Name)) { maplumpnames.Contains(wadfile.Lumps[scanindex + checkoffset].Name)) {
// Count the lump when it is marked as required // Count the lump when it is marked as required
lumpname = wadfile.Lumps[scanindex + checkoffset].Name; lumpname = wadfile.Lumps[scanindex + checkoffset].Name;
if(cfg.ReadSetting("maplumpnames." + lumpname + ".required", false)) if(ci.Configuration.ReadSetting("maplumpnames." + lumpname + ".required", false))
lumpsfound++; lumpsfound++;
// Check the next lump // Check the next lump
@ -148,8 +166,8 @@ namespace CodeImp.DoomBuilder.Windows
return; return;
} }
options.CurrentName = mapslist.SelectedItems[0].Text; // Create new map options
options.PreviousName = string.Empty; options = new MapOptions(mapsettings, mapslist.SelectedItems[0].Text);
// Hide window // Hide window
this.DialogResult = DialogResult.OK; this.DialogResult = DialogResult.OK;

View file

@ -18,6 +18,7 @@
using System; using System;
using System.Drawing; using System.Drawing;
using System.IO;
using System.Windows.Forms; using System.Windows.Forms;
using CodeImp.DoomBuilder.Data; using CodeImp.DoomBuilder.Data;
using CodeImp.DoomBuilder.Editing; using CodeImp.DoomBuilder.Editing;
@ -84,10 +85,8 @@ namespace CodeImp.DoomBuilder.Windows
// Browse texture // Browse texture
private void selecttexture_Click(object sender, EventArgs e) private void selecttexture_Click(object sender, EventArgs e)
{ {
string result;
// Browse for texture // Browse for texture
result = TextureBrowserForm.Browse(this, backgroundname, false); string result = TextureBrowserForm.Browse(this, backgroundname, false);
if(result != null) if(result != null)
{ {
// Set this texture as background // Set this texture as background
@ -102,10 +101,8 @@ namespace CodeImp.DoomBuilder.Windows
// Browse flat // Browse flat
private void selectflat_Click(object sender, EventArgs e) private void selectflat_Click(object sender, EventArgs e)
{ {
string result;
// Browse for flat // Browse for flat
result = TextureBrowserForm.Browse(this, backgroundname, true); //mxd. was FlatBrowserForm string result = TextureBrowserForm.Browse(this, backgroundname, true);
if(result != null) if(result != null)
{ {
// Set this flat as background // Set this flat as background
@ -126,7 +123,7 @@ namespace CodeImp.DoomBuilder.Windows
// Set this file as background // Set this file as background
backgroundname = browsefile.FileName; backgroundname = browsefile.FileName;
backgroundsource = GridSetup.SOURCE_FILE; 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(); img.LoadImage();
General.DisplayZoomedImage(backgroundimage, new Bitmap(img.GetBitmap())); General.DisplayZoomedImage(backgroundimage, new Bitmap(img.GetBitmap()));
img.Dispose(); img.Dispose();

View file

@ -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) this.frontgroup.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right))); | System.Windows.Forms.AnchorStyles.Right)));
this.frontgroup.Controls.Add(this.frontside); this.frontgroup.Controls.Add(this.frontside);
this.frontgroup.Controls.Add(this.frontTextureOffset);
this.frontgroup.Controls.Add(this.frontsector); this.frontgroup.Controls.Add(this.frontsector);
this.frontgroup.Controls.Add(label11); this.frontgroup.Controls.Add(label11);
this.frontgroup.Controls.Add(this.frontlow); this.frontgroup.Controls.Add(this.frontlow);
this.frontgroup.Controls.Add(this.frontmid); this.frontgroup.Controls.Add(this.frontmid);
this.frontgroup.Controls.Add(this.fronthigh); this.frontgroup.Controls.Add(this.fronthigh);
this.frontgroup.Controls.Add(this.frontTextureOffset);
this.frontgroup.Controls.Add(label5); this.frontgroup.Controls.Add(label5);
this.frontgroup.Controls.Add(label4); this.frontgroup.Controls.Add(label4);
this.frontgroup.Controls.Add(label3); this.frontgroup.Controls.Add(label3);
@ -475,7 +475,7 @@ namespace CodeImp.DoomBuilder.Windows
this.frontTextureOffset.Label = "Texture Offset:"; this.frontTextureOffset.Label = "Texture Offset:";
this.frontTextureOffset.Location = new System.Drawing.Point(3, 65); this.frontTextureOffset.Location = new System.Drawing.Point(3, 65);
this.frontTextureOffset.Name = "frontTextureOffset"; 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.TabIndex = 41;
this.frontTextureOffset.OnValuesChanged += new System.EventHandler(this.frontTextureOffset_OnValuesChanged); 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) this.backgroup.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right))); | System.Windows.Forms.AnchorStyles.Right)));
this.backgroup.Controls.Add(this.backTextureOffset);
this.backgroup.Controls.Add(this.backside); this.backgroup.Controls.Add(this.backside);
this.backgroup.Controls.Add(this.backsector); this.backgroup.Controls.Add(this.backsector);
this.backgroup.Controls.Add(label12); this.backgroup.Controls.Add(label12);
this.backgroup.Controls.Add(this.backlow); this.backgroup.Controls.Add(this.backlow);
this.backgroup.Controls.Add(this.backmid); this.backgroup.Controls.Add(this.backmid);
this.backgroup.Controls.Add(this.backhigh); this.backgroup.Controls.Add(this.backhigh);
this.backgroup.Controls.Add(this.backTextureOffset);
this.backgroup.Controls.Add(label8); this.backgroup.Controls.Add(label8);
this.backgroup.Controls.Add(label9); this.backgroup.Controls.Add(label9);
this.backgroup.Controls.Add(label10); this.backgroup.Controls.Add(label10);
@ -566,7 +566,7 @@ namespace CodeImp.DoomBuilder.Windows
this.backTextureOffset.Label = "Texture Offset:"; this.backTextureOffset.Label = "Texture Offset:";
this.backTextureOffset.Location = new System.Drawing.Point(3, 65); this.backTextureOffset.Location = new System.Drawing.Point(3, 65);
this.backTextureOffset.Name = "backTextureOffset"; 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.TabIndex = 42;
this.backTextureOffset.OnValuesChanged += new System.EventHandler(this.backTextureOffset_OnValuesChanged); this.backTextureOffset.OnValuesChanged += new System.EventHandler(this.backTextureOffset_OnValuesChanged);
// //
@ -648,7 +648,6 @@ namespace CodeImp.DoomBuilder.Windows
this.MaximizeBox = false; this.MaximizeBox = false;
this.MinimizeBox = false; this.MinimizeBox = false;
this.Name = "LinedefEditForm"; this.Name = "LinedefEditForm";
this.Opacity = 0;
this.ShowIcon = false; this.ShowIcon = false;
this.ShowInTaskbar = false; this.ShowInTaskbar = false;
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent; this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent;

File diff suppressed because it is too large Load diff

View file

@ -69,8 +69,6 @@ namespace CodeImp.DoomBuilder.Windows
//mxd. Window setup stuff //mxd. Window setup stuff
private static Point location = Point.Empty; private static Point location = Point.Empty;
private static int activeTab; private static int activeTab;
private static int activeFrontTab;
private static int activeBackTab;
private struct LinedefProperties //mxd private struct LinedefProperties //mxd
{ {
@ -173,8 +171,6 @@ namespace CodeImp.DoomBuilder.Windows
{ {
activeTab = 0; activeTab = 0;
} }
if(activeFrontTab > 0) udmfPropertiesFront.SelectTab(activeFrontTab);
if(activeBackTab > 0) udmfPropertiesBack.SelectTab(activeBackTab);
} }
// Fill flags lists // Fill flags lists
@ -278,8 +274,16 @@ namespace CodeImp.DoomBuilder.Windows
labelLightBack.Visible = false; labelLightBack.Visible = false;
lightBack.Visible = false; lightBack.Visible = false;
cbLightAbsoluteBack.Visible = false; cbLightAbsoluteBack.Visible = false;
udmfPropertiesFront.Visible = false; frontflagsgroup.Enabled = false;
udmfPropertiesBack.Visible = 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 // Enable/disable panel
// NOTE: Also enabled when checkbox is grayed! // NOTE: Also enabled when checkbox is grayed!
frontgroup.Enabled = (frontside.CheckState != CheckState.Unchecked); frontgroup.Enabled = (frontside.CheckState != CheckState.Unchecked);
tabfront.ImageIndex = (frontside.CheckState == CheckState.Unchecked ? 1 : 0);
} }
// Back side (un)checked // Back side (un)checked
@ -933,6 +938,7 @@ namespace CodeImp.DoomBuilder.Windows
// Enable/disable panel // Enable/disable panel
// NOTE: Also enabled when checkbox is grayed! // NOTE: Also enabled when checkbox is grayed!
backgroup.Enabled = (backside.CheckState != CheckState.Unchecked); backgroup.Enabled = (backside.CheckState != CheckState.Unchecked);
tabback.ImageIndex = (backside.CheckState == CheckState.Unchecked ? 1 : 0);
} }
// Action changes // Action changes
@ -1020,8 +1026,6 @@ namespace CodeImp.DoomBuilder.Windows
{ {
location = this.Location; location = this.Location;
activeTab = tabs.SelectedIndex; activeTab = tabs.SelectedIndex;
activeFrontTab = udmfPropertiesFront.SelectedIndex;
activeBackTab = udmfPropertiesBack.SelectedIndex;
} }
// Help! // Help!

View file

@ -123,42 +123,6 @@
<metadata name="label2.GenerateMember" type="System.Boolean, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> <metadata name="label2.GenerateMember" type="System.Boolean, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>False</value> <value>False</value>
</metadata> </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"> <metadata name="label11.GenerateMember" type="System.Boolean, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>False</value> <value>False</value>
</metadata> </metadata>
@ -183,31 +147,55 @@
<metadata name="tooltip.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"> <metadata name="tooltip.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>17, 17</value> <value>17, 17</value>
</metadata> </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"> <metadata name="tabcustom.Locked" type="System.Boolean, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value> <value>True</value>
</metadata> </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> </root>

View file

@ -413,7 +413,7 @@ namespace CodeImp.DoomBuilder.Windows
this.itemopenmapincurwad.Name = "itemopenmapincurwad"; this.itemopenmapincurwad.Name = "itemopenmapincurwad";
this.itemopenmapincurwad.Size = new System.Drawing.Size(223, 22); this.itemopenmapincurwad.Size = new System.Drawing.Size(223, 22);
this.itemopenmapincurwad.Tag = "builder_openmapincurrentwad"; 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); this.itemopenmapincurwad.Click += new System.EventHandler(this.InvokeTaggedAction);
// //
// itemclosemap // itemclosemap
@ -869,7 +869,7 @@ namespace CodeImp.DoomBuilder.Windows
this.itemfittoscreen.Name = "itemfittoscreen"; this.itemfittoscreen.Name = "itemfittoscreen";
this.itemfittoscreen.Size = new System.Drawing.Size(209, 22); this.itemfittoscreen.Size = new System.Drawing.Size(209, 22);
this.itemfittoscreen.Tag = "builder_centerinscreen"; 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); this.itemfittoscreen.Click += new System.EventHandler(this.InvokeTaggedAction);
// //
// itemtoggleinfo // itemtoggleinfo

View file

@ -41,6 +41,7 @@ namespace CodeImp.DoomBuilder.Windows
this.apply = new System.Windows.Forms.Button(); this.apply = new System.Windows.Forms.Button();
this.cancel = new System.Windows.Forms.Button(); this.cancel = new System.Windows.Forms.Button();
this.panelres = new System.Windows.Forms.GroupBox(); this.panelres = new System.Windows.Forms.GroupBox();
this.uselongtexturenames = new System.Windows.Forms.CheckBox();
this.strictpatches = new System.Windows.Forms.CheckBox(); this.strictpatches = new System.Windows.Forms.CheckBox();
this.datalocations = new CodeImp.DoomBuilder.Controls.ResourceListEditor(); this.datalocations = new CodeImp.DoomBuilder.Controls.ResourceListEditor();
label3 = new System.Windows.Forms.Label(); label3 = new System.Windows.Forms.Label();
@ -63,12 +64,12 @@ namespace CodeImp.DoomBuilder.Windows
// //
// label2 // label2
// //
label2.AutoSize = true; label2.Location = new System.Drawing.Point(13, 83);
label2.Location = new System.Drawing.Point(58, 83);
label2.Name = "label2"; label2.Name = "label2";
label2.Size = new System.Drawing.Size(65, 14); label2.Size = new System.Drawing.Size(110, 14);
label2.TabIndex = 7; label2.TabIndex = 7;
label2.Text = "Level name:"; label2.Text = "Level name:";
label2.TextAlign = System.Drawing.ContentAlignment.TopRight;
// //
// label1 // label1
// //
@ -76,7 +77,7 @@ namespace CodeImp.DoomBuilder.Windows
label1.Name = "label1"; label1.Name = "label1";
label1.Size = new System.Drawing.Size(110, 14); label1.Size = new System.Drawing.Size(110, 14);
label1.TabIndex = 5; label1.TabIndex = 5;
label1.Text = "Game Configuration:"; label1.Text = "Game configuration:";
label1.TextAlign = System.Drawing.ContentAlignment.TopRight; label1.TextAlign = System.Drawing.ContentAlignment.TopRight;
// //
// panelsettings // panelsettings
@ -124,7 +125,7 @@ namespace CodeImp.DoomBuilder.Windows
this.scriptcompilerlabel.Name = "scriptcompilerlabel"; this.scriptcompilerlabel.Name = "scriptcompilerlabel";
this.scriptcompilerlabel.Size = new System.Drawing.Size(110, 14); this.scriptcompilerlabel.Size = new System.Drawing.Size(110, 14);
this.scriptcompilerlabel.TabIndex = 11; this.scriptcompilerlabel.TabIndex = 11;
this.scriptcompilerlabel.Text = "Script Type:"; this.scriptcompilerlabel.Text = "Script type:";
this.scriptcompilerlabel.TextAlign = System.Drawing.ContentAlignment.TopRight; this.scriptcompilerlabel.TextAlign = System.Drawing.ContentAlignment.TopRight;
// //
// levelname // levelname
@ -152,7 +153,7 @@ namespace CodeImp.DoomBuilder.Windows
// label4 // label4
// //
label4.AutoSize = true; label4.AutoSize = true;
label4.Location = new System.Drawing.Point(15, 190); label4.Location = new System.Drawing.Point(15, 210);
label4.Name = "label4"; label4.Name = "label4";
label4.Size = new System.Drawing.Size(312, 42); label4.Size = new System.Drawing.Size(312, 42);
label4.TabIndex = 17; label4.TabIndex = 17;
@ -163,7 +164,7 @@ namespace CodeImp.DoomBuilder.Windows
// apply // apply
// //
this.apply.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); 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.Name = "apply";
this.apply.Size = new System.Drawing.Size(112, 25); this.apply.Size = new System.Drawing.Size(112, 25);
this.apply.TabIndex = 2; 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.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.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.Name = "cancel";
this.cancel.Size = new System.Drawing.Size(112, 25); this.cancel.Size = new System.Drawing.Size(112, 25);
this.cancel.TabIndex = 3; 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) this.panelres.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right))); | System.Windows.Forms.AnchorStyles.Right)));
this.panelres.Controls.Add(this.uselongtexturenames);
this.panelres.Controls.Add(this.strictpatches); this.panelres.Controls.Add(this.strictpatches);
this.panelres.Controls.Add(this.datalocations); this.panelres.Controls.Add(this.datalocations);
this.panelres.Controls.Add(label4); this.panelres.Controls.Add(label4);
this.panelres.Location = new System.Drawing.Point(12, 130); this.panelres.Location = new System.Drawing.Point(12, 130);
this.panelres.Name = "panelres"; 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.TabIndex = 1;
this.panelres.TabStop = false; this.panelres.TabStop = false;
this.panelres.Text = " Resources "; 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 // strictpatches
// //
this.strictpatches.AutoSize = true; this.strictpatches.AutoSize = true;
@ -212,7 +224,7 @@ namespace CodeImp.DoomBuilder.Windows
this.datalocations.AllowDrop = true; this.datalocations.AllowDrop = true;
this.datalocations.DialogOffset = new System.Drawing.Point(40, 20); 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.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.Name = "datalocations";
this.datalocations.Size = new System.Drawing.Size(368, 130); this.datalocations.Size = new System.Drawing.Size(368, 130);
this.datalocations.TabIndex = 0; this.datalocations.TabIndex = 0;
@ -223,7 +235,7 @@ namespace CodeImp.DoomBuilder.Windows
this.AutoScaleDimensions = new System.Drawing.SizeF(96F, 96F); this.AutoScaleDimensions = new System.Drawing.SizeF(96F, 96F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Dpi; this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Dpi;
this.CancelButton = this.cancel; 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.panelres);
this.Controls.Add(this.cancel); this.Controls.Add(this.cancel);
this.Controls.Add(this.apply); this.Controls.Add(this.apply);
@ -259,6 +271,7 @@ namespace CodeImp.DoomBuilder.Windows
private System.Windows.Forms.ComboBox scriptcompiler; private System.Windows.Forms.ComboBox scriptcompiler;
private System.Windows.Forms.Label scriptcompilerlabel; private System.Windows.Forms.Label scriptcompilerlabel;
private System.Windows.Forms.Label examplelabel; private System.Windows.Forms.Label examplelabel;
private System.Windows.Forms.CheckBox uselongtexturenames;
} }

View file

@ -32,8 +32,8 @@ namespace CodeImp.DoomBuilder.Windows
internal partial class MapOptionsForm : DelayedForm internal partial class MapOptionsForm : DelayedForm
{ {
// Variables // Variables
private MapOptions options; private readonly MapOptions options;
private bool newmap; private readonly bool newmap;
private string previousdefaultmaplumpname; //mxd private string previousdefaultmaplumpname; //mxd
// Properties // Properties
@ -169,6 +169,16 @@ namespace CodeImp.DoomBuilder.Windows
return; 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 // Collect information
ConfigurationInfo configinfo = config.SelectedItem as ConfigurationInfo; //mxd ConfigurationInfo configinfo = config.SelectedItem as ConfigurationInfo; //mxd
DataLocationList locations = datalocations.GetResources(); DataLocationList locations = datalocations.GetResources();
@ -313,6 +323,10 @@ namespace CodeImp.DoomBuilder.Windows
scriptcompiler.SelectedIndex = -1; scriptcompiler.SelectedIndex = -1;
} }
//mxd. Long texture names
uselongtexturenames.Enabled = ci.SupportsLongTextureNames;
uselongtexturenames.Checked = (ci.SupportsLongTextureNames && options.UseLongTextureNames);
// Show resources // Show resources
datalocations.FixedResourceLocationList(ci.Resources); datalocations.FixedResourceLocationList(ci.Resources);
} }

View file

@ -129,16 +129,7 @@
<metadata name="panelsettings.GenerateMember" type="System.Boolean, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> <metadata name="panelsettings.GenerateMember" type="System.Boolean, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>False</value> <value>False</value>
</metadata> </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"> <metadata name="label4.GenerateMember" type="System.Boolean, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>False</value> <value>False</value>
</metadata> </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> </root>

View file

@ -33,6 +33,7 @@ namespace CodeImp.DoomBuilder.Windows
System.Windows.Forms.Label label2; System.Windows.Forms.Label label2;
System.Windows.Forms.Label label3; System.Windows.Forms.Label label3;
this.panelres = new System.Windows.Forms.GroupBox(); this.panelres = new System.Windows.Forms.GroupBox();
this.uselongtexturenames = new System.Windows.Forms.CheckBox();
this.strictpatches = new System.Windows.Forms.CheckBox(); this.strictpatches = new System.Windows.Forms.CheckBox();
this.datalocations = new CodeImp.DoomBuilder.Controls.ResourceListEditor(); this.datalocations = new CodeImp.DoomBuilder.Controls.ResourceListEditor();
this.apply = new System.Windows.Forms.Button(); this.apply = new System.Windows.Forms.Button();
@ -58,7 +59,7 @@ namespace CodeImp.DoomBuilder.Windows
label1.Name = "label1"; label1.Name = "label1";
label1.Size = new System.Drawing.Size(120, 14); label1.Size = new System.Drawing.Size(120, 14);
label1.TabIndex = 14; label1.TabIndex = 14;
label1.Text = "Game Configuration:"; label1.Text = "Game configuration:";
label1.TextAlign = System.Drawing.ContentAlignment.TopRight; label1.TextAlign = System.Drawing.ContentAlignment.TopRight;
// //
// label2 // label2
@ -73,7 +74,7 @@ namespace CodeImp.DoomBuilder.Windows
// label3 // label3
// //
label3.AutoSize = true; label3.AutoSize = true;
label3.Location = new System.Drawing.Point(14, 191); label3.Location = new System.Drawing.Point(14, 210);
label3.Name = "label3"; label3.Name = "label3";
label3.Size = new System.Drawing.Size(312, 42); label3.Size = new System.Drawing.Size(312, 42);
label3.TabIndex = 17; 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) this.panelres.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right))); | System.Windows.Forms.AnchorStyles.Right)));
this.panelres.Controls.Add(this.uselongtexturenames);
this.panelres.Controls.Add(this.strictpatches); this.panelres.Controls.Add(this.strictpatches);
this.panelres.Controls.Add(this.datalocations); this.panelres.Controls.Add(this.datalocations);
this.panelres.Controls.Add(label3); this.panelres.Controls.Add(label3);
this.panelres.Location = new System.Drawing.Point(12, 246); this.panelres.Location = new System.Drawing.Point(12, 246);
this.panelres.Name = "panelres"; 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.TabIndex = 2;
this.panelres.TabStop = false; this.panelres.TabStop = false;
this.panelres.Text = " Resources "; 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 // strictpatches
// //
this.strictpatches.AutoSize = true; this.strictpatches.AutoSize = true;
@ -110,7 +122,7 @@ namespace CodeImp.DoomBuilder.Windows
this.datalocations.AllowDrop = true; this.datalocations.AllowDrop = true;
this.datalocations.DialogOffset = new System.Drawing.Point(40, 20); 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.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.Name = "datalocations";
this.datalocations.Size = new System.Drawing.Size(368, 127); this.datalocations.Size = new System.Drawing.Size(368, 127);
this.datalocations.TabIndex = 0; this.datalocations.TabIndex = 0;
@ -118,7 +130,7 @@ namespace CodeImp.DoomBuilder.Windows
// apply // apply
// //
this.apply.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); 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.Name = "apply";
this.apply.Size = new System.Drawing.Size(112, 25); this.apply.Size = new System.Drawing.Size(112, 25);
this.apply.TabIndex = 3; 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.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.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.Name = "cancel";
this.cancel.Size = new System.Drawing.Size(112, 25); this.cancel.Size = new System.Drawing.Size(112, 25);
this.cancel.TabIndex = 4; this.cancel.TabIndex = 4;
@ -191,7 +203,7 @@ namespace CodeImp.DoomBuilder.Windows
this.scriptcompilerlabel.Name = "scriptcompilerlabel"; this.scriptcompilerlabel.Name = "scriptcompilerlabel";
this.scriptcompilerlabel.Size = new System.Drawing.Size(120, 14); this.scriptcompilerlabel.Size = new System.Drawing.Size(120, 14);
this.scriptcompilerlabel.TabIndex = 18; this.scriptcompilerlabel.TabIndex = 18;
this.scriptcompilerlabel.Text = "Script Type:"; this.scriptcompilerlabel.Text = "Script type:";
this.scriptcompilerlabel.TextAlign = System.Drawing.ContentAlignment.TopRight; this.scriptcompilerlabel.TextAlign = System.Drawing.ContentAlignment.TopRight;
// //
// OpenMapOptionsForm // OpenMapOptionsForm
@ -200,7 +212,7 @@ namespace CodeImp.DoomBuilder.Windows
this.AutoScaleDimensions = new System.Drawing.SizeF(96F, 96F); this.AutoScaleDimensions = new System.Drawing.SizeF(96F, 96F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Dpi; this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Dpi;
this.CancelButton = this.cancel; 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.scriptcompiler);
this.Controls.Add(this.scriptcompilerlabel); this.Controls.Add(this.scriptcompilerlabel);
this.Controls.Add(this.mapslist); this.Controls.Add(this.mapslist);
@ -239,6 +251,7 @@ namespace CodeImp.DoomBuilder.Windows
private System.Windows.Forms.CheckBox strictpatches; private System.Windows.Forms.CheckBox strictpatches;
private System.Windows.Forms.ComboBox scriptcompiler; private System.Windows.Forms.ComboBox scriptcompiler;
private System.Windows.Forms.Label scriptcompilerlabel; private System.Windows.Forms.Label scriptcompilerlabel;
private System.Windows.Forms.CheckBox uselongtexturenames;
} }

View file

@ -324,6 +324,10 @@ namespace CodeImp.DoomBuilder.Windows
scriptcompilerlabel.Enabled = false; scriptcompilerlabel.Enabled = false;
} }
//mxd. Long texture names
uselongtexturenames.Enabled = ci.SupportsLongTextureNames;
uselongtexturenames.Checked = (ci.SupportsLongTextureNames && options.UseLongTextureNames);
// Show configuration resources // Show configuration resources
datalocations.FixedResourceLocationList(ci.Resources); datalocations.FixedResourceLocationList(ci.Resources);
} }
@ -340,6 +344,15 @@ namespace CodeImp.DoomBuilder.Windows
return; 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 // Collect information
ConfigurationInfo configinfo = (config.SelectedItem as ConfigurationInfo); //mxd ConfigurationInfo configinfo = (config.SelectedItem as ConfigurationInfo); //mxd
DataLocationList locations = datalocations.GetResources(); DataLocationList locations = datalocations.GetResources();
@ -464,7 +477,8 @@ namespace CodeImp.DoomBuilder.Windows
datalocations.EditResourceLocationList(listedlocations); datalocations.EditResourceLocationList(listedlocations);
//mxd. Select script compiler //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; scriptconfig = options.ScriptCompiler;
} }
else else
@ -473,6 +487,9 @@ namespace CodeImp.DoomBuilder.Windows
if(!string.IsNullOrEmpty(defaultscriptconfig) && General.CompiledScriptConfigs.ContainsKey(defaultscriptconfig)) if(!string.IsNullOrEmpty(defaultscriptconfig) && General.CompiledScriptConfigs.ContainsKey(defaultscriptconfig))
scriptconfig = defaultscriptconfig; scriptconfig = defaultscriptconfig;
} }
//mxd. Long texture names
if(uselongtexturenames.Enabled) uselongtexturenames.Checked = options.UseLongTextureNames;
} }
//mxd. Select proper script compiler //mxd. Select proper script compiler

View file

@ -126,19 +126,7 @@
<metadata name="label2.GenerateMember" type="System.Boolean, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> <metadata name="label2.GenerateMember" type="System.Boolean, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>False</value> <value>False</value>
</metadata> </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"> <metadata name="label3.GenerateMember" type="System.Boolean, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>False</value> <value>False</value>
</metadata> </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> </root>

View file

@ -1892,6 +1892,7 @@ namespace CodeImp.DoomBuilder.Windows
this.MaximizeBox = false; this.MaximizeBox = false;
this.MinimizeBox = false; this.MinimizeBox = false;
this.Name = "PreferencesForm"; this.Name = "PreferencesForm";
this.Opacity = 0;
this.ShowIcon = false; this.ShowIcon = false;
this.ShowInTaskbar = false; this.ShowInTaskbar = false;
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent; this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent;

View file

@ -129,7 +129,7 @@
groupaction.Controls.Add(this.tagSelector); groupaction.Controls.Add(this.tagSelector);
groupaction.Location = new System.Drawing.Point(7, 341); groupaction.Location = new System.Drawing.Point(7, 341);
groupaction.Name = "groupaction"; groupaction.Name = "groupaction";
groupaction.Size = new System.Drawing.Size(436, 71); groupaction.Size = new System.Drawing.Size(490, 71);
groupaction.TabIndex = 2; groupaction.TabIndex = 2;
groupaction.TabStop = false; groupaction.TabStop = false;
groupaction.Text = " Identification: "; groupaction.Text = " Identification: ";
@ -138,7 +138,7 @@
// //
this.tagSelector.Location = new System.Drawing.Point(6, 21); this.tagSelector.Location = new System.Drawing.Point(6, 21);
this.tagSelector.Name = "tagSelector"; 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; this.tagSelector.TabIndex = 0;
// //
// groupeffect // groupeffect
@ -160,7 +160,7 @@
groupeffect.Controls.Add(label8); groupeffect.Controls.Add(label8);
groupeffect.Location = new System.Drawing.Point(7, 160); groupeffect.Location = new System.Drawing.Point(7, 160);
groupeffect.Name = "groupeffect"; groupeffect.Name = "groupeffect";
groupeffect.Size = new System.Drawing.Size(436, 175); groupeffect.Size = new System.Drawing.Size(490, 175);
groupeffect.TabIndex = 1; groupeffect.TabIndex = 1;
groupeffect.TabStop = false; groupeffect.TabStop = false;
groupeffect.Text = " Effects: "; groupeffect.Text = " Effects: ";
@ -170,7 +170,7 @@
this.fadeColor.DefaultValue = 0; this.fadeColor.DefaultValue = 0;
this.fadeColor.Field = "fadecolor"; this.fadeColor.Field = "fadecolor";
this.fadeColor.Label = "Fade:"; 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.Name = "fadeColor";
this.fadeColor.Size = new System.Drawing.Size(207, 31); this.fadeColor.Size = new System.Drawing.Size(207, 31);
this.fadeColor.TabIndex = 30; this.fadeColor.TabIndex = 30;
@ -181,7 +181,7 @@
this.lightColor.DefaultValue = 16777215; this.lightColor.DefaultValue = 16777215;
this.lightColor.Field = "lightcolor"; this.lightColor.Field = "lightcolor";
this.lightColor.Label = "Light:"; 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.Name = "lightColor";
this.lightColor.Size = new System.Drawing.Size(207, 29); this.lightColor.Size = new System.Drawing.Size(207, 29);
this.lightColor.TabIndex = 29; this.lightColor.TabIndex = 29;
@ -247,7 +247,7 @@
// //
this.soundSequence.Location = new System.Drawing.Point(125, 55); this.soundSequence.Location = new System.Drawing.Point(125, 55);
this.soundSequence.Name = "soundSequence"; 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; this.soundSequence.TabIndex = 2;
// //
// gravity // gravity
@ -276,7 +276,7 @@
// browseeffect // browseeffect
// //
this.browseeffect.Image = global::CodeImp.DoomBuilder.Properties.Resources.List; 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.Name = "browseeffect";
this.browseeffect.Size = new System.Drawing.Size(28, 25); this.browseeffect.Size = new System.Drawing.Size(28, 25);
this.browseeffect.TabIndex = 1; this.browseeffect.TabIndex = 1;
@ -293,7 +293,7 @@
this.effect.GeneralizedOptions = null; this.effect.GeneralizedOptions = null;
this.effect.Location = new System.Drawing.Point(68, 28); this.effect.Location = new System.Drawing.Point(68, 28);
this.effect.Name = "effect"; 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.TabIndex = 0;
this.effect.Value = 402; this.effect.Value = 402;
// //
@ -320,7 +320,7 @@
groupfloorceiling.Controls.Add(this.floorheight); groupfloorceiling.Controls.Add(this.floorheight);
groupfloorceiling.Location = new System.Drawing.Point(7, 6); groupfloorceiling.Location = new System.Drawing.Point(7, 6);
groupfloorceiling.Name = "groupfloorceiling"; groupfloorceiling.Name = "groupfloorceiling";
groupfloorceiling.Size = new System.Drawing.Size(188, 148); groupfloorceiling.Size = new System.Drawing.Size(242, 148);
groupfloorceiling.TabIndex = 0; groupfloorceiling.TabIndex = 0;
groupfloorceiling.TabStop = false; groupfloorceiling.TabStop = false;
groupfloorceiling.Text = " Heights: "; groupfloorceiling.Text = " Heights: ";
@ -432,7 +432,7 @@
this.tabs.Margin = new System.Windows.Forms.Padding(1); this.tabs.Margin = new System.Windows.Forms.Padding(1);
this.tabs.Name = "tabs"; this.tabs.Name = "tabs";
this.tabs.SelectedIndex = 0; 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.SizeMode = System.Windows.Forms.TabSizeMode.Fixed;
this.tabs.TabIndex = 1; this.tabs.TabIndex = 1;
// //
@ -446,7 +446,7 @@
this.tabproperties.Location = new System.Drawing.Point(4, 23); this.tabproperties.Location = new System.Drawing.Point(4, 23);
this.tabproperties.Name = "tabproperties"; this.tabproperties.Name = "tabproperties";
this.tabproperties.Padding = new System.Windows.Forms.Padding(3); 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.TabIndex = 0;
this.tabproperties.Text = "Properties"; this.tabproperties.Text = "Properties";
this.tabproperties.UseVisualStyleBackColor = true; this.tabproperties.UseVisualStyleBackColor = true;
@ -456,7 +456,7 @@
this.groupBox3.Controls.Add(this.flags); this.groupBox3.Controls.Add(this.flags);
this.groupBox3.Location = new System.Drawing.Point(201, 6); this.groupBox3.Location = new System.Drawing.Point(201, 6);
this.groupBox3.Name = "groupBox3"; 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.TabIndex = 3;
this.groupBox3.TabStop = false; this.groupBox3.TabStop = false;
this.groupBox3.Text = " Flags: "; this.groupBox3.Text = " Flags: ";
@ -467,7 +467,7 @@
this.flags.Columns = 1; this.flags.Columns = 1;
this.flags.Location = new System.Drawing.Point(15, 21); this.flags.Location = new System.Drawing.Point(15, 21);
this.flags.Name = "flags"; 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.TabIndex = 5;
this.flags.VerticalSpacing = 2; 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.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.Location = new System.Drawing.Point(4, 23);
this.tabSurfaces.Name = "tabSurfaces"; 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.TabIndex = 2;
this.tabSurfaces.Text = "Surfaces"; this.tabSurfaces.Text = "Surfaces";
this.tabSurfaces.UseVisualStyleBackColor = true; this.tabSurfaces.UseVisualStyleBackColor = true;
@ -503,7 +503,7 @@
this.groupBox2.Controls.Add(this.floortex); this.groupBox2.Controls.Add(this.floortex);
this.groupBox2.Location = new System.Drawing.Point(3, 212); this.groupBox2.Location = new System.Drawing.Point(3, 212);
this.groupBox2.Name = "groupBox2"; 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.TabIndex = 55;
this.groupBox2.TabStop = false; this.groupBox2.TabStop = false;
this.groupBox2.Text = " Floor: "; this.groupBox2.Text = " Floor: ";
@ -511,7 +511,7 @@
// cbUseFloorLineAngles // cbUseFloorLineAngles
// //
this.cbUseFloorLineAngles.AutoSize = true; 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.Name = "cbUseFloorLineAngles";
this.cbUseFloorLineAngles.Size = new System.Drawing.Size(115, 18); this.cbUseFloorLineAngles.Size = new System.Drawing.Size(115, 18);
this.cbUseFloorLineAngles.TabIndex = 57; this.cbUseFloorLineAngles.TabIndex = 57;
@ -522,9 +522,9 @@
// //
// floorAngleControl // floorAngleControl
// //
this.floorAngleControl.Angle = 0; this.floorAngleControl.Angle = -360;
this.floorAngleControl.AngleOffset = 90; 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.Name = "floorAngleControl";
this.floorAngleControl.Size = new System.Drawing.Size(44, 44); this.floorAngleControl.Size = new System.Drawing.Size(44, 44);
this.floorAngleControl.TabIndex = 56; this.floorAngleControl.TabIndex = 56;
@ -532,7 +532,7 @@
// //
// label7 // 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.Name = "label7";
this.label7.Size = new System.Drawing.Size(80, 14); this.label7.Size = new System.Drawing.Size(80, 14);
this.label7.TabIndex = 54; this.label7.TabIndex = 54;
@ -542,7 +542,7 @@
// //
// label10 // 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.Name = "label10";
this.label10.Size = new System.Drawing.Size(80, 14); this.label10.Size = new System.Drawing.Size(80, 14);
this.label10.TabIndex = 52; this.label10.TabIndex = 52;
@ -558,7 +558,7 @@
this.floorAlpha.ButtonStep = 1; this.floorAlpha.ButtonStep = 1;
this.floorAlpha.ButtonStepFloat = 0.1F; this.floorAlpha.ButtonStepFloat = 0.1F;
this.floorAlpha.ButtonStepsWrapAround = false; 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.Name = "floorAlpha";
this.floorAlpha.Size = new System.Drawing.Size(62, 24); this.floorAlpha.Size = new System.Drawing.Size(62, 24);
this.floorAlpha.StepValues = null; this.floorAlpha.StepValues = null;
@ -567,7 +567,7 @@
// //
// label11 // 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.Name = "label11";
this.label11.Size = new System.Drawing.Size(80, 14); this.label11.Size = new System.Drawing.Size(80, 14);
this.label11.TabIndex = 50; this.label11.TabIndex = 50;
@ -583,7 +583,7 @@
this.floorRotation.ButtonStep = 5; this.floorRotation.ButtonStep = 5;
this.floorRotation.ButtonStepFloat = 1F; this.floorRotation.ButtonStepFloat = 1F;
this.floorRotation.ButtonStepsWrapAround = false; 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.Name = "floorRotation";
this.floorRotation.Size = new System.Drawing.Size(62, 24); this.floorRotation.Size = new System.Drawing.Size(62, 24);
this.floorRotation.StepValues = null; this.floorRotation.StepValues = null;
@ -594,7 +594,7 @@
// floorLightAbsolute // floorLightAbsolute
// //
this.floorLightAbsolute.AutoSize = true; 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.Name = "floorLightAbsolute";
this.floorLightAbsolute.Size = new System.Drawing.Size(69, 18); this.floorLightAbsolute.Size = new System.Drawing.Size(69, 18);
this.floorLightAbsolute.TabIndex = 49; this.floorLightAbsolute.TabIndex = 49;
@ -604,7 +604,7 @@
// //
// label12 // 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.Name = "label12";
this.label12.Size = new System.Drawing.Size(80, 14); this.label12.Size = new System.Drawing.Size(80, 14);
this.label12.TabIndex = 47; this.label12.TabIndex = 47;
@ -620,7 +620,7 @@
this.floorBrightness.ButtonStep = 16; this.floorBrightness.ButtonStep = 16;
this.floorBrightness.ButtonStepFloat = 1F; this.floorBrightness.ButtonStepFloat = 1F;
this.floorBrightness.ButtonStepsWrapAround = false; 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.Name = "floorBrightness";
this.floorBrightness.Size = new System.Drawing.Size(62, 24); this.floorBrightness.Size = new System.Drawing.Size(62, 24);
this.floorBrightness.StepValues = null; this.floorBrightness.StepValues = null;
@ -632,7 +632,7 @@
// //
this.floorRenderStyle.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; this.floorRenderStyle.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
this.floorRenderStyle.FormattingEnabled = true; 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.Name = "floorRenderStyle";
this.floorRenderStyle.Size = new System.Drawing.Size(130, 22); this.floorRenderStyle.Size = new System.Drawing.Size(130, 22);
this.floorRenderStyle.TabIndex = 46; 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.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.Label = "Texture Scale:";
this.floorScale.LinkValues = false; 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.Name = "floorScale";
this.floorScale.Size = new System.Drawing.Size(276, 28); this.floorScale.Size = new System.Drawing.Size(276, 28);
this.floorScale.TabIndex = 17; 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.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.Label = "Texture Offsets:";
this.floorOffsets.LinkValues = false; 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.Name = "floorOffsets";
this.floorOffsets.Size = new System.Drawing.Size(276, 26); this.floorOffsets.Size = new System.Drawing.Size(276, 26);
this.floorOffsets.TabIndex = 16; this.floorOffsets.TabIndex = 16;
@ -675,12 +675,13 @@
// //
// floortex // 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.MultipleTextures = false;
this.floortex.Name = "floortex"; 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.TabIndex = 15;
this.floortex.TextureName = ""; this.floortex.TextureName = "";
this.floortex.UsePreviews = false;
this.floortex.OnValueChanged += new System.EventHandler(this.floortex_OnValueChanged); this.floortex.OnValueChanged += new System.EventHandler(this.floortex_OnValueChanged);
// //
// groupBox1 // groupBox1
@ -703,7 +704,7 @@
this.groupBox1.Controls.Add(this.ceilingtex); this.groupBox1.Controls.Add(this.ceilingtex);
this.groupBox1.Location = new System.Drawing.Point(3, 3); this.groupBox1.Location = new System.Drawing.Point(3, 3);
this.groupBox1.Name = "groupBox1"; 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.TabIndex = 0;
this.groupBox1.TabStop = false; this.groupBox1.TabStop = false;
this.groupBox1.Text = " Ceiling: "; this.groupBox1.Text = " Ceiling: ";
@ -711,7 +712,7 @@
// cbUseCeilLineAngles // cbUseCeilLineAngles
// //
this.cbUseCeilLineAngles.AutoSize = true; 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.Name = "cbUseCeilLineAngles";
this.cbUseCeilLineAngles.Size = new System.Drawing.Size(115, 18); this.cbUseCeilLineAngles.Size = new System.Drawing.Size(115, 18);
this.cbUseCeilLineAngles.TabIndex = 56; this.cbUseCeilLineAngles.TabIndex = 56;
@ -722,9 +723,9 @@
// //
// ceilAngleControl // ceilAngleControl
// //
this.ceilAngleControl.Angle = 0; this.ceilAngleControl.Angle = -360;
this.ceilAngleControl.AngleOffset = 90; 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.Name = "ceilAngleControl";
this.ceilAngleControl.Size = new System.Drawing.Size(44, 44); this.ceilAngleControl.Size = new System.Drawing.Size(44, 44);
this.ceilAngleControl.TabIndex = 55; this.ceilAngleControl.TabIndex = 55;
@ -732,7 +733,7 @@
// //
// label3 // 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.Name = "label3";
this.label3.Size = new System.Drawing.Size(80, 14); this.label3.Size = new System.Drawing.Size(80, 14);
this.label3.TabIndex = 54; this.label3.TabIndex = 54;
@ -742,7 +743,7 @@
// //
// label4 // 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.Name = "label4";
this.label4.Size = new System.Drawing.Size(80, 14); this.label4.Size = new System.Drawing.Size(80, 14);
this.label4.TabIndex = 52; this.label4.TabIndex = 52;
@ -758,7 +759,7 @@
this.ceilAlpha.ButtonStep = 1; this.ceilAlpha.ButtonStep = 1;
this.ceilAlpha.ButtonStepFloat = 0.1F; this.ceilAlpha.ButtonStepFloat = 0.1F;
this.ceilAlpha.ButtonStepsWrapAround = false; 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.Name = "ceilAlpha";
this.ceilAlpha.Size = new System.Drawing.Size(62, 24); this.ceilAlpha.Size = new System.Drawing.Size(62, 24);
this.ceilAlpha.StepValues = null; this.ceilAlpha.StepValues = null;
@ -767,7 +768,7 @@
// //
// label1 // 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.Name = "label1";
this.label1.Size = new System.Drawing.Size(80, 14); this.label1.Size = new System.Drawing.Size(80, 14);
this.label1.TabIndex = 50; this.label1.TabIndex = 50;
@ -783,7 +784,7 @@
this.ceilRotation.ButtonStep = 5; this.ceilRotation.ButtonStep = 5;
this.ceilRotation.ButtonStepFloat = 1F; this.ceilRotation.ButtonStepFloat = 1F;
this.ceilRotation.ButtonStepsWrapAround = false; 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.Name = "ceilRotation";
this.ceilRotation.Size = new System.Drawing.Size(62, 24); this.ceilRotation.Size = new System.Drawing.Size(62, 24);
this.ceilRotation.StepValues = null; this.ceilRotation.StepValues = null;
@ -794,7 +795,7 @@
// ceilLightAbsolute // ceilLightAbsolute
// //
this.ceilLightAbsolute.AutoSize = true; 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.Name = "ceilLightAbsolute";
this.ceilLightAbsolute.Size = new System.Drawing.Size(69, 18); this.ceilLightAbsolute.Size = new System.Drawing.Size(69, 18);
this.ceilLightAbsolute.TabIndex = 49; this.ceilLightAbsolute.TabIndex = 49;
@ -805,7 +806,7 @@
// //
// labelLightFront // 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.Name = "labelLightFront";
this.labelLightFront.Size = new System.Drawing.Size(80, 14); this.labelLightFront.Size = new System.Drawing.Size(80, 14);
this.labelLightFront.TabIndex = 47; this.labelLightFront.TabIndex = 47;
@ -821,7 +822,7 @@
this.ceilBrightness.ButtonStep = 16; this.ceilBrightness.ButtonStep = 16;
this.ceilBrightness.ButtonStepFloat = 1F; this.ceilBrightness.ButtonStepFloat = 1F;
this.ceilBrightness.ButtonStepsWrapAround = false; 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.Name = "ceilBrightness";
this.ceilBrightness.Size = new System.Drawing.Size(62, 24); this.ceilBrightness.Size = new System.Drawing.Size(62, 24);
this.ceilBrightness.StepValues = null; this.ceilBrightness.StepValues = null;
@ -833,7 +834,7 @@
// //
this.ceilRenderStyle.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; this.ceilRenderStyle.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
this.ceilRenderStyle.FormattingEnabled = true; 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.Name = "ceilRenderStyle";
this.ceilRenderStyle.Size = new System.Drawing.Size(130, 22); this.ceilRenderStyle.Size = new System.Drawing.Size(130, 22);
this.ceilRenderStyle.TabIndex = 46; 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.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.Label = "Texture Scale:";
this.ceilScale.LinkValues = false; 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.Name = "ceilScale";
this.ceilScale.Size = new System.Drawing.Size(276, 28); this.ceilScale.Size = new System.Drawing.Size(276, 28);
this.ceilScale.TabIndex = 17; 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.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.Label = "Texture Offsets:";
this.ceilOffsets.LinkValues = false; 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.Name = "ceilOffsets";
this.ceilOffsets.Size = new System.Drawing.Size(276, 26); this.ceilOffsets.Size = new System.Drawing.Size(276, 26);
this.ceilOffsets.TabIndex = 16; this.ceilOffsets.TabIndex = 16;
@ -876,12 +877,13 @@
// //
// ceilingtex // 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.MultipleTextures = false;
this.ceilingtex.Name = "ceilingtex"; 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.TabIndex = 15;
this.ceilingtex.TextureName = ""; this.ceilingtex.TextureName = "";
this.ceilingtex.UsePreviews = false;
this.ceilingtex.OnValueChanged += new System.EventHandler(this.ceilingtex_OnValueChanged); this.ceilingtex.OnValueChanged += new System.EventHandler(this.ceilingtex_OnValueChanged);
// //
// tabslopes // 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.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.Location = new System.Drawing.Point(4, 23);
this.tabslopes.Name = "tabslopes"; 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.TabIndex = 3;
this.tabslopes.Text = "Slopes"; this.tabslopes.Text = "Slopes";
this.tabslopes.UseVisualStyleBackColor = true; this.tabslopes.UseVisualStyleBackColor = true;
@ -901,7 +903,7 @@
this.groupBox5.Controls.Add(this.floorslopecontrol); this.groupBox5.Controls.Add(this.floorslopecontrol);
this.groupBox5.Location = new System.Drawing.Point(3, 212); this.groupBox5.Location = new System.Drawing.Point(3, 212);
this.groupBox5.Name = "groupBox5"; 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.TabIndex = 1;
this.groupBox5.TabStop = false; this.groupBox5.TabStop = false;
this.groupBox5.Text = " Floor: "; this.groupBox5.Text = " Floor: ";
@ -923,7 +925,7 @@
this.groupBox4.Controls.Add(this.ceilingslopecontrol); this.groupBox4.Controls.Add(this.ceilingslopecontrol);
this.groupBox4.Location = new System.Drawing.Point(3, 3); this.groupBox4.Location = new System.Drawing.Point(3, 3);
this.groupBox4.Name = "groupBox4"; 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.TabIndex = 0;
this.groupBox4.TabStop = false; this.groupBox4.TabStop = false;
this.groupBox4.Text = " Ceiling: "; this.groupBox4.Text = " Ceiling: ";
@ -947,7 +949,7 @@
this.tabcustom.Location = new System.Drawing.Point(4, 23); this.tabcustom.Location = new System.Drawing.Point(4, 23);
this.tabcustom.Name = "tabcustom"; this.tabcustom.Name = "tabcustom";
this.tabcustom.Padding = new System.Windows.Forms.Padding(3); 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.TabIndex = 1;
this.tabcustom.Text = "Custom"; this.tabcustom.Text = "Custom";
this.tabcustom.UseVisualStyleBackColor = true; this.tabcustom.UseVisualStyleBackColor = true;
@ -967,7 +969,7 @@
this.fieldslist.Name = "fieldslist"; this.fieldslist.Name = "fieldslist";
this.fieldslist.PropertyColumnVisible = true; this.fieldslist.PropertyColumnVisible = true;
this.fieldslist.PropertyColumnWidth = 150; 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.TabIndex = 1;
this.fieldslist.TypeColumnVisible = true; this.fieldslist.TypeColumnVisible = true;
this.fieldslist.TypeColumnWidth = 100; 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.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.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.Name = "cancel";
this.cancel.Size = new System.Drawing.Size(112, 25); this.cancel.Size = new System.Drawing.Size(112, 25);
this.cancel.TabIndex = 4; this.cancel.TabIndex = 4;
@ -988,7 +990,7 @@
// apply // apply
// //
this.apply.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); 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.Name = "apply";
this.apply.Size = new System.Drawing.Size(112, 25); this.apply.Size = new System.Drawing.Size(112, 25);
this.apply.TabIndex = 3; this.apply.TabIndex = 3;
@ -1009,7 +1011,7 @@
this.AutoScaleDimensions = new System.Drawing.SizeF(96F, 96F); this.AutoScaleDimensions = new System.Drawing.SizeF(96F, 96F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Dpi; this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Dpi;
this.CancelButton = this.cancel; 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.cancel);
this.Controls.Add(this.apply); this.Controls.Add(this.apply);
this.Controls.Add(this.tabs); this.Controls.Add(this.tabs);
@ -1018,7 +1020,6 @@
this.MaximizeBox = false; this.MaximizeBox = false;
this.MinimizeBox = false; this.MinimizeBox = false;
this.Name = "SectorEditFormUDMF"; this.Name = "SectorEditFormUDMF";
this.Opacity = 0;
this.ShowIcon = false; this.ShowIcon = false;
this.ShowInTaskbar = false; this.ShowInTaskbar = false;
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent; this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent;

View file

@ -162,4 +162,7 @@
<metadata name="fieldslist.Locked" type="System.Boolean, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> <metadata name="fieldslist.Locked" type="System.Boolean, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value> <value>True</value>
</metadata> </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> </root>

View file

@ -19,6 +19,7 @@
using System; using System;
using System.Drawing; using System.Drawing;
using System.Windows.Forms; using System.Windows.Forms;
using CodeImp.DoomBuilder.Controls;
using CodeImp.DoomBuilder.IO; using CodeImp.DoomBuilder.IO;
using CodeImp.DoomBuilder.Data; using CodeImp.DoomBuilder.Data;
using CodeImp.DoomBuilder.Config; using CodeImp.DoomBuilder.Config;
@ -34,11 +35,11 @@ namespace CodeImp.DoomBuilder.Windows
private string selectedname; private string selectedname;
private Point lastposition; private Point lastposition;
private Size lastsize; private Size lastsize;
private ListViewGroup usedgroup; private readonly ListViewGroup usedgroup;
private ListViewGroup availgroup; private readonly ListViewGroup availgroup;
private TreeNode selectedset; //mxd private TreeNode selectedset; //mxd
private string selecttextureonfill; private string selecttextureonfill;
private bool browseFlats; private readonly bool browseFlats;
// Properties // Properties
public string SelectedName { get { return selectedname; } } public string SelectedName { get { return selectedname; } }
@ -119,17 +120,22 @@ namespace CodeImp.DoomBuilder.Windows
//mxd. Select the last one that was selected //mxd. Select the last one that was selected
string selectname = General.Settings.ReadSetting("browserwindow.textureset", ""); string selectname = General.Settings.ReadSetting("browserwindow.textureset", "");
TreeNode match; TreeNode match;
if (string.IsNullOrEmpty(selectname)) { if (string.IsNullOrEmpty(selectname))
{
match = tvTextureSets.Nodes[tvTextureSets.Nodes.Count - 1]; match = tvTextureSets.Nodes[tvTextureSets.Nodes.Count - 1];
} else { }
else
{
match = findNodeByName(tvTextureSets.Nodes, selectname); match = findNodeByName(tvTextureSets.Nodes, selectname);
} }
if (match != null) { if (match != null)
{
IFilledTextureSet set = (match.Tag as IFilledTextureSet); IFilledTextureSet set = (match.Tag as IFilledTextureSet);
foreach (ImageData img in set.Textures)
foreach (ImageData img in set.Textures) { {
if (img.LongName == longname) { if (img.LongName == longname)
{
selectedset = match; selectedset = match;
break; 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 //mxd. If the selected texture was not found in the last-selected set, try finding it in the other sets
if (selectedset == null && selecttexture != "-") { if (selectedset == null && selecttexture != "-")
foreach (TreeNode n in tvTextureSets.Nodes) { {
foreach (TreeNode n in tvTextureSets.Nodes)
{
selectedset = findTextureByLongName(n, longname); selectedset = findTextureByLongName(n, longname);
if (selectedset != null) break; if (selectedset != null) break;
} }
@ -169,12 +177,15 @@ namespace CodeImp.DoomBuilder.Windows
this.WindowState = (FormWindowState)General.Settings.ReadSetting("browserwindow.windowstate", (int)FormWindowState.Normal); this.WindowState = (FormWindowState)General.Settings.ReadSetting("browserwindow.windowstate", (int)FormWindowState.Normal);
//mxd //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)); 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; this.Location = location;
} else { }
else
{
this.StartPosition = FormStartPosition.CenterParent; this.StartPosition = FormStartPosition.CenterParent;
} }
} }
@ -194,7 +205,8 @@ namespace CodeImp.DoomBuilder.Windows
//first search in child nodes //first search in child nodes
TreeNode match; TreeNode match;
foreach(TreeNode n in node.Nodes) { foreach(TreeNode n in node.Nodes)
{
match = findTextureByLongName(n, longname); match = findTextureByLongName(n, longname);
if(match != null) return match; if(match != null) return match;
} }
@ -219,7 +231,8 @@ namespace CodeImp.DoomBuilder.Windows
//mxd //mxd
private static TreeNode findNodeByName(TreeNodeCollection nodes, string selectname) private static TreeNode findNodeByName(TreeNodeCollection nodes, string selectname)
{ {
foreach (TreeNode n in nodes) { foreach (TreeNode n in nodes)
{
if (n.Name == selectname) return n; if (n.Name == selectname) return n;
TreeNode match = findNodeByName(n.Nodes, selectname); TreeNode match = findNodeByName(n.Nodes, selectname);
@ -232,43 +245,47 @@ namespace CodeImp.DoomBuilder.Windows
private void createNodes(TreeNode root) private void createNodes(TreeNode root)
{ {
ResourceTextureSet set = root.Tag as ResourceTextureSet; ResourceTextureSet set = root.Tag as ResourceTextureSet;
if (set == null) { if (set == null)
{
General.ErrorLogger.Add(ErrorType.Error, "Resource " + root.Name + " doesn't have TextureSet!"); General.ErrorLogger.Add(ErrorType.Error, "Resource " + root.Name + " doesn't have TextureSet!");
return; return;
} }
int imageIndex = set.Location.type + 4; int imageIndex = set.Location.type + 4;
string[] separator = new[] { Path.DirectorySeparatorChar.ToString() }; char[] separator = new[] { Path.AltDirectorySeparatorChar };
ImageData[] textures; ImageData[] images;
if (browseFlats) if (browseFlats)
{ {
textures = new ImageData[set.Flats.Count]; images = new ImageData[set.Flats.Count];
set.Flats.CopyTo(textures, 0); set.Flats.CopyTo(images, 0);
} }
else else
{ {
textures = new ImageData[set.Textures.Count]; images = new ImageData[set.Textures.Count];
set.Textures.CopyTo(textures, 0); set.Textures.CopyTo(images, 0);
} }
Array.Sort(textures, sortImageData); Array.Sort(images, sortImageData);
foreach (ImageData image in textures) { foreach(ImageData image in images)
string localName = image.FullName.Replace(set.Location.location, ""); {
string[] parts = localName.Split(separator, StringSplitOptions.RemoveEmptyEntries); string[] parts = image.VirtualName.Split(separator, StringSplitOptions.RemoveEmptyEntries);
TreeNode curNode = root; TreeNode curNode = root;
if (parts.Length == 1) continue; if (parts.Length == 1) continue;
int localindex = parts[0] == "[TEXTURES]" ? 7 : imageIndex; 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]; string category = parts[i];
//already got such category? //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]; 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 }; TreeNode n = new TreeNode(category) { Name = category, ImageIndex = localindex, SelectedImageIndex = localindex };
curNode.Nodes.Add(n); curNode.Nodes.Add(n);
@ -279,9 +296,11 @@ namespace CodeImp.DoomBuilder.Windows
} }
//add to current and parent nodes //add to current and parent nodes
if (i == parts.Length - 2) { if (i == parts.Length - 2)
{
TreeNode cn = curNode; TreeNode cn = curNode;
while (cn != root) { while (cn != root)
{
ResourceTextureSet curTs = cn.Tag as ResourceTextureSet; ResourceTextureSet curTs = cn.Tag as ResourceTextureSet;
if (image.IsFlat) if (image.IsFlat)
curTs.AddFlat(image); 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]; TreeNode[] children = new TreeNode[root.Nodes[0].Nodes.Count];
root.Nodes[0].Nodes.CopyTo(children, 0); root.Nodes[0].Nodes.CopyTo(children, 0);
root.Nodes.Clear(); root.Nodes.Clear();
@ -335,7 +355,8 @@ namespace CodeImp.DoomBuilder.Windows
// Set selected name and close // Set selected name and close
if(browser.SelectedItem != null) if(browser.SelectedItem != null)
{ {
selectedname = browser.SelectedItem.Text; ImageBrowserItem item = browser.SelectedItem as ImageBrowserItem;
selectedname = item.icon.Name;
DialogResult = DialogResult.OK; DialogResult = DialogResult.OK;
} }
else else
@ -450,22 +471,25 @@ namespace CodeImp.DoomBuilder.Windows
// Start adding // Start adding
browser.BeginAdding(false); browser.BeginAdding(false);
if (browseFlats) { if (browseFlats)
{
// Add all available flats // Add all available flats
foreach(ImageData img in set.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 // Add all used flats
foreach(ImageData img in set.Flats) foreach(ImageData img in set.Flats)
if(img.UsedInMap) browser.Add(img.Name, img, img, usedgroup); if(img.UsedInMap) browser.Add(img.DisplayName, img, img, usedgroup);
}else{ }
else
{
// Add all available textures and mark the images for temporary loading // Add all available textures and mark the images for temporary loading
foreach (ImageData img in set.Textures) 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 // Add all used textures and mark the images for permanent loading
foreach (ImageData img in set.Textures) 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 // Done adding
@ -496,14 +520,17 @@ namespace CodeImp.DoomBuilder.Windows
} }
//mxd //mxd
private void tvTextureSets_NodeMouseClick(object sender, TreeNodeMouseClickEventArgs e) { private void tvTextureSets_NodeMouseClick(object sender, TreeNodeMouseClickEventArgs e)
{
selectedset = e.Node; selectedset = e.Node;
FillImagesList(); FillImagesList();
} }
//mxd //mxd
private void tvTextureSets_KeyUp(object sender, KeyEventArgs e) { private void tvTextureSets_KeyUp(object sender, KeyEventArgs e)
if(tvTextureSets.SelectedNode != selectedset) { {
if(tvTextureSets.SelectedNode != selectedset)
{
selectedset = tvTextureSets.SelectedNode; selectedset = tvTextureSets.SelectedNode;
FillImagesList(); FillImagesList();
} }

View file

@ -90,6 +90,9 @@ namespace CodeImp.DoomBuilder.ZDoom
return; return;
} }
//mxd
name = name.Replace(Path.AltDirectorySeparatorChar, Path.DirectorySeparatorChar);
// Now we should find a comma // Now we should find a comma
parser.SkipWhitespace(true); parser.SkipWhitespace(true);
tokenstr = parser.ReadToken(); tokenstr = parser.ReadToken();

View file

@ -70,8 +70,6 @@ namespace CodeImp.DoomBuilder.ZDoom
// Constructor // Constructor
internal TextureStructure(TexturesParser parser, string typename) internal TextureStructure(TexturesParser parser, string typename)
{ {
string tokenstr;
// Initialize // Initialize
this.typename = typename; this.typename = typename;
patches = new List<PatchStructure>(4); patches = new List<PatchStructure>(4);
@ -92,7 +90,7 @@ namespace CodeImp.DoomBuilder.ZDoom
// Now we should find a comma // Now we should find a comma
parser.SkipWhitespace(true); parser.SkipWhitespace(true);
tokenstr = parser.ReadToken(); string tokenstr = parser.ReadToken();
if(tokenstr != ",") if(tokenstr != ",")
{ {
parser.ReportError("Expected a comma"); parser.ReportError("Expected a comma");
@ -264,7 +262,7 @@ namespace CodeImp.DoomBuilder.ZDoom
if(yscale == 0.0f) scaley = defaultscale; else scaley = 1f / yscale; if(yscale == 0.0f) scaley = defaultscale; else scaley = 1f / yscale;
// Make texture // 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 // Add patches
foreach(PatchStructure p in patches) foreach(PatchStructure p in patches)

View file

@ -19,6 +19,7 @@
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.IO; using System.IO;
using CodeImp.DoomBuilder.Data;
#endregion #endregion
@ -36,9 +37,9 @@ namespace CodeImp.DoomBuilder.ZDoom
#region ================== Variables #region ================== Variables
private Dictionary<string, TextureStructure> textures; private readonly Dictionary<string, TextureStructure> textures;
private Dictionary<string, TextureStructure> flats; private readonly Dictionary<string, TextureStructure> flats;
private Dictionary<string, TextureStructure> sprites; private readonly Dictionary<string, TextureStructure> sprites;
#endregion #endregion
@ -90,7 +91,7 @@ namespace CodeImp.DoomBuilder.ZDoom
if(this.HasError) break; if(this.HasError) break;
// if a limit for the texture name length is set make sure that it's not exceeded // 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"); 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(this.HasError) break;
// if a limit for the sprite name length is set make sure that it's not exceeded // 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 else
{ {
@ -125,7 +126,7 @@ namespace CodeImp.DoomBuilder.ZDoom
if(this.HasError) break; if(this.HasError) break;
// if a limit for the walltexture name length is set make sure that it's not exceeded // 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"); 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(this.HasError) break;
// if a limit for the flat name length is set make sure that it's not exceeded // 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"); 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");
} }

View file

@ -72,7 +72,7 @@ namespace CodeImp.DoomBuilder.BuilderModes
List<FindReplaceObject> objs = new List<FindReplaceObject>(); List<FindReplaceObject> objs = new List<FindReplaceObject>();
// Interpret the replacement // 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); MessageBox.Show("Invalid replace value for this search type!", "Find and Replace", MessageBoxButtons.OK, MessageBoxIcon.Error);
return objs.ToArray(); return objs.ToArray();

View file

@ -65,7 +65,7 @@ namespace CodeImp.DoomBuilder.BuilderModes
List<FindReplaceObject> objs = new List<FindReplaceObject>(); List<FindReplaceObject> objs = new List<FindReplaceObject>();
// Interpret the replacement // 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); MessageBox.Show("Invalid replace value for this search type!", "Find and Replace", MessageBoxButtons.OK, MessageBoxIcon.Error);
return objs.ToArray(); return objs.ToArray();

View file

@ -65,7 +65,7 @@ namespace CodeImp.DoomBuilder.BuilderModes
List<FindReplaceObject> objs = new List<FindReplaceObject>(); List<FindReplaceObject> objs = new List<FindReplaceObject>();
// Interpret the replacement // 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); MessageBox.Show("Invalid replace value for this search type!", "Find and Replace", MessageBoxButtons.OK, MessageBoxIcon.Error);
return objs.ToArray(); return objs.ToArray();

View file

@ -485,7 +485,7 @@ namespace CodeImp.DoomBuilder.BuilderModes
this.toolStripMenuItem5.Name = "toolStripMenuItem5"; this.toolStripMenuItem5.Name = "toolStripMenuItem5";
this.toolStripMenuItem5.Size = new System.Drawing.Size(229, 22); this.toolStripMenuItem5.Size = new System.Drawing.Size(229, 22);
this.toolStripMenuItem5.Tag = "exporttoobj"; 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); this.toolStripMenuItem5.Click += new System.EventHandler(this.InvokeTaggedAction);
// //
// buttoncopyproperties // buttoncopyproperties