mirror of
https://git.do.srb2.org/STJr/ZoneBuilder.git
synced 2025-01-27 11:10:56 +00:00
GZDB merging - part 1
This commit is contained in:
parent
655b6b6c5e
commit
095aa9bb68
182 changed files with 5421 additions and 3249 deletions
Binary file not shown.
|
@ -24,12 +24,12 @@ special
|
|||
17:Thing_Raise(1),
|
||||
18:StartConversation(1,2),
|
||||
19:Thing_Stop(1),
|
||||
20:Floor_LowerByValue(3),
|
||||
21:Floor_LowerToLowest(2),
|
||||
22:Floor_LowerToNearest(2),
|
||||
23:Floor_RaiseByValue(3),
|
||||
24:Floor_RaiseToHighest(2),
|
||||
25:Floor_RaiseToNearest(2),
|
||||
20:Floor_LowerByValue(3,4),
|
||||
21:Floor_LowerToLowest(2,3),
|
||||
22:Floor_LowerToNearest(2,3),
|
||||
23:Floor_RaiseByValue(3,5),
|
||||
24:Floor_RaiseToHighest(2,5),
|
||||
25:Floor_RaiseToNearest(2,4),
|
||||
26:Stairs_BuildDown(5),
|
||||
27:Stairs_BuildUp(5),
|
||||
28:Floor_RaiseAndCrush(3,4),
|
||||
|
@ -39,19 +39,19 @@ special
|
|||
32:Stairs_BuildUpSync(4),
|
||||
33:ForceField(0),
|
||||
34:ClearForceField(1),
|
||||
35:Floor_RaiseByValueTimes8(3),
|
||||
36:Floor_LowerByValueTimes8(3),
|
||||
37:Floor_MoveToValue(3,4),
|
||||
35:Floor_RaiseByValueTimes8(3,5),
|
||||
36:Floor_LowerByValueTimes8(3,4),
|
||||
37:Floor_MoveToValue(3,5),
|
||||
38:Ceiling_Waggle(5),
|
||||
39:Teleport_ZombieChanger(2),
|
||||
40:Ceiling_LowerByValue(3),
|
||||
41:Ceiling_RaiseByValue(3),
|
||||
40:Ceiling_LowerByValue(3,4),
|
||||
41:Ceiling_RaiseByValue(3,4),
|
||||
42:Ceiling_CrushAndRaise(3,4),
|
||||
43:Ceiling_LowerAndCrush(3,4),
|
||||
44:Ceiling_CrushStop(1),
|
||||
45:Ceiling_CrushRaiseAndStay(3,4),
|
||||
46:Floor_CrushStop(1),
|
||||
47:Ceiling_MoveToValue(3,4),
|
||||
47:Ceiling_MoveToValue(3,5),
|
||||
// 48:Sector_Attach3dMidtex
|
||||
49:GlassBreak(0,1),
|
||||
// 50:ExtraFloor_LightOnly
|
||||
|
@ -70,10 +70,10 @@ special
|
|||
63:Plat_DownByValue(4),
|
||||
64:Plat_UpWaitDownStay(3),
|
||||
65:Plat_UpByValue(4),
|
||||
66:Floor_LowerInstant(3),
|
||||
67:Floor_RaiseInstant(3),
|
||||
68:Floor_MoveToValueTimes8(4),
|
||||
69:Ceiling_MoveToValueTimes8(4),
|
||||
66:Floor_LowerInstant(3,4),
|
||||
67:Floor_RaiseInstant(3,5),
|
||||
68:Floor_MoveToValueTimes8(4,5),
|
||||
69:Ceiling_MoveToValueTimes8(4,5),
|
||||
70:Teleport(1,3),
|
||||
71:Teleport_NoFog(1,4),
|
||||
72:ThrustThing(2,4),
|
||||
|
@ -109,6 +109,9 @@ special
|
|||
// 102:Scroll_Texture_Up
|
||||
// 103:Scroll_Texture_Down
|
||||
104:Ceiling_CrushAndRaiseSilentDist(4,5),
|
||||
105:Door_WaitRaise(4,5),
|
||||
106:Door_WaitClose(3,4),
|
||||
107:Line_SetPortalTarget(2),
|
||||
|
||||
109:Light_ForceLightning(1),
|
||||
110:Light_RaiseByValue(2),
|
||||
|
@ -177,14 +180,14 @@ special
|
|||
188:Sector_SetCeilingScale(5),
|
||||
189:Sector_SetFloorScale(5),
|
||||
191:SetPlayerProperty(3),
|
||||
192:Ceiling_LowerToHighestFloor(2),
|
||||
193:Ceiling_LowerInstant(3),
|
||||
194:Ceiling_RaiseInstant(3),
|
||||
192:Ceiling_LowerToHighestFloor(2,4),
|
||||
193:Ceiling_LowerInstant(3,5),
|
||||
194:Ceiling_RaiseInstant(3,4),
|
||||
195:Ceiling_CrushRaiseAndStayA(4,5),
|
||||
196:Ceiling_CrushAndRaiseA(4,5),
|
||||
197:Ceiling_CrushAndRaiseSilentA(4,5),
|
||||
198:Ceiling_RaiseByValueTimes8(3),
|
||||
199:Ceiling_LowerByValueTimes8(3),
|
||||
198:Ceiling_RaiseByValueTimes8(3,4),
|
||||
199:Ceiling_LowerByValueTimes8(3,4),
|
||||
200:Generic_Floor(5),
|
||||
201:Generic_Ceiling(5),
|
||||
202:Generic_Door(5),
|
||||
|
@ -223,9 +226,9 @@ special
|
|||
235:Floor_TransferTrigger(1),
|
||||
236:Floor_TransferNumeric(1),
|
||||
237:ChangeCamera(3),
|
||||
238:Floor_RaiseToLowestCeiling(2),
|
||||
238:Floor_RaiseToLowestCeiling(2,4),
|
||||
239:Floor_RaiseByValueTxTy(3),
|
||||
240:Floor_RaiseByTexture(2),
|
||||
240:Floor_RaiseByTexture(2,4),
|
||||
241:Floor_LowerToLowestTxTy(2),
|
||||
242:Floor_LowerToHighest(3,4),
|
||||
243:Exit_Normal(1),
|
||||
|
@ -237,10 +240,31 @@ special
|
|||
249:Door_CloseWaitOpen(3, 4),
|
||||
250:Floor_Donut(3),
|
||||
251:FloorAndCeiling_LowerRaise(3,4),
|
||||
252:Ceiling_RaiseToNearest(2),
|
||||
253:Ceiling_LowerToLowest(2),
|
||||
254:Ceiling_LowerToFloor(2),
|
||||
252:Ceiling_RaiseToNearest(2,3),
|
||||
253:Ceiling_LowerToLowest(2,4),
|
||||
254:Ceiling_LowerToFloor(2,4),
|
||||
255:Ceiling_CrushRaiseAndStaySilA(4,5),
|
||||
|
||||
// These are specialized versions of the Generic_* specials which are defined for EE Extradata.
|
||||
256:Floor_LowerToHighestEE(2, 3),
|
||||
257:Floor_RaiseToLowest(2, 3),
|
||||
258:Floor_LowerToLowestCeiling(2,3),
|
||||
259:Floor_RaiseToCeiling(2, 4),
|
||||
260:Floor_ToCeilingInstant(1, 3),
|
||||
261:Floor_LowerByTexture(2, 3),
|
||||
262:Ceiling_RaiseToHighest(2, 3),
|
||||
263:Ceiling_ToHighestInstant(1, 3),
|
||||
264:Ceiling_LowerToNearest(2, 4),
|
||||
265:Ceiling_RaiseToLowest(2, 3),
|
||||
266:Ceiling_RaiseToHighestFloor(2, 3),
|
||||
267:Ceiling_ToFloorInstant(1, 3),
|
||||
268:Ceiling_RaiseByTexture(2, 3),
|
||||
269:Ceiling_LowerByTexture(2, 4),
|
||||
270:Stairs_BuildDownDoom(5),
|
||||
271:Stairs_BuildUpDoomSync(4),
|
||||
272:Stairs_BuildDownDoomSync(4),
|
||||
|
||||
|
||||
|
||||
// internal functions have negative values
|
||||
-1:GetLineUDMFInt(2),
|
||||
|
|
|
@ -2982,22 +2982,24 @@ zdoom
|
|||
type = 11;
|
||||
enum
|
||||
{
|
||||
1 = "Texture only";
|
||||
2 = "Things only";
|
||||
4 = "Both";
|
||||
0 = "Texture only";
|
||||
1 = "Things only";
|
||||
2 = "Both";
|
||||
}
|
||||
}
|
||||
arg3
|
||||
{
|
||||
title = "Horizontal Speed";
|
||||
default = 128;
|
||||
type = 11;
|
||||
enum = "scroll_speeds";
|
||||
enum = "sector_scroll_speeds_x";
|
||||
}
|
||||
arg4
|
||||
{
|
||||
title = "Vertical Speed";
|
||||
default = 128;
|
||||
type = 11;
|
||||
enum = "scroll_speeds";
|
||||
enum = "sector_scroll_speeds_y";
|
||||
}
|
||||
}
|
||||
224
|
||||
|
@ -3025,14 +3027,16 @@ zdoom
|
|||
arg3
|
||||
{
|
||||
title = "Horizontal Speed";
|
||||
default = 128;
|
||||
type = 11;
|
||||
enum = "scroll_speeds";
|
||||
enum = "sector_scroll_speeds_x";
|
||||
}
|
||||
arg4
|
||||
{
|
||||
title = "Vertical Speed";
|
||||
default = 128;
|
||||
type = 11;
|
||||
enum = "scroll_speeds";
|
||||
enum = "sector_scroll_speeds_y";
|
||||
}
|
||||
}
|
||||
225
|
||||
|
|
|
@ -661,6 +661,36 @@ enums
|
|||
128 = "128: Very fast";
|
||||
}
|
||||
|
||||
sector_scroll_speeds_x
|
||||
{
|
||||
0 = "0: West very fast";
|
||||
16 = "16: West fast";
|
||||
32 = "32: West normal";
|
||||
64 = "64: West slow";
|
||||
96 = "96: West very slow";
|
||||
128 = "128: Don't scroll";
|
||||
160 = "144: East very slow";
|
||||
192 = "160: East slow";
|
||||
224 = "176: East normal";
|
||||
240 = "192: East fast";
|
||||
256 = "256: East very fast";
|
||||
}
|
||||
|
||||
sector_scroll_speeds_y
|
||||
{
|
||||
0 = "0: South very fast";
|
||||
16 = "16: South fast";
|
||||
32 = "32: South normal";
|
||||
64 = "64: South slow";
|
||||
96 = "96: South very slow";
|
||||
128 = "128: Don't scroll";
|
||||
160 = "144: North very slow";
|
||||
192 = "160: North slow";
|
||||
224 = "176: North normal";
|
||||
240 = "192: North fast";
|
||||
256 = "256: North very fast";
|
||||
}
|
||||
|
||||
stair_speeds
|
||||
{
|
||||
2 = "2: Slow";
|
||||
|
|
|
@ -72,6 +72,7 @@ keywords
|
|||
Ceiling_CrushAndRaiseA = "Ceiling_CrushAndRaiseA(tag, dspeed, uspeed, crush, crushmode)";
|
||||
Ceiling_CrushAndRaiseDist = "Ceiling_CrushAndRaiseDist(tag, dist, speed, damage, crushmode)";
|
||||
Ceiling_CrushAndRaiseSilentA = "Ceiling_CrushAndRaiseSilentA(tag, dspeed, uspeed, crush, crushmode)";
|
||||
Ceiling_CrushAndRaiseSilentDist = "Ceiling_CrushAndRaiseSilentDist(tag, dist, speed, damage[, crushmode])";
|
||||
Ceiling_CrushRaiseAndStay = "Ceiling_CrushRaiseAndStay(tag, speed, crush, crushmode)";
|
||||
Ceiling_CrushRaiseAndStayA = "Ceiling_CrushRaiseAndStayA(tag, dspeed, uspeed, crush, crushmode)";
|
||||
Ceiling_CrushRaiseAndStaySilA = "Ceiling_CrushRaiseAndStaySilA(tag, dspeed, uspeed, crush, crushmode)";
|
||||
|
@ -91,8 +92,8 @@ keywords
|
|||
Ceiling_RaiseInstant = "Ceiling_RaiseInstant(tag, unused, height)";
|
||||
Ceiling_RaiseToNearest = "Ceiling_RaiseToNearest(tag, speed)";
|
||||
Ceiling_Waggle = "Ceiling_Waggle(tag, amp, freq, offset, time)";
|
||||
ChangeActorAngle = "ChangeActorAngle(int tid, fixed angle[, bool interpolate = false])\nSets the angle for the actors with the specified tid.\nIf tid is 0, it sets the angle for the activator of the script.\nangle: a fixed point angle in the range of 0.0 to 1.0 (N = 0.25, W = 0.5, S = 0.75, E = 1.0).";
|
||||
ChangeActorPitch = "ChangeActorPitch(int tid, fixed pitch[, bool interpolate = false])\nSets the pitch for the actors with the specified tid. If tid is 0, it sets the pitch for the activator of the script.\npitch: a fixed point angle in the range of 0.0 to 1.0.";
|
||||
ChangeActorAngle = "void ChangeActorAngle(int tid, fixed angle[, bool interpolate = false])\nSets the angle for the actors with the specified tid.\nIf tid is 0, it sets the angle for the activator of the script.\nangle: a fixed point angle in the range of 0.0 to 1.0 (N = 0.25, W = 0.5, S = 0.75, E = 1.0).";
|
||||
ChangeActorPitch = "void ChangeActorPitch(int tid, fixed pitch[, bool interpolate = false])\nSets the pitch for the actors with the specified tid. If tid is 0, it sets the pitch for the activator of the script.\npitch: a fixed point angle in the range of 0.0 to 1.0.";
|
||||
ChangeActorRoll = "void ChangeActorRoll(int tid, fixed angle[, bool interpolate = false])";
|
||||
ChangeCamera = "ChangeCamera(tid, who, revert)";
|
||||
ChangeCeiling = "void ChangeCeiling(int tag, str flatname)";
|
||||
|
|
|
@ -23,7 +23,50 @@ scripttype = 3; //0 = unknown script, 1 = acc, 2 = modeldef, 3 = decorate
|
|||
|
||||
keywords
|
||||
{
|
||||
//Editor special comments
|
||||
//These are handled in a different fascion: key is replaced with the value and the caret is placed at [EP] position
|
||||
$Angled = "$Angled";
|
||||
$NotAngled = "$NotAngled";
|
||||
$Category = "//$Category \"[EP]\"";
|
||||
$Sprite = "//$Sprite \"[EP]\"";
|
||||
$IgnoreRenderstyle = "//$IgnoreRenderstyle";
|
||||
$Title = "//$Title \"[EP]\"";
|
||||
$Arg0 = "//$Arg0 \"[EP]\"";
|
||||
$Arg1 = "//$Arg1 \"[EP]\"";
|
||||
$Arg2 = "//$Arg2 \"[EP]\"";
|
||||
$Arg3 = "//$Arg3 \"[EP]\"";
|
||||
$Arg4 = "//$Arg4 \"[EP]\"";
|
||||
$Arg0Default = "//$Arg0Default ";
|
||||
$Arg1Default = "//$Arg1Default ";
|
||||
$Arg2Default = "//$Arg2Default ";
|
||||
$Arg3Default = "//$Arg3Default ";
|
||||
$Arg4Default = "//$Arg4Default ";
|
||||
$Arg0Tooltip = "//$Arg0Tooltip \"[EP]\"";
|
||||
$Arg1Tooltip = "//$Arg1Tooltip \"[EP]\"";
|
||||
$Arg2Tooltip = "//$Arg2Tooltip \"[EP]\"";
|
||||
$Arg3Tooltip = "//$Arg3Tooltip \"[EP]\"";
|
||||
$Arg4Tooltip = "//$Arg4Tooltip \"[EP]\"";
|
||||
$Arg0Type = "//$Arg0Type ";
|
||||
$Arg1Type = "//$Arg1Type ";
|
||||
$Arg2Type = "//$Arg2Type ";
|
||||
$Arg3Type = "//$Arg3Type ";
|
||||
$Arg4Type = "//$Arg4Type ";
|
||||
$Arg0Enum = "//$Arg0Enum ";
|
||||
$Arg1Enum = "//$Arg1Enum ";
|
||||
$Arg2Enum = "//$Arg2Enum ";
|
||||
$Arg3Enum = "//$Arg3Enum ";
|
||||
$Arg4Enum = "//$Arg4Enum ";
|
||||
$Color = "//$Color ";
|
||||
$Obsolete = "//$Obsolete \"[EP]\"";
|
||||
$GZDB_SKIP = "//$GZDB_SKIP";
|
||||
//Preprocessor directives
|
||||
#Include = "#Include";
|
||||
#region = "#region";
|
||||
#endregion = "#endregion";
|
||||
//WFDS
|
||||
A_Bool = "return A_Bool(bool result);";
|
||||
A_Int = "return A_Int(int result);";
|
||||
A_State = "return A_State(str state);\nreturn A_State(int offset);";
|
||||
//Monster AI
|
||||
A_AlertMonsters = "A_AlertMonsters[(float maxrange = 0.0[, int flags = 0])]";
|
||||
A_Burst = "A_Burst(str chunktype)";
|
||||
|
@ -49,7 +92,7 @@ keywords
|
|||
A_KillTracer = "A_KillTracer[(str damagetype = \"None\"[, int flags = 0[, str filter = \"None\"[, str species = \"None\"]]])]\ndamagetype: if the actor dies, the actor will enter a death state based on damagetype if present (or pain state if using NODAMAGE).\nflags: KILS flags.\nfilter: the actor class to damage.\nspecies: the actor species to damage.";
|
||||
A_Look = "A_Look";
|
||||
A_Look2 = "A_Look2";
|
||||
A_LookEx = "A_LookEx(int flags, fixed minseedist, fixed maxseedist, fixed maxheardist, fixed fov, state seestate)";
|
||||
A_LookEx = "A_LookEx(int flags, float minseedist, float maxseedist, float maxheardist, float fov, state seestate)";
|
||||
A_RaiseChildren = "A_RaiseChildren[(bool copyaffiliation = false)]";
|
||||
A_RaiseMaster = "A_RaiseMaster[(bool copyaffiliation = false)]";
|
||||
A_RaiseSiblings = "A_RaiseSiblings[(bool copyaffiliation = false)]";
|
||||
|
@ -64,23 +107,23 @@ keywords
|
|||
A_Srcr2Decide = "A_Srcr2Decide";
|
||||
A_SwapTeleFog = "A_SwapTeleFog";
|
||||
A_TurretLook = "A_TurretLook";
|
||||
A_Teleport = "A_Teleport[(str teleportstate = \"Teleport\"[, str targettype = \"BossSpot\"[, str fogtype = \"TeleportFog\"[, int flags = 0[, float mindist = 0.0[, float maxdist = 0.0[, int pointer = AAPTR_DEFAULT]]]]]])]";
|
||||
A_Teleport = "state A_Teleport[(str teleportstate = \"Teleport\"[, str targettype = \"BossSpot\"[, str fogtype = \"TeleportFog\"[, int flags = 0[, float mindist = 0.0[, float maxdist = 0.0[, int pointer = AAPTR_DEFAULT]]]]]])]\nbool A_Teleport[(str teleportstate = \"Teleport\"[, str targettype = \"BossSpot\"[, str fogtype = \"TeleportFog\"[, int flags = 0[, float mindist = 0.0[, float maxdist = 0.0[, int pointer = AAPTR_DEFAULT]]]]]])]";
|
||||
A_VileChase = "A_VileChase";
|
||||
A_Wander = "A_Wander";
|
||||
//Generic monster attacks
|
||||
A_CustomMissile = "A_CustomMissile(str missiletype[, float spawnheight = 0.0[, int spawnofs_horiz = 0[, int angle = 0[, int aimflags = 0[, int pitch = 0[, int target = AAPTR_TARGET]]]]]])";
|
||||
A_CustomBulletAttack = "A_CustomBulletAttack(float horz_spread, float vert_spread, int numbullets, int damageperbullet[, str pufftype = \"BulletPuff\"[, float range = 0.0[, int flags = 0[, int target = AAPTR_TARGET]]]])";
|
||||
A_CustomRailgun = "A_CustomRailgun(int damage[, int offset[, color ringcolor[, color corecolor[, int flags = 0[, bool aim = false[, float maxdiff = 0.0[, str pufftype = \"\"[, float spread_xy = 0.0[, float spread_z = 0.0[, fixed range = 8192[, int duration = 35[, float sparsity = 1.0[, float driftspeed = 1.0[, str spawnclass = \"\"[, float spawnofs_z = 0[, int spiraloffset = 270]]]]]]]]]]]]]]]])";
|
||||
A_CustomRailgun = "A_CustomRailgun(int damage[, int offset[, color ringcolor[, color corecolor[, int flags = 0[, bool aim = false[, float maxdiff = 0.0[, str pufftype = \"\"[, float spread_xy = 0.0[, float spread_z = 0.0[, float range = 8192[, int duration = 35[, float sparsity = 1.0[, float driftspeed = 1.0[, str spawnclass = \"\"[, float spawnofs_z = 0[, int spiraloffset = 270]]]]]]]]]]]]]]]])";
|
||||
A_CustomMeleeAttack = "A_CustomMeleeAttack[(int damage = 0[, str meleesound = \"\"[, str misssound = \"\"[, str damagetype = \"Melee\"[, bool bleed = true]]]])]";
|
||||
A_CustomComboAttack = "A_CustomComboAttack(str missiletype, float spawnheight, int damage, str meleesound[, str damagetype = \"Melee\"[, bool bleed = true]])";
|
||||
A_MonsterRefire = "A_MonsterRefire(int chancecontinue, str abortstate) ";
|
||||
A_MonsterRefire = "state A_MonsterRefire(int chancecontinue, str abortstate)";
|
||||
A_BasicAttack = "A_BasicAttack(int meleedamage, str meleesound, str missiletype, float missileheight)";
|
||||
A_BulletAttack = "A_BulletAttack";
|
||||
A_MonsterRail = "A_MonsterRail";
|
||||
A_Explode = "A_Explode[(int explosiondamage = 128[, int explosionradius = 128[, int flags = XF_HURTSOURCE[, bool alert = false[, int fulldamageradius = 0[, int nails = 0[, int naildamage = 10[, str pufftype = \"BulletPuff\"]]]]]]])]";
|
||||
A_RadiusThrust = "A_RadiusThrust(int force, int distance[, int flags[, int fullthrustdistance]])";
|
||||
A_Detonate = "A_Detonate";
|
||||
A_ThrowGrenade = "A_ThrowGrenade(str spawntype[, float spawnheight[, float throwspeed_horz[, float throwspeed_vert[, bool useammo]]]])";
|
||||
A_ThrowGrenade = "bool A_ThrowGrenade(str spawntype[, float spawnheight[, float throwspeed_horz[, float throwspeed_vert[, bool useammo]]]])";
|
||||
A_WolfAttack = "A_WolfAttack[(int flags = 0[, str soundname = \"weapons/pistol\"[, float snipe = 1.0[, int damage = 64[, int blocksize = 128[, int pointblank = 0[, int longrange = 0[, float runspeed = 160.0[, str pufftype = \"BulletPuff\"]]]]]]]])]";
|
||||
//Freeze death functions
|
||||
A_FreezeDeath = "A_FreezeDeath";
|
||||
|
@ -116,45 +159,45 @@ keywords
|
|||
A_CheckTerrain = "A_CheckTerrain";
|
||||
A_SetBlend = "A_SetBlend(str blendcolor, float alpha, int duration[, str fadecolor])";
|
||||
A_CheckPlayerDone = "A_CheckPlayerDone";
|
||||
A_PlayerSkinCheck = "A_PlayerSkinCheck(str state)";
|
||||
A_PlayerSkinCheck = "state A_PlayerSkinCheck(str state)";
|
||||
A_SkullPop = "A_SkullPop[(str type = \"BloodySkull\")]";
|
||||
A_Quake = "A_Quake(int intensity, int duration, int damageradius, int tremorradius[, str sound = \"world/quake\"])";
|
||||
A_QuakeEx = "A_QuakeEx(int intensityX, int intensityY, int intensityZ, int duration, int damrad, int tremrad[, str sound = \"world/quake\"[, int flags = 0[, float mulwavex = 1.0[, float mulwavey = 1.0[, float mulwavez = 1.0]]]]])";
|
||||
//Spawn functions
|
||||
A_TossGib = "A_TossGib";
|
||||
A_SpawnDebris = "A_SpawnDebris(str type[, bool translation = false[, float horizontal_vel = 1.0[, float vertical_vel = 1.0]]])";
|
||||
A_SpawnItem = "A_SpawnItem(str type, int distance, float zpos, bool useammo, bool translation)";
|
||||
A_SpawnItemEx = "A_SpawnItemEx(str type[, float xoffset = 0.0[, float yoffset = 0.0[, float zoffset = 0.0[, float xvelocity = 0.0[, float yvelocity = 0.0[, float zvelocity = 0.0[, float angle = 0.0[, int flags = 0[, int skipchance = 0[, int tid = 0]]]]]]]]]])";
|
||||
A_SpawnItem = "bool A_SpawnItem(str type, int distance, float zpos, bool useammo, bool translation)";
|
||||
A_SpawnItemEx = "bool A_SpawnItemEx(str type[, float xoffset = 0.0[, float yoffset = 0.0[, float zoffset = 0.0[, float xvelocity = 0.0[, float yvelocity = 0.0[, float zvelocity = 0.0[, float angle = 0.0[, int flags = 0[, int skipchance = 0[, int tid = 0]]]]]]]]]])";
|
||||
A_SpawnParticle = "A_SpawnParticle(color color[, int flags = 0[, int lifetime = 35[, int size = 1[, float angle = 0.0[, float xoff = 0.0[, float yoff = 0.0[, float zoff = 0.0[, float velx = 0.0[, float vely = 0.0[, float velz = 0.0[, float accelx = 0.0[, float accely = 0.0[, float accelz = 0.0[, float startalpha = 1.0[, float fadestep = -1.0]]]]]]]]]]]]]]])";
|
||||
//State jumps
|
||||
A_CheckBlock = "A_CheckBlock(str block[, int flags = 0[, int pointer = AAPTR_TARGET]])";
|
||||
A_CheckCeiling = "A_CheckCeiling(int offset OR str state)";
|
||||
A_CheckFloor = "A_CheckFloor(int offset OR str state)";
|
||||
A_CheckFlag = "A_CheckFlag(str flagname, state label[, int check_pointer = AAPTR_DEFAULT])";
|
||||
A_CheckLOF = "A_CheckLOF(state jump[, int flags = 0[, float range = 0.0[, float minrange = 0.0[, float angle = 0.0[, float pitch = 0.0[, float offsetheight = 0.0[, float offsetwidth = 0.0[, int ptr_target = AAPTR_DEFAULT]]]]]]]])";
|
||||
A_CheckProximity = "A_CheckProximity(str jump, str classname, float distance[, int count = 1[, int flags = 0[, int pointer = AAPTR_DEFAULT]]])";
|
||||
A_CheckRange = "A_CheckRange(float distance, int offset OR str state[, bool 2d_check = false])";
|
||||
A_CheckSight = "A_CheckSight(int offset OR str state)";
|
||||
A_CheckSightOrRange = "A_CheckSightOrRange(float distance, int offset OR str state[, bool 2d_check = false])";
|
||||
A_CheckSpecies = "A_CheckSpecies(str jump[, str species=\"None\"[, int pointer = AAPTR_DEFAULT]]) ";
|
||||
A_Jump = "A_Jump(int chance, int offset OR str state, ...)";
|
||||
A_JumpIf = "A_JumpIf(expression, int offset OR str state)";
|
||||
A_JumpIfArmorType = "A_JumpIfArmorType(str armortype, str state[, int minimum = 1])";
|
||||
A_JumpIfCloser = "A_JumpIfCloser(int distance, int offset OR str state[, bool noz = false])";
|
||||
A_JumpIfHealthLower = "A_JumpIfHealthLower(int health, int offset OR str state[, int pointer = AAPTR_DEFAULT])";
|
||||
A_JumpIfHigherOrLower = "A_JumpIfHigherOrLower(str high, str low[, float offsethigh = 0.0[, float offsetlow = 0.0[, bool includeHeight = true[, int pointer = AAPTR_TARGET]]]])";
|
||||
A_JumpIfInventory = "A_JumpIfInventory(str inventorytype, int amount, int offset OR str state[, int owner = AAPTR_DEFAULT])";
|
||||
A_JumpIfInTargetInventory = "A_JumpIfInTargetInventory(str item, int count, int offset OR str state[, int forward = AAPTR_DEFAULT])";
|
||||
A_JumpIfInTargetLOS = "A_JumpIfInTargetLOS(int offset OR str state[, float fov = 0.0[, int flags = 0[, float dist_max = 0.0[, float dist_close = 0.0]]]])\nflags: JLOSF flags.";
|
||||
A_JumpIfMasterCloser = "A_JumpIfMasterCloser(int distance, int offset OR str state[, bool noz = false])";
|
||||
A_JumpIfNoAmmo = "A_JumpIfNoAmmo(int offset OR str state)";
|
||||
A_JumpIfTargetInLOS = "A_JumpIfTargetInLOS(int offset OR str state[, float fov = 0.0[, int flags = 0[, float dist_max = 0.0[, float dist_close = 0.0]]]])\nflags: JLOSF flags.";
|
||||
A_JumpIfTargetInsideMeleeRange = "A_JumpIfTargetInsideMeleeRange(int offset OR str state)\nJumps the number of frames (offset) forward, or to the specified state\nwhen the target of the calling actor is within melee range of the caller.";
|
||||
A_JumpIfTargetOutsideMeleeRange = "A_JumpIfTargetOutsideMeleeRange(int offset OR str state)\nJumps the number of frames (offset) forward, or to the specified state\nwhen the target of the calling actor is beyond melee range of the caller.";
|
||||
A_JumpIfTracerCloser = "A_JumpIfTracerCloser(int distance, int offset OR str state[, bool noz = false])";
|
||||
A_CheckBlock = "state A_CheckBlock(str block[, int flags = 0[, int pointer = AAPTR_TARGET]])";
|
||||
A_CheckCeiling = "state A_CheckCeiling(str state)\nstate A_CheckCeiling(int offset)";
|
||||
A_CheckFloor = "state A_CheckFloor(str state)\nstate A_CheckFloor(int offset)";
|
||||
A_CheckFlag = "state A_CheckFlag(str flagname, state label[, int check_pointer = AAPTR_DEFAULT])";
|
||||
A_CheckLOF = "state A_CheckLOF(state jump[, int flags = 0[, float range = 0.0[, float minrange = 0.0[, float angle = 0.0[, float pitch = 0.0[, float offsetheight = 0.0[, float offsetwidth = 0.0[, int ptr_target = AAPTR_DEFAULT]]]]]]]])";
|
||||
A_CheckProximity = "state A_CheckProximity(str jump, str classname, float distance[, int count = 1[, int flags = 0[, int pointer = AAPTR_DEFAULT]]])";
|
||||
A_CheckRange = "state A_CheckRange(float distance, str state[, bool 2d_check = false])\nstate A_CheckRange(float distance, int offset[, bool 2d_check = false])";
|
||||
A_CheckSight = "state A_CheckSight(str state)\nstate A_CheckSight(int offsete)";
|
||||
A_CheckSightOrRange = "state A_CheckSightOrRange(float distance, str state[, bool 2d_check = false])\nstate A_CheckSightOrRange(float distance, int offset[, bool 2d_check = false])";
|
||||
A_CheckSpecies = "state A_CheckSpecies(str jump[, str species=\"None\"[, int pointer = AAPTR_DEFAULT]]) ";
|
||||
A_Jump = "state A_Jump(int chance, str state, ...)\nstate A_Jump(int chance, int offset, ...)";
|
||||
A_JumpIf = "state A_JumpIf(expression, str state)\nstate A_JumpIf(expression, int offset)";
|
||||
A_JumpIfArmorType = "state A_JumpIfArmorType(str armortype, str state[, int minimum = 1])";
|
||||
A_JumpIfCloser = "state A_JumpIfCloser(int distance, str state[, bool noz = false])\nstate A_JumpIfCloser(int distance, int offset[, bool noz = false])";
|
||||
A_JumpIfHealthLower = "state A_JumpIfHealthLower(int health, str state[, int pointer = AAPTR_DEFAULT])\nstate A_JumpIfHealthLower(int health, int offset[, int pointer = AAPTR_DEFAULT])";
|
||||
A_JumpIfHigherOrLower = "state A_JumpIfHigherOrLower(str high, str low[, float offsethigh = 0.0[, float offsetlow = 0.0[, bool includeheight = true[, int pointer = AAPTR_TARGET]]]])";
|
||||
A_JumpIfInventory = "state A_JumpIfInventory(str inventorytype, int amount, str state[, int owner = AAPTR_DEFAULT])\nstate A_JumpIfInventory(str inventorytype, int amount, int offset[, int owner = AAPTR_DEFAULT])";
|
||||
A_JumpIfInTargetInventory = "state A_JumpIfInTargetInventory(str item, int count, str state[, int forward = AAPTR_DEFAULT])\nstate A_JumpIfInTargetInventory(str item, int count, int offset[, int forward = AAPTR_DEFAULT])";
|
||||
A_JumpIfInTargetLOS = "state A_JumpIfInTargetLOS(str state[, float fov = 0.0[, int flags = 0[, float dist_max = 0.0[, float dist_close = 0.0]]]])\nstate A_JumpIfInTargetLOS(int offset[, float fov = 0.0[, int flags = 0[, float dist_max = 0.0[, float dist_close = 0.0]]]])\nflags: JLOSF flags.";
|
||||
A_JumpIfMasterCloser = "state A_JumpIfMasterCloser(int distance, str state[, bool noz = false])\nstate A_JumpIfMasterCloser(int distance, int offset[, bool noz = false])";
|
||||
A_JumpIfNoAmmo = "state A_JumpIfNoAmmo(str state)\nstate A_JumpIfNoAmmo(int offset)";
|
||||
A_JumpIfTargetInLOS = "state A_JumpIfTargetInLOS(str state[, float fov = 0.0[, int flags = 0[, float dist_max = 0.0[, float dist_close = 0.0]]]])\nstate A_JumpIfTargetInLOS(int offset[, float fov = 0.0[, int flags = 0[, float dist_max = 0.0[, float dist_close = 0.0]]]])\nflags: JLOSF flags.";
|
||||
A_JumpIfTargetInsideMeleeRange = "state A_JumpIfTargetInsideMeleeRange(str state)\nstate A_JumpIfTargetInsideMeleeRange(int offset)\nJumps the number of frames (offset) forward, or to the specified state\nwhen the target of the calling actor is within melee range of the caller.";
|
||||
A_JumpIfTargetOutsideMeleeRange = "state A_JumpIfTargetOutsideMeleeRange(str state)\nstate A_JumpIfTargetOutsideMeleeRange(int offset)\nJumps the number of frames (offset) forward, or to the specified state\nwhen the target of the calling actor is beyond melee range of the caller.";
|
||||
A_JumpIfTracerCloser = "state A_JumpIfTracerCloser(int distance, str state[, bool noz = false])\nstate A_JumpIfTracerCloser(int distance, int offset[, bool noz = false])";
|
||||
//Status changes
|
||||
A_ActiveAndUnblock = "A_ActiveAndUnblock";
|
||||
A_CallSpecial = "A_CallSpecial(int special[, int arg1 = 0[, int arg2 = 0[, int arg3 = 0[, int arg4 = 0[, int arg5 = 0]]]]])";
|
||||
A_CallSpecial = "bool A_CallSpecial(int special[, int arg1 = 0[, int arg2 = 0[, int arg3 = 0[, int arg4 = 0[, int arg5 = 0]]]]])";
|
||||
A_ChangeFlag = "A_ChangeFlag(str flagname, bool value)";
|
||||
A_ChangeVelocity = "A_ChangeVelocity[(float x = 0.0[, float y = 0.0[, float z = 0.0[, int flags = 0[, int pointer = AAPTR_DEFAULT]]]])]\nflags: CVF flags.";
|
||||
A_ClearShadow = "A_ClearShadow";
|
||||
|
@ -163,7 +206,7 @@ keywords
|
|||
A_FadeIn = "A_FadeIn[(float increase_amount = 0.1[, int flags = 0])]\nflags: FTF flags.";
|
||||
A_FadeOut = "A_FadeOut[(float reduce_amount = 0.1[, int flags = FTF_REMOVE])]\nflags: FTF flags.";
|
||||
A_FadeTo = "A_FadeTo(float target[, float amount = 0.1[, int flags = 0]])\nflags: FTF flags.";
|
||||
A_FaceMovementDirection = "A_FaceMovementDirection([float offset = 0[, float anglelimit = 0[, float pitchlimit = 0[, int flags = 0[, int pointer = AAPTR_DEFAULT]]]]])";
|
||||
A_FaceMovementDirection = "state A_FaceMovementDirection[(float offset = 0[, float anglelimit = 0[, float pitchlimit = 0[, int flags = 0[, int pointer = AAPTR_DEFAULT]]]])]";
|
||||
A_Fall = "A_Fall";
|
||||
A_Gravity = "A_Gravity";
|
||||
A_HideThing = "A_HideThing";
|
||||
|
@ -178,6 +221,7 @@ keywords
|
|||
A_ScreamAndUnblock = "A_ScreamAndUnblock";
|
||||
A_SetAngle = "A_SetAngle(float angle[, int flags = 0[, int pointer = AAPTR_DEFAULT]])\nangle: the actor's new angle, in degrees.\nflags: SPF flags.";
|
||||
A_SetArg = "A_SetArg(int position, int value)";
|
||||
A_SetChaseThreshold = "A_SetChaseThreshold(int threshold[, bool setdefaultthreshhold = false[, int pointer = AAPTR_DEFAULT]])";
|
||||
A_SetDamageType = "A_SetDamageType(str damagetype)";
|
||||
A_SetFloat = "A_SetFloat";
|
||||
A_SetFloatSpeed = "A_SetFloatSpeed(float speed[, int pointer = AAPTR_DEFAULT])";
|
||||
|
@ -220,23 +264,23 @@ keywords
|
|||
A_FaceTracer = "A_FaceTracer[(float angle = 0.0[, float pitch = 270.0])]\nA_FaceTracer([float max_turn = 0.0[, float max_pitch = 270.0[, float ang_offset = 0.0[, float pitch_offset = 0.0[, int flags = 0[, float z_add = 0.0]]]]]])";
|
||||
A_Fire = "A_Fire[(float height = 0.0)]";
|
||||
A_Weave = "A_Weave(int horzspeed, int vertspeed, float horzdist, float vertdist)";
|
||||
A_Warp = "A_Warp(int ptr_destination[, float x-offset = 0[, float y-offset = 0[, float z-offset = 0[, float angle = 0[, int flags = 0[, str success_state = \"\"[, float heightoffset = 0[, float radiusoffset = 0[, float pitch = 0]]]]]]]]])\nflags: WARPF flags.";
|
||||
A_Warp = "state A_Warp(int ptr_destination[, float x-offset = 0[, float y-offset = 0[, float z-offset = 0[, float angle = 0[, int flags = 0[, str success_state = \"\"[, float heightoffset = 0[, float radiusoffset = 0[, float pitch = 0]]]]]]]]])\nbool A_Warp(int ptr_destination[, float x-offset = 0[, float y-offset = 0[, float z-offset = 0[, float angle = 0[, int flags = 0[, str success_state = \"\"[, float heightoffset = 0[, float radiusoffset = 0[, float pitch = 0]]]]]]]]])\nflags: WARPF flags.";
|
||||
A_Countdown = "A_Countdown";
|
||||
A_CountdownArg = "A_CountdownArg(int arg[, str targetstate])";
|
||||
A_Stop = "A_Stop";
|
||||
//Inventory functions
|
||||
A_GiveInventory = "A_GiveInventory(str type[, int count = 0[, int giveto = AAPTR_DEFAULT]])\ntype: the item to give. This should be a valid inventory item.\ncount: the number of samples of this item to give. Default is 0, which is interpreted as 1.\ngiveto: the actor to give the item to";
|
||||
A_GiveToChildren = "A_GiveToChildren(str type[, int count])\ntype: the item to give. This should be a valid inventory item.\ncount: the number of samples of this item to give. Default is 0, which is interpreted as 1.";
|
||||
A_GiveToSiblings = "A_GiveToSiblings(str type[, int count])\ntype: the item to give. This should be a valid inventory item.\ncount: the number of samples of this item to give. Default is 0, which is interpreted as 1.";
|
||||
A_GiveToTarget = "A_GiveToTarget(str type, int count[, int giveto])";
|
||||
A_TakeInventory = "A_TakeInventory(str type, int count[, int flags[, int takefrom = AAPTR_DEFAULT]])";
|
||||
A_TakeFromChildren = "A_TakeFromChildren(str type[, int count])\ntype: the item to take. This should be a valid inventory item.\ncount: the number of samples of this item to take.\nIf this is 0, the item is cleared from the inventory unless it has the\nINVENTORY.KEEPDEPLETED flag set, and in which case, its amount is merely reduced to 0.\nDefault is 0.";
|
||||
A_TakeFromSiblings = "A_TakeFromSiblings(str type[, int count])\ntype: the item to take. This should be a valid inventory item.\ncount: the number of samples of this item to take.\nIf this is 0, the item is cleared from the inventory unless it has the\nINVENTORY.KEEPDEPLETED flag set, and in which case, its amount is merely reduced to 0.\nDefault is 0.";
|
||||
A_TakeFromTarget = "A_TakeFromTarget(str type, int count[, int flags[, int takefrom]])";
|
||||
A_GiveInventory = "bool A_GiveInventory(str type[, int count = 0[, int giveto = AAPTR_DEFAULT]])\ntype: the item to give. This should be a valid inventory item.\ncount: the number of samples of this item to give. Default is 0, which is interpreted as 1.\ngiveto: the actor to give the item to";
|
||||
A_GiveToChildren = "int A_GiveToChildren(str type[, int count = 0])\ntype: the item to give. This should be a valid inventory item.\ncount: the number of samples of this item to give. Default is 0, which is interpreted as 1.";
|
||||
A_GiveToSiblings = "int A_GiveToSiblings(str type[, int count = 0])\ntype: the item to give. This should be a valid inventory item.\ncount: the number of samples of this item to give. Default is 0, which is interpreted as 1.";
|
||||
A_GiveToTarget = "bool A_GiveToTarget(str type, int count[, int giveto = AAPTR_DEFAULT])";
|
||||
A_TakeInventory = "bool A_TakeInventory(str type, int count[, int flags[, int takefrom = AAPTR_DEFAULT]])";
|
||||
A_TakeFromChildren = "int A_TakeFromChildren(str type[, int count = 0])\ntype: the item to take. This should be a valid inventory item.\ncount: the number of samples of this item to take.\nIf this is 0, the item is cleared from the inventory unless it has the\nINVENTORY.KEEPDEPLETED flag set, and in which case, its amount is merely reduced to 0.\nDefault is 0.";
|
||||
A_TakeFromSiblings = "int A_TakeFromSiblings(str type[, int count = 0])\ntype: the item to take. This should be a valid inventory item.\ncount: the number of samples of this item to take.\nIf this is 0, the item is cleared from the inventory unless it has the\nINVENTORY.KEEPDEPLETED flag set, and in which case, its amount is merely reduced to 0.\nDefault is 0.";
|
||||
A_TakeFromTarget = "bool A_TakeFromTarget(str type, int count[, int flags[, int takefrom = AAPTR_DEFAULT]])";
|
||||
A_DropInventory = "A_DropInventory(str type)";
|
||||
A_DropItem = "A_DropItem(str item[, int dropamount = -1[, int chance = 256]])\nThe calling actor drops the specified item.\nThis works in a similar way to the DropItem actor property.";
|
||||
A_SelectWeapon = "A_SelectWeapon(str type)";
|
||||
A_RadiusGive = "A_RadiusGive(str item, fixed distance, int flags[, int amount = 0[, str filter = \"None\"[, str species = \"None\"[, fixed mindist = 0]]]])\nflags: RGF flags.";
|
||||
A_SelectWeapon = "bool A_SelectWeapon(str type)";
|
||||
A_RadiusGive = "int A_RadiusGive(str item, float distance, int flags[, int amount = 0[, str filter = \"None\"[, str species = \"None\"[, float mindist = 0]]]])\nflags: RGF flags.";
|
||||
//Weapon functions
|
||||
A_WeaponReady = "A_WeaponReady[(int flags = 0)]\nflags: WRF flags.";
|
||||
A_Lower = "A_Lower";
|
||||
|
@ -245,7 +289,7 @@ keywords
|
|||
A_ClearReFire = "A_ClearReFire";
|
||||
A_GunFlash = "A_GunFlash[(str state = \"Flash\"[, int flags = 0])]\nflags: GFF flags.";
|
||||
A_CheckReload = "A_CheckReload";
|
||||
A_CheckForReload = "A_CheckForReload(int counter, str state[, bool dontincrement = false])";
|
||||
A_CheckForReload = "state A_CheckForReload(int counter, str state[, bool dontincrement = false])";
|
||||
A_ResetReloadCounter = "A_ResetReloadCounter";
|
||||
A_Light = "A_Light(int intensity)";
|
||||
A_Light0 = "A_Light0";
|
||||
|
@ -260,8 +304,8 @@ keywords
|
|||
A_Saw = "A_Saw[(str fullsound = \"weapons/sawfull\"[, str hitsound = \"weapons/sawhit\"[, int damage = 0[, str pufftype = \"BulletPuff\"[, int flags = 0[, float range = 65.0[, float spread_xy = 2.8125[, float spread_z = 0.0[, float lifesteal = 0.0[, int lifestealmax = 0[, str armorbonustype = \"ArmorBonus\"]]]]]]]]]])]";
|
||||
A_CustomPunch = "A_CustomPunch(int damage[, bool norandom = false[, int flags = 0[, str pufftype = \"BulletPuff\"[, float range = 64.0[, float lifesteal = 0.0[, int lifestealmax = 0[, str armorbonustype = \"ArmorBonus\"[, str meleesound[, str misssound]]]]]]]]])";
|
||||
A_FireBullets = "A_FireBullets(int spread_horz, int spread_vert, int numbullets, int damage[, str pufftype = \"\"[, int flags = FBF_USEAMMO[, float range = 0.0]]])";
|
||||
A_FireCustomMissile = "A_FireCustomMissile(str 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[, str ringcolor[, str corecolor[, int flags[, int maxdiff[, str pufftype[, float spread_xy = 0[, float spread_z = 0.0[, fixed range = 8192[, int duration = 35[, float sparsity = 1.0[, float driftspeed = 1.0[, str spawnclass[, float spawnofs_z = 0.0[, int spiraloffset = 270]]]]]]]]]]]]]]]])";
|
||||
A_FireCustomMissile = "A_FireCustomMissile(str missiletype[, int angle = 0[, bool useammo = false[, int spawnofs_horz = 0[, int spawnheight = 0[, int flags = 0[, angle pitch = 0]]]]]])";
|
||||
A_RailAttack = "A_RailAttack(int damage[, int spawnofs_horz[, bool useammo[, str ringcolor[, str corecolor[, int flags[, int maxdiff[, str pufftype[, float spread_xy = 0.0[, float spread_z = 0.0[, float range = 8192.0[, int duration = 35[, float sparsity = 1.0[, float driftspeed = 1.0[, str spawnclass[, float spawnofs_z = 0.0[, int spiraloffset = 270]]]]]]]]]]]]]]]])";
|
||||
A_FireAssaultGun = "A_FireAssaultGun";
|
||||
A_FireBFG = "A_FireBFG";
|
||||
A_FireOldBFG = "A_FireOldBFG";
|
||||
|
@ -324,7 +368,7 @@ keywords
|
|||
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.0[, str blasteffect = \"BlastEffect\"[, sound blastsound = \"BlastRadius\"]]]]])]";
|
||||
A_Blast = "A_Blast[(int flags = 0[, int strength = 255[, int radius = 255[, float speed = 20.0[, str blasteffect = \"BlastEffect\"[, str blastsound = \"BlastRadius\"]]]]])]\nA_Blast[(int flags = 0[, int strength = 255[, float radius = 255.0[, float speed = 20.0[, str blasteffect = \"BlastEffect\"[, str blastsound = \"BlastRadius\"]]]]])]";
|
||||
A_BishopMissileWeave = "A_BishopMissileWeave";
|
||||
A_DropWeaponPieces = "A_DropWeaponPieces(str actorclass1, str actorclass2, str actorclass3)";
|
||||
A_Feathers = "A_Feathers";
|
||||
|
@ -341,28 +385,48 @@ keywords
|
|||
abs = "abs(x)\nReturns the absolute value of x.";
|
||||
sin = "sin(x)\nTrigonometry function, x must be in degrees.";
|
||||
cos = "cos(x)\nTrigonometry function, x must be in degrees.";
|
||||
tan = "tan(x)\nTrigonometry function, x must be in degrees.";
|
||||
asin = "asin(x)\nTrigonometry function, returns an angle in degrees.";
|
||||
acos = "acos(x)\nTrigonometry function, returns an angle in degrees.";
|
||||
atan = "atan(x)\nTrigonometry function, returns an angle in degrees.";
|
||||
sinh = "sinh(x)\nTrigonometry function, x must be in radians.";
|
||||
cosh = "cosh(x)\nTrigonometry function, x must be in radians.";
|
||||
tanh = "tanh(x)\nTrigonometry function, x must be in radians.";
|
||||
exp = "exp(x)\nReturns the base-e exponential function of x, which is e raised to the power x.";
|
||||
log = "log(x)\nReturns the natural logarithm of x - the opposite of exp.";
|
||||
log10 = "log10(x)\nReturns the common (base-10) logarithm of x.";
|
||||
ceil = "ceil(x)\nRounds the number upward to the next closest integer.";
|
||||
floor = "floor(x)\nRounds the number downward to the next closest integer.";
|
||||
sqrt = "sqrt(x)\nReturns the square root of x.";
|
||||
random = "random[identifier](min, max)\nReturns a random integer value between min and max.";
|
||||
random2 = "random2[identifier](mask)\nReturns a random integer value between -mask and +mask.";
|
||||
frandom = "frandom[identifier](min, max)\nReturns a random floating point value between min and max.";
|
||||
randompick = "randompick[identifier](int, ...)\nPicks a number from the numbers placed in it.\nThis can take an unlimited amount of parameters.";
|
||||
frandompick = "frandompick[identifier](int, ...)\nSimilar to randompick but for float-point values.";
|
||||
//State keywords
|
||||
//Bright = "Bright";
|
||||
CanRaise = "CanRaise";
|
||||
Fast = "Fast";
|
||||
min = "min(x1, ...)\nGets the smallest value of all values listed.\nCan take any amount of numbers, and can solve both ints and floats.";
|
||||
max = "max(x1, ...)\nGets the largest value of all values listed.\nCan take any amount of numbers, and can solve both ints and floats.";
|
||||
clamp = "clamp(src, min, max)\nReturns src within the range of min and max inclusively. All parameters can be ints or floats.";
|
||||
//Randum number functions
|
||||
random = "int random[identifier](min, max)\nReturns a random integer value between min and max.";
|
||||
random2 = "int random2[identifier](mask)\nReturns a random integer value between -mask and +mask.";
|
||||
frandom = "float frandom[identifier](min, max)\nReturns a random floating point value between min and max.";
|
||||
randompick = "int randompick[identifier](int, ...)\nPicks a number from the numbers placed in it.\nThis can take an unlimited amount of parameters.";
|
||||
frandompick = "float frandompick[identifier](float, ...)\nPicks a number from the numbers placed in it.\nThis can take an unlimited amount of parameters.";
|
||||
//State functions
|
||||
Light = "Light(str lightname)";
|
||||
NoDelay = "NoDelay";
|
||||
Offset = "Offset(int x, int y)";
|
||||
Slow = "Slow";
|
||||
//Special functions
|
||||
CheckClass = "bool CheckClass(str classname[, int ptr_select = AAPTR_DEFAULT[, bool match_superclass = false]])";
|
||||
IsPointerEqual = "bool IsPointerEqual(int ptr_select1, int ptr_select2)";
|
||||
IsPointerEqual = "bool IsPointerEqual(int ptr1, int ptr2)";
|
||||
CountInv = "int CountInv(str itemclassname[, int ptr_select = AAPTR_DEFAULT])";
|
||||
GetDistance = "float GetDistance(bool checkz[, int ptr_select = AAPTR_TARGET])";
|
||||
GetSpawnHealth = "int GetSpawnHealth()";
|
||||
GetGibHealth = "int GetGibHealth()";
|
||||
}
|
||||
|
||||
properties
|
||||
{
|
||||
Actor;
|
||||
enum;
|
||||
const;
|
||||
var;
|
||||
int;
|
||||
float;
|
||||
//WFDS
|
||||
if;
|
||||
else;
|
||||
|
@ -373,7 +437,13 @@ properties
|
|||
Wait;
|
||||
Fail;
|
||||
goto;
|
||||
//states:
|
||||
//State keywords
|
||||
Bright;
|
||||
CanRaise;
|
||||
Fast;
|
||||
Slow;
|
||||
NoDelay;
|
||||
//States
|
||||
States;
|
||||
Spawn:;
|
||||
Idle:;
|
||||
|
@ -452,6 +522,8 @@ properties
|
|||
Activation;
|
||||
TeleFogSourceType;
|
||||
TeleFogDestType;
|
||||
Threshold;
|
||||
DefThreshold;
|
||||
//Collision and 'Physics'
|
||||
Radius;
|
||||
Height;
|
||||
|
@ -1008,6 +1080,7 @@ constants
|
|||
CBF_SETTRACER;
|
||||
CBF_SETONPTR;
|
||||
CBF_DROPOFF;
|
||||
CBF_NOACTORS;
|
||||
CHF_DONTMOVE;
|
||||
CHF_FASTCHASE;
|
||||
CHF_NIGHTMAREFAST;
|
||||
|
|
|
@ -1,55 +1,63 @@
|
|||
Doom Builder 2 command-line arguments
|
||||
GZDoom Builder command-line arguments
|
||||
==========================================================================================
|
||||
|
||||
Usage:
|
||||
|
||||
builder.exe [wadfile] [-map mapname] [-cfg configname] [-delaywindow] [-nopreferences]
|
||||
[-strictpatches] [-resource wad|dir|pk3 [roottextures] [rootflats]
|
||||
[strictpatches] [notest] resourcename]
|
||||
GZBuilder.exe [wadfile] [-map mapname] [-cfg configname] [-delaywindow] [-nopreferences]
|
||||
[-strictpatches] [-portable] [-resource wad|dir|pk3 [roottextures]
|
||||
[rootflats] [strictpatches] [notest] resourcename]
|
||||
|
||||
==========================================================================================
|
||||
|
||||
Parameters:
|
||||
|
||||
- wadfile
|
||||
wadfile
|
||||
This is a .WAD file to load immediately after Doom Builder has started up. Unless -map
|
||||
and -cfg are used, this will show the map-options dialog.
|
||||
|
||||
- map
|
||||
Where 'mapname' is the name of the map (map header lump name) such as MAP01 or E1M1. When
|
||||
-map "mapname"
|
||||
Where "mapname" is the name of the map (map header lump name) such as MAP01 or E1M1. When
|
||||
specified, this will indicate the map to load from the specified wad file. Use in
|
||||
combination with -cfg to provide the required information to skip the map-options dialog.
|
||||
|
||||
- cfg
|
||||
Where 'configname' is a game configuration filename, for example, "ZDoom_DoomHexen.cfg".
|
||||
-cfg "configname"
|
||||
-config "configname"
|
||||
Where "configname" is a game configuration filename, for example, "ZDoom_DoomHexen.cfg".
|
||||
Do NOT include the path, all game configurations must be in the Configurations subfolder.
|
||||
When used in combination with -map this will provide the required information to load a
|
||||
map directly and skip the map-options dialog.
|
||||
|
||||
- delaywindow
|
||||
-delaywindow
|
||||
This delays showing the main interface window until the automatic map loading from
|
||||
command line parameters is completed, and the program is not terminating yet. This is
|
||||
usefull for plugins that can be used to perform batch processes where the showing of the
|
||||
main interface window is not desired. If a plugin completes it's actions on map load and
|
||||
terminates the application immediately, the main window will not be shown at all.
|
||||
|
||||
- nosettings
|
||||
-nosettings
|
||||
When this parameter is specified, Doom Builder will not load your preferences or game
|
||||
configuration settings and will use the default settings instead. You will not lose your
|
||||
original settings, but when this parameter is specified your settings will not be saved.
|
||||
|
||||
- strictpatches
|
||||
-strictpatches
|
||||
Specify this parameter to enforce strictly loading texture patches from between P_START
|
||||
and P_END marker lumps only. This can solve lump name conflicts, but old WAD files do not
|
||||
always adhere to this rule.
|
||||
|
||||
- resource
|
||||
-portable
|
||||
The editor will be launched in portable mode. It will use the "GZBuilder.cfg" located in
|
||||
the program directory instead of the one located in the
|
||||
"%LocalAppData%\Doom Builder\GZBuilder.cfg" to load and save program settings. Log and
|
||||
crash report files will be also created in the program directory.
|
||||
|
||||
-resource <resource type> [flags] "path\to\resource"
|
||||
When -wadfile is specified, the -resource option can be used to add additional resources
|
||||
that must be loaded along with the wad file. Note that these are added to the resources
|
||||
which are automatically loaded due to the selection of a game configuration. You can
|
||||
repeat this option for any number of resources you wish to add. As always, the last
|
||||
specified resource will override any data in earlier specified resource. This parameter
|
||||
has the following arguments:
|
||||
specified resource will override any data in earlier specified resource.
|
||||
|
||||
This parameter has the following arguments:
|
||||
|
||||
wad|dir|pk3 Either 'wad', 'dir' or 'pk3' must be specified to indicate how this
|
||||
resource must be loaded. This is the same as selecting the tabs in
|
||||
|
@ -77,16 +85,18 @@ Examples:
|
|||
This loads the file "Ubermegawad.wad" after Doom Builder is initialized and shows the
|
||||
map-options dialog:
|
||||
|
||||
builder.exe "C:\Games\Doom\My Maps\Ubermegawad.wad"
|
||||
GZBuilder.exe "C:\Games\Doom\My Maps\Ubermegawad.wad"
|
||||
|
||||
Same as the example above, but now without showing the map-options dialog and instead
|
||||
immediately loads map MAP23 with the game configuration for Doom 2:
|
||||
|
||||
builder.exe "C:\Games\Doom\My Maps\Ubermegawad.wad" -map MAP23 -cfg "Doom2.cfg"
|
||||
GZBuilder.exe "C:\Games\Doom\My Maps\Ubermegawad.wad" -map MAP23 -cfg "Doom_Doom2Doom.cfg"
|
||||
|
||||
Same as the example above, but with added wad file resource and PK3 file resource:
|
||||
Same as the example above, but using one of GZDoom game configurations with added wad
|
||||
file resource and PK3 file resources:
|
||||
|
||||
builder.exe "C:\Games\Doom\My Maps\Ubermegawad.wad" -map MAP23 -cfg "Doom2.cfg"
|
||||
-resource wad strictpatches "C:\Games\Doom\gothtextures.wad"
|
||||
-resource pk3 "C:\Games\Doom\hardmonsters.pk3"
|
||||
GZBuilder.exe "C:\Games\Doom\My Maps\Ubermegawad.wad" -map MAP23 -cfg "GZDoom_DoomUDMF.cfg"
|
||||
-resource pk3 notest "C:\GZDoom\gzdoom.pk3"
|
||||
-resource wad strictpatches "C:\Games\Doom\gothtextures.wad"
|
||||
-resource pk3 "C:\Games\Doom\hardmonsters.pk3"
|
||||
|
||||
|
|
|
@ -7,49 +7,74 @@
|
|||
</head>
|
||||
<body>
|
||||
<object type="application/x-oleobject" classid="clsid:1e2a7bd0-dab9-11d0-b93a-00c04fc99f9e">
|
||||
<param name="keyword" value="command line">
|
||||
<param name="keyword" value="arguments">
|
||||
<param name="keyword" value="command line">
|
||||
<param name="keyword" value="arguments">
|
||||
</object>
|
||||
<div id="gz_title">
|
||||
<h1>Command Line Parameters</h1>
|
||||
<h1>Command Line Parameters</h1>
|
||||
</div>
|
||||
<div id="contents">
|
||||
<p> All command line parameters are case-insensitive.<br />
|
||||
<br />
|
||||
<b class="fat">-portable</b> - <span class="red">GZDB only.</span><br />
|
||||
The editor will be launched in portable mode. It will use the "GZBuilder.cfg" located in the program directory instead of the one located in the "%LocalAppData%\Doom Builder\GZBuilder.cfg" to load and save program settings. Log and crash report files will be also created in the program directory.<br />
|
||||
<br />
|
||||
<b class="fat">-nosettings</b><br />
|
||||
The editor doesn't load or save program settings.<br />
|
||||
<br />
|
||||
<b class="fat">-delaywindow</b><br />
|
||||
Delays showing of the main window.<br />
|
||||
<br />
|
||||
<b class="fat">-map "path\to\mapfile.wad"</b><br />
|
||||
The editor will automatically load the specified map.<br />
|
||||
<h2>The following parameters are used only in conjunction with the "-map" parameter</h2>
|
||||
They replicate the settings, which can be set in the <a href="w_openmapoptions.html">Open Map Window</a>.<br />
|
||||
<br />
|
||||
<b class="fat">-strictpatches</b><br />
|
||||
Enables strict patches rules.<br />
|
||||
<br />
|
||||
<b class="fat">-cfg "path\to\game configuration.cfg"</b><br />
|
||||
<b class="fat">-config "path\to\game configuration.cfg"</b><br />
|
||||
The editor will use the specified game configuration file when loading the map.<br />
|
||||
<br />
|
||||
<b class="fat">-resource <resource type> [flags] "path\to\resource"</b><br />
|
||||
Adds a map resource.<br />
|
||||
<strong>Resource type</strong> (required): "wad", "dir" or "pk3".<br />
|
||||
<strong>Flags</strong> (optional):
|
||||
<ul>
|
||||
<li><strong>ROOTTEXTURES</strong> - load images in the root directory of the resource as textures.</li>
|
||||
<li><strong>ROOTFLATS</strong> - load images in the root directory of the resource as flats.</li>
|
||||
<li><strong>STRICTPATCHES</strong> - use strict rules for patches.</li>
|
||||
<li><strong>NOTEST</strong> - exclude this resource from testing parameters.</li>
|
||||
</ul>
|
||||
<strong>Examples:</strong>
|
||||
<pre>
|
||||
-resource pk3 notest "c:\GZDoom\gzdoom.pk3"
|
||||
-resource WAD "c:\Doom\DOOM.WAD"</pre>
|
||||
<h2>Usage:</h2>
|
||||
All command line parameters are case-insensitive.<br />
|
||||
<br />
|
||||
<b class="fat">GZBuilder.exe [wadfile] [-map mapname] [-cfg configname] [-delaywindow] [-nosettings]
|
||||
[-strictpatches] [-portable] [-resource wad|dir|pk3 [roottextures] [rootflats]
|
||||
[strictpatches] [notest] resourcename]</b>
|
||||
<h2>Parameters:</h2>
|
||||
<br />
|
||||
<b class="fat">wadfile</b><br />
|
||||
This is a .WAD file to load immediately after GZDoom Builder has started up. Unless <strong>-map</strong> and <strong>-cfg</strong> are used, this will show the map-options dialog.<br />
|
||||
<p><b class="fat">-map "mapname"</b><br />
|
||||
Where "mapname" is the name of the map (map header lump name) such as <strong>MAP01</strong> or <strong>E1M1</strong>.<br />
|
||||
When specified, this will indicate the map to load from the specified wad file.<br />
|
||||
Use in combination with <strong>-cfg</strong> to provide the required information to skip the map-options dialog.
|
||||
<p><b class="fat">-delaywindow</b><br />
|
||||
This delays showing the main interface window until the automatic map loading from command line parameters is completed, and the program is not terminating yet.<br />This is usefull for plugins that can be used to perform batch processes where the showing of the main interface window is not desired.<br />If a plugin completes it's actions on map load and terminates the application immediately, the main window will not be shown at all.
|
||||
<p>
|
||||
<b class="fat">-nosettings</b><br />
|
||||
When this parameter is specified, GZDoom Builder will not load your preferences or game configuration settings and will use the default settings instead.<br />You will not lose your original settings, but when this parameter is specified your settings will not be saved.<br />
|
||||
<br />
|
||||
<b class="fat">-portable</b> - <span class="red">GZDB only.</span><br />
|
||||
The editor will be launched in portable mode. It will use the "GZBuilder.cfg" located in the program directory instead of the one located in the "%LocalAppData%\Doom Builder\GZBuilder.cfg" to load and save program settings. Log and crash report files will be also created in the program directory.<br />
|
||||
<h2>The following parameters are used only when both "wadfile" and "-map" parameters are present</h2>
|
||||
They replicate the settings, which can be set in the <a href="w_openmapoptions.html">Open Map Window</a>.<br />
|
||||
<br />
|
||||
<b class="fat">-strictpatches</b><br />
|
||||
Specify this parameter to enforce strictly loading texture patches from between P_START
|
||||
and P_END marker lumps only. This can solve lump name conflicts, but old WAD files do not
|
||||
always adhere to this rule.<br />
|
||||
<br />
|
||||
<b class="fat">-cfg "game_configuration.cfg"</b><br />
|
||||
<b class="fat">-config "game_configuration.cfg"</b><br />
|
||||
The editor will use the specified game configuration file when loading the map.<br />
|
||||
Do not include the path, all game configurations must be in the "Configurations" subfolder.<br />
|
||||
<br />
|
||||
<b class="fat">-resource <resource type> [flags] "path\to\resource"</b><br />
|
||||
Adds a map resource. Note that these are added to the resources, which are automatically loaded according to selected game configuration.<br />
|
||||
<strong>Resource type</strong> (required): "wad", "dir" or "pk3".<br />
|
||||
<strong>Flags</strong> (optional):
|
||||
<ul>
|
||||
<li><strong>ROOTTEXTURES</strong> - load images in the root directory of the resource as textures (directory/pk3 resources only).</li>
|
||||
<li><strong>ROOTFLATS</strong> - load images in the root directory of the resource as flats (directory/pk3 resources only).</li>
|
||||
<li><strong>STRICTPATCHES</strong> - use strict rules for patches (wad resources only).</li>
|
||||
<li><strong>NOTEST</strong> - exclude this resource from testing parameters.</li>
|
||||
</ul>
|
||||
<h2>Examples:</h2>
|
||||
This loads the file "Ubermegawad.wad" after GZDoom Builder is initialized and shows the
|
||||
map-options dialog:
|
||||
<pre>
|
||||
GZBuilder.exe "C:\Games\Doom\My Maps\Ubermegawad.wad"
|
||||
</pre>
|
||||
Same as the example above, but now without showing the map-options dialog and instead immediately loading map MAP23 with the Doom 2 game configuration:
|
||||
<pre>
|
||||
GZBuilder.exe "C:\Games\Doom\My Maps\Ubermegawad.wad" -map MAP23 -cfg "Doom_Doom2Doom.cfg"
|
||||
</pre>
|
||||
Same as the example above, but using one of GZDoom game configurations with added wad file resource and PK3 file resources:
|
||||
<pre>
|
||||
GZBuilder.exe "C:\Games\Doom\My Maps\Ubermegawad.wad" -map MAP23 -cfg "GZDoom_DoomUDMF.cfg"
|
||||
-resource pk3 notest "C:\GZDoom\gzdoom.pk3"
|
||||
-resource wad strictpatches "C:\Games\Doom\gothtextures.wad"
|
||||
-resource pk3 "C:\Games\Doom\hardmonsters.pk3"
|
||||
</pre>
|
||||
</div>
|
||||
</body>
|
||||
|
|
|
@ -31,6 +31,9 @@
|
|||
<strong>//$Title <title></strong><br />
|
||||
Specifies which name to give to the actor. By default, a custom actor not identified in a configuration file will use the Tag property, and if not present, will default to the class name.<br />
|
||||
<br />
|
||||
<strong>//$IgnoreRenderstyle</strong> - <span class="red">GZDB only</span>.<br />
|
||||
"RenderStyle" DECORATE property will be ignored by the editor. Helpful when you want to see the sprite of an invisible actor in Visual mode.<br />
|
||||
<br />
|
||||
<strong><a name="argtitle" id="argtitle"></a>//$ArgN <name></strong> - <span class="red">GZDB only</span>.<br />
|
||||
Allows to override default argument names for this actor.<br />
|
||||
<br />
|
||||
|
@ -87,6 +90,7 @@ Actor ChexShield : ResistanceRune replaces ResistanceRune 5104
|
|||
{
|
||||
//$Category "Pickups/Chex Powerups"
|
||||
//$Sprite ARMXA0
|
||||
//$IgnoreRenderstyle
|
||||
//$Title "Chex Shield"
|
||||
//$Color 12
|
||||
//$NotAngled
|
||||
|
@ -115,6 +119,7 @@ Actor ChexShield : ResistanceRune replaces ResistanceRune 5104
|
|||
|
||||
Height 44
|
||||
Radius 26
|
||||
RenderStyle None
|
||||
Inventory.PickupMessage "Picked up the energized Chex armor!"
|
||||
|
||||
States
|
||||
|
|
|
@ -28,21 +28,34 @@
|
|||
<li>7-zip archiver (<a href="www.7-zip.org">www.7-zip.org</a>).</li>
|
||||
<li>Inno Setup 5 or newer (<a href="http://www.jrsoftware.org/isinfo.php">http://www.jrsoftware.org/isinfo.php</a>).</li>
|
||||
<li>Microsoft HTML Help compiler (<a href="http://www.microsoft.com/en-us/download/details.aspx?id=21138">http://www.microsoft.com/en-us/download/details.aspx?id=21138</a>).</li>
|
||||
<li>SlimDX Developer SDK. You can download it for free from <a href="http://slimdx.org/download.php">http://slimdx.org/download.php</a>.</li>
|
||||
<li>SlimDX Developer SDK (<a href="http://slimdx.org/download.php">http://slimdx.org/download.php</a>).</li>
|
||||
<li>DirectX SDK (<a href="https://www.microsoft.com/en-us/download/details.aspx?id=6812">https://www.microsoft.com/en-us/download/details.aspx?id=6812</a>).</li>
|
||||
</ul>
|
||||
|
||||
<h2>Obtaining the source:</h2>
|
||||
The Doom Builder 2 source code is hosted on SourceForge and is available through SVN at the following location:<pre>https://svn.code.sf.net/p/doombuilder/code/branches/GZDoomBuilder</pre>
|
||||
If you don't want to use a SVN client, head to
|
||||
<a href="https://sourceforge.net/p/doombuilder/code/HEAD/tree/branches/GZDoomBuilder/">https://sourceforge.net/p/doombuilder/code/HEAD/tree/branches/GZDoomBuilder/</a>
|
||||
and press "Download Snapshot" button.
|
||||
The GZDoom Builder source code is hosted on SourceForge and is available through SVN at the following location:
|
||||
<pre>https://svn.code.sf.net/p/doombuilder/code/branches/GZDoomBuilder</pre>
|
||||
If you don't want to use a SVN client, head to <a href="https://sourceforge.net/p/doombuilder/code/HEAD/tree/branches/GZDoomBuilder/">https://sourceforge.net/p/doombuilder/code/HEAD/tree/branches/GZDoomBuilder/</a> and press "Download Snapshot" button.
|
||||
<h2>Quick start guide:</h2>
|
||||
This guide assumes you are using <strong>Visual Studio 2008</strong> / <strong>Visual C# 2008 Express Edition</strong> and <strong>Tortiose SVN</strong>.
|
||||
<ol>
|
||||
<li>Create an empty folder, right click on it and choose "<strong>SVN Checkout...</strong>" from the context menu.</li>
|
||||
<li>Enter "<strong>https://svn.code.sf.net/p/doombuilder/code/branches/GZDoomBuilder</strong>" in the "<strong>URL of repository</strong>" field and click OK.</li>
|
||||
<li> Open "<strong>Builder.sln</strong>" in the Visual Studio and make sure it compiles and runs (click the green "<strong>Play</strong>" button, or press <strong>F5</strong>).
|
||||
<ul>
|
||||
<li>If the Visual Studio complains about missing <strong>SlimDX</strong> reference in the Builder project, you'll need to re-add it manually. To do so, delete SlimDX from the References in the Solution Explorer, right click on the Builder project and choose "<strong>Add reference</strong>". On the .NET tab, choose SlimDX (.net 2.0, x86 version).</li>
|
||||
<li>You can ignore the warning about missing <strong>JetBrains.Profiler.Core.Api</strong> reference. Everything should build fine, unless you choose a profiler-enabled build target (or you can use dotTrace Performance, if you have access to it).</li>
|
||||
</ul>
|
||||
</li>
|
||||
<li>If you've made some code changes and want to submit them to the main GZDB repository, you can make a diff patch (right-click on the GZDB source folder and choose "<strong>TortioseSVN -> Create patch...</strong>") and post it at the official GZDB thread at ZDoom.org (<a href="http://forum.zdoom.org/viewtopic.php?f=3&t=32392&start=999999">http://forum.zdoom.org/viewtopic.php?f=3&t=32392&start=999999</a>).</li>
|
||||
</ol>
|
||||
<h2>Batch files:</h2>
|
||||
GZDB source comes with several batch files, which can be used to automatically compile and package the editor. Before launching a batch file for the first time, make sure to open it and check that variables holding software paths point to the right directories. These variables are always located near the top of the file, after the info block.
|
||||
<ul>
|
||||
<li><strong>Clean Rebuild.bat</strong> - removes project cache files, then compiles it in Release mode.<br />Requires Visual C# Express Edition / Visual Studio.</li><br />
|
||||
<li><strong>Clean Rebuild.bat</strong> - removes project cache files, then compiles it in Release mode.<br />Requires Visual C# Express Edition / Visual Studio.</li><br />
|
||||
<li><strong>CompileHelp.bat</strong> - compiles "Build\Refmanual.chm". Help source files are located in the "Help" directory.<br />Requires Microsoft HTML Help compiler.</li><br />
|
||||
<li><strong>MakeRelease.bat</strong> - removes project cache files, sets project version number to match the latest SVN revision, compiles the project in Release mode, generates "Build\Changelog.txt", compiles "Build\Refmanual.chm", creates an installer and places it in the "Release" folder.<br />Requires Subversion command-line client, Visual C# Express Edition / Visual Studio, Microsoft HTML Help compiler and Inno Setup 5.</li><br />
|
||||
<li><strong>MakeSVNRelease.bat</strong> - removes project cache files, sets project version number to match the latest SVN revision, compiles the project in Release mode, generates "Build\Changelog.txt", compiles "Build\Refmanual.chm", packs the build into 7-zip archive and places it in the "SVN_Build" folder.<br />Requires Subversion command-line client, Visual C# Express Edition / Visual Studio, Microsoft HTML Help compiler and 7-zip archiver.</li>
|
||||
<li><strong>MakeSVNRelease.bat</strong> - removes project cache files, sets project version number to match the latest SVN revision, compiles the project in Release mode, generates "Build\Changelog.txt", compiles "Build\Refmanual.chm", packs the build into 7-zip archive and places it in the "SVN_Build" folder.<br />Requires Subversion command-line client, Visual C# Express Edition / Visual Studio, Microsoft HTML Help compiler and 7-zip archiver.</li>
|
||||
</ul>
|
||||
</div>
|
||||
</body>
|
||||
|
|
|
@ -193,7 +193,7 @@ namespace CodeImp.DoomBuilder.Actions
|
|||
else
|
||||
{
|
||||
// Action already exists!
|
||||
General.ErrorLogger.Add(ErrorType.Warning, "Action '" + name + "' already exists. Action names must be unique.");
|
||||
General.ErrorLogger.Add(ErrorType.Warning, "Action \"" + name + "\" already exists. Action names must be unique.");
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -142,7 +142,7 @@ namespace CodeImp.DoomBuilder.Actions
|
|||
{
|
||||
General.Interface.ShowHints(DEFAULT_HINT);
|
||||
#if DEBUG
|
||||
Console.WriteLine("WARNING: Unable to get hints for class '" + fullname + "', group '" + groupname + "'");
|
||||
Console.WriteLine("WARNING: Unable to get hints for class \"" + fullname + "\", group \"" + groupname + "\"");
|
||||
#endif
|
||||
return;
|
||||
}
|
||||
|
|
|
@ -1143,6 +1143,7 @@
|
|||
<None Include="Resources\GroupRemove.png" />
|
||||
<None Include="Resources\GridDecrease.png" />
|
||||
<None Include="Resources\GridIncrease.png" />
|
||||
<None Include="Resources\FixedThingsScale.png" />
|
||||
<Content Include="Resources\Light.png" />
|
||||
<None Include="Resources\Lightbulb.png" />
|
||||
<None Include="Resources\LightDisabled.png" />
|
||||
|
|
|
@ -76,9 +76,9 @@ namespace CodeImp.DoomBuilder.Compilers
|
|||
// Initialize
|
||||
this.info = info;
|
||||
this.errors = new List<CompilerError>();
|
||||
this.includes = new HashSet<string>(); //mxd
|
||||
|
||||
General.WriteLogLine("Creating compiler '" + info.Name + "' on interface '" + this.GetType().Name + "'...");
|
||||
this.includes = new HashSet<string>(StringComparer.OrdinalIgnoreCase); //mxd
|
||||
|
||||
General.WriteLogLine("Creating compiler \"" + info.Name + "\" on interface \"" + this.GetType().Name + "\"...");
|
||||
|
||||
// Create temporary directory
|
||||
tempdir = Directory.CreateDirectory(General.MakeTempDirname());
|
||||
|
@ -146,7 +146,7 @@ namespace CodeImp.DoomBuilder.Compilers
|
|||
string srcfile = Path.Combine(info.Path, f);
|
||||
if(!File.Exists(srcfile))
|
||||
{
|
||||
General.ErrorLogger.Add(ErrorType.Error, "The file '" + f + "' required by the '" + info.Name + "' compiler is missing. According to the compiler configuration in '" + info.FileName + "', the was expected to be found in the following path: " + info.Path);
|
||||
General.ErrorLogger.Add(ErrorType.Error, "The file \"" + f + "\" required by the \"" + info.Name + "\" compiler is missing. According to the compiler configuration in \"" + info.FileName + "\", it was expected to be found here: \"" + info.Path + "\"");
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
|
@ -87,7 +87,7 @@ namespace CodeImp.DoomBuilder.Config
|
|||
}
|
||||
else
|
||||
{
|
||||
General.ErrorLogger.Add(ErrorType.Warning, "'" + argspath + ".arg" + istr + "' references unknown enumeration '" + argdic["enum"] + "'.");
|
||||
General.ErrorLogger.Add(ErrorType.Warning, "\"" + argspath + ".arg" + istr + "\" references unknown enumeration \"" + argdic["enum"] + "\".");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -59,7 +59,7 @@ namespace CodeImp.DoomBuilder.Config
|
|||
// Constructor
|
||||
internal CompilerInfo(string filename, string name, string path, Configuration cfg)
|
||||
{
|
||||
General.WriteLogLine("Registered compiler configuration '" + name + "' from '" + filename + "'");
|
||||
General.WriteLogLine("Registered compiler configuration \"" + name + "\" from \"" + filename + "\"");
|
||||
|
||||
// Initialize
|
||||
this.filename = filename;
|
||||
|
@ -80,7 +80,7 @@ namespace CodeImp.DoomBuilder.Config
|
|||
//mxd
|
||||
string include = de.Value.ToString().Replace(System.IO.Path.AltDirectorySeparatorChar, System.IO.Path.DirectorySeparatorChar);
|
||||
if(files.Contains(include))
|
||||
General.ErrorLogger.Add(ErrorType.Warning, "Include file '" + de.Value + "' is double-defined in '" + name + "' compiler configuration");
|
||||
General.ErrorLogger.Add(ErrorType.Warning, "Include file \"" + de.Value + "\" is double defined in \"" + name + "\" compiler configuration");
|
||||
else
|
||||
files.Add(include);
|
||||
}
|
||||
|
|
|
@ -76,7 +76,7 @@ namespace CodeImp.DoomBuilder.Config
|
|||
}
|
||||
else
|
||||
{
|
||||
General.ErrorLogger.Add(ErrorType.Warning, "Structure '" + fullpath + "." + name + "' contains invalid entries. The keys must be numeric.");
|
||||
General.ErrorLogger.Add(ErrorType.Warning, "Structure \"" + fullpath + "." + name + "\" contains invalid entries. The keys must be numeric.");
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -55,7 +55,7 @@ namespace CodeImp.DoomBuilder.Config
|
|||
}
|
||||
else
|
||||
{
|
||||
General.ErrorLogger.Add(ErrorType.Warning, "Map lump '" + name + "' in the current game configuration specifies an unknown script configuration '" + scriptconfig + "'. Using plain text instead.");
|
||||
General.ErrorLogger.Add(ErrorType.Warning, "Map lump \"" + name + "\" in the current game configuration specifies an unknown script configuration \"" + scriptconfig + "\". Using plain text instead.");
|
||||
this.Script = new ScriptConfiguration();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -55,7 +55,7 @@ namespace CodeImp.DoomBuilder.Config
|
|||
// Constructor
|
||||
public NodebuilderInfo(string filename, string name, Configuration cfg)
|
||||
{
|
||||
General.WriteLogLine("Registered nodebuilder configuration '" + name + "' from '" + filename + "'");
|
||||
General.WriteLogLine("Registered nodebuilder configuration \"" + name + "\" from \"" + filename + "\"");
|
||||
|
||||
// Initialize
|
||||
this.name = name;
|
||||
|
@ -80,7 +80,7 @@ namespace CodeImp.DoomBuilder.Config
|
|||
}
|
||||
|
||||
// No compiler found?
|
||||
if(this.compiler == null) throw new Exception("No such compiler defined: '" + compilername + "'");
|
||||
if(this.compiler == null) throw new Exception("Compiler \"" + compilername + "\" is not defined");
|
||||
}
|
||||
|
||||
// Constructor for "none" nodebuilder
|
||||
|
|
|
@ -85,7 +85,8 @@ namespace CodeImp.DoomBuilder.Config
|
|||
private float filteranisotropy;
|
||||
private bool showtexturesizes;
|
||||
private bool locatetexturegroup; //mxd
|
||||
private SplitLineBehavior splitlinebehavior; //mxd
|
||||
private bool keeptexturefilterfocused; //mxd
|
||||
private SplitLineBehavior splitlinebehavior; //mxd
|
||||
|
||||
//mxd. Script editor settings
|
||||
private string scriptfontname;
|
||||
|
@ -131,7 +132,8 @@ namespace CodeImp.DoomBuilder.Config
|
|||
private bool storeSelectedEditTab;
|
||||
private int maxbackups;
|
||||
private bool checkforupdates;
|
||||
private bool rendercomments;
|
||||
private bool rendercomments; //mxd
|
||||
private bool fixedthingsscale; //mxd
|
||||
private bool rendergrid;
|
||||
private bool rendernightspath;
|
||||
private bool dynamicgridsize;
|
||||
|
@ -194,6 +196,7 @@ namespace CodeImp.DoomBuilder.Config
|
|||
public float FilterAnisotropy { get { return filteranisotropy; } internal set { filteranisotropy = value; } }
|
||||
public bool ShowTextureSizes { get { return showtexturesizes; } internal set { showtexturesizes = value; } }
|
||||
public bool LocateTextureGroup { get { return locatetexturegroup; } internal set { locatetexturegroup = value; } } //mxd
|
||||
public bool KeepTextureFilterFocused { get { return keeptexturefilterfocused; } internal set { keeptexturefilterfocused = value; } } //mxd
|
||||
public SplitLineBehavior SplitLineBehavior { get { return splitlinebehavior; } set { splitlinebehavior = value; } } //mxd
|
||||
|
||||
//mxd. Script editor settings
|
||||
|
@ -241,6 +244,7 @@ namespace CodeImp.DoomBuilder.Config
|
|||
internal int MaxBackups { get { return maxbackups; } set { maxbackups = value; } }
|
||||
internal bool CheckForUpdates { get { return checkforupdates; } set { checkforupdates = value; } } //mxd
|
||||
public bool RenderComments { get { return rendercomments; } internal set { rendercomments = value; } } //mxd
|
||||
public bool FixedThingsScale { get { return fixedthingsscale; } internal set { fixedthingsscale = value; } } //mxd
|
||||
public bool RenderGrid { get { return rendergrid; } internal set { rendergrid = value; } } //mxd
|
||||
public bool RenderNiGHTSPath { get { return rendernightspath; } internal set { rendernightspath = value; } }
|
||||
public bool DynamicGridSize { get { return dynamicgridsize; } internal set { dynamicgridsize = value; } } //mxd
|
||||
|
@ -326,6 +330,7 @@ namespace CodeImp.DoomBuilder.Config
|
|||
filteranisotropy = cfg.ReadSetting("filteranisotropy", 8.0f);
|
||||
showtexturesizes = cfg.ReadSetting("showtexturesizes", true);
|
||||
locatetexturegroup = cfg.ReadSetting("locatetexturegroup", true); //mxd
|
||||
keeptexturefilterfocused = cfg.ReadSetting("keeptexturefilterfocused", true); //mxd
|
||||
splitlinebehavior = (SplitLineBehavior) General.Clamp(cfg.ReadSetting("splitlinebehavior", 0), 0, 3); //mxd
|
||||
|
||||
//mxd. Script editor
|
||||
|
@ -371,6 +376,7 @@ namespace CodeImp.DoomBuilder.Config
|
|||
maxbackups = cfg.ReadSetting("maxbackups", 3);
|
||||
checkforupdates = false; //No update checking for Zone Builder
|
||||
rendercomments = cfg.ReadSetting("rendercomments", true); //mxd
|
||||
fixedthingsscale = cfg.ReadSetting("fixedthingsscale", false); //mxd
|
||||
rendergrid = cfg.ReadSetting("rendergrid", true); //mxd
|
||||
rendernightspath = cfg.ReadSetting("rendernightspath", true);
|
||||
dynamicgridsize = cfg.ReadSetting("dynamicgridsize", true); //mxd
|
||||
|
@ -438,6 +444,7 @@ namespace CodeImp.DoomBuilder.Config
|
|||
cfg.WriteSetting("filteranisotropy", filteranisotropy);
|
||||
cfg.WriteSetting("showtexturesizes", showtexturesizes);
|
||||
cfg.WriteSetting("locatetexturegroup", locatetexturegroup); //mxd
|
||||
cfg.WriteSetting("keeptexturefilterfocused", keeptexturefilterfocused); //mxd
|
||||
cfg.WriteSetting("splitlinebehavior", (int)splitlinebehavior); //mxd
|
||||
|
||||
//mxd. Script editor
|
||||
|
@ -485,6 +492,7 @@ namespace CodeImp.DoomBuilder.Config
|
|||
cfg.WriteSetting("maxbackups", maxbackups);
|
||||
//cfg.WriteSetting("checkforupdates", checkforupdates); //mxd
|
||||
cfg.WriteSetting("rendercomments", rendercomments); //mxd
|
||||
cfg.WriteSetting("fixedthingsscale", fixedthingsscale); //mxd
|
||||
cfg.WriteSetting("rendergrid", rendergrid); //mxd
|
||||
cfg.WriteSetting("rendernightspath", rendernightspath); //mxd
|
||||
cfg.WriteSetting("dynamicgridsize", dynamicgridsize); //mxd
|
||||
|
@ -498,7 +506,7 @@ namespace CodeImp.DoomBuilder.Config
|
|||
cfg.WriteSetting("defaultbrightness", defaultbrightness);
|
||||
|
||||
// Save settings configuration
|
||||
General.WriteLogLine("Saving program configuration to '" + filepathname + "'...");
|
||||
General.WriteLogLine("Saving program configuration to \"" + filepathname + "\"...");
|
||||
cfg.SaveConfiguration(filepathname);
|
||||
}
|
||||
|
||||
|
|
|
@ -28,12 +28,20 @@ using ScintillaNET;
|
|||
namespace CodeImp.DoomBuilder.Config
|
||||
{
|
||||
//mxd
|
||||
internal enum ScriptType
|
||||
public enum ScriptType
|
||||
{
|
||||
UNKNOWN = 0,
|
||||
ACS = 1,
|
||||
MODELDEF = 2,
|
||||
DECORATE = 3,
|
||||
GLDEFS = 4,
|
||||
SNDSEQ = 5,
|
||||
MAPINFO = 6,
|
||||
VOXELDEF = 7,
|
||||
TEXTURES = 8,
|
||||
ANIMDEFS = 9,
|
||||
REVERBS = 10,
|
||||
TERRAIN = 11,
|
||||
}
|
||||
|
||||
internal class ScriptConfiguration : IComparable<ScriptConfiguration>
|
||||
|
@ -214,7 +222,7 @@ namespace CodeImp.DoomBuilder.Config
|
|||
string keyword = de.Key.ToString();
|
||||
if(keywords.ContainsKey(keyword)) //mxd
|
||||
{
|
||||
General.ErrorLogger.Add(ErrorType.Warning, "Keyword \"" + keyword + "\" is double-defined in \"" + description + "\" script configuration.");
|
||||
General.ErrorLogger.Add(ErrorType.Warning, "Keyword \"" + keyword + "\" is double defined in \"" + description + "\" script configuration.");
|
||||
continue;
|
||||
}
|
||||
|
||||
|
@ -226,16 +234,16 @@ namespace CodeImp.DoomBuilder.Config
|
|||
//mxd. Sort keywords lookup
|
||||
keywordkeyssorted.Sort();
|
||||
|
||||
//mxd. Load properties
|
||||
dic = cfg.ReadSetting("properties", new Hashtable());
|
||||
foreach (DictionaryEntry de in dic)
|
||||
{
|
||||
string property = de.Key.ToString();
|
||||
if (lowerproperties.ContainsValue(property)) //mxd
|
||||
{
|
||||
General.ErrorLogger.Add(ErrorType.Warning, "Property \"" + property + "\" is double-defined in \"" + description + "\" script configuration.");
|
||||
continue;
|
||||
}
|
||||
//mxd. Load properties
|
||||
dic = cfg.ReadSetting("properties", new Hashtable());
|
||||
foreach(DictionaryEntry de in dic)
|
||||
{
|
||||
string property = de.Key.ToString();
|
||||
if(lowerproperties.ContainsValue(property)) //mxd
|
||||
{
|
||||
General.ErrorLogger.Add(ErrorType.Warning, "Property \"" + property + "\" is double defined in \"" + description + "\" script configuration.");
|
||||
continue;
|
||||
}
|
||||
|
||||
properties.Add(property);
|
||||
lowerproperties[property.ToLowerInvariant()] = property;
|
||||
|
@ -248,12 +256,12 @@ namespace CodeImp.DoomBuilder.Config
|
|||
dic = cfg.ReadSetting("constants", new Hashtable());
|
||||
foreach(DictionaryEntry de in dic)
|
||||
{
|
||||
string constant = de.Key.ToString();
|
||||
if (lowerconstants.ContainsValue(constant)) //mxd
|
||||
{
|
||||
General.ErrorLogger.Add(ErrorType.Warning, "Constant \"" + constant + "\" is double-defined in \"" + description + "\" script configuration.");
|
||||
continue;
|
||||
}
|
||||
string constant = de.Key.ToString();
|
||||
if(lowerconstants.ContainsValue(constant)) //mxd
|
||||
{
|
||||
General.ErrorLogger.Add(ErrorType.Warning, "Constant \"" + constant + "\" is double defined in \"" + description + "\" script configuration.");
|
||||
continue;
|
||||
}
|
||||
|
||||
constants.Add(constant);
|
||||
lowerconstants[constant.ToLowerInvariant()] = constant;
|
||||
|
@ -275,10 +283,10 @@ namespace CodeImp.DoomBuilder.Config
|
|||
foreach (string file in files)
|
||||
{
|
||||
string name = Path.GetFileNameWithoutExtension(file);
|
||||
if (string.IsNullOrEmpty(name))
|
||||
{
|
||||
General.ErrorLogger.Add(ErrorType.Warning, "Failed to load snippet '" + file + "' for '" + description + "' script configuration.");
|
||||
}
|
||||
if(string.IsNullOrEmpty(name))
|
||||
{
|
||||
General.ErrorLogger.Add(ErrorType.Warning, "Failed to load snippet \"" + file + "\" for \"" + description + "\" script configuration.");
|
||||
}
|
||||
else
|
||||
{
|
||||
if (name.Contains(" ")) name = name.Replace(' ', '_');
|
||||
|
@ -290,37 +298,36 @@ namespace CodeImp.DoomBuilder.Config
|
|||
}
|
||||
else
|
||||
{
|
||||
General.ErrorLogger.Add(ErrorType.Warning, "Failed to load snippet '" + file + "' for '" + description + "' script configuration: file is empty!");
|
||||
General.ErrorLogger.Add(ErrorType.Warning, "Failed to load snippet \"" + file + "\" for \"" + description + "\" script configuration: file is empty!");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//mxd. Sort snippets lookup
|
||||
sortedkeys.Sort();
|
||||
snippetkeyssorted = new HashSet<string>(sortedkeys, StringComparer.OrdinalIgnoreCase);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
// Compiler specified?
|
||||
if (compilername.Length > 0)
|
||||
{
|
||||
// Find compiler
|
||||
foreach (CompilerInfo c in General.Compilers)
|
||||
{
|
||||
// Compiler name matches?
|
||||
if (c.Name == compilername)
|
||||
{
|
||||
// Apply compiler
|
||||
this.compiler = c;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
// No compiler found?
|
||||
if (this.compiler == null) throw new Exception("No such compiler defined: '" + compilername + "'");
|
||||
}
|
||||
}
|
||||
//mxd. Sort snippets lookup
|
||||
sortedkeys.Sort();
|
||||
snippetkeyssorted = new HashSet<string>(sortedkeys, StringComparer.OrdinalIgnoreCase);
|
||||
}
|
||||
}
|
||||
|
||||
// Compiler specified?
|
||||
if(compilername.Length > 0)
|
||||
{
|
||||
// Find compiler
|
||||
foreach(CompilerInfo c in General.Compilers)
|
||||
{
|
||||
// Compiler name matches?
|
||||
if(c.Name == compilername)
|
||||
{
|
||||
// Apply compiler
|
||||
this.compiler = c;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
// No compiler found?
|
||||
if(this.compiler == null) throw new Exception("Compiler \"" + compilername + "\" is not defined");
|
||||
}
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
|
|
|
@ -293,7 +293,7 @@ namespace CodeImp.DoomBuilder.Config
|
|||
if(child.IsValid && child.things.Count > 0)
|
||||
{
|
||||
if(cats.ContainsKey(child.title.ToLowerInvariant()))
|
||||
General.ErrorLogger.Add(ErrorType.Warning, "Thing Category '" + child.title + "' is double-defined in " + this.title);
|
||||
General.ErrorLogger.Add(ErrorType.Warning, "Thing Category \"" + child.title + "\" is double defined in " + this.title);
|
||||
cats[child.title.ToLowerInvariant()] = child;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -559,7 +559,7 @@ namespace CodeImp.DoomBuilder.Config
|
|||
//mxd. Marked as obsolete?
|
||||
if(actor.HasPropertyWithValue("$obsolete"))
|
||||
{
|
||||
obsoletemessage = ZDTextParser.StripQuotes(actor.GetPropertyValueString("$obsolete", 0));
|
||||
obsoletemessage = actor.GetPropertyValueString("$obsolete", 0, true);
|
||||
obsolete = true;
|
||||
color = 4; //red
|
||||
}
|
||||
|
@ -591,7 +591,8 @@ namespace CodeImp.DoomBuilder.Config
|
|||
if(actor.HasPropertyWithValue("height")) height = actor.GetPropertyValueInt("height", 0);
|
||||
|
||||
//mxd. Renderstyle
|
||||
if(actor.HasPropertyWithValue("renderstyle")) renderstyle = actor.GetPropertyValueString("renderstyle", 0).ToLower();
|
||||
if(actor.HasPropertyWithValue("renderstyle") && !actor.HasProperty("$ignorerenderstyle"))
|
||||
renderstyle = actor.GetPropertyValueString("renderstyle", 0, true).ToLower();
|
||||
|
||||
//mxd. Alpha
|
||||
if(actor.HasPropertyWithValue("alpha"))
|
||||
|
|
|
@ -47,7 +47,7 @@ namespace CodeImp.DoomBuilder.Config
|
|||
|
||||
// Duplicate flags check
|
||||
if(Flags.ContainsKey(flag))
|
||||
General.ErrorLogger.Add(ErrorType.Warning, "ThingFlagsCompare flag '" + flag + "' is double-defined in '" + name + "' group");
|
||||
General.ErrorLogger.Add(ErrorType.Warning, "ThingFlagsCompare flag \"" + flag + "\" is double defined in the \"" + name + "\" group");
|
||||
|
||||
Flags[flag] = new ThingFlagsCompare(cfg, name, flag);
|
||||
}
|
||||
|
@ -294,7 +294,7 @@ namespace CodeImp.DoomBuilder.Config
|
|||
result.Add("Thing is not used by any class.");
|
||||
break;
|
||||
default:
|
||||
result.Add("At least one '" + group.Key + "' flag should be set.");
|
||||
result.Add("At least one \"" + group.Key + "\" flag should be set.");
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -242,7 +242,7 @@ namespace CodeImp.DoomBuilder.Controls
|
|||
//mxd. this sets default value
|
||||
public void SetDefaultValue()
|
||||
{
|
||||
typehandler.SetDefaultValue();
|
||||
typehandler.ApplyDefaultValue();
|
||||
combobox.SelectedItem = null;
|
||||
combobox.Text = typehandler.GetStringValue();
|
||||
combobox_Validating(this, new CancelEventArgs());
|
||||
|
|
|
@ -204,15 +204,21 @@ namespace CodeImp.DoomBuilder.Controls
|
|||
{
|
||||
// Update arguments
|
||||
int showaction = 0;
|
||||
ArgumentInfo[] oldarginfo = (arginfo != null ? (ArgumentInfo[])arginfo.Clone() : null); //mxd
|
||||
|
||||
// Only when action type is known
|
||||
if(General.Map.Config.LinedefActions.ContainsKey(action)) showaction = action;
|
||||
|
||||
// Update argument infos
|
||||
if((showaction == 0) && (info != null)) arginfo = info.Args;
|
||||
else arginfo = General.Map.Config.LinedefActions[showaction].Args;
|
||||
|
||||
// Don't update action args when thing type is changed
|
||||
if(info != null && showaction != 0 && this.action == showaction) return;
|
||||
|
||||
//mxd. Don't update action args when old and new argument infos match
|
||||
if(arginfo != null && oldarginfo != null && ArgumentInfosMatch(arginfo, oldarginfo)) return;
|
||||
|
||||
// Change the argument descriptions
|
||||
this.BeginUpdate();
|
||||
|
||||
|
@ -387,6 +393,24 @@ namespace CodeImp.DoomBuilder.Controls
|
|||
}
|
||||
}
|
||||
|
||||
//mxd
|
||||
private static bool ArgumentInfosMatch(ArgumentInfo[] info1, ArgumentInfo[] info2)
|
||||
{
|
||||
if(info1.Length != info2.Length) return false;
|
||||
bool haveusedargs = false; // Arguments should still be reset if all arguments are unused
|
||||
|
||||
for(int i = 0; i < info1.Length; i++)
|
||||
{
|
||||
if(info1[i].Used != info1[2].Used || info1[i].Type != info1[2].Type
|
||||
|| info1[i].Title.ToUpperInvariant() != info2[i].Title.ToUpperInvariant())
|
||||
return false;
|
||||
|
||||
haveusedargs |= (info1[i].Used || info1[2].Used);
|
||||
}
|
||||
|
||||
return haveusedargs;
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region ================== Redraw control
|
||||
|
|
|
@ -61,27 +61,27 @@ namespace CodeImp.DoomBuilder.Controls
|
|||
private string lasteditfieldname;
|
||||
private bool autoinsertuserprefix;
|
||||
private Dictionary<string, UniversalType> uifields;//mxd
|
||||
private bool showfixedfields = true; //mxd
|
||||
private bool showfixedfields = true; //mxd
|
||||
|
||||
#endregion
|
||||
|
||||
#endregion
|
||||
#region ================== Properties
|
||||
|
||||
#region ================== Properties
|
||||
|
||||
public bool AllowInsert { get { return fieldslist.AllowUserToAddRows; } set { fieldslist.AllowUserToAddRows = value; SetupNewRowStyle(); } }
|
||||
public bool AllowInsert { get { return fieldslist.AllowUserToAddRows; } set { fieldslist.AllowUserToAddRows = value; SetupNewRowStyle(); } }
|
||||
public bool AutoInsertUserPrefix { get { return autoinsertuserprefix; } set { autoinsertuserprefix = value; } }
|
||||
public int PropertyColumnWidth { get { return fieldname.Width; } set { fieldname.Width = value; UpdateValueColumn(); UpdateBrowseButton(); } }
|
||||
public int TypeColumnWidth { get { return fieldtype.Width; } set { fieldtype.Width = value; UpdateValueColumn(); UpdateBrowseButton(); } }
|
||||
public bool PropertyColumnVisible { get { return fieldname.Visible; } set { fieldname.Visible = value; UpdateValueColumn(); UpdateBrowseButton(); } }
|
||||
public bool TypeColumnVisible { get { return fieldtype.Visible; } set { fieldtype.Visible = value; UpdateValueColumn(); UpdateBrowseButton(); } }
|
||||
public bool ValueColumnVisible { get { return fieldvalue.Visible; } set { fieldvalue.Visible = value; UpdateValueColumn(); UpdateBrowseButton(); } }
|
||||
public bool ShowFixedFields { get { return showfixedfields; } set { showfixedfields = value; UpdateFixedFieldsVisibility(); } } //mxd
|
||||
public bool ShowFixedFields {get { return showfixedfields; } set { showfixedfields = value; UpdateFixedFieldsVisibility(); } } //mxd
|
||||
|
||||
#endregion
|
||||
#endregion
|
||||
|
||||
#region ================== Constructor
|
||||
#region ================== Constructor
|
||||
|
||||
// Constructor
|
||||
public FieldsEditorControl()
|
||||
// Constructor
|
||||
public FieldsEditorControl()
|
||||
{
|
||||
InitializeComponent();
|
||||
autoinsertuserprefix = true;
|
||||
|
@ -171,6 +171,7 @@ namespace CodeImp.DoomBuilder.Controls
|
|||
|
||||
// Go for all rows
|
||||
bool foundrow = false;
|
||||
bool skiprow = false; //mxd
|
||||
foreach(DataGridViewRow row in fieldslist.Rows)
|
||||
{
|
||||
// Row is a field?
|
||||
|
@ -181,11 +182,18 @@ namespace CodeImp.DoomBuilder.Controls
|
|||
// Row name matches with field
|
||||
if(frow.Name == f.Key)
|
||||
{
|
||||
//mxd. User vars are set separately
|
||||
if(frow.RowType == FieldsEditorRowType.USERVAR)
|
||||
{
|
||||
skiprow = true;
|
||||
break;
|
||||
}
|
||||
|
||||
// First time?
|
||||
if(first)
|
||||
{
|
||||
// Set type when row is not fixed
|
||||
if(!frow.IsFixed) frow.ChangeType(f.Value.Type);
|
||||
if(frow.RowType == FieldsEditorRowType.DYNAMIC) frow.ChangeType(f.Value.Type);
|
||||
|
||||
// Apply value of field to row
|
||||
frow.Define(f.Value.Value);
|
||||
|
@ -207,16 +215,18 @@ namespace CodeImp.DoomBuilder.Controls
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
//mxd. User vars are set separately
|
||||
if(skiprow) continue;
|
||||
|
||||
// Row not found?
|
||||
if(!foundrow)
|
||||
{
|
||||
// Make new row
|
||||
FieldsEditorRow frow = new FieldsEditorRow(fieldslist, f.Key, f.Value.Type, f.Value.Value);
|
||||
FieldsEditorRow frow = new FieldsEditorRow(fieldslist, f.Key, f.Value.Type, f.Value.Value, false);
|
||||
fieldslist.Rows.Insert(fieldslist.Rows.Count - 1, frow);
|
||||
|
||||
// When not the first, clear the field
|
||||
// because the others did not define this one
|
||||
// When not the first, clear the field because the others did not define this one
|
||||
if(!first) frow.Clear();
|
||||
}
|
||||
}
|
||||
|
@ -245,6 +255,82 @@ namespace CodeImp.DoomBuilder.Controls
|
|||
// Sort fields
|
||||
Sort();
|
||||
}
|
||||
|
||||
//mxd
|
||||
public void SetUserVars(Dictionary<string, UniversalType> vars, UniFields fromfields, bool first)
|
||||
{
|
||||
foreach(KeyValuePair<string, UniversalType> group in vars)
|
||||
{
|
||||
// Go for all rows
|
||||
bool foundrow = false;
|
||||
TypeHandler vartype = General.Types.GetFieldHandler((int)group.Value, 0);
|
||||
object value = fromfields.ContainsKey(group.Key) ? fromfields[group.Key].Value : vartype.GetDefaultValue();
|
||||
|
||||
foreach(DataGridViewRow row in fieldslist.Rows)
|
||||
{
|
||||
// Row is a field?
|
||||
if(row is FieldsEditorRow)
|
||||
{
|
||||
FieldsEditorRow frow = row as FieldsEditorRow;
|
||||
|
||||
// Row name matches with user var?
|
||||
if(frow.RowType == FieldsEditorRowType.USERVAR && frow.Name == group.Key)
|
||||
{
|
||||
// First time?
|
||||
if(first)
|
||||
{
|
||||
frow.Define(value);
|
||||
}
|
||||
// Check if the value is different
|
||||
else if(!frow.TypeHandler.GetValue().Equals(value))
|
||||
{
|
||||
// Clear the value in the row
|
||||
frow.Define(value);
|
||||
frow.Clear();
|
||||
}
|
||||
|
||||
// Done
|
||||
foundrow = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Row not found?
|
||||
if(!foundrow)
|
||||
{
|
||||
// Make new row
|
||||
object defaultvalue = vartype.GetDefaultValue();
|
||||
FieldsEditorRow frow = new FieldsEditorRow(fieldslist, group.Key, (int)group.Value, defaultvalue, true);
|
||||
if(!value.Equals(defaultvalue)) frow.Define(value);
|
||||
fieldslist.Rows.Insert(fieldslist.Rows.Count - 1, frow);
|
||||
}
|
||||
}
|
||||
|
||||
// Now check for rows that the givens fields do NOT have
|
||||
foreach(DataGridViewRow row in fieldslist.Rows)
|
||||
{
|
||||
// Row is a field?
|
||||
if(row is FieldsEditorRow)
|
||||
{
|
||||
FieldsEditorRow frow = row as FieldsEditorRow;
|
||||
|
||||
// Don't undefine user var rows defined by other actor types
|
||||
if(frow.RowType != FieldsEditorRowType.USERVAR || !vars.ContainsKey(frow.Name)) continue;
|
||||
|
||||
// Is this row defined previously?
|
||||
if(frow.IsDefined)
|
||||
{
|
||||
// Check if this row can not be found in the fields at all
|
||||
if(!fromfields.ContainsKey(frow.Name))
|
||||
{
|
||||
// It is not defined in these fields, undefine the value
|
||||
frow.Undefine();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// This applies the current fields to a UniFields object
|
||||
public void Apply(UniFields tofields)
|
||||
|
@ -259,6 +345,7 @@ namespace CodeImp.DoomBuilder.Controls
|
|||
|
||||
// Go for all rows
|
||||
bool foundrow = false;
|
||||
bool skiprow = false; //mxd
|
||||
foreach(DataGridViewRow row in fieldslist.Rows)
|
||||
{
|
||||
// Row is a field and matches field name?
|
||||
|
@ -266,6 +353,13 @@ namespace CodeImp.DoomBuilder.Controls
|
|||
{
|
||||
FieldsEditorRow frow = row as FieldsEditorRow;
|
||||
|
||||
//mxd. User vars are stored separately
|
||||
if(frow.RowType == FieldsEditorRowType.USERVAR)
|
||||
{
|
||||
skiprow = true;
|
||||
break;
|
||||
}
|
||||
|
||||
// Field is defined?
|
||||
if(frow.IsDefined)
|
||||
{
|
||||
|
@ -275,6 +369,9 @@ namespace CodeImp.DoomBuilder.Controls
|
|||
}
|
||||
}
|
||||
|
||||
//mxd. User vars are stored separately
|
||||
if(skiprow) continue;
|
||||
|
||||
// No such row?
|
||||
if(!foundrow)
|
||||
{
|
||||
|
@ -292,7 +389,7 @@ namespace CodeImp.DoomBuilder.Controls
|
|||
FieldsEditorRow frow = row as FieldsEditorRow;
|
||||
|
||||
// Field is defined and not empty?
|
||||
if(frow.IsDefined && !frow.IsEmpty)
|
||||
if(frow.RowType != FieldsEditorRowType.USERVAR && frow.IsDefined && !frow.IsEmpty)
|
||||
{
|
||||
// Apply field
|
||||
object oldvalue = null;
|
||||
|
@ -300,7 +397,7 @@ namespace CodeImp.DoomBuilder.Controls
|
|||
tofields[frow.Name] = new UniValue(frow.TypeHandler.Index, frow.GetResult(oldvalue));
|
||||
|
||||
// Custom row?
|
||||
if(!frow.IsFixed)
|
||||
if(frow.RowType == FieldsEditorRowType.DYNAMIC)
|
||||
{
|
||||
// Write type to map configuration
|
||||
General.Map.Options.SetUniversalFieldType(elementname, frow.Name, frow.TypeHandler.Index);
|
||||
|
@ -310,6 +407,38 @@ namespace CodeImp.DoomBuilder.Controls
|
|||
}
|
||||
}
|
||||
|
||||
//mxd
|
||||
public void ApplyUserVars(Dictionary<string, UniversalType> vars, UniFields tofields)
|
||||
{
|
||||
// Apply user variables when target map element contains user var definition and the value is not default
|
||||
foreach(DataGridViewRow row in fieldslist.Rows)
|
||||
{
|
||||
// Row is a field?
|
||||
if(row is FieldsEditorRow)
|
||||
{
|
||||
FieldsEditorRow frow = row as FieldsEditorRow;
|
||||
if(frow.RowType != FieldsEditorRowType.USERVAR || !vars.ContainsKey(frow.Name)) continue;
|
||||
|
||||
object oldvalue = (tofields.ContainsKey(frow.Name) ? tofields[frow.Name].Value : null);
|
||||
object newvalue = frow.GetResult(oldvalue);
|
||||
|
||||
// Skip field when mixed values
|
||||
if(newvalue == null) continue;
|
||||
|
||||
// Remove field
|
||||
if(newvalue.Equals(frow.TypeHandler.GetDefaultValue()))
|
||||
{
|
||||
if(tofields.ContainsKey(frow.Name)) tofields.Remove(frow.Name);
|
||||
}
|
||||
// Add field
|
||||
else if(!newvalue.Equals(oldvalue))
|
||||
{
|
||||
tofields[frow.Name] = new UniValue(frow.TypeHandler.Index, newvalue);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region ================== Events
|
||||
|
@ -377,16 +506,16 @@ namespace CodeImp.DoomBuilder.Controls
|
|||
// First column?
|
||||
if(e.ColumnIndex == 0)
|
||||
{
|
||||
// Not a fixed field?
|
||||
if((frow != null) && !frow.IsFixed)
|
||||
// Dynamic field?
|
||||
if((frow != null) && frow.RowType == FieldsEditorRowType.DYNAMIC)
|
||||
{
|
||||
lasteditfieldname = frow.Name;
|
||||
fieldslist.CurrentCell = fieldslist.SelectedRows[0].Cells[0];
|
||||
fieldslist.CurrentCell.ReadOnly = false;
|
||||
|
||||
if((e.RowIndex == fieldslist.NewRowIndex) ||
|
||||
frow.Name.StartsWith(FIELD_PREFIX_SUGGESTION, StringComparison.OrdinalIgnoreCase))
|
||||
fieldslist.BeginEdit(false);
|
||||
if((e.RowIndex == fieldslist.NewRowIndex) ||
|
||||
frow.Name.StartsWith(FIELD_PREFIX_SUGGESTION, StringComparison.OrdinalIgnoreCase))
|
||||
fieldslist.BeginEdit(false);
|
||||
else
|
||||
fieldslist.BeginEdit(true);
|
||||
}
|
||||
|
@ -399,21 +528,20 @@ namespace CodeImp.DoomBuilder.Controls
|
|||
{
|
||||
// Get the row
|
||||
FieldsEditorRow row = e.Row as FieldsEditorRow;
|
||||
if(row == null) return;
|
||||
|
||||
// Fixed field?
|
||||
if(row.IsFixed)
|
||||
// Fixed/uservar field?
|
||||
if(row.RowType == FieldsEditorRowType.FIXED || row.RowType == FieldsEditorRowType.USERVAR)
|
||||
{
|
||||
// Just undefine the field
|
||||
row.Undefine();
|
||||
e.Cancel = true;
|
||||
|
||||
if(OnFieldUndefined != null)
|
||||
OnFieldUndefined(row.Name);
|
||||
if(OnFieldUndefined != null) OnFieldUndefined(row.Name);
|
||||
}
|
||||
else
|
||||
{
|
||||
if(OnFieldDeleted != null)
|
||||
OnFieldDeleted(row.Name);
|
||||
if(OnFieldDeleted != null) OnFieldDeleted(row.Name);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -428,10 +556,7 @@ namespace CodeImp.DoomBuilder.Controls
|
|||
{
|
||||
// Remove all text
|
||||
fieldslist.Rows[e.RowIndex].Cells[0].Style.ForeColor = SystemColors.WindowText;
|
||||
if(autoinsertuserprefix)
|
||||
fieldslist.Rows[e.RowIndex].Cells[0].Value = FIELD_PREFIX_SUGGESTION;
|
||||
else
|
||||
fieldslist.Rows[e.RowIndex].Cells[0].Value = "";
|
||||
fieldslist.Rows[e.RowIndex].Cells[0].Value = (autoinsertuserprefix ? FIELD_PREFIX_SUGGESTION : string.Empty);
|
||||
}
|
||||
}
|
||||
// Value cell?
|
||||
|
@ -470,13 +595,13 @@ namespace CodeImp.DoomBuilder.Controls
|
|||
// Select the value of this field (for DropDownList style combo)
|
||||
foreach(EnumItem i in enumscombo.Items)
|
||||
{
|
||||
// Matches?
|
||||
if (string.Compare(i.Title, frow.TypeHandler.GetStringValue(), StringComparison.OrdinalIgnoreCase) == 0)
|
||||
{
|
||||
// Matches?
|
||||
if(string.Compare(i.Title, frow.TypeHandler.GetStringValue(), StringComparison.OrdinalIgnoreCase) == 0)
|
||||
{
|
||||
// Select this item
|
||||
enumscombo.SelectedItem = i;
|
||||
break; //mxd
|
||||
}
|
||||
break; //mxd
|
||||
}
|
||||
}
|
||||
|
||||
// Put the display text in the text (for DropDown style combo)
|
||||
|
@ -538,12 +663,11 @@ namespace CodeImp.DoomBuilder.Controls
|
|||
int type = General.Map.Options.GetUniversalFieldType(elementname, validname, 0);
|
||||
|
||||
// Make new row
|
||||
frow = new FieldsEditorRow(fieldslist, validname, type, null);
|
||||
frow = new FieldsEditorRow(fieldslist, validname, type, null, false);
|
||||
frow.Visible = false;
|
||||
fieldslist.Rows.Insert(e.RowIndex + 1, frow);
|
||||
|
||||
if(OnFieldInserted != null)
|
||||
OnFieldInserted(validname);
|
||||
if(OnFieldInserted != null) OnFieldInserted(validname);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -587,11 +711,8 @@ namespace CodeImp.DoomBuilder.Controls
|
|||
row.Cells[0].Value = validname;
|
||||
if(type != -1) frow.ChangeType(type);
|
||||
|
||||
if(OnFieldNameChanged != null)
|
||||
OnFieldNameChanged(lasteditfieldname, validname);
|
||||
|
||||
if(OnFieldTypeChanged != null)
|
||||
OnFieldTypeChanged(validname);
|
||||
if(OnFieldNameChanged != null) OnFieldNameChanged(lasteditfieldname, validname);
|
||||
if(OnFieldTypeChanged != null) OnFieldTypeChanged(validname);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -615,8 +736,7 @@ namespace CodeImp.DoomBuilder.Controls
|
|||
// Changing field type?
|
||||
if((e.ColumnIndex == 1) && (frow != null))
|
||||
{
|
||||
if(OnFieldTypeChanged != null)
|
||||
OnFieldTypeChanged(frow.Name);
|
||||
if(OnFieldTypeChanged != null) OnFieldTypeChanged(frow.Name);
|
||||
}
|
||||
// Changing field value?
|
||||
if((e.ColumnIndex == 2) && (frow != null))
|
||||
|
@ -641,18 +761,18 @@ namespace CodeImp.DoomBuilder.Controls
|
|||
// Delete all rows that must be deleted
|
||||
for(int i = fieldslist.Rows.Count - 1; i >= 0; i--)
|
||||
{
|
||||
if (fieldslist.Rows[i].ReadOnly)
|
||||
{
|
||||
try { fieldslist.Rows.RemoveAt(i); } catch { }
|
||||
}
|
||||
else
|
||||
{
|
||||
//mxd. Preserve fixed fields visibility setting
|
||||
FieldsEditorRow frow = (fieldslist.Rows[i] as FieldsEditorRow);
|
||||
if (frow != null && frow.IsFixed) frow.Visible = showfixedfields;
|
||||
else fieldslist.Rows[i].Visible = true;
|
||||
}
|
||||
}
|
||||
if(fieldslist.Rows[i].ReadOnly)
|
||||
{
|
||||
try { fieldslist.Rows.RemoveAt(i); } catch { }
|
||||
}
|
||||
else
|
||||
{
|
||||
//mxd. Preserve fixed fields visibility setting
|
||||
FieldsEditorRow frow = (fieldslist.Rows[i] as FieldsEditorRow);
|
||||
if(frow != null && frow.RowType == FieldsEditorRowType.FIXED) frow.Visible = showfixedfields;
|
||||
else fieldslist.Rows[i].Visible = true;
|
||||
}
|
||||
}
|
||||
|
||||
// Update new row
|
||||
SetupNewRowStyle();
|
||||
|
@ -730,17 +850,17 @@ namespace CodeImp.DoomBuilder.Controls
|
|||
private void ApplyValue(FieldsEditorRow frow, object value)
|
||||
{
|
||||
// Defined?
|
||||
if((value != null) && (!frow.IsFixed || !frow.Info.Default.Equals(value)))
|
||||
if((value != null) && (frow.RowType == FieldsEditorRowType.DYNAMIC || frow.RowType == FieldsEditorRowType.USERVAR
|
||||
|| !frow.Info.Default.Equals(value)))
|
||||
{
|
||||
frow.Define(value);
|
||||
}
|
||||
else if(frow.IsFixed)
|
||||
else if(frow.RowType == FieldsEditorRowType.FIXED)
|
||||
{
|
||||
frow.Undefine();
|
||||
}
|
||||
|
||||
if(OnFieldValueChanged != null)
|
||||
OnFieldValueChanged(frow.Name);
|
||||
if(OnFieldValueChanged != null) OnFieldValueChanged(frow.Name);
|
||||
}
|
||||
|
||||
// This applies the contents of the enums combobox and hides (if opened)
|
||||
|
@ -841,16 +961,16 @@ namespace CodeImp.DoomBuilder.Controls
|
|||
}
|
||||
}
|
||||
|
||||
//mxd
|
||||
private void UpdateFixedFieldsVisibility()
|
||||
{
|
||||
foreach (var row in fieldslist.Rows)
|
||||
{
|
||||
FieldsEditorRow frow = (row as FieldsEditorRow);
|
||||
if (frow != null && frow.IsFixed) frow.Visible = showfixedfields;
|
||||
}
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
//mxd
|
||||
private void UpdateFixedFieldsVisibility()
|
||||
{
|
||||
foreach(var row in fieldslist.Rows)
|
||||
{
|
||||
FieldsEditorRow frow = (row as FieldsEditorRow);
|
||||
if(frow != null && frow.RowType == FieldsEditorRowType.FIXED) frow.Visible = showfixedfields;
|
||||
}
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
|
|
|
@ -26,6 +26,23 @@ using CodeImp.DoomBuilder.Types;
|
|||
|
||||
namespace CodeImp.DoomBuilder.Controls
|
||||
{
|
||||
internal enum FieldsEditorRowType //mxd
|
||||
{
|
||||
// This is a fixed field defined in the game configuration
|
||||
// The field cannot be deleted (delete will result in a reset)
|
||||
// and cannot change type.
|
||||
FIXED,
|
||||
|
||||
// This is an abstartct variable field enetered by user
|
||||
// The field can be deleted and can change type.
|
||||
DYNAMIC,
|
||||
|
||||
// This is a user variable field defined in actor's DECORATE
|
||||
// The field cannot be deleted (delete will result in a reset)
|
||||
// but can change type.
|
||||
USERVAR,
|
||||
}
|
||||
|
||||
internal class FieldsEditorRow : DataGridViewRow
|
||||
{
|
||||
#region ================== Constants
|
||||
|
@ -34,13 +51,11 @@ namespace CodeImp.DoomBuilder.Controls
|
|||
|
||||
#region ================== Variables
|
||||
|
||||
// This is true when for a fixed field as defined in the game configuration
|
||||
// This means that the field cannot be deleted (delete will result in a reset)
|
||||
// and cannot change type.
|
||||
private bool isfixed;
|
||||
//mxd. Row type
|
||||
private readonly FieldsEditorRowType rowtype;
|
||||
|
||||
// Field information (only for fixed fields)
|
||||
private UniversalFieldInfo fieldinfo;
|
||||
private readonly UniversalFieldInfo fieldinfo;
|
||||
|
||||
// This is true when the field is defined. Cannot be false when this field
|
||||
// is not fixed, because non-fixed fields are deleted from the list when undefined.
|
||||
|
@ -53,7 +68,7 @@ namespace CodeImp.DoomBuilder.Controls
|
|||
|
||||
#region ================== Properties
|
||||
|
||||
public bool IsFixed { get { return isfixed; } }
|
||||
public FieldsEditorRowType RowType { get { return rowtype; } } //mxd
|
||||
public bool IsDefined { get { return isdefined; } }
|
||||
public bool IsEmpty { get { return (this.Cells[2].Value == null) || (this.Cells[2].Value.ToString().Length == 0); } }
|
||||
public string Name { get { return this.Cells[0].Value.ToString(); } }
|
||||
|
@ -73,7 +88,7 @@ namespace CodeImp.DoomBuilder.Controls
|
|||
|
||||
// Fixed
|
||||
this.fieldinfo = fixedfield;
|
||||
isfixed = true;
|
||||
this.rowtype = FieldsEditorRowType.FIXED; //mxd
|
||||
|
||||
// Type
|
||||
this.fieldtype = General.Types.GetFieldHandler(fixedfield);
|
||||
|
@ -97,31 +112,54 @@ namespace CodeImp.DoomBuilder.Controls
|
|||
}
|
||||
|
||||
// Constructor for a non-fixed, defined field
|
||||
public FieldsEditorRow(DataGridView view, string name, int type, object value)
|
||||
//mxd. Also for a user variable field.
|
||||
public FieldsEditorRow(DataGridView view, string name, int type, object value, bool isuservar)
|
||||
{
|
||||
// Defined
|
||||
this.DefaultCellStyle.ForeColor = SystemColors.WindowText;
|
||||
isdefined = true;
|
||||
|
||||
// Non-fixed
|
||||
isfixed = false;
|
||||
//mxd. Row type
|
||||
this.rowtype = (isuservar ? FieldsEditorRowType.USERVAR : FieldsEditorRowType.DYNAMIC);
|
||||
|
||||
// Type
|
||||
this.fieldtype = General.Types.GetFieldHandler(type, value);
|
||||
|
||||
// Make all cells
|
||||
base.CreateCells(view);
|
||||
|
||||
// Setup property cell
|
||||
this.Cells[0].Value = name;
|
||||
this.Cells[0].ReadOnly = true;
|
||||
|
||||
// Setup type cell
|
||||
this.Cells[1].Value = fieldtype.GetDisplayType();
|
||||
this.Cells[1].ReadOnly = false;
|
||||
//mxd. Our path splits here...
|
||||
if(isuservar)
|
||||
{
|
||||
// Not defined
|
||||
this.DefaultCellStyle.ForeColor = SystemColors.GrayText;
|
||||
isdefined = false;
|
||||
fieldtype.ApplyDefaultValue();
|
||||
|
||||
// Setup value cell
|
||||
this.Cells[2].Value = fieldtype.GetStringValue();
|
||||
// Setup property cell
|
||||
this.Cells[0].Value = name;
|
||||
this.Cells[0].ReadOnly = true;
|
||||
|
||||
// Setup type cell
|
||||
this.Cells[1].Value = fieldtype.GetDisplayType();
|
||||
this.Cells[1].ReadOnly = true;
|
||||
|
||||
// Setup value cell
|
||||
this.Cells[2].Value = fieldtype.GetStringValue();
|
||||
}
|
||||
else
|
||||
{
|
||||
// Defined
|
||||
this.DefaultCellStyle.ForeColor = SystemColors.WindowText;
|
||||
isdefined = true;
|
||||
|
||||
// Setup property cell
|
||||
this.Cells[0].Value = name;
|
||||
this.Cells[0].ReadOnly = true;
|
||||
|
||||
// Setup type cell
|
||||
this.Cells[1].Value = fieldtype.GetDisplayType();
|
||||
this.Cells[1].ReadOnly = false;
|
||||
|
||||
// Setup value cell
|
||||
this.Cells[2].Value = fieldtype.GetStringValue();
|
||||
}
|
||||
|
||||
// We have no destructor
|
||||
GC.SuppressFinalize(this);
|
||||
|
@ -140,7 +178,7 @@ namespace CodeImp.DoomBuilder.Controls
|
|||
fieldtype.Browse(parent);
|
||||
|
||||
// This is a fixed field?
|
||||
if(isfixed)
|
||||
if(rowtype == FieldsEditorRowType.FIXED)
|
||||
{
|
||||
// Does this match the default setting?
|
||||
if(fieldtype.GetValue().Equals(fieldinfo.Default))
|
||||
|
@ -188,7 +226,7 @@ namespace CodeImp.DoomBuilder.Controls
|
|||
this.Cells[2].Value = fieldtype.GetStringValue();
|
||||
|
||||
// This is a fixed field?
|
||||
if(isfixed)
|
||||
if(rowtype == FieldsEditorRowType.FIXED)
|
||||
{
|
||||
// Does this match the default setting?
|
||||
if(fieldtype.GetValue().Equals(fieldinfo.Default))
|
||||
|
@ -201,15 +239,19 @@ namespace CodeImp.DoomBuilder.Controls
|
|||
}
|
||||
|
||||
// This undefines the field
|
||||
// ONLY VALID FOR FIXED FIELDS
|
||||
// ONLY VALID FOR FIXED AND USERVAR FIELDS
|
||||
// You should just delete non-fixed fields
|
||||
public void Undefine()
|
||||
{
|
||||
// Must be fixed!
|
||||
if(!isfixed) throw new InvalidOperationException();
|
||||
if(rowtype != FieldsEditorRowType.FIXED && rowtype != FieldsEditorRowType.USERVAR) throw new InvalidOperationException();
|
||||
|
||||
// Now undefined
|
||||
fieldtype.SetValue(fieldinfo.Default);
|
||||
if(rowtype == FieldsEditorRowType.USERVAR)
|
||||
fieldtype.ApplyDefaultValue();
|
||||
else
|
||||
fieldtype.SetValue(fieldinfo.Default);
|
||||
|
||||
this.Cells[2].Value = fieldtype.GetStringValue();
|
||||
this.DefaultCellStyle.ForeColor = SystemColors.GrayText;
|
||||
isdefined = false;
|
||||
|
@ -218,10 +260,13 @@ namespace CodeImp.DoomBuilder.Controls
|
|||
// This defines the field
|
||||
public void Define(object value)
|
||||
{
|
||||
//mxd. Don't count as defined when default value is passed
|
||||
if(value.ToString() == fieldtype.GetDefaultValue().ToString()) return;
|
||||
|
||||
// Now defined
|
||||
fieldtype.SetValue(value);
|
||||
this.Cells[2].Value = fieldtype.GetStringValue();
|
||||
this.DefaultCellStyle.ForeColor = SystemColors.WindowText;
|
||||
this.DefaultCellStyle.ForeColor = (rowtype == FieldsEditorRowType.USERVAR ? SystemColors.HotTrack : SystemColors.WindowText);
|
||||
isdefined = true;
|
||||
}
|
||||
|
||||
|
@ -229,13 +274,12 @@ namespace CodeImp.DoomBuilder.Controls
|
|||
public void ChangeType(int typeindex)
|
||||
{
|
||||
// Can't do this for a fixed field!
|
||||
if(isfixed) throw new InvalidOperationException();
|
||||
if(rowtype == FieldsEditorRowType.FIXED) throw new InvalidOperationException();
|
||||
|
||||
// Different?
|
||||
if(typeindex != fieldtype.Index)
|
||||
{
|
||||
// Change field type!
|
||||
//TypeHandlerAttribute attrib = General.Types.GetAttribute(typeindex); //mxd
|
||||
fieldtype = General.Types.GetFieldHandler(typeindex, this.Cells[2].Value);
|
||||
this.Cells[1].Value = fieldtype.GetDisplayType();
|
||||
}
|
||||
|
|
|
@ -67,7 +67,7 @@ namespace CodeImp.DoomBuilder.Controls
|
|||
if(usepreviews ? !texture.IsPreviewLoaded : !texture.IsImageLoaded) timer.Start(); //mxd
|
||||
|
||||
// Set the image
|
||||
return (usepreviews ? texture.GetPreview() : texture.GetBitmap());
|
||||
return new Bitmap(usepreviews ? texture.GetPreview() : texture.GetBitmap());
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -116,6 +116,7 @@ namespace CodeImp.DoomBuilder.Controls
|
|||
this.list.DoubleClick += new System.EventHandler(this.list_DoubleClick);
|
||||
this.list.ItemSelectionChanged += new System.Windows.Forms.ListViewItemSelectionChangedEventHandler(this.list_ItemSelectionChanged);
|
||||
this.list.KeyPress += new System.Windows.Forms.KeyPressEventHandler(this.list_KeyPress);
|
||||
this.list.KeyDown += new System.Windows.Forms.KeyEventHandler(this.list_KeyDown);
|
||||
//
|
||||
// showsubdirtextures
|
||||
//
|
||||
|
|
|
@ -237,6 +237,20 @@ namespace CodeImp.DoomBuilder.Controls
|
|||
}
|
||||
}
|
||||
|
||||
//mxd. Handle keyboard navigation the same way regardless of list being focused...
|
||||
private void list_KeyDown(object sender, KeyEventArgs e)
|
||||
{
|
||||
// Check what key is pressed
|
||||
switch(e.KeyData)
|
||||
{
|
||||
// Cursor keys
|
||||
case Keys.Left: SelectNextItem(SearchDirectionHint.Left); e.SuppressKeyPress = true; break;
|
||||
case Keys.Right: SelectNextItem(SearchDirectionHint.Right); e.SuppressKeyPress = true; break;
|
||||
case Keys.Up: SelectNextItem(SearchDirectionHint.Up); e.SuppressKeyPress = true; break;
|
||||
case Keys.Down: SelectNextItem(SearchDirectionHint.Down); e.SuppressKeyPress = true; break;
|
||||
}
|
||||
}
|
||||
|
||||
//mxd
|
||||
private void filterSize_WhenTextChanged(object sender, EventArgs e)
|
||||
{
|
||||
|
@ -277,6 +291,8 @@ namespace CodeImp.DoomBuilder.Controls
|
|||
//mxd. Transfer focus to Filter textbox
|
||||
private void list_KeyPress(object sender, KeyPressEventArgs e)
|
||||
{
|
||||
if(!General.Settings.KeepTextureFilterFocused) return;
|
||||
|
||||
objectname.Focus();
|
||||
if(e.KeyChar == '\b') // Any better way to check for Backspace?..
|
||||
{
|
||||
|
@ -388,36 +404,115 @@ namespace CodeImp.DoomBuilder.Controls
|
|||
}
|
||||
else
|
||||
{
|
||||
// Get selected item
|
||||
ListViewItem lvi = list.SelectedItems[0];
|
||||
Rectangle lvirect = list.GetItemRect(lvi.Index, ItemBoundsPortion.Entire);
|
||||
Point spos = new Point(lvirect.Location.X + lvirect.Width / 2, lvirect.Y + lvirect.Height / 2);
|
||||
//mxd
|
||||
int index = list.SelectedItems[0].Index;
|
||||
int targetindex = -1;
|
||||
ListViewGroup startgroup = list.SelectedItems[0].Group;
|
||||
Rectangle startrect = list.SelectedItems[0].GetBounds(ItemBoundsPortion.Entire);
|
||||
|
||||
// Try finding 5 times in the given direction
|
||||
for(int i = 0; i < 5; i++)
|
||||
switch(dir)
|
||||
{
|
||||
// Move point in given direction
|
||||
switch(dir)
|
||||
{
|
||||
case SearchDirectionHint.Left: spos.X -= list.TileSize.Width / 2; break;
|
||||
case SearchDirectionHint.Right: spos.X += list.TileSize.Width / 2; break;
|
||||
case SearchDirectionHint.Up: spos.Y -= list.TileSize.Height / 2; break;
|
||||
case SearchDirectionHint.Down: spos.Y += list.TileSize.Height / 2; break;
|
||||
}
|
||||
|
||||
// Test position
|
||||
lvi = list.GetItemAt(spos.X, spos.Y);
|
||||
if(lvi != null)
|
||||
{
|
||||
// Select item
|
||||
list.SelectedItems.Clear();
|
||||
lvi.Selected = true;
|
||||
// Check previous items untill groups match...
|
||||
case SearchDirectionHint.Left:
|
||||
if(list.SelectedIndices[0] > 0)
|
||||
{
|
||||
while(--index > -1)
|
||||
{
|
||||
if(list.Items[index].Group == startgroup)
|
||||
{
|
||||
targetindex = index;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
// Same thing, other direction...
|
||||
case SearchDirectionHint.Right:
|
||||
if(list.SelectedIndices[0] < list.Items.Count - 1)
|
||||
{
|
||||
while(++index < list.Items.Count)
|
||||
{
|
||||
if(list.Items[index].Group == startgroup)
|
||||
{
|
||||
targetindex = index;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
// Check previous items untill X coordinate match and Y coordinate is less than the start ones...
|
||||
case SearchDirectionHint.Up:
|
||||
while(--index > -1)
|
||||
{
|
||||
ListViewItem item = list.Items[index];
|
||||
if(item != null && item.Group == startgroup)
|
||||
{
|
||||
Rectangle rect = item.GetBounds(ItemBoundsPortion.Entire);
|
||||
if(rect.X == startrect.X && rect.Y < startrect.Y)
|
||||
{
|
||||
targetindex = index;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
// Same thing, other direction...
|
||||
case SearchDirectionHint.Down:
|
||||
if(list.SelectedIndices[0] < list.Items.Count - 1)
|
||||
{
|
||||
while(++index < list.Items.Count)
|
||||
{
|
||||
ListViewItem item = list.Items[index];
|
||||
if(item != null && item.Group == startgroup)
|
||||
{
|
||||
Rectangle rect = item.GetBounds(ItemBoundsPortion.Entire);
|
||||
if(rect.X == startrect.X && rect.Y > startrect.Y)
|
||||
{
|
||||
targetindex = index;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
//mxd. Use the old method for Up/Down keys, becaue it can jump between Groups...
|
||||
if(targetindex == -1 && (dir == SearchDirectionHint.Up || dir == SearchDirectionHint.Down))
|
||||
{
|
||||
Point spos = new Point(startrect.Location.X + startrect.Width / 2, startrect.Y + startrect.Height / 2);
|
||||
|
||||
// Try finding 5 times in the given direction
|
||||
for(int i = 0; i < 5; i++)
|
||||
{
|
||||
// Move point in given direction
|
||||
switch(dir)
|
||||
{
|
||||
case SearchDirectionHint.Up: spos.Y -= list.TileSize.Height / 2; break;
|
||||
case SearchDirectionHint.Down: spos.Y += list.TileSize.Height / 2; break;
|
||||
}
|
||||
|
||||
// Test position
|
||||
ListViewItem lvi = list.GetItemAt(spos.X, spos.Y);
|
||||
if(lvi != null)
|
||||
{
|
||||
targetindex = lvi.Index;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Make selection visible
|
||||
if(list.SelectedItems.Count > 0) list.SelectedItems[0].EnsureVisible();
|
||||
|
||||
//mxd. Found something?..
|
||||
if(targetindex != -1)
|
||||
{
|
||||
// Select item
|
||||
list.SelectedItems.Clear();
|
||||
list.Items[targetindex].Selected = true;
|
||||
list.SelectedItems[0].EnsureVisible();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -514,6 +609,15 @@ namespace CodeImp.DoomBuilder.Controls
|
|||
private void RefillList(bool selectfirst)
|
||||
{
|
||||
visibleitems = new List<ImageBrowserItem>();
|
||||
|
||||
//mxd. Store info about currently selected item
|
||||
string selectedname = string.Empty;
|
||||
ListViewGroup selecteditemgroup = null;
|
||||
if(!selectfirst && keepselected == -1 && list.SelectedIndices.Count > 0)
|
||||
{
|
||||
selectedname = list.Items[list.SelectedIndices[0]].Text;
|
||||
selecteditemgroup = list.Items[list.SelectedIndices[0]].Group;
|
||||
}
|
||||
|
||||
// Begin updating list
|
||||
updating = true;
|
||||
|
@ -569,6 +673,56 @@ namespace CodeImp.DoomBuilder.Controls
|
|||
{
|
||||
SelectFirstItem();
|
||||
}
|
||||
//mxd. Try reselecting the same/next closest item
|
||||
else if(selecteditemgroup != null && !string.IsNullOrEmpty(selectedname))
|
||||
{
|
||||
ListViewItem bestmatch = null;
|
||||
int charsmatched = 1;
|
||||
foreach(ListViewItem item in list.Items)
|
||||
{
|
||||
if(item.Group == selecteditemgroup && item.Text[0] == selectedname[0])
|
||||
{
|
||||
if(item.Text == selectedname)
|
||||
{
|
||||
bestmatch = item;
|
||||
break;
|
||||
}
|
||||
|
||||
for(int i = 1; i < Math.Min(item.Text.Length, selectedname.Length); i++)
|
||||
{
|
||||
if(item.Text[i] != selectedname[i])
|
||||
{
|
||||
if(i > charsmatched)
|
||||
{
|
||||
bestmatch = item;
|
||||
charsmatched = i;
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Select the first item from the same group...
|
||||
if(bestmatch == null)
|
||||
{
|
||||
foreach(ListViewItem item in list.Items)
|
||||
{
|
||||
if(item.Group == selecteditemgroup)
|
||||
{
|
||||
bestmatch = item;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Select found item
|
||||
if(bestmatch != null)
|
||||
{
|
||||
bestmatch.Selected = true;
|
||||
bestmatch.EnsureVisible();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Raise event
|
||||
|
@ -605,7 +759,10 @@ namespace CodeImp.DoomBuilder.Controls
|
|||
// This sends the focus to the textbox
|
||||
public void FocusTextbox()
|
||||
{
|
||||
objectname.Focus();
|
||||
if(General.Settings.KeepTextureFilterFocused) //mxd
|
||||
objectname.Focus();
|
||||
else
|
||||
list.Focus();
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
|
File diff suppressed because it is too large
Load diff
|
@ -61,15 +61,15 @@ namespace CodeImp.DoomBuilder.Controls
|
|||
if(config.Extensions.Length > 0) ext = "." + config.Extensions[0];
|
||||
SetTitle("Untitled" + ext);
|
||||
editor.ClearUndoRedo();
|
||||
editor.FunctionBar.Enabled = (config.ScriptType != ScriptType.UNKNOWN); //mxd
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region ================== Methods
|
||||
|
||||
// This compiles the script file
|
||||
public override void Compile()
|
||||
editor.FunctionBar.Enabled = (config.ScriptType != ScriptType.UNKNOWN); //mxd
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region ================== Methods
|
||||
|
||||
// This compiles the script file
|
||||
public override void Compile()
|
||||
{
|
||||
//mxd. ACS requires special handling...
|
||||
if(config.ScriptType == ScriptType.ACS)
|
||||
|
@ -126,8 +126,8 @@ namespace CodeImp.DoomBuilder.Controls
|
|||
// Dispose compiler
|
||||
compiler.Dispose();
|
||||
|
||||
//mxd. Update script navigator
|
||||
UpdateNavigator();
|
||||
//mxd. Update script navigator
|
||||
UpdateNavigator();
|
||||
|
||||
// Feed errors to panel
|
||||
panel.ShowErrors(errors);
|
||||
|
@ -147,7 +147,7 @@ namespace CodeImp.DoomBuilder.Controls
|
|||
// Boilderplate
|
||||
if(!General.CompiledScriptConfigs.ContainsKey(General.Map.Options.ScriptCompiler))
|
||||
{
|
||||
General.ShowErrorMessage("Unable to compile '" + inputfile + "'. Unable to find required script compiler configuration ('" + General.Map.Options.ScriptCompiler + "').", MessageBoxButtons.OK);
|
||||
General.ShowErrorMessage("Unable to compile \"" + inputfile + "\". Unable to find required script compiler configuration (\"" + General.Map.Options.ScriptCompiler + "\").", MessageBoxButtons.OK);
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -232,7 +232,7 @@ namespace CodeImp.DoomBuilder.Controls
|
|||
{
|
||||
// Fail
|
||||
compiler.Dispose();
|
||||
errors.Add(new CompilerError("Output file '" + outputfile + "' doesn't exist."));
|
||||
errors.Add(new CompilerError("Output file \"" + outputfile + "\" doesn't exist."));
|
||||
panel.ShowErrors(errors);
|
||||
return;
|
||||
}
|
||||
|
@ -247,7 +247,7 @@ namespace CodeImp.DoomBuilder.Controls
|
|||
{
|
||||
// Fail
|
||||
compiler.Dispose();
|
||||
errors.Add(new CompilerError("Unable to create library file '" + targetfilename + "'. " + e.GetType().Name + ": " + e.Message));
|
||||
errors.Add(new CompilerError("Unable to create library file \"" + targetfilename + "\". " + e.GetType().Name + ": " + e.Message));
|
||||
panel.ShowErrors(errors);
|
||||
return;
|
||||
}
|
||||
|
@ -257,8 +257,8 @@ namespace CodeImp.DoomBuilder.Controls
|
|||
// Dispose compiler
|
||||
compiler.Dispose();
|
||||
|
||||
// Update script navigator
|
||||
UpdateNavigator();
|
||||
// Update script navigator
|
||||
UpdateNavigator();
|
||||
|
||||
// Feed errors to panel
|
||||
panel.ShowErrors(errors);
|
||||
|
@ -282,16 +282,16 @@ namespace CodeImp.DoomBuilder.Controls
|
|||
catch(Exception e)
|
||||
{
|
||||
// Failed
|
||||
General.ErrorLogger.Add(ErrorType.Error, "Cannot open file '" + filepathname + "' for writing. Make sure the path exists and that the file is not in use by another application.");
|
||||
General.ErrorLogger.Add(ErrorType.Error, "Cannot open file \"" + filepathname + "\" for writing. Make sure the path exists and that the file is not in use by another application.");
|
||||
General.WriteLogLine(e.GetType().Name + ": " + e.Message);
|
||||
General.ShowErrorMessage("Unable to open file \"" + filepathname + "\" for writing. Make sure the path exists and that the file is not in use by another application.", MessageBoxButtons.OK);
|
||||
return false;
|
||||
}
|
||||
|
||||
// Done
|
||||
editor.SetSavePoint(); //mxd
|
||||
UpdateTitle(); //mxd
|
||||
return true;
|
||||
|
||||
// Done
|
||||
editor.SetSavePoint(); //mxd
|
||||
UpdateTitle(); //mxd
|
||||
return true;
|
||||
}
|
||||
|
||||
// This saves the document to a new file
|
||||
|
@ -317,14 +317,13 @@ namespace CodeImp.DoomBuilder.Controls
|
|||
{
|
||||
try
|
||||
{
|
||||
// Read the file
|
||||
editor.Text = File.ReadAllText(filepathname); //mxd
|
||||
}
|
||||
|
||||
catch (Exception e)
|
||||
// Read the file
|
||||
editor.Text = File.ReadAllText(filepathname); //mxd
|
||||
}
|
||||
catch(Exception e)
|
||||
{
|
||||
// Failed
|
||||
General.ErrorLogger.Add(ErrorType.Error, "Cannot open file '" + filepathname + "' for reading. Make sure the path exists and that the file is not in use by another application.");
|
||||
General.ErrorLogger.Add(ErrorType.Error, "Cannot open file \"" + filepathname + "\" for reading. Make sure the path exists and that the file is not in use by another application.");
|
||||
General.WriteLogLine(e.GetType().Name + ": " + e.Message);
|
||||
General.ShowErrorMessage("Unable to open file \"" + filepathname + "\" for reading. Make sure the path exists and that the file is not in use by another application.", MessageBoxButtons.OK);
|
||||
return false;
|
||||
|
|
22
Source/Core/Controls/StatisticsControl.Designer.cs
generated
22
Source/Core/Controls/StatisticsControl.Designer.cs
generated
|
@ -45,7 +45,7 @@
|
|||
this.thingscount.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(204)));
|
||||
this.thingscount.Location = new System.Drawing.Point(10, 81);
|
||||
this.thingscount.Name = "thingscount";
|
||||
this.thingscount.Size = new System.Drawing.Size(43, 14);
|
||||
this.thingscount.Size = new System.Drawing.Size(63, 14);
|
||||
this.thingscount.TabIndex = 19;
|
||||
this.thingscount.Text = "0";
|
||||
this.thingscount.TextAlign = System.Drawing.ContentAlignment.TopRight;
|
||||
|
@ -55,7 +55,7 @@
|
|||
this.sectorscount.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(204)));
|
||||
this.sectorscount.Location = new System.Drawing.Point(10, 62);
|
||||
this.sectorscount.Name = "sectorscount";
|
||||
this.sectorscount.Size = new System.Drawing.Size(43, 14);
|
||||
this.sectorscount.Size = new System.Drawing.Size(63, 14);
|
||||
this.sectorscount.TabIndex = 18;
|
||||
this.sectorscount.Text = "0";
|
||||
this.sectorscount.TextAlign = System.Drawing.ContentAlignment.TopRight;
|
||||
|
@ -65,7 +65,7 @@
|
|||
this.sidedefscount.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(204)));
|
||||
this.sidedefscount.Location = new System.Drawing.Point(10, 44);
|
||||
this.sidedefscount.Name = "sidedefscount";
|
||||
this.sidedefscount.Size = new System.Drawing.Size(43, 14);
|
||||
this.sidedefscount.Size = new System.Drawing.Size(63, 14);
|
||||
this.sidedefscount.TabIndex = 17;
|
||||
this.sidedefscount.Text = "0";
|
||||
this.sidedefscount.TextAlign = System.Drawing.ContentAlignment.TopRight;
|
||||
|
@ -75,7 +75,7 @@
|
|||
this.linedefscount.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(204)));
|
||||
this.linedefscount.Location = new System.Drawing.Point(10, 26);
|
||||
this.linedefscount.Name = "linedefscount";
|
||||
this.linedefscount.Size = new System.Drawing.Size(43, 14);
|
||||
this.linedefscount.Size = new System.Drawing.Size(63, 14);
|
||||
this.linedefscount.TabIndex = 16;
|
||||
this.linedefscount.Text = "0";
|
||||
this.linedefscount.TextAlign = System.Drawing.ContentAlignment.TopRight;
|
||||
|
@ -85,7 +85,7 @@
|
|||
this.verticescount.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(204)));
|
||||
this.verticescount.Location = new System.Drawing.Point(10, 8);
|
||||
this.verticescount.Name = "verticescount";
|
||||
this.verticescount.Size = new System.Drawing.Size(43, 14);
|
||||
this.verticescount.Size = new System.Drawing.Size(63, 14);
|
||||
this.verticescount.TabIndex = 15;
|
||||
this.verticescount.Text = "0";
|
||||
this.verticescount.TextAlign = System.Drawing.ContentAlignment.TopRight;
|
||||
|
@ -93,7 +93,7 @@
|
|||
// thingslabel
|
||||
//
|
||||
this.thingslabel.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(204)));
|
||||
this.thingslabel.Location = new System.Drawing.Point(55, 81);
|
||||
this.thingslabel.Location = new System.Drawing.Point(75, 81);
|
||||
this.thingslabel.Name = "thingslabel";
|
||||
this.thingslabel.Size = new System.Drawing.Size(60, 15);
|
||||
this.thingslabel.TabIndex = 14;
|
||||
|
@ -102,7 +102,7 @@
|
|||
// sectorslabel
|
||||
//
|
||||
this.sectorslabel.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(204)));
|
||||
this.sectorslabel.Location = new System.Drawing.Point(55, 62);
|
||||
this.sectorslabel.Location = new System.Drawing.Point(75, 62);
|
||||
this.sectorslabel.Name = "sectorslabel";
|
||||
this.sectorslabel.Size = new System.Drawing.Size(60, 15);
|
||||
this.sectorslabel.TabIndex = 13;
|
||||
|
@ -111,7 +111,7 @@
|
|||
// sidedefslabel
|
||||
//
|
||||
this.sidedefslabel.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(204)));
|
||||
this.sidedefslabel.Location = new System.Drawing.Point(55, 44);
|
||||
this.sidedefslabel.Location = new System.Drawing.Point(75, 44);
|
||||
this.sidedefslabel.Name = "sidedefslabel";
|
||||
this.sidedefslabel.Size = new System.Drawing.Size(60, 15);
|
||||
this.sidedefslabel.TabIndex = 12;
|
||||
|
@ -120,7 +120,7 @@
|
|||
// linedefslabel
|
||||
//
|
||||
this.linedefslabel.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(204)));
|
||||
this.linedefslabel.Location = new System.Drawing.Point(55, 26);
|
||||
this.linedefslabel.Location = new System.Drawing.Point(75, 26);
|
||||
this.linedefslabel.Name = "linedefslabel";
|
||||
this.linedefslabel.Size = new System.Drawing.Size(60, 15);
|
||||
this.linedefslabel.TabIndex = 11;
|
||||
|
@ -129,7 +129,7 @@
|
|||
// verticeslabel
|
||||
//
|
||||
this.verticeslabel.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(204)));
|
||||
this.verticeslabel.Location = new System.Drawing.Point(55, 8);
|
||||
this.verticeslabel.Location = new System.Drawing.Point(75, 8);
|
||||
this.verticeslabel.Name = "verticeslabel";
|
||||
this.verticeslabel.Size = new System.Drawing.Size(60, 15);
|
||||
this.verticeslabel.TabIndex = 10;
|
||||
|
@ -151,7 +151,7 @@
|
|||
this.Controls.Add(this.verticeslabel);
|
||||
this.ForeColor = System.Drawing.SystemColors.GrayText;
|
||||
this.Name = "StatisticsControl";
|
||||
this.Size = new System.Drawing.Size(118, 104);
|
||||
this.Size = new System.Drawing.Size(138, 104);
|
||||
this.ResumeLayout(false);
|
||||
|
||||
}
|
||||
|
|
|
@ -74,10 +74,12 @@ namespace CodeImp.DoomBuilder.Controls
|
|||
|
||||
if(string.IsNullOrEmpty(texture.FilePathName) || texture is UnknownImage) DisplayImageSize(0, 0); //mxd
|
||||
else DisplayImageSize(texture.ScaledWidth, texture.ScaledHeight); //mxd
|
||||
if(usepreviews ? !texture.IsPreviewLoaded : !texture.IsImageLoaded) timer.Start(); //mxd
|
||||
|
||||
|
||||
if(usepreviews && !texture.IsPreviewLoaded) timer.Start(); //mxd
|
||||
else if(!texture.IsImageLoaded) texture.LoadImage(); //mxd. In some cases the image may never me loaded by the DataManager
|
||||
|
||||
// Set the image
|
||||
return (usepreviews ? texture.GetPreview() : texture.GetBitmap());
|
||||
return new Bitmap((usepreviews ? texture.GetPreview() : texture.GetBitmap()));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -495,14 +495,25 @@ namespace CodeImp.DoomBuilder.Controls
|
|||
validnodes.Clear();
|
||||
|
||||
string match = tbFilter.Text.ToUpperInvariant();
|
||||
HashSet<string> added = new HashSet<string>(StringComparer.OrdinalIgnoreCase);
|
||||
|
||||
// First add nodes, which titles start with given text
|
||||
foreach(TreeNode node in nodes)
|
||||
{
|
||||
if(node.Text.ToUpperInvariant().Contains(match))
|
||||
if(node.Text.ToUpperInvariant().StartsWith(match))
|
||||
{
|
||||
typelist.Nodes.Add(node);
|
||||
added.Add(node.Text);
|
||||
}
|
||||
}
|
||||
|
||||
// Then add nodes, which titles contain given text
|
||||
foreach(TreeNode node in nodes)
|
||||
{
|
||||
if(!added.Contains(node.Text) && node.Text.ToUpperInvariant().Contains(match))
|
||||
typelist.Nodes.Add(node);
|
||||
}
|
||||
|
||||
doupdatenode = true;
|
||||
doupdatetextbox = true;
|
||||
}
|
||||
|
|
|
@ -67,7 +67,7 @@ namespace CodeImp.DoomBuilder.Data
|
|||
if(reader is UnknownImageReader)
|
||||
{
|
||||
// Data is in an unknown format!
|
||||
General.ErrorLogger.Add(ErrorType.Error, "Colormap lump '" + Name + "' data format could not be read. Does this lump contain valid colormap data at all?");
|
||||
General.ErrorLogger.Add(ErrorType.Error, "Colormap lump \"" + Name + "\" data format could not be read. Does this lump contain valid colormap data at all?");
|
||||
bitmap = null;
|
||||
}
|
||||
else
|
||||
|
@ -97,7 +97,7 @@ namespace CodeImp.DoomBuilder.Data
|
|||
else
|
||||
{
|
||||
// Missing a patch lump!
|
||||
General.ErrorLogger.Add(ErrorType.Error, "Missing colormap lump '" + Name + "'. Did you forget to include required resources?");
|
||||
General.ErrorLogger.Add(ErrorType.Error, "Missing colormap lump \"" + Name + "\". Did you forget to include required resources?");
|
||||
loadfailed = true;
|
||||
}
|
||||
|
||||
|
|
|
@ -79,8 +79,8 @@ namespace CodeImp.DoomBuilder.Data
|
|||
}
|
||||
}
|
||||
|
||||
return name;
|
||||
}
|
||||
return (name ?? string.Empty);
|
||||
}
|
||||
|
||||
// This compares two locations
|
||||
public int CompareTo(DataLocation other)
|
||||
|
|
|
@ -172,7 +172,7 @@ namespace CodeImp.DoomBuilder.Data
|
|||
// Not loaded?
|
||||
if(bitmap == null)
|
||||
{
|
||||
General.ErrorLogger.Add(ErrorType.Error, "Image file '" + filepathname + "' 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 \"" + filepathname + "\" data format could not be read, while loading image \"" + this.Name + "\". Is this a valid picture file at all?");
|
||||
loadfailed = true;
|
||||
}
|
||||
else
|
||||
|
|
|
@ -68,7 +68,7 @@ namespace CodeImp.DoomBuilder.Data
|
|||
if(reader is UnknownImageReader)
|
||||
{
|
||||
// Data is in an unknown format!
|
||||
General.ErrorLogger.Add(ErrorType.Error, "Flat lump '" + Name + "' data format could not be read. Does this lump contain valid picture data at all?");
|
||||
General.ErrorLogger.Add(ErrorType.Error, "Flat lump \"" + Name + "\" data format could not be read. Does this lump contain valid picture data at all?");
|
||||
bitmap = null;
|
||||
}
|
||||
else
|
||||
|
@ -98,7 +98,7 @@ namespace CodeImp.DoomBuilder.Data
|
|||
else
|
||||
{
|
||||
// Missing a patch lump!
|
||||
General.ErrorLogger.Add(ErrorType.Error, "Missing flat lump '" + Name + "'. Did you forget to include required resources?");
|
||||
General.ErrorLogger.Add(ErrorType.Error, "Missing flat lump \"" + Name + "\". Did you forget to include required resources?");
|
||||
loadfailed = true;
|
||||
}
|
||||
|
||||
|
|
|
@ -125,17 +125,26 @@ namespace CodeImp.DoomBuilder.Data
|
|||
catch(Exception e)
|
||||
{
|
||||
// Unable to make bitmap
|
||||
General.ErrorLogger.Add(ErrorType.Error, "Unable to load texture image '" + this.Name + "'. " + e.GetType().Name + ": " + e.Message);
|
||||
General.ErrorLogger.Add(ErrorType.Error, "Unable to load texture image \"" + this.Name + "\". " + e.GetType().Name + ": " + e.Message);
|
||||
loadfailed = true;
|
||||
}
|
||||
|
||||
int missingpatches = 0; //mxd
|
||||
|
||||
if(!loadfailed)
|
||||
if(patches.Count == 0) //mxd
|
||||
{
|
||||
// No patches!
|
||||
General.ErrorLogger.Add(ErrorType.Warning, "No patches are defined for texture \"" + this.Name + "\"");
|
||||
loadfailed = true;
|
||||
}
|
||||
else if(!loadfailed)
|
||||
{
|
||||
// Go for all patches
|
||||
foreach(TexturePatch p in patches)
|
||||
{
|
||||
//mxd. Some patches (like "TNT1A0") should be skipped
|
||||
if(p.skip) continue;
|
||||
|
||||
// Get the patch data stream
|
||||
Stream patchdata = General.Map.Data.GetPatchData(p.lumpname, p.haslongname);
|
||||
|
||||
|
@ -161,7 +170,7 @@ namespace CodeImp.DoomBuilder.Data
|
|||
if(reader is UnknownImageReader)
|
||||
{
|
||||
// Data is in an unknown format!
|
||||
General.ErrorLogger.Add(ErrorType.Error, "Patch lump '" + p.lumpname + "' data format could not be read, while loading texture '" + this.Name + "'");
|
||||
General.ErrorLogger.Add(ErrorType.Error, "Patch lump \"" + p.lumpname + "\" data format could not be read, while loading texture \"" + this.Name + "\"");
|
||||
missingpatches++; //mxd
|
||||
}
|
||||
}
|
||||
|
@ -175,7 +184,7 @@ namespace CodeImp.DoomBuilder.Data
|
|||
catch(InvalidDataException)
|
||||
{
|
||||
// Data cannot be read!
|
||||
General.ErrorLogger.Add(ErrorType.Error, "Patch lump '" + p.lumpname + "' data format could not be read, while loading texture '" + this.Name + "'");
|
||||
General.ErrorLogger.Add(ErrorType.Error, "Patch lump \"" + p.lumpname + "\" data format could not be read, while loading texture \"" + this.Name + "\"");
|
||||
missingpatches++; //mxd
|
||||
}
|
||||
|
||||
|
@ -217,7 +226,7 @@ namespace CodeImp.DoomBuilder.Data
|
|||
}
|
||||
|
||||
// Missing a patch lump!
|
||||
General.ErrorLogger.Add(ErrorType.Error, "Missing patch lump '" + p.lumpname + "' while loading texture '" + this.Name + "'");
|
||||
General.ErrorLogger.Add(ErrorType.Error, "Missing patch lump \"" + p.lumpname + "\" while loading texture \"" + this.Name + "\"");
|
||||
missingpatches++; //mxd
|
||||
}
|
||||
}
|
||||
|
@ -243,12 +252,9 @@ namespace CodeImp.DoomBuilder.Data
|
|||
if(p.flipx || p.flipy)
|
||||
{
|
||||
RotateFlipType flip;
|
||||
if(p.flipx && !p.flipy)
|
||||
flip = RotateFlipType.RotateNoneFlipX;
|
||||
else if(!p.flipx && p.flipy)
|
||||
flip = RotateFlipType.RotateNoneFlipY;
|
||||
else
|
||||
flip = RotateFlipType.RotateNoneFlipXY;
|
||||
if(p.flipx && !p.flipy) flip = RotateFlipType.RotateNoneFlipX;
|
||||
else if(!p.flipx && p.flipy) flip = RotateFlipType.RotateNoneFlipY;
|
||||
else flip = RotateFlipType.RotateNoneFlipXY;
|
||||
patchbmp.RotateFlip(flip);
|
||||
}
|
||||
|
||||
|
@ -258,15 +264,9 @@ namespace CodeImp.DoomBuilder.Data
|
|||
RotateFlipType rotate;
|
||||
switch(p.rotate)
|
||||
{
|
||||
case 90:
|
||||
rotate = RotateFlipType.Rotate90FlipNone;
|
||||
break;
|
||||
case 180:
|
||||
rotate = RotateFlipType.Rotate180FlipNone;
|
||||
break;
|
||||
default:
|
||||
rotate = RotateFlipType.Rotate270FlipNone;
|
||||
break;
|
||||
case 90: rotate = RotateFlipType.Rotate90FlipNone; break;
|
||||
case 180: rotate = RotateFlipType.Rotate180FlipNone; break;
|
||||
default: rotate = RotateFlipType.Rotate270FlipNone; break;
|
||||
}
|
||||
patchbmp.RotateFlip(rotate);
|
||||
}
|
||||
|
@ -282,7 +282,7 @@ namespace CodeImp.DoomBuilder.Data
|
|||
}
|
||||
catch(Exception e)
|
||||
{
|
||||
General.ErrorLogger.Add(ErrorType.Error, "Cannot lock image '" + p.lumpname + "' for alpha adjustment. " + e.GetType().Name + ": " + e.Message);
|
||||
General.ErrorLogger.Add(ErrorType.Error, "Cannot lock image \"" + p.lumpname + "\" for alpha adjustment. " + e.GetType().Name + ": " + e.Message);
|
||||
}
|
||||
|
||||
if(bmpdata != null)
|
||||
|
@ -347,7 +347,7 @@ namespace CodeImp.DoomBuilder.Data
|
|||
}
|
||||
catch(Exception e)
|
||||
{
|
||||
General.ErrorLogger.Add(ErrorType.Error, "Cannot lock texture '" + this.Name + "' to apply render style. " + e.GetType().Name + ": " + e.Message);
|
||||
General.ErrorLogger.Add(ErrorType.Error, "Cannot lock texture \"" + this.Name + "\" to apply render style. " + e.GetType().Name + ": " + e.Message);
|
||||
}
|
||||
|
||||
if(texturebmpdata != null)
|
||||
|
|
|
@ -277,7 +277,7 @@ namespace CodeImp.DoomBuilder.Data
|
|||
catch(Exception e)
|
||||
{
|
||||
bitmap = oldbitmap;
|
||||
General.ErrorLogger.Add(ErrorType.Warning, "Cannot lock image '" + name + "' for pixel format conversion. The image may not be displayed correctly.\n" + e.GetType().Name + ": " + e.Message);
|
||||
General.ErrorLogger.Add(ErrorType.Warning, "Cannot lock image \"" + name + "\" for pixel format conversion. The image may not be displayed correctly.\n" + e.GetType().Name + ": " + e.Message);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -293,7 +293,7 @@ namespace CodeImp.DoomBuilder.Data
|
|||
}
|
||||
catch(Exception e)
|
||||
{
|
||||
General.ErrorLogger.Add(ErrorType.Warning, "Cannot lock image '" + name + "' for color correction. The image may not be displayed correctly.\n" + e.GetType().Name + ": " + e.Message);
|
||||
General.ErrorLogger.Add(ErrorType.Warning, "Cannot lock image \"" + name + "\" for color correction. The image may not be displayed correctly.\n" + e.GetType().Name + ": " + e.Message);
|
||||
}
|
||||
|
||||
// Bitmap locked?
|
||||
|
@ -348,7 +348,7 @@ namespace CodeImp.DoomBuilder.Data
|
|||
{
|
||||
BitmapData bmpdata = null;
|
||||
try { bmpdata = bitmap.LockBits(new Rectangle(0, 0, bitmap.Size.Width, bitmap.Size.Height), ImageLockMode.ReadWrite, PixelFormat.Format32bppArgb); }
|
||||
catch(Exception e) { General.ErrorLogger.Add(ErrorType.Error, "Cannot lock image '" + this.filepathname + "' for glow color calculation. " + e.GetType().Name + ": " + e.Message); }
|
||||
catch(Exception e) { General.ErrorLogger.Add(ErrorType.Error, "Cannot lock image \"" + this.filepathname + "\" for glow color calculation. " + e.GetType().Name + ": " + e.Message); }
|
||||
|
||||
if(bmpdata != null)
|
||||
{
|
||||
|
@ -403,7 +403,7 @@ namespace CodeImp.DoomBuilder.Data
|
|||
{
|
||||
BitmapData bmpdata = null;
|
||||
try { bmpdata = bitmap.LockBits(new Rectangle(0, 0, bitmap.Size.Width, bitmap.Size.Height), ImageLockMode.ReadWrite, PixelFormat.Format32bppArgb); }
|
||||
catch(Exception e) { General.ErrorLogger.Add(ErrorType.Error, "Cannot lock image '" + this.filepathname + "' for translucency check. " + e.GetType().Name + ": " + e.Message); }
|
||||
catch(Exception e) { General.ErrorLogger.Add(ErrorType.Error, "Cannot lock image \"" + this.filepathname + "\" for translucency check. " + e.GetType().Name + ": " + e.Message); }
|
||||
|
||||
if(bmpdata != null)
|
||||
{
|
||||
|
|
|
@ -140,7 +140,7 @@ namespace CodeImp.DoomBuilder.Data
|
|||
// Not loaded?
|
||||
if(bitmap == null)
|
||||
{
|
||||
General.ErrorLogger.Add(ErrorType.Error, "Image file '" + filepathname + "' data format could not be read, while loading texture '" + this.Name + "'");
|
||||
General.ErrorLogger.Add(ErrorType.Error, "Image file \"" + filepathname + "\" data format could not be read, while loading texture \"" + this.Name + "\"");
|
||||
loadfailed = true;
|
||||
}
|
||||
else
|
||||
|
|
|
@ -17,8 +17,8 @@
|
|||
#region ================== Namespaces
|
||||
|
||||
using System;
|
||||
using CodeImp.DoomBuilder.IO;
|
||||
using System.IO;
|
||||
using CodeImp.DoomBuilder.IO;
|
||||
|
||||
#endregion
|
||||
|
||||
|
@ -32,7 +32,7 @@ namespace CodeImp.DoomBuilder.Data
|
|||
|
||||
#region ================== Variables
|
||||
|
||||
private string lumpname;
|
||||
private readonly string lumpname;
|
||||
|
||||
#endregion
|
||||
|
||||
|
@ -93,7 +93,7 @@ namespace CodeImp.DoomBuilder.Data
|
|||
// Not loaded?
|
||||
if(bitmap == null)
|
||||
{
|
||||
General.ErrorLogger.Add(ErrorType.Error, "Image lump '" + lumpname + "' data format could not be read, while loading texture '" + this.Name + "'. Does this lump contain valid picture data at all?");
|
||||
General.ErrorLogger.Add(ErrorType.Error, "Image lump \"" + lumpname + "\" data format could not be read, while loading texture \"" + this.Name + "\". Does this lump contain valid picture data at all?");
|
||||
loadfailed = true;
|
||||
}
|
||||
else
|
||||
|
@ -108,7 +108,7 @@ namespace CodeImp.DoomBuilder.Data
|
|||
}
|
||||
else
|
||||
{
|
||||
General.ErrorLogger.Add(ErrorType.Error, "Image lump '" + lumpname + "' could not be found, while loading texture '" + this.Name + "'. Did you forget to include required resources?");
|
||||
General.ErrorLogger.Add(ErrorType.Error, "Image lump \"" + lumpname + "\" could not be found, while loading texture \"" + this.Name + "\". Did you forget to include required resources?");
|
||||
loadfailed = true;
|
||||
}
|
||||
|
||||
|
|
|
@ -95,7 +95,7 @@ namespace CodeImp.DoomBuilder.Data
|
|||
if(reader is UnknownImageReader)
|
||||
{
|
||||
// Data is in an unknown format!
|
||||
General.ErrorLogger.Add(ErrorType.Error, "Sprite lump '" + Name + "' data format could not be read. Does this lump contain valid picture data at all?");
|
||||
General.ErrorLogger.Add(ErrorType.Error, "Sprite lump \"" + Name + "\" data format could not be read. Does this lump contain valid picture data at all?");
|
||||
bitmap = null;
|
||||
}
|
||||
else
|
||||
|
@ -133,7 +133,7 @@ namespace CodeImp.DoomBuilder.Data
|
|||
else
|
||||
{
|
||||
// Missing a patch lump!
|
||||
General.ErrorLogger.Add(ErrorType.Error, "Missing sprite lump '" + Name + "'. Forgot to include required resources?");
|
||||
General.ErrorLogger.Add(ErrorType.Error, "Missing sprite lump \"" + Name + "\". Forgot to include required resources?");
|
||||
}
|
||||
|
||||
// Pass on to base
|
||||
|
|
|
@ -90,7 +90,7 @@ namespace CodeImp.DoomBuilder.Data
|
|||
catch(Exception e)
|
||||
{
|
||||
// Unable to make bitmap
|
||||
General.ErrorLogger.Add(ErrorType.Error, "Unable to load texture image '" + this.Name + "'. " + e.GetType().Name + ": " + e.Message);
|
||||
General.ErrorLogger.Add(ErrorType.Error, "Unable to load texture image \"" + this.Name + "\". " + e.GetType().Name + ": " + e.Message);
|
||||
loadfailed = true;
|
||||
}
|
||||
|
||||
|
@ -124,7 +124,7 @@ namespace CodeImp.DoomBuilder.Data
|
|||
if(reader is UnknownImageReader)
|
||||
{
|
||||
// Data is in an unknown format!
|
||||
General.ErrorLogger.Add(ErrorType.Error, "Patch lump '" + p.lumpname + "' data format could not be read, while loading texture '" + this.Name + "'. Does this lump contain valid picture data at all?");
|
||||
General.ErrorLogger.Add(ErrorType.Error, "Patch lump \"" + p.lumpname + "\" data format could not be read, while loading texture \"" + this.Name + "\". Does this lump contain valid picture data at all?");
|
||||
loadfailed = true;
|
||||
missingpatches++; //mxd
|
||||
}
|
||||
|
@ -138,7 +138,7 @@ namespace CodeImp.DoomBuilder.Data
|
|||
catch(InvalidDataException)
|
||||
{
|
||||
// Data cannot be read!
|
||||
General.ErrorLogger.Add(ErrorType.Error, "Patch lump '" + p.lumpname + "' data format could not be read, while loading texture '" + this.Name + "'. Does this lump contain valid picture data at all?");
|
||||
General.ErrorLogger.Add(ErrorType.Error, "Patch lump \"" + p.lumpname + "\" data format could not be read, while loading texture \"" + this.Name + "\". Does this lump contain valid picture data at all?");
|
||||
loadfailed = true;
|
||||
missingpatches++; //mxd
|
||||
}
|
||||
|
@ -150,7 +150,7 @@ namespace CodeImp.DoomBuilder.Data
|
|||
else
|
||||
{
|
||||
// Missing a patch lump!
|
||||
General.ErrorLogger.Add(ErrorType.Error, "Missing patch lump '" + p.lumpname + "' while loading texture '" + this.Name + "'. Did you forget to include required resources?");
|
||||
General.ErrorLogger.Add(ErrorType.Error, "Missing patch lump \"" + p.lumpname + "\" while loading texture \"" + this.Name + "\". Did you forget to include required resources?");
|
||||
loadfailed = true;
|
||||
missingpatches++; //mxd
|
||||
}
|
||||
|
|
|
@ -59,6 +59,7 @@ namespace CodeImp.DoomBuilder.Data
|
|||
public readonly TexturePathRenderStyle style;
|
||||
public readonly TexturePathBlendStyle blendstyle; //mxd
|
||||
public readonly float tintammount;//mxd
|
||||
public readonly bool skip; //mxd
|
||||
|
||||
// Constructor for simple patches
|
||||
public TexturePatch(string lumpname, int x, int y)
|
||||
|
@ -76,6 +77,7 @@ namespace CodeImp.DoomBuilder.Data
|
|||
this.blendstyle = TexturePathBlendStyle.None;//mxd
|
||||
this.tintammount = 0; //mxd
|
||||
this.haslongname = false; //mxd
|
||||
this.skip = false; //mxd
|
||||
}
|
||||
|
||||
//mxd. Constructor for hires patches
|
||||
|
@ -94,6 +96,7 @@ namespace CodeImp.DoomBuilder.Data
|
|||
this.blendstyle = patch.BlendStyle;
|
||||
this.tintammount = patch.TintAmmount;
|
||||
this.haslongname = (Path.GetFileNameWithoutExtension(this.lumpname) != this.lumpname);
|
||||
this.skip = patch.Skip;
|
||||
|
||||
//mxd. Check data so we don't perform unneeded operations later on
|
||||
if(this.alpha == 1.0f)
|
||||
|
|
|
@ -565,6 +565,10 @@ namespace CodeImp.DoomBuilder.Editing
|
|||
// Save mouse down position
|
||||
mousedownpos = mousepos;
|
||||
mousedownmappos = mousemappos;
|
||||
|
||||
//mxd. Looks like in some cases (very detailed maps / slow CPUs) OnMouseUp is not fired
|
||||
// This is my attempt at fixing this...
|
||||
if(e.Button == mousedragging) mousedragging = MouseButtons.None;
|
||||
|
||||
// Let the base class know
|
||||
base.OnMouseDown(e);
|
||||
|
|
|
@ -246,7 +246,7 @@ namespace CodeImp.DoomBuilder.Editing
|
|||
// Write data to stream
|
||||
MemoryStream memstream = new MemoryStream();
|
||||
ClipboardStreamWriter writer = new ClipboardStreamWriter(); //mxd
|
||||
writer.Write(copyset, memstream, General.Map.Config.UseLongTextureNames);
|
||||
writer.Write(copyset, memstream);
|
||||
|
||||
// Set on clipboard
|
||||
Clipboard.SetData(CLIPBOARD_DATA_FORMAT, memstream);
|
||||
|
@ -290,37 +290,31 @@ namespace CodeImp.DoomBuilder.Editing
|
|||
// Create undo
|
||||
General.MainWindow.DisplayStatus(StatusType.Action, "Pasted selected elements.");
|
||||
General.Map.UndoRedo.CreateUndo("Paste");
|
||||
|
||||
// Read from clipboard
|
||||
Stream memstream = (Stream)Clipboard.GetData(CLIPBOARD_DATA_FORMAT);
|
||||
memstream.Seek(0, SeekOrigin.Begin);
|
||||
|
||||
// Mark all current geometry
|
||||
General.Map.Map.ClearAllMarks(true);
|
||||
|
||||
// Read data stream
|
||||
ClipboardStreamReader reader = new ClipboardStreamReader(); //mxd
|
||||
General.Map.Map.BeginAddRemove();
|
||||
reader.Read(General.Map.Map, memstream);
|
||||
General.Map.Map.EndAddRemove();
|
||||
// Read from clipboard
|
||||
using(Stream memstream = (Stream)Clipboard.GetData(CLIPBOARD_DATA_FORMAT))
|
||||
{
|
||||
// Rewind before use
|
||||
memstream.Seek(0, SeekOrigin.Begin);
|
||||
|
||||
// Read data stream
|
||||
ClipboardStreamReader reader = new ClipboardStreamReader(); //mxd
|
||||
General.Map.Map.BeginAddRemove();
|
||||
bool success = reader.Read(General.Map.Map, memstream);
|
||||
General.Map.Map.EndAddRemove();
|
||||
if(!success) //mxd
|
||||
{
|
||||
General.Map.UndoRedo.WithdrawUndo(); // This will also mess with the marks...
|
||||
General.Map.Map.ClearAllMarks(true); // So re-mark all current geometry...
|
||||
}
|
||||
}
|
||||
|
||||
// The new geometry is not marked, so invert the marks to get it marked
|
||||
General.Map.Map.InvertAllMarks();
|
||||
|
||||
// Convert UDMF fields back to flags and activations, if needed
|
||||
if(!(General.Map.FormatInterface is UniversalMapSetIO || General.Map.FormatInterface is SRB2MapSetIO)) General.Map.Map.TranslateFromUDMF();
|
||||
|
||||
//mxd. Translate texture names
|
||||
General.Map.Map.TranslateTextureNames(General.Map.Config.UseLongTextureNames, true);
|
||||
|
||||
// Modify tags and actions if preferred
|
||||
if(options.ChangeTags == PasteOptions.TAGS_REMOVE) Tools.RemoveMarkedTags();
|
||||
if(options.ChangeTags == PasteOptions.TAGS_RENUMBER) Tools.RenumberMarkedTags();
|
||||
if(options.RemoveActions) Tools.RemoveMarkedActions();
|
||||
|
||||
// Clean up
|
||||
memstream.Dispose();
|
||||
|
||||
// Check if anything was pasted
|
||||
List<Thing> things = General.Map.Map.GetMarkedThings(true); //mxd
|
||||
int totalpasted = things.Count;
|
||||
|
@ -328,14 +322,25 @@ namespace CodeImp.DoomBuilder.Editing
|
|||
totalpasted += General.Map.Map.GetMarkedLinedefs(true).Count;
|
||||
totalpasted += General.Map.Map.GetMarkedSidedefs(true).Count;
|
||||
totalpasted += General.Map.Map.GetMarkedSectors(true).Count;
|
||||
|
||||
if(totalpasted > 0)
|
||||
{
|
||||
// Convert UDMF fields back to flags and activations, if needed
|
||||
if(!(General.Map.FormatInterface is UniversalMapSetIO || General.Map.FormatInterface is SRB2MapSetIO)) General.Map.Map.TranslateFromUDMF();
|
||||
|
||||
//mxd. Translate texture names
|
||||
General.Map.Map.TranslateTextureNames(General.Map.Config.UseLongTextureNames, true);
|
||||
|
||||
// Modify tags and actions if preferred
|
||||
if(options.ChangeTags == PasteOptions.TAGS_REMOVE) Tools.RemoveMarkedTags();
|
||||
if(options.ChangeTags == PasteOptions.TAGS_RENUMBER) Tools.RenumberMarkedTags();
|
||||
if(options.RemoveActions) Tools.RemoveMarkedActions();
|
||||
|
||||
foreach(Thing t in things) t.UpdateConfiguration(); //mxd
|
||||
General.Map.ThingsFilter.Update();
|
||||
General.Editing.Mode.OnPasteEnd(options.Copy());
|
||||
General.Plugins.OnPasteEnd(options);
|
||||
}
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -246,7 +246,7 @@ namespace CodeImp.DoomBuilder.Editing
|
|||
// This snaps to the nearest grid coordinate
|
||||
public Vector2D SnappedToGrid(Vector2D v)
|
||||
{
|
||||
return GridSetup.SnappedToGrid(v, gridsizef, gridsizefinv);
|
||||
return SnappedToGrid(v, gridsizef, gridsizefinv);
|
||||
}
|
||||
|
||||
// This snaps to the nearest grid coordinate
|
||||
|
@ -291,6 +291,9 @@ namespace CodeImp.DoomBuilder.Editing
|
|||
// Not lower than 1
|
||||
if(gridsize >= 2)
|
||||
{
|
||||
//mxd. Disable automatic grid resizing
|
||||
General.MainWindow.DisableDynamicGridResize();
|
||||
|
||||
// Change grid
|
||||
SetGridSize(gridsize >> 1);
|
||||
|
||||
|
@ -307,6 +310,9 @@ namespace CodeImp.DoomBuilder.Editing
|
|||
// Not higher than 1024
|
||||
if(gridsize <= 512)
|
||||
{
|
||||
//mxd. Disable automatic grid resizing
|
||||
General.MainWindow.DisableDynamicGridResize();
|
||||
|
||||
// Change grid
|
||||
SetGridSize(gridsize << 1);
|
||||
|
||||
|
|
|
@ -272,7 +272,7 @@ namespace CodeImp.DoomBuilder.Editing
|
|||
|
||||
//Integrity check
|
||||
if(!IsValid())
|
||||
General.ErrorLogger.Add(ErrorType.Warning, "Things filter '" + name + "' has invalid properties. Configure the things filter to fix this!");
|
||||
General.ErrorLogger.Add(ErrorType.Warning, "Things filter \"" + name + "\" has invalid properties. Configure the things filter to fix this!");
|
||||
}
|
||||
|
||||
//mxd
|
||||
|
|
|
@ -1116,8 +1116,12 @@ namespace CodeImp.DoomBuilder.Editing
|
|||
Sidedef sd = (sindex >= 0) ? General.Map.Map.GetSidedefByIndex(sindex) : null;
|
||||
l.AttachFront(sd);
|
||||
l.Marked = true;
|
||||
if (l.Tag != 0) linedeftags.Add(l.Tag);
|
||||
if (sd != null) sd.Marked = true;
|
||||
if (l.Tag != 0) linedeftags.Add(l.Tag);
|
||||
if (sd != null)
|
||||
{
|
||||
sd.Marked = true;
|
||||
if(sd.Sector != null) sd.Sector.UpdateNeeded = true; //mxd. Sector needs to be updated as well...
|
||||
}
|
||||
geometrychanged = true;
|
||||
}
|
||||
|
||||
|
@ -1141,8 +1145,12 @@ namespace CodeImp.DoomBuilder.Editing
|
|||
Sidedef sd = (sindex >= 0) ? General.Map.Map.GetSidedefByIndex(sindex) : null;
|
||||
l.AttachBack(sd);
|
||||
l.Marked = true;
|
||||
if (l.Tag != 0) linedeftags.Add(l.Tag);
|
||||
if (sd != null) sd.Marked = true;
|
||||
if (l.Tag != 0) linedeftags.Add(l.Tag);
|
||||
if (sd != null)
|
||||
{
|
||||
sd.Marked = true;
|
||||
if(sd.Sector != null) sd.Sector.UpdateNeeded = true; //mxd. Sector needs to be updated as well...
|
||||
}
|
||||
geometrychanged = true;
|
||||
}
|
||||
|
||||
|
|
|
@ -68,8 +68,7 @@
|
|||
this.newTag.Size = new System.Drawing.Size(54, 24);
|
||||
this.newTag.TabIndex = 2;
|
||||
this.newTag.Text = "New";
|
||||
this.tooltip.SetToolTip(this.newTag, "Finds a tag, which is not used as a tag or tag action argument \r\nby any map eleme" +
|
||||
"nt");
|
||||
this.tooltip.SetToolTip(this.newTag, "Find a tag, which is not used as a tag or tag action argument\r\nby any map element");
|
||||
this.newTag.UseVisualStyleBackColor = true;
|
||||
this.newTag.Click += new System.EventHandler(this.newTag_Click);
|
||||
//
|
||||
|
@ -80,7 +79,7 @@
|
|||
this.unusedTag.Size = new System.Drawing.Size(54, 24);
|
||||
this.unusedTag.TabIndex = 3;
|
||||
this.unusedTag.Text = "Unused";
|
||||
this.tooltip.SetToolTip(this.unusedTag, "Finds a tag, which is not used as a tag \r\nby any map element of this type");
|
||||
this.tooltip.SetToolTip(this.unusedTag, "Find a tag, which is not used as a tag\r\nby any map element of this type");
|
||||
this.unusedTag.UseVisualStyleBackColor = true;
|
||||
this.unusedTag.Click += new System.EventHandler(this.unusedTag_Click);
|
||||
//
|
||||
|
@ -98,7 +97,7 @@
|
|||
this.clear.Name = "clear";
|
||||
this.clear.Size = new System.Drawing.Size(26, 24);
|
||||
this.clear.TabIndex = 4;
|
||||
this.tooltip.SetToolTip(this.clear, "Sets tag to 0");
|
||||
this.tooltip.SetToolTip(this.clear, "Set tag to 0");
|
||||
this.clear.UseVisualStyleBackColor = true;
|
||||
this.clear.Click += new System.EventHandler(this.clear_Click);
|
||||
//
|
||||
|
|
|
@ -255,9 +255,9 @@ namespace CodeImp.DoomBuilder.GZBuilder.Controls
|
|||
private void TagSelector_Resize(object sender, EventArgs e)
|
||||
{
|
||||
clear.Left = this.Width - clear.Width - clear.Margin.Right;
|
||||
unusedTag.Left = clear.Left - clear.Margin.Left - unusedTag.Margin.Right - unusedTag.Width;
|
||||
newTag.Left = unusedTag.Left - unusedTag.Margin.Left - newTag.Margin.Right - newTag.Width;
|
||||
cbTagPicker.Width = newTag.Left - newTag.Margin.Left - cbTagPicker.Margin.Right - cbTagPicker.Left;
|
||||
unusedTag.Left = clear.Left - unusedTag.Margin.Right - unusedTag.Width;
|
||||
newTag.Left = unusedTag.Left - newTag.Margin.Right - newTag.Width;
|
||||
cbTagPicker.Width = newTag.Left - cbTagPicker.Margin.Right - cbTagPicker.Left;
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
|
|
@ -257,6 +257,8 @@ namespace CodeImp.DoomBuilder.GZBuilder.Controls
|
|||
if(tagpicker.SelectedIndex == -1) tagpicker.Text = tag.ToString();
|
||||
}
|
||||
|
||||
clear.Enabled = (tagpicker.Text.Trim() != "0");
|
||||
|
||||
blockupdate = false;
|
||||
}
|
||||
|
||||
|
@ -278,6 +280,7 @@ namespace CodeImp.DoomBuilder.GZBuilder.Controls
|
|||
|
||||
private void clear_Click(object sender, EventArgs e)
|
||||
{
|
||||
tagpicker.Focus();
|
||||
tagpicker.SelectedIndex = -1;
|
||||
tagpicker.Text = "0";
|
||||
}
|
||||
|
@ -356,6 +359,7 @@ namespace CodeImp.DoomBuilder.GZBuilder.Controls
|
|||
{
|
||||
if(blockupdate) return;
|
||||
|
||||
clear.Enabled = (tagpicker.Text.Trim() != "0");
|
||||
if(tagpicker.SelectedItem != null)
|
||||
{
|
||||
TagInfo info = (TagInfo)tagpicker.SelectedItem;
|
||||
|
@ -420,11 +424,11 @@ namespace CodeImp.DoomBuilder.GZBuilder.Controls
|
|||
private void TagsSelector_Resize(object sender, EventArgs e)
|
||||
{
|
||||
clear.Left = this.Width - clear.Width - clear.Margin.Right;
|
||||
unusedtag.Left = clear.Left - clear.Margin.Left - unusedtag.Margin.Right - unusedtag.Width;
|
||||
newtag.Left = unusedtag.Left - unusedtag.Margin.Left - newtag.Margin.Right - newtag.Width;
|
||||
tagpicker.Width = newtag.Left - newtag.Margin.Left - tagpicker.Margin.Right - tagpicker.Left;
|
||||
unusedtag.Left = clear.Left - unusedtag.Margin.Right - unusedtag.Width;
|
||||
newtag.Left = unusedtag.Left - newtag.Margin.Right - newtag.Width;
|
||||
tagpicker.Width = newtag.Left - tagpicker.Margin.Right - tagpicker.Left;
|
||||
removetag.Left = clear.Left;
|
||||
addtag.Left = removetag.Left - removetag.Margin.Left - addtag.Margin.Right - addtag.Width;
|
||||
addtag.Left = removetag.Left - addtag.Margin.Right - addtag.Width;
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
|
|
@ -45,7 +45,7 @@ namespace CodeImp.DoomBuilder.GZBuilder.Data
|
|||
{
|
||||
if(testprogramname == DEFAULT_ENGINE_NAME && !String.IsNullOrEmpty(TestProgram))
|
||||
{
|
||||
//get engine name from path
|
||||
// Get engine name from path
|
||||
testprogramname = Path.GetFileNameWithoutExtension(TestProgram);
|
||||
}
|
||||
|
||||
|
@ -59,12 +59,11 @@ namespace CodeImp.DoomBuilder.GZBuilder.Data
|
|||
if(File.Exists(TestProgram))
|
||||
{
|
||||
Icon i = Icon.ExtractAssociatedIcon(TestProgram);
|
||||
if(i != null) icon = i.ToBitmap();
|
||||
icon = (i != null ? i.ToBitmap() : new Bitmap(Properties.Resources.Question));
|
||||
}
|
||||
|
||||
if(icon == null)
|
||||
else
|
||||
{
|
||||
icon = new Bitmap(16, 16);
|
||||
icon = new Bitmap(Properties.Resources.Warning);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -22,6 +22,8 @@ namespace CodeImp.DoomBuilder.GZBuilder.Geometry
|
|||
{
|
||||
this.Start = start;
|
||||
this.End = end;
|
||||
this.Start2D = start;
|
||||
this.End2D = end;
|
||||
this.Color = General.Colors.InfoLine;
|
||||
this.RenderArrowhead = true;
|
||||
}
|
||||
|
@ -30,6 +32,8 @@ namespace CodeImp.DoomBuilder.GZBuilder.Geometry
|
|||
{
|
||||
this.Start = start;
|
||||
this.End = end;
|
||||
this.Start2D = start;
|
||||
this.End2D = end;
|
||||
this.Color = General.Colors.InfoLine;
|
||||
this.RenderArrowhead = renderArrowhead;
|
||||
}
|
||||
|
@ -38,6 +42,8 @@ namespace CodeImp.DoomBuilder.GZBuilder.Geometry
|
|||
{
|
||||
this.Start = start;
|
||||
this.End = end;
|
||||
this.Start2D = start;
|
||||
this.End2D = end;
|
||||
this.Color = color;
|
||||
this.RenderArrowhead = true;
|
||||
}
|
||||
|
@ -46,6 +52,8 @@ namespace CodeImp.DoomBuilder.GZBuilder.Geometry
|
|||
{
|
||||
this.Start = start;
|
||||
this.End = end;
|
||||
this.Start2D = start;
|
||||
this.End2D = end;
|
||||
this.Color = color;
|
||||
this.RenderArrowhead = renderArrowhead;
|
||||
}
|
||||
|
|
|
@ -130,7 +130,7 @@ namespace CodeImp.DoomBuilder.GZBuilder.Windows
|
|||
|
||||
// Get OS name
|
||||
ManagementObjectSearcher searcher = new ManagementObjectSearcher("SELECT Caption FROM Win32_OperatingSystem");
|
||||
foreach(ManagementObject mo in searcher.Get())
|
||||
foreach(ManagementBaseObject mo in searcher.Get())
|
||||
{
|
||||
result += "OS: " + mo["Caption"] + Environment.NewLine;
|
||||
break;
|
||||
|
@ -138,7 +138,7 @@ namespace CodeImp.DoomBuilder.GZBuilder.Windows
|
|||
|
||||
// Get GPU name
|
||||
searcher = new ManagementObjectSearcher("SELECT * FROM Win32_VideoController");
|
||||
foreach(ManagementObject mo in searcher.Get())
|
||||
foreach(ManagementBaseObject mo in searcher.Get())
|
||||
{
|
||||
PropertyData bpp = mo.Properties["CurrentBitsPerPixel"];
|
||||
PropertyData description = mo.Properties["Description"];
|
||||
|
|
|
@ -102,7 +102,7 @@ namespace CodeImp.DoomBuilder.GZBuilder.MD3
|
|||
MemoryStream ms = LoadFile(containers, mde.ModelNames[i], true);
|
||||
if(ms == null)
|
||||
{
|
||||
General.ErrorLogger.Add(ErrorType.Error, "Error while loading '" + mde.ModelNames[i] + "': unable to find file.");
|
||||
General.ErrorLogger.Add(ErrorType.Error, "Error while loading \"" + mde.ModelNames[i] + "\": unable to find file.");
|
||||
continue;
|
||||
}
|
||||
|
||||
|
@ -112,7 +112,7 @@ namespace CodeImp.DoomBuilder.GZBuilder.MD3
|
|||
case ".md3":
|
||||
if(!string.IsNullOrEmpty(mde.FrameNames[i]))
|
||||
{
|
||||
General.ErrorLogger.Add(ErrorType.Error, "Error while loading '" + mde.ModelNames[i] + "': frame names are not supported for MD3 models!");
|
||||
General.ErrorLogger.Add(ErrorType.Error, "Error while loading \"" + mde.ModelNames[i] + "\": frame names are not supported for MD3 models!");
|
||||
continue;
|
||||
}
|
||||
result = ReadMD3Model(ref bbs, useSkins, ms, device, mde.FrameIndices[i]);
|
||||
|
@ -131,7 +131,7 @@ namespace CodeImp.DoomBuilder.GZBuilder.MD3
|
|||
//got errors?
|
||||
if(!String.IsNullOrEmpty(result.Errors))
|
||||
{
|
||||
General.ErrorLogger.Add(ErrorType.Error, "Error while loading '" + mde.ModelNames[i] + "': " + result.Errors);
|
||||
General.ErrorLogger.Add(ErrorType.Error, "Error while loading \"" + mde.ModelNames[i] + "\": " + result.Errors);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -164,7 +164,7 @@ namespace CodeImp.DoomBuilder.GZBuilder.MD3
|
|||
if(Array.IndexOf(ModelData.SUPPORTED_TEXTURE_EXTENSIONS, ext) == -1)
|
||||
{
|
||||
mde.Model.Textures.Add(General.Map.Data.UnknownTexture3D.Texture);
|
||||
errors.Add("image format '" + ext + "' is not supported!");
|
||||
errors.Add("image format \"" + ext + "\" is not supported!");
|
||||
continue;
|
||||
}
|
||||
|
||||
|
@ -177,7 +177,7 @@ namespace CodeImp.DoomBuilder.GZBuilder.MD3
|
|||
if(t == null)
|
||||
{
|
||||
mde.Model.Textures.Add(General.Map.Data.UnknownTexture3D.Texture);
|
||||
errors.Add("unable to load skin '" + result.Skins[m] + "'");
|
||||
errors.Add("unable to load skin \"" + result.Skins[m] + "\"");
|
||||
continue;
|
||||
}
|
||||
|
||||
|
@ -191,7 +191,7 @@ namespace CodeImp.DoomBuilder.GZBuilder.MD3
|
|||
if(t == null)
|
||||
{
|
||||
mde.Model.Textures.Add(General.Map.Data.UnknownTexture3D.Texture);
|
||||
errors.Add("unable to load texture '" + mde.TextureNames[i] + "'");
|
||||
errors.Add("unable to load texture \"" + mde.TextureNames[i] + "\"");
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -203,7 +203,7 @@ namespace CodeImp.DoomBuilder.GZBuilder.MD3
|
|||
if(errors.Count > 0)
|
||||
{
|
||||
foreach(string e in errors)
|
||||
General.ErrorLogger.Add(ErrorType.Error, "Error while loading '" + mde.ModelNames[i] + "': " + e);
|
||||
General.ErrorLogger.Add(ErrorType.Error, "Error while loading \"" + mde.ModelNames[i] + "\": " + e);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -242,7 +242,7 @@ namespace CodeImp.DoomBuilder.GZBuilder.MD3
|
|||
string magic = ReadString(br, 4);
|
||||
if(magic != "IDP3")
|
||||
{
|
||||
result.Errors = "unknown header: expected 'IDP3', but got '" + magic + "'";
|
||||
result.Errors = "unknown header: expected \"IDP3\", but got \"" + magic + "\"";
|
||||
return result;
|
||||
}
|
||||
|
||||
|
@ -341,7 +341,7 @@ namespace CodeImp.DoomBuilder.GZBuilder.MD3
|
|||
long start = br.BaseStream.Position;
|
||||
|
||||
string magic = ReadString(br, 4);
|
||||
if(magic != "IDP3") return "error while reading surface. Unknown header: expected 'IDP3', but got '" + magic + "'";
|
||||
if(magic != "IDP3") return "error while reading surface. Unknown header: expected \"IDP3\", but got \"" + magic + "\"";
|
||||
|
||||
string name = ReadString(br, 64);
|
||||
int flags = br.ReadInt32();
|
||||
|
@ -432,8 +432,8 @@ namespace CodeImp.DoomBuilder.GZBuilder.MD3
|
|||
{
|
||||
string magic = ReadString(br, 4);
|
||||
if(magic != "IDP2") //magic number: "IDP2"
|
||||
{
|
||||
result.Errors = "unknown header: expected 'IDP2', but got '" + magic + "'";
|
||||
{
|
||||
result.Errors = "unknown header: expected \"IDP2\", but got \"" + magic + "\"";
|
||||
return result;
|
||||
}
|
||||
|
||||
|
@ -521,7 +521,7 @@ namespace CodeImp.DoomBuilder.GZBuilder.MD3
|
|||
// No dice? Bail out!
|
||||
if(!framefound)
|
||||
{
|
||||
result.Errors = "unable to find frame '" + framename + "'!";
|
||||
result.Errors = "unable to find frame \"" + framename + "\"!";
|
||||
return result;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -176,8 +176,8 @@ namespace CodeImp.DoomBuilder
|
|||
foreach(Process process in result.Processes)
|
||||
{
|
||||
result.Error += Path.GetFileName(process.MainModule.FileName)
|
||||
+ " ('" + process.MainModule.FileName
|
||||
+ "', started at " + process.StartTime + ")"
|
||||
+ " (\"" + process.MainModule.FileName
|
||||
+ "\", started at " + process.StartTime + ")"
|
||||
+ Environment.NewLine + Environment.NewLine;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -318,7 +318,7 @@ namespace CodeImp.DoomBuilder
|
|||
ConfigurationInfo cfginfo = new ConfigurationInfo(cfg, fullfilename);
|
||||
|
||||
// Add to lists
|
||||
General.WriteLogLine("Registered game configuration '" + cfginfo.Name + "' from '" + fullfilename + "'");
|
||||
General.WriteLogLine("Registered game configuration \"" + cfginfo.Name + "\" from \"" + fullfilename + "\"");
|
||||
configs.Add(cfginfo);
|
||||
}
|
||||
}
|
||||
|
@ -369,7 +369,7 @@ namespace CodeImp.DoomBuilder
|
|||
catch(Exception e)
|
||||
{
|
||||
// Unable to load configuration
|
||||
errorlogger.Add(ErrorType.Error, "Unable to load the nodebuilder configuration '" + de.Key + "' from \"" + Path.GetFileName(filepath) + "\". Error: " + e.Message);
|
||||
errorlogger.Add(ErrorType.Error, "Unable to load the nodebuilder configuration \"" + de.Key + "\" from \"" + Path.GetFileName(filepath) + "\". Error: " + e.Message);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -677,7 +677,7 @@ namespace CodeImp.DoomBuilder
|
|||
// Show any errors if preferred
|
||||
if(errorlogger.IsErrorAdded)
|
||||
{
|
||||
mainwindow.DisplayStatus(StatusType.Warning, "There were errors during program statup!");
|
||||
mainwindow.DisplayStatus(StatusType.Warning, "There were errors during program startup!");
|
||||
if(!delaymainwindow && General.Settings.ShowErrorsWindow) mainwindow.ShowErrors();
|
||||
}
|
||||
|
||||
|
@ -707,7 +707,7 @@ namespace CodeImp.DoomBuilder
|
|||
if((DateTime.Now - File.GetLastWriteTime(backup)).TotalDays > 30)
|
||||
{
|
||||
File.Delete(backup);
|
||||
WriteLogLine("Removed '" + backup + "' map backup.");
|
||||
WriteLogLine("Removed \"" + backup + "\" map backup.");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -749,7 +749,7 @@ namespace CodeImp.DoomBuilder
|
|||
MessageBoxIcon.Exclamation) == DialogResult.Yes)
|
||||
{
|
||||
// Go to DirectX End-User Runtime Web Installer page (mxd)
|
||||
OpenWebsite("http://www.microsoft.com/en-us/download/details.aspx?id=35");
|
||||
OpenWebsite("https://www.microsoft.com/en-us/download/details.aspx?id=35&44F86079-8679-400C-BFF2-9CA5F2BCBDFC=1");
|
||||
}
|
||||
|
||||
// End program here
|
||||
|
@ -859,7 +859,7 @@ namespace CodeImp.DoomBuilder
|
|||
catch(Exception) { }
|
||||
|
||||
// Warn the user?
|
||||
if(!portablemode) ShowWarningMessage("Failed to enable portable mode.\nMake sure you have write premission for '" + apppath + "' directory.", MessageBoxButtons.OK);
|
||||
if(!portablemode) ShowWarningMessage("Failed to enable portable mode.\nMake sure you have write premission for \"" + apppath + "\" directory.", MessageBoxButtons.OK);
|
||||
}
|
||||
// Resource?
|
||||
else if(string.Compare(curarg, "-RESOURCE", true) == 0)
|
||||
|
@ -1219,8 +1219,8 @@ namespace CodeImp.DoomBuilder
|
|||
if(changemapwindow.ShowDialog(mainwindow) != DialogResult.OK) return;
|
||||
|
||||
// Display status
|
||||
mainwindow.DisplayStatus(StatusType.Busy, "Switching to map '" + changemapwindow.Options.CurrentName + "'...");
|
||||
WriteLogLine("Switching to map '" + changemapwindow.Options.CurrentName + "'...");
|
||||
mainwindow.DisplayStatus(StatusType.Busy, "Switching to map \"" + changemapwindow.Options.CurrentName + "\"...");
|
||||
WriteLogLine("Switching to map \"" + changemapwindow.Options.CurrentName + "\"...");
|
||||
|
||||
Cursor.Current = Cursors.WaitCursor;
|
||||
|
||||
|
@ -1431,8 +1431,14 @@ namespace CodeImp.DoomBuilder
|
|||
mainwindow.DisplayStatus(StatusType.Warning, "There were errors during saving!");
|
||||
if(!delaymainwindow && settings.ShowErrorsWindow) mainwindow.ShowErrors();
|
||||
}
|
||||
else
|
||||
else if(result)
|
||||
{
|
||||
mainwindow.DisplayStatus(StatusType.Info, "Map saved in " + map.FileTitle + ".");
|
||||
}
|
||||
else
|
||||
{
|
||||
mainwindow.DisplayStatus(StatusType.Info, "Map saving cancelled."); //mxd
|
||||
}
|
||||
|
||||
Cursor.Current = Cursors.Default;
|
||||
}
|
||||
|
@ -1499,10 +1505,16 @@ namespace CodeImp.DoomBuilder
|
|||
{
|
||||
// Show any errors if preferred
|
||||
mainwindow.DisplayStatus(StatusType.Warning, "There were errors during saving!");
|
||||
if(!delaymainwindow && General.Settings.ShowErrorsWindow) mainwindow.ShowErrors();
|
||||
if(!delaymainwindow && settings.ShowErrorsWindow) mainwindow.ShowErrors();
|
||||
}
|
||||
else if(result)
|
||||
{
|
||||
mainwindow.DisplayStatus(StatusType.Info, "Map saved in " + map.FileTitle + ".");
|
||||
}
|
||||
else
|
||||
mainwindow.DisplayStatus(StatusType.Info, "Map saved in " + map.FileTitle + ".");
|
||||
{
|
||||
mainwindow.DisplayStatus(StatusType.Info, "Map saving cancelled."); //mxd
|
||||
}
|
||||
|
||||
Cursor.Current = Cursors.Default;
|
||||
}
|
||||
|
@ -1561,8 +1573,14 @@ namespace CodeImp.DoomBuilder
|
|||
mainwindow.DisplayStatus(StatusType.Warning, "There were errors during saving!");
|
||||
if(!delaymainwindow && settings.ShowErrorsWindow) mainwindow.ShowErrors();
|
||||
}
|
||||
else if(result)
|
||||
{
|
||||
mainwindow.DisplayStatus(StatusType.Info, "Map saved in " + map.FileTitle + ".");
|
||||
}
|
||||
else
|
||||
mainwindow.DisplayStatus(StatusType.Info, "Map saved into " + map.FileTitle + ".");
|
||||
{
|
||||
mainwindow.DisplayStatus(StatusType.Info, "Map saving cancelled."); //mxd
|
||||
}
|
||||
|
||||
Cursor.Current = Cursors.Default;
|
||||
}
|
||||
|
|
|
@ -245,7 +245,7 @@ namespace CodeImp.DoomBuilder
|
|||
{
|
||||
if(process != null)
|
||||
{
|
||||
General.ShowWarningMessage("Game engine is already running." + Environment.NewLine + "Please close '" + process.MainModule.FileName + "' first.", MessageBoxButtons.OK);
|
||||
General.ShowWarningMessage("Game engine is already running." + Environment.NewLine + "Please close \"" + process.MainModule.FileName + "\" first.", MessageBoxButtons.OK);
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
|
@ -724,7 +724,7 @@ namespace CodeImp.DoomBuilder
|
|||
internal bool SaveMap(string newfilepathname, SavePurpose purpose)
|
||||
{
|
||||
string settingsfile;
|
||||
WAD targetwad;
|
||||
WAD targetwad = null;
|
||||
bool includenodes;
|
||||
|
||||
General.WriteLogLine("Saving map to file: " + newfilepathname);
|
||||
|
@ -773,6 +773,31 @@ namespace CodeImp.DoomBuilder
|
|||
includenodes = VerifyNodebuilderLumps(tempwad, TEMP_MAP_HEADER);
|
||||
}
|
||||
|
||||
//mxd. Target file is read-only?
|
||||
FileInfo info = new FileInfo(newfilepathname);
|
||||
if(info.Exists && info.IsReadOnly)
|
||||
{
|
||||
if(General.ShowWarningMessage("Unable to save the map: target file is read-only.\nRemove read-only flag and save the map anyway?", MessageBoxButtons.YesNo) == DialogResult.Yes)
|
||||
{
|
||||
General.WriteLogLine("Removing read-only flag from the map file...");
|
||||
try
|
||||
{
|
||||
info.IsReadOnly = false;
|
||||
}
|
||||
catch(Exception e)
|
||||
{
|
||||
General.ShowErrorMessage("Failed to remove read-only flag from \"" + filepathname + "\":" + Environment.NewLine + Environment.NewLine + e.Message, MessageBoxButtons.OK);
|
||||
General.WriteLogLine("Failed to remove read-only flag from \"" + filepathname + "\":" + e.Message);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
General.WriteLogLine("Map saving cancelled...");
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
// Suspend data resources
|
||||
data.Suspend();
|
||||
|
||||
|
@ -916,22 +941,29 @@ namespace CodeImp.DoomBuilder
|
|||
targetwad = new WAD(newfilepathname);
|
||||
}
|
||||
}
|
||||
catch (IOException)
|
||||
catch(Exception e)
|
||||
{
|
||||
General.ShowErrorMessage("IO Error while writing target file: " + newfilepathname + ". Please make sure the location is accessible and not in use by another program.", MessageBoxButtons.OK);
|
||||
if(!string.IsNullOrEmpty(origwadfile) && File.Exists(origwadfile)) File.Delete(origwadfile); //mxd. Clean-up
|
||||
General.ShowErrorMessage("Unable to write the map to target file \"" + newfilepathname + "\":\n" + e.Message, MessageBoxButtons.OK);
|
||||
if(!string.IsNullOrEmpty(origwadfile) && File.Exists(origwadfile))
|
||||
{
|
||||
//mxd. Clean-up
|
||||
if(File.Exists(newfilepathname))
|
||||
{
|
||||
//mxd. We MAY've just deleted the map from the target file. Let's pretend this never happened
|
||||
if(targetwad != null) targetwad.Dispose();
|
||||
File.Delete(newfilepathname);
|
||||
File.Move(origwadfile, newfilepathname);
|
||||
}
|
||||
else
|
||||
{
|
||||
File.Delete(origwadfile);
|
||||
}
|
||||
}
|
||||
|
||||
data.Resume();
|
||||
General.WriteLogLine("Map saving failed");
|
||||
General.WriteLogLine("Map saving failed: " + e.Message);
|
||||
return false;
|
||||
}
|
||||
catch (UnauthorizedAccessException)
|
||||
{
|
||||
General.ShowErrorMessage("Error while accessing target file: " + newfilepathname + ". Please make sure the location is accessible and not in use by another program.", MessageBoxButtons.OK);
|
||||
if(!string.IsNullOrEmpty(origwadfile) && File.Exists(origwadfile)) File.Delete(origwadfile); //mxd. Clean-up
|
||||
data.Resume();
|
||||
General.WriteLogLine("Map saving failed");
|
||||
return false;
|
||||
}
|
||||
|
||||
// Copy map lumps to target file
|
||||
CopyLumpsByType(tempwad, TEMP_MAP_HEADER, targetwad, origmapname, true, true, includenodes, true);
|
||||
|
|
|
@ -10,8 +10,9 @@ namespace CodeImp.DoomBuilder
|
|||
{
|
||||
internal static class UpdateChecker
|
||||
{
|
||||
private const string NO_UPDATE_REQUIRED = "Your version is up to date.";
|
||||
|
||||
private static BackgroundWorker worker;
|
||||
private static string errordesc;
|
||||
private static bool verbose;
|
||||
|
||||
internal static void PerformCheck(bool verbosemode)
|
||||
|
@ -19,15 +20,7 @@ namespace CodeImp.DoomBuilder
|
|||
// Update check already runing?
|
||||
if(worker != null && worker.IsBusy)
|
||||
{
|
||||
if(verbosemode)
|
||||
{
|
||||
General.ShowWarningMessage("Update check is already running!", MessageBoxButtons.OK);
|
||||
}
|
||||
else
|
||||
{
|
||||
General.ErrorLogger.Add(ErrorType.Warning, "Update check is already running!");
|
||||
General.MainWindow.ShowErrors();
|
||||
}
|
||||
if(verbosemode) General.ShowWarningMessage("Update check is already running!", MessageBoxButtons.OK);
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -45,7 +38,7 @@ namespace CodeImp.DoomBuilder
|
|||
string updaterpath = Path.Combine(General.AppPath, "Updater.exe");
|
||||
if(!File.Exists(updaterpath))
|
||||
{
|
||||
errordesc = "Update check failed: '" + updaterpath + "' does not exist!";
|
||||
e.Result = "Update check failed: \"" + updaterpath + "\" does not exist!";
|
||||
e.Cancel = true;
|
||||
return;
|
||||
}
|
||||
|
@ -53,7 +46,7 @@ namespace CodeImp.DoomBuilder
|
|||
string inipath = Path.Combine(General.AppPath, "Updater.ini");
|
||||
if(!File.Exists(inipath))
|
||||
{
|
||||
errordesc = "Update check failed: '" + inipath + "' does not exist!";
|
||||
e.Result = "Update check failed: \"" + inipath + "\" does not exist!";
|
||||
e.Cancel = true;
|
||||
return;
|
||||
}
|
||||
|
@ -61,7 +54,7 @@ namespace CodeImp.DoomBuilder
|
|||
string url = GetDownloadUrl(inipath);
|
||||
if(string.IsNullOrEmpty(url))
|
||||
{
|
||||
errordesc = "Update check failed: failed to get update url from Updater.ini!";
|
||||
e.Result = "Update check failed: failed to get update url from Updater.ini!";
|
||||
e.Cancel = true;
|
||||
return;
|
||||
}
|
||||
|
@ -77,7 +70,7 @@ namespace CodeImp.DoomBuilder
|
|||
{
|
||||
if(stream == null)
|
||||
{
|
||||
errordesc = "Update check failed: failed to retrieve remote revision info.";
|
||||
e.Result = "Update check failed: failed to retrieve remote revision info.";
|
||||
e.Cancel = true;
|
||||
return;
|
||||
}
|
||||
|
@ -90,7 +83,7 @@ namespace CodeImp.DoomBuilder
|
|||
|
||||
if(!int.TryParse(s, out remoterev))
|
||||
{
|
||||
errordesc = "Update check failed: failed to retrieve remote revision number.";
|
||||
e.Result = "Update check failed: failed to retrieve remote revision number.";
|
||||
e.Cancel = true;
|
||||
return;
|
||||
}
|
||||
|
@ -103,7 +96,7 @@ namespace CodeImp.DoomBuilder
|
|||
|
||||
if(string.IsNullOrEmpty(changelog))
|
||||
{
|
||||
errordesc = "Update check failed: failed to retrieve changelog.";
|
||||
e.Result = "Update check failed: failed to retrieve changelog.";
|
||||
e.Cancel = true;
|
||||
return;
|
||||
}
|
||||
|
@ -113,24 +106,20 @@ namespace CodeImp.DoomBuilder
|
|||
}
|
||||
else if(verbose)
|
||||
{
|
||||
errordesc = "Your version is up to date";
|
||||
e.Result = NO_UPDATE_REQUIRED;
|
||||
}
|
||||
}
|
||||
|
||||
private static void RunWorkerCompleted(object sender, RunWorkerCompletedEventArgs runWorkerCompletedEventArgs)
|
||||
private static void RunWorkerCompleted(object sender, RunWorkerCompletedEventArgs e)
|
||||
{
|
||||
worker = null;
|
||||
string errordesc = (e.Result != null ? e.Result.ToString() : string.Empty);
|
||||
if(!string.IsNullOrEmpty(errordesc))
|
||||
{
|
||||
if(verbose)
|
||||
{
|
||||
General.ShowWarningMessage(errordesc, MessageBoxButtons.OK);
|
||||
}
|
||||
else
|
||||
{
|
||||
General.ErrorLogger.Add(ErrorType.Warning, errordesc);
|
||||
General.MainWindow.ShowErrors();
|
||||
}
|
||||
else if(errordesc != NO_UPDATE_REQUIRED)
|
||||
General.ErrorLogger.Add(ErrorType.Error, errordesc);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -178,47 +167,42 @@ namespace CodeImp.DoomBuilder
|
|||
private static MemoryStream DownloadWebFile(string url)
|
||||
{
|
||||
// Open a data stream from the supplied URL
|
||||
WebRequest webReq = WebRequest.Create(url);
|
||||
WebResponse webResponse;
|
||||
WebRequest request = WebRequest.Create(url);
|
||||
WebResponse response;
|
||||
|
||||
try
|
||||
{
|
||||
webResponse = webReq.GetResponse();
|
||||
response = request.GetResponse();
|
||||
}
|
||||
catch(WebException)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
Stream dataStream = webResponse.GetResponseStream();
|
||||
Stream source = response.GetResponseStream();
|
||||
if(source == null) return null;
|
||||
|
||||
// Download the data in chuncks
|
||||
byte[] dataBuffer = new byte[1024];
|
||||
byte[] buffer = new byte[1024];
|
||||
|
||||
// Download the data
|
||||
MemoryStream memoryStream = new MemoryStream();
|
||||
MemoryStream result = new MemoryStream();
|
||||
while(!General.MainWindow.IsDisposed)
|
||||
{
|
||||
// Let's try and read the data
|
||||
int bytesFromStream = dataStream.Read(dataBuffer, 0, dataBuffer.Length);
|
||||
if(bytesFromStream == 0)
|
||||
{
|
||||
// Download complete
|
||||
break;
|
||||
}
|
||||
else
|
||||
{
|
||||
// Write the downloaded data
|
||||
memoryStream.Write(dataBuffer, 0, bytesFromStream);
|
||||
}
|
||||
int numbytes = source.Read(buffer, 0, buffer.Length);
|
||||
if(numbytes == 0) break; // Download complete
|
||||
|
||||
// Write the downloaded data
|
||||
result.Write(buffer, 0, numbytes);
|
||||
}
|
||||
|
||||
// Release resources
|
||||
dataStream.Close();
|
||||
source.Close();
|
||||
|
||||
// Rewind and return the stream
|
||||
memoryStream.Position = 0;
|
||||
return memoryStream;
|
||||
result.Position = 0;
|
||||
return result;
|
||||
}
|
||||
|
||||
private static string GetDownloadUrl(string filename)
|
||||
|
|
|
@ -21,7 +21,7 @@ namespace CodeImp.DoomBuilder.Geometry
|
|||
case Mode.EASE_IN_SINE: return EaseInSine(val1, val2, delta);
|
||||
case Mode.EASE_OUT_SINE: return EaseOutSine(val1, val2, delta);
|
||||
case Mode.EASE_IN_OUT_SINE: return EaseInOutSine(val1, val2, delta);
|
||||
default: throw new NotImplementedException("InterpolationTools.Interpolate: '" + mode + "' mode is not supported!");
|
||||
default: throw new NotImplementedException("InterpolationTools.Interpolate: \"" + mode + "\" mode is not supported!");
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -1845,7 +1845,7 @@ namespace CodeImp.DoomBuilder.Geometry
|
|||
return GetSidedefBottomOffsetY(side, offset, scaleY, fromNormalized);
|
||||
|
||||
default:
|
||||
throw new NotSupportedException("Tools.GetSidedefOffsetY: '" + part + "' geometry type is not supported!");
|
||||
throw new NotSupportedException("Tools.GetSidedefOffsetY: \"" + part + "\" geometry type is not supported!");
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -2236,7 +2236,7 @@ namespace CodeImp.DoomBuilder.Geometry
|
|||
/// <summary>Flips sector linedefs so they all face either inward or outward.</summary>
|
||||
public static void FlipSectorLinedefs(ICollection<Sector> sectors, bool selectedlinesonly)
|
||||
{
|
||||
Dictionary<Linedef, bool> processed = new Dictionary<Linedef, bool>();
|
||||
HashSet<Linedef> processed = new HashSet<Linedef>();
|
||||
|
||||
foreach(Sector s in sectors)
|
||||
{
|
||||
|
@ -2248,7 +2248,7 @@ namespace CodeImp.DoomBuilder.Geometry
|
|||
//sort lines
|
||||
foreach(Sidedef side in s.Sidedefs)
|
||||
{
|
||||
if(processed.ContainsKey(side.Line)) continue;
|
||||
if(processed.Contains(side.Line)) continue;
|
||||
if(selectedlinesonly && !side.Line.Selected)
|
||||
{
|
||||
if(side == side.Line.Front) unselectedfrontlines++;
|
||||
|
@ -2261,7 +2261,7 @@ namespace CodeImp.DoomBuilder.Geometry
|
|||
else
|
||||
backlines.Add(side.Line);
|
||||
|
||||
processed.Add(side.Line, false);
|
||||
processed.Add(side.Line);
|
||||
}
|
||||
|
||||
//flip lines
|
||||
|
|
|
@ -7,6 +7,7 @@ using CodeImp.DoomBuilder.Config;
|
|||
using CodeImp.DoomBuilder.Geometry;
|
||||
using CodeImp.DoomBuilder.Map;
|
||||
using CodeImp.DoomBuilder.Types;
|
||||
using CodeImp.DoomBuilder.Windows;
|
||||
|
||||
#endregion
|
||||
|
||||
|
@ -29,32 +30,56 @@ namespace CodeImp.DoomBuilder.IO
|
|||
public Dictionary<string, bool> Flags;
|
||||
}
|
||||
|
||||
private bool uselongtexturenames; //mxd
|
||||
|
||||
#endregion
|
||||
|
||||
#region ================== Properties
|
||||
|
||||
public bool UseLongTextureNames { get { return uselongtexturenames; } } //mxd
|
||||
|
||||
#endregion
|
||||
|
||||
#region ================== Reading
|
||||
|
||||
// This reads from a stream
|
||||
public MapSet Read(MapSet map, Stream stream)
|
||||
public bool Read(MapSet map, Stream stream)
|
||||
{
|
||||
BinaryReader reader = new BinaryReader(stream);
|
||||
|
||||
//mxd. Sanity checks
|
||||
int numverts = reader.ReadInt32();
|
||||
if(map.Vertices.Count + numverts >= General.Map.FormatInterface.MaxVertices)
|
||||
{
|
||||
General.Interface.DisplayStatus(StatusType.Warning, "Cannot paste: resulting number of vertices (" + (map.Vertices.Count + numverts) + ") will exceed map format's maximum (" + General.Map.FormatInterface.MaxVertices + ").");
|
||||
return false;
|
||||
}
|
||||
|
||||
int numsectors = reader.ReadInt32();
|
||||
if(map.Sectors.Count + numsectors >= General.Map.FormatInterface.MaxSectors)
|
||||
{
|
||||
General.Interface.DisplayStatus(StatusType.Warning, "Cannot paste: resulting number of sectors (" + (map.Sectors.Count + numsectors) + ") will exceed map format's maximum (" + General.Map.FormatInterface.MaxSectors + ").");
|
||||
return false;
|
||||
}
|
||||
|
||||
int numlinedefs = reader.ReadInt32();
|
||||
if(map.Linedefs.Count + numlinedefs >= General.Map.FormatInterface.MaxLinedefs)
|
||||
{
|
||||
General.Interface.DisplayStatus(StatusType.Warning, "Cannot paste: resulting number of linedefs (" + (map.Linedefs.Count + numlinedefs) + ") will exceed map format's maximum (" + General.Map.FormatInterface.MaxLinedefs + ").");
|
||||
return false;
|
||||
}
|
||||
|
||||
int numthings = reader.ReadInt32();
|
||||
if(map.Things.Count + numthings >= General.Map.FormatInterface.MaxThings)
|
||||
{
|
||||
General.Interface.DisplayStatus(StatusType.Warning, "Cannot paste: resulting number of things (" + (map.Things.Count + numthings) + ") will exceed map format's maximum (" + General.Map.FormatInterface.MaxThings + ").");
|
||||
return false;
|
||||
}
|
||||
|
||||
// Read the map
|
||||
uselongtexturenames = reader.ReadBoolean(); //mxd
|
||||
Dictionary<int, Vertex> vertexlink = ReadVertices(map, reader);
|
||||
Dictionary<int, Sector> sectorlink = ReadSectors(map, reader);
|
||||
Dictionary<int, SidedefData> sidedeflink = ReadSidedefs(reader);
|
||||
ReadLinedefs(map, reader, vertexlink, sectorlink, sidedeflink);
|
||||
ReadThings(map, reader);
|
||||
|
||||
return map;
|
||||
return true;
|
||||
}
|
||||
|
||||
private static Dictionary<int, Vertex> ReadVertices(MapSet map, BinaryReader reader)
|
||||
|
@ -388,7 +413,7 @@ namespace CodeImp.DoomBuilder.IO
|
|||
break;
|
||||
|
||||
default: //WOLOLO! ERRORS!
|
||||
throw new Exception("Got unknown value type while reading custom fields from clipboard data! Field '" + name + "', type '" + type + "', primitive type '" + valueType + "'");
|
||||
throw new Exception("Got unknown value type while reading custom fields from clipboard data! Field \"" + name + "\", type \"" + type + "\", primitive type \"" + valueType + "\"");
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -22,7 +22,7 @@ namespace CodeImp.DoomBuilder.IO
|
|||
|
||||
#region ================== Variables
|
||||
|
||||
private Configuration config;
|
||||
private readonly Configuration config;
|
||||
|
||||
#endregion
|
||||
|
||||
|
@ -83,13 +83,13 @@ namespace CodeImp.DoomBuilder.IO
|
|||
|
||||
#region ================== Writing
|
||||
|
||||
public void Write(MapSet map, Stream stream, bool longtexturenames)
|
||||
public void Write(MapSet map, Stream stream)
|
||||
{
|
||||
Write(map.Vertices, map.Linedefs, map.Sidedefs, map.Sectors, map.Things, stream, longtexturenames);
|
||||
Write(map.Vertices, map.Linedefs, map.Sidedefs, map.Sectors, map.Things, stream);
|
||||
}
|
||||
|
||||
public void Write(ICollection<Vertex> vertices, ICollection<Linedef> linedefs, ICollection<Sidedef> sidedefs,
|
||||
ICollection<Sector> sectors, ICollection<Thing> things, Stream stream, bool longtexturenames)
|
||||
ICollection<Sector> sectors, ICollection<Thing> things, Stream stream)
|
||||
{
|
||||
// Create collections
|
||||
Dictionary<Vertex, int> vertexids = new Dictionary<Vertex, int>();
|
||||
|
@ -104,7 +104,10 @@ namespace CodeImp.DoomBuilder.IO
|
|||
BinaryWriter writer = new BinaryWriter(stream);
|
||||
|
||||
// Write the data structures to stream
|
||||
writer.Write(longtexturenames); //mxd
|
||||
writer.Write(vertices.Count); //mxd
|
||||
writer.Write(sectors.Count); //mxd
|
||||
writer.Write(linedefs.Count); //mxd
|
||||
writer.Write(things.Count); //mxd
|
||||
WriteVertices(vertices, writer);
|
||||
WriteSectors(sectors, writer);
|
||||
WriteSidedefs(sidedefs, writer, sectorids);
|
||||
|
@ -292,8 +295,8 @@ namespace CodeImp.DoomBuilder.IO
|
|||
writer.Write(s.ToCharArray());
|
||||
}
|
||||
else //WOLOLO! ERRORS!
|
||||
{
|
||||
General.ErrorLogger.Add(ErrorType.Error, "Unable to copy Universal Field '" + f.Key + "' to clipboard: unknown value type '" + f.Value.Type + "'!");
|
||||
{
|
||||
General.ErrorLogger.Add(ErrorType.Error, "Unable to copy Universal Field \"" + f.Key + "\" to clipboard: unknown value type \"" + f.Value.Type + "\"!");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -804,7 +804,8 @@ namespace CodeImp.DoomBuilder.IO
|
|||
case "true": return true;
|
||||
case "false": return false;
|
||||
case "null": return null;
|
||||
default: RaiseError(file, line, ERROR_KEYWORDUNKNOWN + "\nUnrecognized token: '" + val.Trim().ToLowerInvariant() + "'"); return null;
|
||||
default: RaiseError(file, line, ERROR_KEYWORDUNKNOWN + "\nUnrecognized token: \"" + val.Trim().ToLowerInvariant() + "\"");
|
||||
return null;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -860,7 +861,7 @@ namespace CodeImp.DoomBuilder.IO
|
|||
}
|
||||
else
|
||||
{
|
||||
RaiseError(file, line, "Include missing structure '" + args[1] + "' in file '" + includefile + "'");
|
||||
RaiseError(file, line, "Include missing structure \"" + args[1] + "\" in file \"" + includefile + "\"");
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
@ -885,7 +886,7 @@ namespace CodeImp.DoomBuilder.IO
|
|||
}
|
||||
catch(Exception e)
|
||||
{
|
||||
RaiseError(file, line, "Unable to include file '" + includefile + "'. " + e.GetType().Name + ": " + e.Message);
|
||||
RaiseError(file, line, "Unable to include file \"" + includefile + "\". " + e.GetType().Name + ": " + e.Message);
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -915,7 +916,7 @@ namespace CodeImp.DoomBuilder.IO
|
|||
}
|
||||
else
|
||||
{
|
||||
RaiseError(file, line, "Include missing structure '" + args[1] + "' in file '" + includefile + "'");
|
||||
RaiseError(file, line, "Include missing structure \"" + args[1] + "\" in file \"" + includefile + "\"");
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -60,7 +60,7 @@ namespace CodeImp.DoomBuilder.IO
|
|||
// Will throw and exception when it is not
|
||||
public void ValidateType(Type t)
|
||||
{
|
||||
if(value.GetType() != t) throw new Exception("The value of entry '" + key + "' is of incompatible type (expected " + t.Name + ")");
|
||||
if(value.GetType() != t) throw new Exception("The value of entry \"" + key + "\" is of incompatible type (expected " + t.Name + ")");
|
||||
}
|
||||
|
||||
//mxd
|
||||
|
|
|
@ -414,13 +414,13 @@ namespace CodeImp.DoomBuilder.IO
|
|||
catch(FormatException)
|
||||
{
|
||||
// ERROR: Invalid value in assignment
|
||||
RaiseError(line, ERROR_VALUEINVALID + "\n\nUnrecognized token: '" + s.Trim() + "'");
|
||||
RaiseError(line, ERROR_VALUEINVALID + "\n\nUnrecognized token: \"" + s.Trim() + "\"");
|
||||
}
|
||||
}
|
||||
catch(FormatException)
|
||||
{
|
||||
// ERROR: Invalid value in assignment
|
||||
RaiseError(line, ERROR_VALUEINVALID + "\n\nUnrecognized token: '" + s.Trim() + "'");
|
||||
RaiseError(line, ERROR_VALUEINVALID + "\n\nUnrecognized token: \"" + s.Trim() + "\"");
|
||||
}
|
||||
}
|
||||
// Floating point?
|
||||
|
@ -434,7 +434,7 @@ namespace CodeImp.DoomBuilder.IO
|
|||
catch(FormatException)
|
||||
{
|
||||
// ERROR: Invalid value in assignment
|
||||
RaiseError(line, ERROR_VALUEINVALID + "\n\nUnrecognized token: '" + s.Trim() + "'");
|
||||
RaiseError(line, ERROR_VALUEINVALID + "\n\nUnrecognized token: \"" + s.Trim() + "\"");
|
||||
}
|
||||
|
||||
// Add it to struct
|
||||
|
@ -476,13 +476,13 @@ namespace CodeImp.DoomBuilder.IO
|
|||
catch(FormatException)
|
||||
{
|
||||
// ERROR: Invalid value in assignment
|
||||
RaiseError(line, ERROR_VALUEINVALID + "\n\nUnrecognized token: '" + s.Trim() + "'");
|
||||
RaiseError(line, ERROR_VALUEINVALID + "\n\nUnrecognized token: \"" + s.Trim() + "\"");
|
||||
}
|
||||
}
|
||||
catch(FormatException)
|
||||
{
|
||||
// ERROR: Invalid value in assignment
|
||||
RaiseError(line, ERROR_VALUEINVALID + "\n\nUnrecognized token: '" + s.Trim() + "'");
|
||||
RaiseError(line, ERROR_VALUEINVALID + "\n\nUnrecognized token: \"" + s.Trim() + "\"");
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -533,7 +533,7 @@ namespace CodeImp.DoomBuilder.IO
|
|||
catch(FormatException)
|
||||
{
|
||||
// ERROR: Invalid value in assignment
|
||||
RaiseError(line, ERROR_VALUEINVALID + "\n\nUnrecognized token: '" + v.Trim() + "'");
|
||||
RaiseError(line, ERROR_VALUEINVALID + "\n\nUnrecognized token: \"" + v.Trim() + "\"");
|
||||
}
|
||||
|
||||
// Convert the number to a char
|
||||
|
@ -541,7 +541,7 @@ namespace CodeImp.DoomBuilder.IO
|
|||
catch(FormatException)
|
||||
{
|
||||
// ERROR: Invalid value in assignment
|
||||
RaiseError(line, ERROR_VALUEINVALID + "\n\nUnrecognized token: '" + v.Trim() + "'");
|
||||
RaiseError(line, ERROR_VALUEINVALID + "\n\nUnrecognized token: \"" + v.Trim() + "\"");
|
||||
}
|
||||
|
||||
// Add the char
|
||||
|
@ -623,7 +623,7 @@ namespace CodeImp.DoomBuilder.IO
|
|||
|
||||
default:
|
||||
// Unknown keyword
|
||||
RaiseError(line, ERROR_KEYWORDUNKNOWN + "\n\nUnrecognized token: '" + val.ToString().Trim() + "'");
|
||||
RaiseError(line, ERROR_KEYWORDUNKNOWN + "\n\nUnrecognized token: \"" + val.ToString().Trim() + "\"");
|
||||
break;
|
||||
}
|
||||
|
||||
|
|
|
@ -494,7 +494,7 @@ namespace CodeImp.DoomBuilder.IO
|
|||
}
|
||||
else if(!e.IsValidType(e.Value.GetType()))
|
||||
{
|
||||
General.ErrorLogger.Add(ErrorType.Warning, element + ": the value of entry '" + e.Key + "' is of incompatible type (expected " + e.GetType().Name + ", but got " + e.Value.GetType().Name + "). If you save the map, this value will be ignored.");
|
||||
General.ErrorLogger.Add(ErrorType.Warning, element + ": the value of entry \"" + e.Key + "\" is of incompatible type (expected " + e.GetType().Name + ", but got " + e.Value.GetType().Name + "). If you save the map, this value will be ignored.");
|
||||
continue;
|
||||
}
|
||||
|
||||
|
@ -522,7 +522,7 @@ namespace CodeImp.DoomBuilder.IO
|
|||
}
|
||||
else if(!e.IsValidType(e.Value.GetType()))
|
||||
{
|
||||
General.ErrorLogger.Add(ErrorType.Warning, element + ": the value of entry '" + e.Key + "' is of incompatible type (expected " + e.GetType().Name + ", but got " + e.Value.GetType().Name + "). If you save the map, this value will be ignored.");
|
||||
General.ErrorLogger.Add(ErrorType.Warning, element + ": the value of entry \"" + e.Key + "\" is of incompatible type (expected " + e.GetType().Name + ", but got " + e.Value.GetType().Name + "). If you save the map, this value will be ignored.");
|
||||
continue;
|
||||
}
|
||||
|
||||
|
@ -582,7 +582,7 @@ namespace CodeImp.DoomBuilder.IO
|
|||
{
|
||||
// Report error when entry is required!
|
||||
if(required)
|
||||
General.ErrorLogger.Add(ErrorType.Error, "Error while reading UDMF map data: Missing required field '" + entryname + "' at " + where + ".");
|
||||
General.ErrorLogger.Add(ErrorType.Error, "Error while reading UDMF map data: Missing required field \"" + entryname + "\" at " + where + ".");
|
||||
|
||||
// Make default entry
|
||||
result = defaultvalue;
|
||||
|
|
|
@ -2721,7 +2721,7 @@ namespace CodeImp.DoomBuilder.Map
|
|||
{
|
||||
float px = t.Position.x;
|
||||
float py = t.Position.y;
|
||||
float ts = ((t.FixedSize && General.Map.Renderer2D.Scale > 1.0f) ? t.Size / General.Map.Renderer2D.Scale : t.Size);
|
||||
float ts = (((t.FixedSize || General.Settings.FixedThingsScale) && General.Map.Renderer2D.Scale > 1.0f) ? t.Size / General.Map.Renderer2D.Scale : t.Size);
|
||||
|
||||
//mxd. Within range?
|
||||
if(px < range.Left - ts || px > range.Right + ts || py < range.Top - ts || py > range.Bottom + ts) continue;
|
||||
|
|
|
@ -66,7 +66,7 @@ namespace CodeImp.DoomBuilder.Plugins
|
|||
// Initialize
|
||||
string shortfilename = Path.GetFileName(filename);
|
||||
name = Path.GetFileNameWithoutExtension(filename);
|
||||
General.WriteLogLine("Loading plugin '" + name + "' from '" + shortfilename + "'...");
|
||||
General.WriteLogLine("Loading plugin \"" + name + "\" from \"" + shortfilename + "\"...");
|
||||
|
||||
try
|
||||
{
|
||||
|
@ -218,7 +218,7 @@ namespace CodeImp.DoomBuilder.Plugins
|
|||
catch(TargetInvocationException e)
|
||||
{
|
||||
// Error!
|
||||
string error = "Failed to create class instance '" + t.Name + "' from plugin '" + name + "'.";
|
||||
string error = "Failed to create class instance \"" + t.Name + "\" from plugin \"" + name + "\".";
|
||||
General.ShowErrorMessage(error + Environment.NewLine + Environment.NewLine + "See the error log for more details", MessageBoxButtons.OK, false);
|
||||
General.WriteLogLine(error + " " + e.InnerException.GetType().Name + " at target: "
|
||||
+ e.InnerException.Message + Environment.NewLine + "Stacktrace: " + e.InnerException.StackTrace.Trim());
|
||||
|
@ -227,7 +227,7 @@ namespace CodeImp.DoomBuilder.Plugins
|
|||
catch(Exception e)
|
||||
{
|
||||
// Error!
|
||||
string error = "Failed to create class instance '" + t.Name + "' from plugin '" + name + "'.";
|
||||
string error = "Failed to create class instance \"" + t.Name + "\" from plugin \"" + name + "\".";
|
||||
General.ShowErrorMessage(error + Environment.NewLine + Environment.NewLine + "See the error log for more details", MessageBoxButtons.OK, false);
|
||||
General.WriteLogLine(error + " " + e.GetType().Name + ": " + e.Message + Environment.NewLine
|
||||
+ "Stacktrace: " + e.StackTrace.Trim());
|
||||
|
|
14
Source/Core/Properties/Resources.Designer.cs
generated
14
Source/Core/Properties/Resources.Designer.cs
generated
|
@ -1,7 +1,7 @@
|
|||
//------------------------------------------------------------------------------
|
||||
// <auto-generated>
|
||||
// Dieser Code wurde von einem Tool generiert.
|
||||
// Laufzeitversion:4.0.30319.42000
|
||||
// This code was generated by a tool.
|
||||
// Runtime Version:2.0.50727.5466
|
||||
//
|
||||
// Änderungen an dieser Datei können falsches Verhalten verursachen und gehen verloren, wenn
|
||||
// der Code erneut generiert wird.
|
||||
|
@ -370,9 +370,13 @@ namespace CodeImp.DoomBuilder.Properties {
|
|||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Sucht eine lokalisierte Ressource vom Typ System.Drawing.Bitmap.
|
||||
/// </summary>
|
||||
internal static System.Drawing.Bitmap FixedThingsScale {
|
||||
get {
|
||||
object obj = ResourceManager.GetObject("FixedThingsScale", resourceCulture);
|
||||
return ((System.Drawing.Bitmap)(obj));
|
||||
}
|
||||
}
|
||||
|
||||
internal static System.Drawing.Bitmap fog {
|
||||
get {
|
||||
object obj = ResourceManager.GetObject("fog", resourceCulture);
|
||||
|
|
|
@ -574,4 +574,7 @@
|
|||
<data name="ScriptProperty" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
||||
<value>..\Resources\ScriptProperty.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
|
||||
</data>
|
||||
<data name="FixedThingsScale" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
||||
<value>..\Resources\FixedThingsScale.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
|
||||
</data>
|
||||
</root>
|
|
@ -168,8 +168,8 @@ namespace CodeImp.DoomBuilder.Rendering
|
|||
device.SetRenderState(RenderState.NormalizeNormals, false);
|
||||
device.SetRenderState(RenderState.PointSpriteEnable, false);
|
||||
device.SetRenderState(RenderState.RangeFogEnable, false);
|
||||
device.SetRenderState(RenderState.ShadeMode, ShadeMode.Flat); //mxd
|
||||
device.SetRenderState(RenderState.SourceBlend, Blend.SourceAlpha);
|
||||
device.SetRenderState(RenderState.ShadeMode, ShadeMode.Gouraud);
|
||||
device.SetRenderState(RenderState.SourceBlend, Blend.SourceAlpha);
|
||||
device.SetRenderState(RenderState.SpecularEnable, false);
|
||||
device.SetRenderState(RenderState.StencilEnable, false);
|
||||
device.SetRenderState(RenderState.TextureFactor, -1);
|
||||
|
|
|
@ -74,6 +74,7 @@ namespace CodeImp.DoomBuilder.Rendering
|
|||
void RenderRectangleFilled(RectangleF rect, PixelColor c, bool transformrect, ImageData texture);
|
||||
void RenderLine(Vector2D start, Vector2D end, float thickness, PixelColor c, bool transformcoords);
|
||||
void RenderArrows(ICollection<Line3D> line); //mxd
|
||||
void RenderArrows(ICollection<Line3D> line, bool transformcoords); //mxd
|
||||
void RenderText(TextLabel text);
|
||||
void RenderGeometry(FlatVertex[] vertices, ImageData texture, bool transformcoords);
|
||||
void RenderHighlight(FlatVertex[] vertices, int color); //mxd
|
||||
|
|
|
@ -250,7 +250,6 @@ namespace CodeImp.DoomBuilder.Rendering
|
|||
// BACKGROUND
|
||||
case RendererLayer.Background:
|
||||
if((backimageverts == null) || (General.Map.Grid.Background.Texture == null)) break;
|
||||
graphics.Device.SetTexture(0, General.Map.Grid.Background.Texture);
|
||||
graphics.Shaders.Display2D.Texture1 = General.Map.Grid.Background.Texture;
|
||||
graphics.Shaders.Display2D.SetSettings(1f / windowsize.Width, 1f / windowsize.Height, FSAA_FACTOR, layer.alpha, false);
|
||||
graphics.Shaders.Display2D.BeginPass(aapass);
|
||||
|
@ -261,7 +260,6 @@ namespace CodeImp.DoomBuilder.Rendering
|
|||
|
||||
// GRID
|
||||
case RendererLayer.Grid:
|
||||
graphics.Device.SetTexture(0, backtex);
|
||||
graphics.Shaders.Display2D.Texture1 = backtex;
|
||||
graphics.Shaders.Display2D.SetSettings(1f / backsize.Width, 1f / backsize.Height, FSAA_FACTOR, layer.alpha, false);
|
||||
graphics.Shaders.Display2D.BeginPass(aapass);
|
||||
|
@ -271,7 +269,6 @@ namespace CodeImp.DoomBuilder.Rendering
|
|||
|
||||
// GEOMETRY
|
||||
case RendererLayer.Geometry:
|
||||
graphics.Device.SetTexture(0, plottertex);
|
||||
graphics.Shaders.Display2D.Texture1 = plottertex;
|
||||
graphics.Shaders.Display2D.SetSettings(1f / structsize.Width, 1f / structsize.Height, FSAA_FACTOR, layer.alpha, false);
|
||||
graphics.Shaders.Display2D.BeginPass(aapass);
|
||||
|
@ -281,7 +278,6 @@ namespace CodeImp.DoomBuilder.Rendering
|
|||
|
||||
// THINGS
|
||||
case RendererLayer.Things:
|
||||
graphics.Device.SetTexture(0, thingstex);
|
||||
graphics.Shaders.Display2D.Texture1 = thingstex;
|
||||
graphics.Shaders.Display2D.SetSettings(1f / thingssize.Width, 1f / thingssize.Height, FSAA_FACTOR, layer.alpha, false);
|
||||
graphics.Shaders.Display2D.BeginPass(aapass);
|
||||
|
@ -291,7 +287,6 @@ namespace CodeImp.DoomBuilder.Rendering
|
|||
|
||||
// OVERLAY
|
||||
case RendererLayer.Overlay:
|
||||
graphics.Device.SetTexture(0, overlaytex);
|
||||
graphics.Shaders.Display2D.Texture1 = overlaytex;
|
||||
graphics.Shaders.Display2D.SetSettings(1f / overlaysize.Width, 1f / overlaysize.Height, FSAA_FACTOR, layer.alpha, false);
|
||||
graphics.Shaders.Display2D.BeginPass(aapass);
|
||||
|
@ -301,7 +296,6 @@ namespace CodeImp.DoomBuilder.Rendering
|
|||
|
||||
// SURFACE
|
||||
case RendererLayer.Surface:
|
||||
graphics.Device.SetTexture(0, surfacetex);
|
||||
graphics.Shaders.Display2D.Texture1 = surfacetex;
|
||||
graphics.Shaders.Display2D.SetSettings(1f / overlaysize.Width, 1f / overlaysize.Height, FSAA_FACTOR, layer.alpha, false);
|
||||
graphics.Shaders.Display2D.BeginPass(aapass);
|
||||
|
@ -317,7 +311,6 @@ namespace CodeImp.DoomBuilder.Rendering
|
|||
graphics.Present();
|
||||
|
||||
// Release binds
|
||||
graphics.Device.SetTexture(0, null);
|
||||
graphics.Shaders.Display2D.Texture1 = null;
|
||||
graphics.Device.SetStreamSource(0, null, 0, 0);
|
||||
}
|
||||
|
@ -985,20 +978,22 @@ namespace CodeImp.DoomBuilder.Rendering
|
|||
|
||||
// This makes vertices for a thing
|
||||
// Returns false when not on the screen
|
||||
private bool CreateThingBoxVerts(Thing t, ref FlatVertex[] verts, Dictionary<Thing, Vector2D> thingsByPosition, int offset, PixelColor c)
|
||||
private bool CreateThingBoxVerts(Thing t, ref FlatVertex[] verts, ref List<Line3D> bboxes, Dictionary<Thing, Vector2D> thingsByPosition, int offset, PixelColor c, byte bboxalpha)
|
||||
{
|
||||
float thingsize = General.Settings.DrawThingsFixedSize ? General.Settings.DefaultThingSize : t.Size;
|
||||
if(thingsize * scale < MINIMUM_THING_RADIUS) return false; //mxd. Don't render tiny little things
|
||||
|
||||
// Determine size
|
||||
float circlesize = (t.FixedSize && (scale > 1.0f) ? thingsize /* * THING_CIRCLE_SIZE*/ : thingsize * scale /* * THING_CIRCLE_SIZE*/);
|
||||
// Determine sizes
|
||||
float circlesize = ((t.FixedSize || General.Settings.FixedThingsScale) && (scale > 1.0f) ? t.Size : t.Size * scale);
|
||||
float bboxsize = ((!t.FixedSize && General.Settings.FixedThingsScale) && (scale > 1.0f) ? t.Size * scale : -1); //mxd
|
||||
float screensize = Math.Max(circlesize, bboxsize); //mxd
|
||||
|
||||
// Transform to screen coordinates
|
||||
Vector2D screenpos = ((Vector2D)t.Position).GetTransformed(translatex, translatey, scale, -scale);
|
||||
|
||||
// Check if the thing is actually on screen
|
||||
if(((screenpos.x + circlesize) <= 0.0f) || ((screenpos.x - circlesize) >= windowsize.Width) ||
|
||||
((screenpos.y + circlesize) <= 0.0f) || ((screenpos.y - circlesize) >= windowsize.Height))
|
||||
if(((screenpos.x + screensize) <= 0.0f) || ((screenpos.x - screensize) >= windowsize.Width) ||
|
||||
((screenpos.y + screensize) <= 0.0f) || ((screenpos.y - screensize) >= windowsize.Height))
|
||||
return false;
|
||||
|
||||
// Get integral color
|
||||
|
@ -1036,6 +1031,22 @@ namespace CodeImp.DoomBuilder.Rendering
|
|||
//mxd. Add to list
|
||||
thingsByPosition.Add(t, screenpos);
|
||||
|
||||
//mxd. Add bounding box?
|
||||
if(bboxsize > 0)
|
||||
{
|
||||
PixelColor boxcolor = c.WithAlpha(bboxalpha);
|
||||
|
||||
Vector2D tl = new Vector2D(screenpos.x - bboxsize, screenpos.y - bboxsize);
|
||||
Vector2D tr = new Vector2D(screenpos.x + bboxsize, screenpos.y - bboxsize);
|
||||
Vector2D bl = new Vector2D(screenpos.x - bboxsize, screenpos.y + bboxsize);
|
||||
Vector2D br = new Vector2D(screenpos.x + bboxsize, screenpos.y + bboxsize);
|
||||
|
||||
bboxes.Add(new Line3D(tl, tr, boxcolor, false));
|
||||
bboxes.Add(new Line3D(tr, br, boxcolor, false));
|
||||
bboxes.Add(new Line3D(bl, br, boxcolor, false));
|
||||
bboxes.Add(new Line3D(tl, bl, boxcolor, false));
|
||||
}
|
||||
|
||||
// Done
|
||||
return true;
|
||||
}
|
||||
|
@ -1045,10 +1056,10 @@ namespace CodeImp.DoomBuilder.Rendering
|
|||
{
|
||||
// Determine size
|
||||
float thingsize = General.Settings.DrawThingsFixedSize ? General.Settings.DefaultThingSize : t.Size;
|
||||
float arrowsize = (t.FixedSize && (scale > 1.0f) ? thingsize : thingsize * scale) * THING_ARROW_SIZE; //mxd
|
||||
float arrowsize = ((t.FixedSize || General.Settings.FixedThingsScale) && (scale > 1.0f) ? t.Size : t.Size * scale) * THING_ARROW_SIZE; //mxd
|
||||
|
||||
// Setup rotated rect for arrow
|
||||
float sinarrowsize = (float)Math.Sin(t.Angle + Angle2D.PI * 0.25f) * arrowsize;
|
||||
// Setup rotated rect for arrow
|
||||
float sinarrowsize = (float)Math.Sin(t.Angle + Angle2D.PI * 0.25f) * arrowsize;
|
||||
float cosarrowsize = (float)Math.Cos(t.Angle + Angle2D.PI * 0.25f) * arrowsize;
|
||||
|
||||
verts[offset].x = screenpos.x + sinarrowsize;
|
||||
|
@ -1123,6 +1134,7 @@ namespace CodeImp.DoomBuilder.Rendering
|
|||
|
||||
// Make alpha color
|
||||
Color4 alphacolor = new Color4(alpha, 1.0f, 1.0f, 1.0f);
|
||||
bool isthingsmode = (General.Editing.Mode.GetType().Name == "ThingsMode");
|
||||
|
||||
// Set renderstates for things rendering
|
||||
graphics.Device.SetRenderState(RenderState.CullMode, Cull.None);
|
||||
|
@ -1136,7 +1148,6 @@ namespace CodeImp.DoomBuilder.Rendering
|
|||
graphics.Device.SetStreamSource(0, thingsvertices, 0, FlatVertex.Stride);
|
||||
|
||||
// Set things texture
|
||||
graphics.Device.SetTexture(0, thingtexture.Texture);
|
||||
graphics.Shaders.Things2D.Texture1 = thingtexture.Texture;
|
||||
SetWorldTransformation(false);
|
||||
graphics.Shaders.Things2D.SetSettings(alpha);
|
||||
|
@ -1148,6 +1159,7 @@ namespace CodeImp.DoomBuilder.Rendering
|
|||
// Determine next lock size
|
||||
int locksize = (things.Count > THING_BUFFER_SIZE) ? THING_BUFFER_SIZE : things.Count;
|
||||
FlatVertex[] verts = new FlatVertex[THING_BUFFER_SIZE * 6];
|
||||
List<Line3D> bboxes = new List<Line3D>(locksize); //mxd
|
||||
|
||||
//mxd
|
||||
Dictionary<int, List<Thing>> thingsByType = new Dictionary<int, List<Thing>>();
|
||||
|
@ -1171,7 +1183,8 @@ namespace CodeImp.DoomBuilder.Rendering
|
|||
|
||||
// Create vertices
|
||||
PixelColor tc = fixedcolor ? c : DetermineThingColor(t);
|
||||
if(CreateThingBoxVerts(t, ref verts, thingsByPosition, buffercount * 6, tc))
|
||||
byte bboxalpha = (byte)(alpha * ((!fixedcolor && !t.Selected && isthingsmode) ? 128 : 255));
|
||||
if(CreateThingBoxVerts(t, ref verts, ref bboxes, thingsByPosition, buffercount * 6, tc, bboxalpha))
|
||||
{
|
||||
buffercount++;
|
||||
|
||||
|
@ -1234,8 +1247,8 @@ namespace CodeImp.DoomBuilder.Rendering
|
|||
}
|
||||
if(sprite.Texture == null) sprite.CreateTexture();
|
||||
|
||||
graphics.Device.SetTexture(0, sprite.Texture);
|
||||
graphics.Shaders.Things2D.Texture1 = sprite.Texture;
|
||||
graphics.Shaders.Things2D.ApplySettings();
|
||||
|
||||
// Determine next lock size
|
||||
locksize = (group.Value.Count > THING_BUFFER_SIZE) ? THING_BUFFER_SIZE : group.Value.Count;
|
||||
|
@ -1246,7 +1259,7 @@ namespace CodeImp.DoomBuilder.Rendering
|
|||
totalcount = 0;
|
||||
|
||||
float spriteWidth, spriteHeight;
|
||||
float spriteScale = (group.Value[0].FixedSize && (scale > 1.0f)) ? 1.0f : scale;
|
||||
float spriteScale = ((group.Value[0].FixedSize || General.Settings.FixedThingsScale) && (scale > 1.0f)) ? 1.0f : scale;
|
||||
|
||||
float radius = General.Settings.DrawThingsFixedSize ? General.Settings.DefaultThingSize : info.Radius;
|
||||
if(sprite.Width > sprite.Height)
|
||||
|
@ -1310,7 +1323,6 @@ namespace CodeImp.DoomBuilder.Rendering
|
|||
graphics.Shaders.Things2D.EndPass();
|
||||
|
||||
//mxd. Render thing arrows
|
||||
graphics.Device.SetTexture(0, thingtexture.Texture);
|
||||
graphics.Shaders.Things2D.Texture1 = thingtexture.Texture;
|
||||
graphics.Shaders.Things2D.BeginPass(0);
|
||||
|
||||
|
@ -1418,6 +1430,9 @@ namespace CodeImp.DoomBuilder.Rendering
|
|||
}
|
||||
|
||||
graphics.Shaders.Things2D.End();
|
||||
|
||||
//mxd. Render thing boxes
|
||||
RenderArrows(bboxes, false);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1625,7 +1640,6 @@ namespace CodeImp.DoomBuilder.Rendering
|
|||
graphics.Device.SetRenderState(RenderState.TextureFactor, -1);
|
||||
graphics.Device.SetRenderState(RenderState.FogEnable, false);
|
||||
graphics.Shaders.Display2D.Texture1 = t;
|
||||
graphics.Device.SetTexture(0, t);
|
||||
SetWorldTransformation(transformcoords);
|
||||
graphics.Shaders.Display2D.SetSettings(1f, 1f, 0f, 1f, General.Settings.ClassicBilinear);
|
||||
|
||||
|
@ -1682,7 +1696,6 @@ namespace CodeImp.DoomBuilder.Rendering
|
|||
graphics.Shaders.Display2D.Texture1 = graphics.FontTexture;
|
||||
SetWorldTransformation(false);
|
||||
graphics.Shaders.Display2D.SetSettings(1f, 1f, 0f, 1f, true);
|
||||
graphics.Device.SetTexture(0, graphics.FontTexture);
|
||||
graphics.Device.SetStreamSource(0, text.VertexBuffer, 0, FlatVertex.Stride);
|
||||
|
||||
// Draw
|
||||
|
@ -1745,7 +1758,6 @@ namespace CodeImp.DoomBuilder.Rendering
|
|||
graphics.Device.SetRenderState(RenderState.TextureFactor, -1);
|
||||
graphics.Device.SetRenderState(RenderState.FogEnable, false);
|
||||
SetWorldTransformation(false);
|
||||
graphics.Device.SetTexture(0, General.Map.Data.WhiteTexture.Texture);
|
||||
graphics.Shaders.Display2D.Texture1 = General.Map.Data.WhiteTexture.Texture;
|
||||
graphics.Shaders.Display2D.SetSettings(1f, 1f, 0f, 1f, General.Settings.ClassicBilinear);
|
||||
|
||||
|
@ -1784,7 +1796,6 @@ namespace CodeImp.DoomBuilder.Rendering
|
|||
graphics.Device.SetRenderState(RenderState.TextureFactor, -1);
|
||||
graphics.Device.SetRenderState(RenderState.FogEnable, false);
|
||||
SetWorldTransformation(false);
|
||||
graphics.Device.SetTexture(0, General.Map.Data.WhiteTexture.Texture);
|
||||
graphics.Shaders.Display2D.Texture1 = General.Map.Data.WhiteTexture.Texture;
|
||||
graphics.Shaders.Display2D.SetSettings(1f, 1f, 0f, 1f, General.Settings.ClassicBilinear);
|
||||
|
||||
|
@ -1820,7 +1831,6 @@ namespace CodeImp.DoomBuilder.Rendering
|
|||
graphics.Device.SetRenderState(RenderState.TextureFactor, -1);
|
||||
graphics.Device.SetRenderState(RenderState.FogEnable, false);
|
||||
SetWorldTransformation(false);
|
||||
graphics.Device.SetTexture(0, texture.Texture);
|
||||
graphics.Shaders.Display2D.Texture1 = texture.Texture;
|
||||
graphics.Shaders.Display2D.SetSettings(1f, 1f, 0f, 1f, General.Settings.ClassicBilinear);
|
||||
|
||||
|
@ -1833,7 +1843,8 @@ namespace CodeImp.DoomBuilder.Rendering
|
|||
}
|
||||
|
||||
//mxd
|
||||
public void RenderArrows(ICollection<Line3D> lines)
|
||||
public void RenderArrows(ICollection<Line3D> lines) { RenderArrows(lines, true); }
|
||||
public void RenderArrows(ICollection<Line3D> lines, bool transformcoords)
|
||||
{
|
||||
if(lines.Count == 0) return;
|
||||
int pointscount = 0;
|
||||
|
@ -1841,9 +1852,12 @@ namespace CodeImp.DoomBuilder.Rendering
|
|||
// Translate to screen coords, determine renderability
|
||||
foreach(Line3D line in lines)
|
||||
{
|
||||
// Calculate screen positions
|
||||
line.Start2D = ((Vector2D)line.Start).GetTransformed(translatex, translatey, scale, -scale); //start
|
||||
line.End2D = ((Vector2D)line.End).GetTransformed(translatex, translatey, scale, -scale); //end
|
||||
// Calculate screen positions?
|
||||
if(transformcoords)
|
||||
{
|
||||
line.Start2D = ((Vector2D)line.Start).GetTransformed(translatex, translatey, scale, -scale); //start
|
||||
line.End2D = ((Vector2D)line.End).GetTransformed(translatex, translatey, scale, -scale); //end
|
||||
}
|
||||
|
||||
float maxx = Math.Max(line.Start2D.x, line.End2D.x);
|
||||
float minx = Math.Min(line.Start2D.x, line.End2D.x);
|
||||
|
@ -1922,7 +1936,6 @@ namespace CodeImp.DoomBuilder.Rendering
|
|||
graphics.Device.SetRenderState(RenderState.TextureFactor, -1);
|
||||
graphics.Device.SetRenderState(RenderState.FogEnable, false);
|
||||
SetWorldTransformation(false);
|
||||
graphics.Device.SetTexture(0, General.Map.Data.WhiteTexture.Texture);
|
||||
graphics.Shaders.Display2D.Texture1 = General.Map.Data.WhiteTexture.Texture;
|
||||
graphics.Shaders.Display2D.SetSettings(1f, 1f, 0f, 1f, General.Settings.ClassicBilinear);
|
||||
|
||||
|
@ -1999,7 +2012,6 @@ namespace CodeImp.DoomBuilder.Rendering
|
|||
graphics.Device.SetRenderState(RenderState.TextureFactor, -1);
|
||||
graphics.Device.SetRenderState(RenderState.FogEnable, false);
|
||||
SetWorldTransformation(false);
|
||||
graphics.Device.SetTexture(0, General.Map.Data.WhiteTexture.Texture);
|
||||
graphics.Shaders.Display2D.Texture1 = General.Map.Data.WhiteTexture.Texture;
|
||||
graphics.Shaders.Display2D.SetSettings(1f, 1f, 0f, 1f, General.Settings.ClassicBilinear);
|
||||
|
||||
|
|
|
@ -1874,13 +1874,11 @@ namespace CodeImp.DoomBuilder.Rendering
|
|||
if(crosshairbusy)
|
||||
{
|
||||
if(General.Map.Data.CrosshairBusy3D.Texture == null) General.Map.Data.CrosshairBusy3D.CreateTexture();
|
||||
graphics.Device.SetTexture(0, General.Map.Data.CrosshairBusy3D.Texture);
|
||||
graphics.Shaders.Display2D.Texture1 = General.Map.Data.CrosshairBusy3D.Texture;
|
||||
}
|
||||
else
|
||||
{
|
||||
if(General.Map.Data.Crosshair3D.Texture == null) General.Map.Data.Crosshair3D.CreateTexture();
|
||||
graphics.Device.SetTexture(0, General.Map.Data.Crosshair3D.Texture);
|
||||
graphics.Shaders.Display2D.Texture1 = General.Map.Data.Crosshair3D.Texture;
|
||||
}
|
||||
|
||||
|
|
|
@ -1037,6 +1037,16 @@ togglecomments //mxd
|
|||
allowscroll = false;
|
||||
}
|
||||
|
||||
togglefixedthingsscale //mxd
|
||||
{
|
||||
title = "Toggle Fixed Things Scale";
|
||||
category = "view";
|
||||
description = "When enabled, Things will no longer be scaled based on current zoom level in Classic modes.";
|
||||
allowkeys = true;
|
||||
allowmouse = false;
|
||||
allowscroll = false;
|
||||
}
|
||||
|
||||
togglebrightness //mxd
|
||||
{
|
||||
title = "Toggle Full Brightness";
|
||||
|
|
BIN
Source/Core/Resources/FixedThingsScale.png
Normal file
BIN
Source/Core/Resources/FixedThingsScale.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 1.6 KiB |
|
@ -102,6 +102,11 @@ namespace CodeImp.DoomBuilder.Types
|
|||
return this.value.ToString();
|
||||
}
|
||||
|
||||
public override object GetDefaultValue()
|
||||
{
|
||||
return 0f;
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
|
|
|
@ -101,6 +101,11 @@ namespace CodeImp.DoomBuilder.Types
|
|||
return this.value.ToString();
|
||||
}
|
||||
|
||||
public override object GetDefaultValue()
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
|
|
|
@ -102,6 +102,11 @@ namespace CodeImp.DoomBuilder.Types
|
|||
return this.value.ToString();
|
||||
}
|
||||
|
||||
public override object GetDefaultValue()
|
||||
{
|
||||
return 0f;
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
|
|
|
@ -93,7 +93,7 @@ namespace CodeImp.DoomBuilder.Types
|
|||
|
||||
public override int GetIntValue()
|
||||
{
|
||||
if(this.value) return 1; else return 0;
|
||||
return (this.value ? 1 : 0);
|
||||
}
|
||||
|
||||
public override string GetStringValue()
|
||||
|
@ -106,6 +106,11 @@ namespace CodeImp.DoomBuilder.Types
|
|||
{
|
||||
return list;
|
||||
}
|
||||
|
||||
public override object GetDefaultValue()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
|
|
|
@ -113,6 +113,11 @@ namespace CodeImp.DoomBuilder.Types
|
|||
return this.value.ToString("X6");
|
||||
}
|
||||
|
||||
public override object GetDefaultValue()
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
|
|
|
@ -38,7 +38,7 @@ namespace CodeImp.DoomBuilder.Types
|
|||
|
||||
private EnumList list;
|
||||
private int value;
|
||||
private int defaultValue; //mxd
|
||||
private int defaultvalue; //mxd
|
||||
|
||||
#endregion
|
||||
|
||||
|
@ -55,7 +55,7 @@ namespace CodeImp.DoomBuilder.Types
|
|||
// When set up for an argument
|
||||
public override void SetupArgument(TypeHandlerAttribute attr, ArgumentInfo arginfo)
|
||||
{
|
||||
defaultValue = (int)arginfo.DefaultValue;//mxd
|
||||
defaultvalue = (int)arginfo.DefaultValue;//mxd
|
||||
base.SetupArgument(attr, arginfo);
|
||||
|
||||
// Keep enum list reference
|
||||
|
@ -100,9 +100,9 @@ namespace CodeImp.DoomBuilder.Types
|
|||
}
|
||||
|
||||
//mxd
|
||||
public override void SetDefaultValue()
|
||||
public override void ApplyDefaultValue()
|
||||
{
|
||||
value = defaultValue;
|
||||
value = defaultvalue;
|
||||
}
|
||||
|
||||
public override object GetValue()
|
||||
|
@ -120,6 +120,11 @@ namespace CodeImp.DoomBuilder.Types
|
|||
return this.value.ToString();
|
||||
}
|
||||
|
||||
public override object GetDefaultValue()
|
||||
{
|
||||
return defaultvalue;
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
|
|
|
@ -140,7 +140,7 @@ namespace CodeImp.DoomBuilder.Types
|
|||
}
|
||||
|
||||
//mxd
|
||||
public override void SetDefaultValue()
|
||||
public override void ApplyDefaultValue()
|
||||
{
|
||||
value = defaultvalue;
|
||||
}
|
||||
|
@ -189,6 +189,11 @@ namespace CodeImp.DoomBuilder.Types
|
|||
{
|
||||
return General.Types.GetAttribute((int)UniversalType.Integer);
|
||||
}
|
||||
|
||||
public override object GetDefaultValue()
|
||||
{
|
||||
return defaultvalue;
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
|
|
|
@ -34,7 +34,7 @@ namespace CodeImp.DoomBuilder.Types
|
|||
|
||||
private EnumList list;
|
||||
private EnumItem value;
|
||||
private EnumItem defaultValue; //mxd
|
||||
private EnumItem defaultvalue; //mxd
|
||||
|
||||
#endregion
|
||||
|
||||
|
@ -50,7 +50,7 @@ namespace CodeImp.DoomBuilder.Types
|
|||
// When set up for an argument
|
||||
public override void SetupArgument(TypeHandlerAttribute attr, ArgumentInfo arginfo)
|
||||
{
|
||||
defaultValue = new EnumItem(arginfo.DefaultValue.ToString(), arginfo.DefaultValue.ToString()); //mxd
|
||||
defaultvalue = new EnumItem(arginfo.DefaultValue.ToString(), arginfo.DefaultValue.ToString()); //mxd
|
||||
base.SetupArgument(attr, arginfo);
|
||||
|
||||
// Keep enum list reference
|
||||
|
@ -121,9 +121,9 @@ namespace CodeImp.DoomBuilder.Types
|
|||
}
|
||||
|
||||
//mxd
|
||||
public override void SetDefaultValue()
|
||||
public override void ApplyDefaultValue()
|
||||
{
|
||||
value = defaultValue;
|
||||
value = defaultvalue;
|
||||
}
|
||||
|
||||
public override object GetValue()
|
||||
|
@ -171,6 +171,11 @@ namespace CodeImp.DoomBuilder.Types
|
|||
return General.Types.GetAttribute((int)UniversalType.String);
|
||||
}
|
||||
|
||||
public override object GetDefaultValue()
|
||||
{
|
||||
return defaultvalue;
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
|
|
|
@ -70,6 +70,11 @@ namespace CodeImp.DoomBuilder.Types
|
|||
return this.value;
|
||||
}
|
||||
|
||||
public override object GetDefaultValue()
|
||||
{
|
||||
return string.Empty;
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
|
|
|
@ -85,6 +85,11 @@ namespace CodeImp.DoomBuilder.Types
|
|||
return this.value.ToString();
|
||||
}
|
||||
|
||||
public override object GetDefaultValue()
|
||||
{
|
||||
return 0f;
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
|
|
|
@ -34,7 +34,7 @@ namespace CodeImp.DoomBuilder.Types
|
|||
#region ================== Variables
|
||||
|
||||
private int value;
|
||||
private int defaultValue; //mxd
|
||||
private int defaultvalue; //mxd
|
||||
|
||||
#endregion
|
||||
|
||||
|
@ -47,7 +47,7 @@ namespace CodeImp.DoomBuilder.Types
|
|||
//mxd
|
||||
public override void SetupArgument(TypeHandlerAttribute attr, ArgumentInfo arginfo)
|
||||
{
|
||||
defaultValue = (int)arginfo.DefaultValue;
|
||||
defaultvalue = (int)arginfo.DefaultValue;
|
||||
base.SetupArgument(attr, arginfo);
|
||||
}
|
||||
|
||||
|
@ -85,9 +85,9 @@ namespace CodeImp.DoomBuilder.Types
|
|||
}
|
||||
|
||||
//mxd
|
||||
public override void SetDefaultValue()
|
||||
public override void ApplyDefaultValue()
|
||||
{
|
||||
value = defaultValue;
|
||||
value = defaultvalue;
|
||||
}
|
||||
|
||||
public override object GetValue()
|
||||
|
@ -104,6 +104,11 @@ namespace CodeImp.DoomBuilder.Types
|
|||
{
|
||||
return this.value.ToString();
|
||||
}
|
||||
|
||||
public override object GetDefaultValue()
|
||||
{
|
||||
return defaultvalue;
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
|
|
|
@ -101,6 +101,11 @@ namespace CodeImp.DoomBuilder.Types
|
|||
return this.value.ToString();
|
||||
}
|
||||
|
||||
public override object GetDefaultValue()
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
|
|
|
@ -62,6 +62,11 @@ namespace CodeImp.DoomBuilder.Types
|
|||
{
|
||||
return this.value.ToString();
|
||||
}
|
||||
|
||||
public override object GetDefaultValue()
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
|
|
|
@ -18,7 +18,7 @@ namespace CodeImp.DoomBuilder.Types
|
|||
#region ================== Variables
|
||||
|
||||
private float value;
|
||||
private bool randomValue;
|
||||
private bool randomvalue;
|
||||
private float min;
|
||||
private float max;
|
||||
|
||||
|
@ -77,7 +77,7 @@ namespace CodeImp.DoomBuilder.Types
|
|||
if(float.TryParse(parts[0], NumberStyles.Float, CultureInfo.CurrentCulture, out min) &&
|
||||
float.TryParse(parts[1], NumberStyles.Float, CultureInfo.CurrentCulture, out max))
|
||||
{
|
||||
randomValue = (min != max);
|
||||
randomvalue = (min != max);
|
||||
|
||||
if(min == max) this.value = min;
|
||||
else if(min > max) General.Swap(ref min, ref max);
|
||||
|
@ -91,22 +91,27 @@ namespace CodeImp.DoomBuilder.Types
|
|||
|
||||
public override object GetValue()
|
||||
{
|
||||
if(randomValue) return General.Random(min, max); //mxd
|
||||
if(randomvalue) return General.Random(min, max); //mxd
|
||||
return this.value;
|
||||
}
|
||||
|
||||
public override int GetIntValue()
|
||||
{
|
||||
if(randomValue) return (int)General.Random(min, max); //mxd
|
||||
if(randomvalue) return (int)General.Random(min, max); //mxd
|
||||
return (int)this.value;
|
||||
}
|
||||
|
||||
public override string GetStringValue()
|
||||
{
|
||||
if(randomValue) return General.Random(min, max).ToString(CultureInfo.InvariantCulture); //mxd
|
||||
if(randomvalue) return General.Random(min, max).ToString(CultureInfo.InvariantCulture); //mxd
|
||||
return this.value.ToString(CultureInfo.InvariantCulture);
|
||||
}
|
||||
|
||||
public override object GetDefaultValue()
|
||||
{
|
||||
return 0f;
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
|
|
|
@ -14,8 +14,8 @@ namespace CodeImp.DoomBuilder.Types
|
|||
#region ================== Variables
|
||||
|
||||
private int value;
|
||||
private int defaultValue;
|
||||
private bool randomValue;
|
||||
private int defaultvalue;
|
||||
private bool randomvalue;
|
||||
private int min;
|
||||
private int max;
|
||||
|
||||
|
@ -29,7 +29,7 @@ namespace CodeImp.DoomBuilder.Types
|
|||
|
||||
public override void SetupArgument(TypeHandlerAttribute attr, ArgumentInfo arginfo)
|
||||
{
|
||||
defaultValue = (int)arginfo.DefaultValue;
|
||||
defaultvalue = (int)arginfo.DefaultValue;
|
||||
base.SetupArgument(attr, arginfo);
|
||||
|
||||
//mxd. We don't want to store this type
|
||||
|
@ -74,7 +74,7 @@ namespace CodeImp.DoomBuilder.Types
|
|||
if(int.TryParse(parts[0], NumberStyles.Integer, CultureInfo.CurrentCulture, out min) &&
|
||||
int.TryParse(parts[1], NumberStyles.Integer, CultureInfo.CurrentCulture, out max))
|
||||
{
|
||||
randomValue = (min != max);
|
||||
randomvalue = (min != max);
|
||||
if(min == max) this.value = min;
|
||||
else if(min > max) General.Swap(ref min, ref max);
|
||||
}
|
||||
|
@ -89,29 +89,34 @@ namespace CodeImp.DoomBuilder.Types
|
|||
}
|
||||
|
||||
//mxd
|
||||
public override void SetDefaultValue()
|
||||
public override void ApplyDefaultValue()
|
||||
{
|
||||
value = defaultValue;
|
||||
value = defaultvalue;
|
||||
}
|
||||
|
||||
public override object GetValue()
|
||||
{
|
||||
if(randomValue) return General.Random(min, max); //mxd
|
||||
if(randomvalue) return General.Random(min, max); //mxd
|
||||
return this.value;
|
||||
}
|
||||
|
||||
public override int GetIntValue()
|
||||
{
|
||||
if(randomValue) return General.Random(min, max); //mxd
|
||||
if(randomvalue) return General.Random(min, max); //mxd
|
||||
return this.value;
|
||||
}
|
||||
|
||||
public override string GetStringValue()
|
||||
{
|
||||
if(randomValue) return General.Random(min, max).ToString(CultureInfo.InvariantCulture); //mxd
|
||||
if(randomvalue) return General.Random(min, max).ToString(CultureInfo.InvariantCulture); //mxd
|
||||
return this.value.ToString(CultureInfo.InvariantCulture);
|
||||
}
|
||||
|
||||
public override object GetDefaultValue()
|
||||
{
|
||||
return defaultvalue;
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
|
|
|
@ -101,6 +101,11 @@ namespace CodeImp.DoomBuilder.Types
|
|||
return this.value.ToString();
|
||||
}
|
||||
|
||||
public override object GetDefaultValue()
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
|
|
|
@ -170,7 +170,7 @@ namespace CodeImp.DoomBuilder.Types
|
|||
}
|
||||
|
||||
//mxd
|
||||
public override void SetDefaultValue()
|
||||
public override void ApplyDefaultValue()
|
||||
{
|
||||
value = defaultvalue;
|
||||
}
|
||||
|
@ -197,6 +197,11 @@ namespace CodeImp.DoomBuilder.Types
|
|||
return (this.value != null ? this.value.Title : "0: No Tag");
|
||||
}
|
||||
|
||||
public override object GetDefaultValue()
|
||||
{
|
||||
return defaultvalue;
|
||||
}
|
||||
|
||||
// This returns an enum list
|
||||
public override EnumList GetEnumList()
|
||||
{
|
||||
|
|
|
@ -68,8 +68,7 @@ namespace CodeImp.DoomBuilder.Types
|
|||
public override int GetIntValue()
|
||||
{
|
||||
int result;
|
||||
if(int.TryParse(this.value, out result)) return result;
|
||||
else return 0;
|
||||
return (int.TryParse(this.value, out result) ? result : 0);
|
||||
}
|
||||
|
||||
public override string GetStringValue()
|
||||
|
@ -77,6 +76,11 @@ namespace CodeImp.DoomBuilder.Types
|
|||
return this.value;
|
||||
}
|
||||
|
||||
public override object GetDefaultValue()
|
||||
{
|
||||
return string.Empty;
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Reference in a new issue