Skip to content

Commit 2ca5f47

Browse files
committed
DragDropCommon: proper defaults for the module settings
1 parent 372cd7e commit 2ca5f47

2 files changed

Lines changed: 25 additions & 1 deletion

File tree

scripts/ui/DragDrop/DragDropCommon.asc

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,29 @@ struct DragDropState
3535

3636
DragDropState DDState;
3737

38+
39+
//===========================================================================
40+
//
41+
// DragDropSettings::ResetState()
42+
// Resets settings to "default".
43+
//
44+
//===========================================================================
45+
void Reset(this DragDropSettings*)
46+
{
47+
int i;
48+
while (i < NUM_DRAGDROPCOMMON_MODES)
49+
{
50+
this.ModeEnabled[i] = false;
51+
i++;
52+
}
53+
this.PixelPerfect = false;
54+
this.TestClickable = false;
55+
this.Move = eDDCmnMoveSelf;
56+
this.GhostTransparency = 33;
57+
this.GhostAlpha = true;
58+
this.GhostGUI = null;
59+
}
60+
3861
//===========================================================================
3962
//
4063
// DragDropState::CreateRepresentation()
@@ -607,6 +630,7 @@ void Drag(this DragDropState*)
607630
//===========================================================================
608631
function game_start()
609632
{
633+
DDSet.Reset();
610634
DDState.Reset();
611635
}
612636

scripts/ui/DragDrop/DragDropCommon.ash

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
#error DragDropCommon requires DragDrop module
2929
#endif
3030

31-
#define MOUSE_DRAGDROPCOMMON_VERSION_00_01_00_00
31+
#define MOUSE_DRAGDROPCOMMON_VERSION_00_01_00_01
3232

3333
// Comment this line out to completely disable DragDropCommon during compilation
3434
#define ENABLE_MOUSE_DRAGDROPCOMMON

0 commit comments

Comments
 (0)