HedgeEditor: Clean up messy HWP overwrites
authorWuzzy <Wuzzy2@mail.ru>
Thu, 08 Mar 2018 19:36:07 +0100
changeset 13130 c8c8f856e236
parent 13129 991db8fc45eb
child 13131 b1de2f84e130
HedgeEditor: Clean up messy HWP overwrites - Remove all sounds - Move sticky mine, mine and dud mine images to custom sprites - Move crate preview outline to custom sprite
share/hedgewars/Data/Scripts/Multiplayer/HedgeEditor.hwp
share/hedgewars/Data/Scripts/Multiplayer/HedgeEditor.lua
Binary file share/hedgewars/Data/Scripts/Multiplayer/HedgeEditor.hwp has changed
--- a/share/hedgewars/Data/Scripts/Multiplayer/HedgeEditor.lua	Thu Mar 08 19:14:06 2018 +0100
+++ b/share/hedgewars/Data/Scripts/Multiplayer/HedgeEditor.lua	Thu Mar 08 19:36:07 2018 +0100
@@ -569,7 +569,7 @@
   sprTargetBee, sprAmGirder, sprAmRubber, sprIceTexture, sprHHTelepMask,
   sprAMAmmos, sprAMAmmosBW, sprAMSlot, sprAMCorners, sprTurnsLeft, sprBotlevels,
   sprSpeechCorner, sprSpeechEdge, sprSpeechTail, sprThoughtCorner, sprThoughtEdge, sprThoughtTail,
-  sprShoutCorner, sprShoutEdge, sprShoutTail, sprCustom1, sprCustom2, }
+  sprShoutCorner, sprShoutEdge, sprShoutTail, }
 
  -- Set in onGameInit
  local reducedSpriteIDArrayFrames
@@ -578,7 +578,7 @@
   "sprTargetBee", "sprAmGirder", "sprAmRubber", "sprIceTexture", "sprHHTelepMask",
   "sprAMAmmos", "sprAMAmmosBW", "sprAMSlot",  "sprAMCorners", "sprTurnsLeft", "sprBotlevels",
   "sprSpeechCorner", "sprSpeechEdge", "sprSpeechTail", "sprThoughtCorner", "sprThoughtEdge", "sprThoughtTail",
-  "sprShoutCorner", "sprShoutEdge", "sprShoutTail", "sprCustom1", "sprCustom2", }
+  "sprShoutCorner", "sprShoutEdge", "sprShoutTail", }
 
 ----------------------------
 -- placement shite
@@ -593,7 +593,7 @@
 local helpDisabled = false  --determines whether help popups pop up
 local CG = nil -- this is the visual gear displayed at CursorX, CursorY
 local crateSprite = nil-- this is a visual gear aid for crate placement
-local tSpr = {}
+local crateSpriteBorer = nil
 
 local cGear = nil -- detects placement of girders and objects (using airattack)
 local curWep = amNothing
@@ -2850,7 +2850,6 @@
 
 		genTimer = genTimer + 1
 
-
 		tSprCol = 0x00000000
 		tempFrame = 0
 		xDisplacement = 42
@@ -2863,14 +2862,11 @@
 			dFrame = 0
 			dAngle = 0
 			if (cat[cIndex] == loc("Mine Placement Mode")) then
-				dSprite = sprBotlevels--sprMineOff
-				dFrame = 1
+				dSprite = sprCustom2
 			elseif (cat[cIndex] == loc("Dud Mine Placement Mode")) then
-				dSprite = sprBotlevels--sprMineDead
-				dFrame = 3
+				dSprite = sprCustom4
 			elseif (cat[cIndex] == loc("Sticky Mine Placement Mode")) then
-				dSprite = sprBotlevels--sprSMineOff
-				dFrame = 2
+				dSprite = sprCustom3
 			elseif (cat[cIndex] == loc("Air Mine Placement Mode")) then
 				dSprite = sprAirMine
 			elseif (cat[cIndex] == loc("Barrel Placement Mode")) then
@@ -2907,9 +2903,7 @@
 
 			if crateSprite == nil then
 				crateSprite = AddVisualGear(CursorX, CursorY-35, vgtStraightShot,0,true,3)
-				for i = 1, 4 do
-					tSpr[i] = AddVisualGear(CursorX, CursorY-35, vgtStraightShot,0,true,3)
-				end
+				crateSpriteBorder = AddVisualGear(CursorX, CursorY-35, vgtStraightShot,0,true,3)
 			end
 
 
@@ -2938,11 +2932,7 @@
 		end
 
 		SetVisualGearValues(crateSprite, CursorX+xDisplacement, CursorY+yDisplacement, 0, 0, dAngle, tempFrame, 1000, sprAMAmmos, 1000, tSprCol)
-		SetVisualGearValues(tSpr[1], CursorX+xDisplacement-2, CursorY+yDisplacement-2, 0, 0, dAngle, 1, 1000, sprTarget, 1000, tSprCol)
-		SetVisualGearValues(tSpr[2], CursorX+xDisplacement-2, CursorY+yDisplacement+2, 0, 0, dAngle, 1, 1000, sprTarget, 1000, tSprCol)
-		SetVisualGearValues(tSpr[3], CursorX+xDisplacement+2, CursorY+yDisplacement-2, 0, 0, dAngle, 1, 1000, sprTarget, 1000, tSprCol)
-		SetVisualGearValues(tSpr[4], CursorX+xDisplacement+2, CursorY+yDisplacement+2, 0, 0, dAngle, 1, 1000, sprTarget, 1000, tSprCol)
-
+		SetVisualGearValues(crateSpriteBorder, CursorX+xDisplacement, CursorY+yDisplacement, 0, 0, 0, 0, 1000, sprCustom1, 1000, tSprCol)
 
 		if genTimer >= 100 then