mirror of
https://git.do.srb2.org/STJr/UltimateZoneBuilder.git
synced 2024-11-26 22:01:45 +00:00
Changed, Visual mode: reduced dynamic lights intensity to better match with GZDoom.
Fixed, Map conversion: game mode flags were ignored when converting from Doom map format to UDMF. Fixed, Edit Selection mode: when "Drag selection automatically on paste" setting was enabled, it was possible to start rotating/scaling map elements instead of dragging them after pasting.
This commit is contained in:
parent
fbb30f6f91
commit
8ac4189c7a
3 changed files with 51 additions and 25 deletions
|
@ -2164,9 +2164,9 @@ namespace CodeImp.DoomBuilder
|
|||
configinfo = General.GetConfigurationInfo(options.ConfigFile);
|
||||
Type oldiotype = io.GetType(); //mxd
|
||||
|
||||
//mxd. Step 1 of hackish way to translate SP/MP thing flags to Hexen map format...
|
||||
//mxd. Step 1 of hackish way to translate SP/MP thing flags to Hexen / UDMF formats...
|
||||
//TODO: add proper Doom -> Hexen thing flags translation to the configs?
|
||||
if(oldiotype == typeof(DoomMapSetIO) && configinfo.FormatInterface == "hexenmapsetio")
|
||||
if(oldiotype == typeof(DoomMapSetIO) && configinfo.FormatInterface != "doommapsetio")
|
||||
{
|
||||
// Translate to UDMF using Doom things flags translation table
|
||||
foreach(Thing t in General.Map.Map.Things) t.TranslateToUDMF();
|
||||
|
@ -2196,24 +2196,36 @@ namespace CodeImp.DoomBuilder
|
|||
foreach(Linedef l in General.Map.Map.Linedefs) l.TranslateFromUDMF();
|
||||
foreach(Thing t in General.Map.Map.Things) t.TranslateFromUDMF();
|
||||
}
|
||||
else if(oldiotype != typeof(UniversalMapSetIO) && io is UniversalMapSetIO)
|
||||
else if(oldiotype == typeof(DoomMapSetIO))
|
||||
{
|
||||
if(io is UniversalMapSetIO)
|
||||
{
|
||||
//Thing flags were already translated in Setp 1...
|
||||
//TODO: linedef actions will require the same handling...
|
||||
foreach(Linedef l in General.Map.Map.Linedefs) l.TranslateToUDMF(oldiotype);
|
||||
}
|
||||
else if(io is HexenMapSetIO)
|
||||
{
|
||||
// Step 2 of hackish way to translate SP/MP thing flags to Hexen map format...
|
||||
foreach(Thing t in General.Map.Map.Things) t.TranslateFromUDMF();
|
||||
}
|
||||
}
|
||||
else if(oldiotype != typeof(UniversalMapSetIO) && io is UniversalMapSetIO)
|
||||
{
|
||||
foreach(Linedef l in General.Map.Map.Linedefs) l.TranslateToUDMF(oldiotype);
|
||||
foreach(Thing t in General.Map.Map.Things) t.TranslateToUDMF();
|
||||
}
|
||||
else if(oldiotype != typeof(DoomMapSetIO) && io is DoomMapSetIO)
|
||||
{
|
||||
// Drop all arguments
|
||||
foreach(Linedef l in General.Map.Map.Linedefs)
|
||||
}
|
||||
|
||||
// Drop all arguments
|
||||
if(oldiotype != typeof(DoomMapSetIO) && io is DoomMapSetIO)
|
||||
{
|
||||
|
||||
foreach(Linedef l in General.Map.Map.Linedefs)
|
||||
for(int i = 0; i < l.Args.Length; i++) l.Args[i] = 0;
|
||||
foreach(Thing t in General.Map.Map.Things)
|
||||
foreach(Thing t in General.Map.Map.Things)
|
||||
for(int i = 0; i < t.Args.Length; i++) t.Args[i] = 0;
|
||||
}
|
||||
else if(oldiotype == typeof(DoomMapSetIO) && io is HexenMapSetIO)
|
||||
{
|
||||
// Step 2 of hackish way to translate SP/MP thing flags to Hexen map format...
|
||||
foreach(Thing t in General.Map.Map.Things) t.TranslateFromUDMF();
|
||||
}
|
||||
|
||||
map.UpdateCustomLinedefColors();
|
||||
|
||||
// Reload resources
|
||||
|
|
|
@ -556,19 +556,19 @@ namespace CodeImp.DoomBuilder.VisualModes
|
|||
n = 0;
|
||||
lightRenderStyle = DynamicLightRenderStyle.NORMAL;
|
||||
//lightColor.Alpha used in shader to perform some calculations based on light type
|
||||
lightColor = new Color4((float)lightRenderStyle / 100.0f, thing.Args[0] / scaled_intensity, thing.Args[1] / scaled_intensity, thing.Args[2] / scaled_intensity);
|
||||
lightColor = new Color4((float)lightRenderStyle / 100.0f, thing.Args[0] / scaled_intensity / 2, thing.Args[1] / scaled_intensity / 2, thing.Args[2] / scaled_intensity / 2);
|
||||
}
|
||||
else if(lightId < GZBuilder.GZGeneral.GZ_LIGHT_TYPES[1])
|
||||
{
|
||||
n = 10;
|
||||
lightRenderStyle = DynamicLightRenderStyle.ADDITIVE;
|
||||
lightColor = new Color4((float)lightRenderStyle / 100.0f, thing.Args[0] / scaled_intensity, thing.Args[1] / scaled_intensity, thing.Args[2] / scaled_intensity);
|
||||
lightColor = new Color4((float)lightRenderStyle / 100.0f, thing.Args[0] / scaled_intensity / 2, thing.Args[1] / scaled_intensity / 2, thing.Args[2] / scaled_intensity / 2);
|
||||
}
|
||||
else
|
||||
{
|
||||
n = 20;
|
||||
lightRenderStyle = DynamicLightRenderStyle.NEGATIVE;
|
||||
lightColor = new Color4((float)lightRenderStyle / 100.0f, thing.Args[0] / scaled_intensity, thing.Args[1] / scaled_intensity, thing.Args[2] / scaled_intensity);
|
||||
lightColor = new Color4((float)lightRenderStyle / 100.0f, thing.Args[0] / scaled_intensity / 3, thing.Args[1] / scaled_intensity / 3, thing.Args[2] / scaled_intensity / 3);
|
||||
}
|
||||
lightType = (DynamicLightType)(thing.Type - 9800 - n);
|
||||
|
||||
|
@ -589,9 +589,9 @@ namespace CodeImp.DoomBuilder.VisualModes
|
|||
lightRenderStyle = DynamicLightRenderStyle.VAVOOM;
|
||||
lightType = (DynamicLightType)thing.Type;
|
||||
if(lightType == DynamicLightType.VAVOOM_COLORED)
|
||||
lightColor = new Color4((float)lightRenderStyle / 100.0f, thing.Args[1] / scaled_intensity, thing.Args[2] / scaled_intensity, thing.Args[3] / scaled_intensity);
|
||||
lightColor = new Color4((float)lightRenderStyle / 100.0f, thing.Args[1] / scaled_intensity / 2, thing.Args[2] / scaled_intensity / 2, thing.Args[3] / scaled_intensity / 2);
|
||||
else
|
||||
lightColor = new Color4((float)lightRenderStyle / 100.0f, General.Settings.GZDynamicLightIntensity, General.Settings.GZDynamicLightIntensity, General.Settings.GZDynamicLightIntensity);
|
||||
lightColor = new Color4((float)lightRenderStyle / 100.0f, General.Settings.GZDynamicLightIntensity / 2, General.Settings.GZDynamicLightIntensity / 2, General.Settings.GZDynamicLightIntensity / 2);
|
||||
lightPrimaryRadius = (thing.Args[0] * 8) * General.Settings.GZDynamicLightRadius;
|
||||
}
|
||||
|
||||
|
|
|
@ -138,6 +138,7 @@ namespace CodeImp.DoomBuilder.BuilderModes
|
|||
private bool modealreadyswitching;
|
||||
private bool clearselection; //mxd
|
||||
private bool pasting;
|
||||
private bool autodrag; //mxd
|
||||
private PasteOptions pasteoptions;
|
||||
|
||||
// Docker
|
||||
|
@ -385,7 +386,7 @@ namespace CodeImp.DoomBuilder.BuilderModes
|
|||
{
|
||||
// Check what grip the mouse is over
|
||||
// and change cursor accordingly
|
||||
Grip mousegrip = CheckMouseGrip();
|
||||
Grip mousegrip = (autodrag ? Grip.Main : CheckMouseGrip()); //mxd. We only want to move when starting auto-dragging
|
||||
switch(mousegrip)
|
||||
{
|
||||
case Grip.Main:
|
||||
|
@ -1036,7 +1037,7 @@ namespace CodeImp.DoomBuilder.BuilderModes
|
|||
{
|
||||
base.OnEngage();
|
||||
|
||||
bool autodrag = (pasting && mouseinside && BuilderPlug.Me.AutoDragOnPaste);
|
||||
autodrag = (pasting && mouseinside && BuilderPlug.Me.AutoDragOnPaste);
|
||||
snaptonearest = General.Interface.AutoMerge; //mxd
|
||||
|
||||
// Add toolbar buttons
|
||||
|
@ -1193,7 +1194,11 @@ namespace CodeImp.DoomBuilder.BuilderModes
|
|||
Update();
|
||||
|
||||
// When pasting and mouse is in screen, drag selection immediately
|
||||
if(autodrag) OnSelectBegin();
|
||||
if(autodrag)
|
||||
{
|
||||
OnSelectBegin();
|
||||
autodrag = false; //mxd. Don't need this any more
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -1642,7 +1647,8 @@ namespace CodeImp.DoomBuilder.BuilderModes
|
|||
Vector2D delta;
|
||||
|
||||
// Check what grip the mouse is over
|
||||
switch(CheckMouseGrip())
|
||||
Grip mousegrip = (autodrag ? Grip.Main : CheckMouseGrip()); //mxd. We only want to move when starting auto-dragging
|
||||
switch(mousegrip)
|
||||
{
|
||||
// Drag main rectangle
|
||||
case Grip.Main:
|
||||
|
@ -1653,7 +1659,11 @@ namespace CodeImp.DoomBuilder.BuilderModes
|
|||
int index = 0;
|
||||
foreach(Vertex v in selectedvertices)
|
||||
{
|
||||
if(v == highlighted) highlightedpos = vertexpos[index];
|
||||
if(v == highlighted)
|
||||
{
|
||||
highlightedpos = vertexpos[index];
|
||||
break;
|
||||
}
|
||||
index++;
|
||||
}
|
||||
}
|
||||
|
@ -1662,7 +1672,11 @@ namespace CodeImp.DoomBuilder.BuilderModes
|
|||
int index = 0;
|
||||
foreach(Thing t in selectedthings)
|
||||
{
|
||||
if(t == highlighted) highlightedpos = thingpos[index];
|
||||
if(t == highlighted)
|
||||
{
|
||||
highlightedpos = thingpos[index];
|
||||
break;
|
||||
}
|
||||
index++;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue