share/hedgewars/Data/Scripts/Multiplayer/HedgeEditor.lua
changeset 12005 38563aa129c1
parent 12004 a3e2f9408799
child 12006 86cd92f64979
equal deleted inserted replaced
12004:a3e2f9408799 12005:38563aa129c1
   315 
   315 
   316 local shoppaPointList = {}
   316 local shoppaPointList = {}
   317 local shoppaPX = {}
   317 local shoppaPX = {}
   318 local shoppaPY = {}
   318 local shoppaPY = {}
   319 local shoppaPR = {}
   319 local shoppaPR = {}
       
   320 
       
   321 local hedgeEditorMissionPanelShown = false
   320 
   322 
   321 ---------------------------------
   323 ---------------------------------
   322 -- crates are made of this stuff
   324 -- crates are made of this stuff
   323 ---------------------------------
   325 ---------------------------------
   324 
   326 
  2478 
  2480 
  2479 function updateHelp()
  2481 function updateHelp()
  2480 
  2482 
  2481 	if (GetCurAmmoType() ~= amGirder) and (GetCurAmmoType() ~= amRubber) and (GetCurAmmoType() ~= amAirAttack) then
  2483 	if (GetCurAmmoType() ~= amGirder) and (GetCurAmmoType() ~= amRubber) and (GetCurAmmoType() ~= amAirAttack) then
  2482 
  2484 
  2483 		showHedgeEditorMissionPanel()
  2485 		if not hedgeEditorMissionPanelShown then
       
  2486 			showHedgeEditorMissionPanel()
       
  2487 		end
  2484 
  2488 
  2485 	elseif cat[cIndex] == loc("Girder Placement Mode") then
  2489 	elseif cat[cIndex] == loc("Girder Placement Mode") then
  2486 
  2490 
  2487 		ShowMission	(
  2491 		ShowMission	(
  2488 				loc("GIRDER PLACEMENT MODE"),
  2492 				loc("GIRDER PLACEMENT MODE"),
  2498 				" " .. "|" ..
  2502 				" " .. "|" ..
  2499 				loc("Deletion Mode: [5]") .. "|" ..
  2503 				loc("Deletion Mode: [5]") .. "|" ..
  2500 				loc("Toggle Help: Precise+1") .. "|" ..
  2504 				loc("Toggle Help: Precise+1") .. "|" ..
  2501 				"", -amGirder, 60000
  2505 				"", -amGirder, 60000
  2502 				)
  2506 				)
       
  2507 		hedgeEditorMissionPanelShown = false
  2503 
  2508 
  2504 	elseif cat[cIndex] == loc("Rubber Placement Mode") then
  2509 	elseif cat[cIndex] == loc("Rubber Placement Mode") then
  2505 
  2510 
  2506 		ShowMission	(
  2511 		ShowMission	(
  2507 				loc("RUBBER PLACEMENT MODE"),
  2512 				loc("RUBBER PLACEMENT MODE"),
  2512 				" " .. "|" ..
  2517 				" " .. "|" ..
  2513 				loc("Deletion Mode: [5]") .. "|" ..
  2518 				loc("Deletion Mode: [5]") .. "|" ..
  2514 				loc("Toggle Help: Precise+1") .. "|" ..
  2519 				loc("Toggle Help: Precise+1") .. "|" ..
  2515 				"", -amRubber, 60000
  2520 				"", -amRubber, 60000
  2516 				)
  2521 				)
       
  2522 		hedgeEditorMissionPanelShown = false
  2517 
  2523 
  2518 	elseif cat[cIndex] == loc("Barrel Placement Mode") then
  2524 	elseif cat[cIndex] == loc("Barrel Placement Mode") then
  2519 
  2525 
  2520 		ShowMission	(
  2526 		ShowMission	(
  2521 				loc("BARREL PLACEMENT MODE"),
  2527 				loc("BARREL PLACEMENT MODE"),
  2525 				" " .. "|" ..
  2531 				" " .. "|" ..
  2526 				loc("Change Placement Mode: [Up], [Down]") .. "|" ..
  2532 				loc("Change Placement Mode: [Up], [Down]") .. "|" ..
  2527 				loc("Toggle Help: Precise+1") .. "|" ..
  2533 				loc("Toggle Help: Precise+1") .. "|" ..
  2528 				"", 8, 60000
  2534 				"", 8, 60000
  2529 				)
  2535 				)
       
  2536 		hedgeEditorMissionPanelShown = false
  2530 
  2537 
  2531 	elseif cat[cIndex] == loc("Cleaver Placement Mode") then
  2538 	elseif cat[cIndex] == loc("Cleaver Placement Mode") then
  2532 
  2539 
  2533 		ShowMission	(
  2540 		ShowMission	(
  2534 				loc("CLEAVER MINE PLACEMENT MODE"),
  2541 				loc("CLEAVER MINE PLACEMENT MODE"),
  2537 				" " .. "|" ..
  2544 				" " .. "|" ..
  2538 				loc("Change Placement Mode: [Up], [Down]") .. "|" ..
  2545 				loc("Change Placement Mode: [Up], [Down]") .. "|" ..
  2539 				loc("Toggle Help: Precise+1") .. "|" ..
  2546 				loc("Toggle Help: Precise+1") .. "|" ..
  2540 				"", -amKnife, 60000
  2547 				"", -amKnife, 60000
  2541 				)
  2548 				)
       
  2549 		hedgeEditorMissionPanelShown = false
  2542 
  2550 
  2543 	elseif cat[cIndex] == loc("Target Placement Mode") then
  2551 	elseif cat[cIndex] == loc("Target Placement Mode") then
  2544 
  2552 
  2545 		ShowMission	(
  2553 		ShowMission	(
  2546 				loc("TARGET MINE PLACEMENT MODE"),
  2554 				loc("TARGET MINE PLACEMENT MODE"),
  2549 				" " .. "|" ..
  2557 				" " .. "|" ..
  2550 				loc("Change Placement Mode: [Up], [Down]") .. "|" ..
  2558 				loc("Change Placement Mode: [Up], [Down]") .. "|" ..
  2551 				loc("Toggle Help: Precise+1") .. "|" ..
  2559 				loc("Toggle Help: Precise+1") .. "|" ..
  2552 				"", 1, 60000
  2560 				"", 1, 60000
  2553 				)
  2561 				)
       
  2562 		hedgeEditorMissionPanelShown = false
  2554 
  2563 
  2555 	elseif cat[cIndex] == loc("Waypoint Mode") then
  2564 	elseif cat[cIndex] == loc("Waypoint Mode") then
  2556 
  2565 
  2557 		ShowMission	(
  2566 		ShowMission	(
  2558 				loc("WAYPOINT MODE"),
  2567 				loc("WAYPOINT MODE"),
  2562 				" " .. "|" ..
  2571 				" " .. "|" ..
  2563 				loc("Change Placement Mode: [Up], [Down]") .. "|" ..
  2572 				loc("Change Placement Mode: [Up], [Down]") .. "|" ..
  2564 				loc("Toggle Help: Precise+1") .. "|" ..
  2573 				loc("Toggle Help: Precise+1") .. "|" ..
  2565 				"", -amAirAttack, 60000
  2574 				"", -amAirAttack, 60000
  2566 				)
  2575 				)
       
  2576 		hedgeEditorMissionPanelShown = false
  2567 
  2577 
  2568 	elseif cat[cIndex] == loc("Mine Placement Mode") then
  2578 	elseif cat[cIndex] == loc("Mine Placement Mode") then
  2569 
  2579 
  2570 		ShowMission	(
  2580 		ShowMission	(
  2571 				loc("MINE PLACEMENT MODE"),
  2581 				loc("MINE PLACEMENT MODE"),
  2575 				" " .. "|" ..
  2585 				" " .. "|" ..
  2576 				loc("Change Placement Mode: [Up], [Down]") .. "|" ..
  2586 				loc("Change Placement Mode: [Up], [Down]") .. "|" ..
  2577 				loc("Toggle Help: Precise+1") .. "|" ..
  2587 				loc("Toggle Help: Precise+1") .. "|" ..
  2578 				"", -amMine, 60000
  2588 				"", -amMine, 60000
  2579 				)
  2589 				)
       
  2590 		hedgeEditorMissionPanelShown = false
  2580 
  2591 
  2581 	elseif cat[cIndex] == loc("Dud Mine Placement Mode") then
  2592 	elseif cat[cIndex] == loc("Dud Mine Placement Mode") then
  2582 
  2593 
  2583 		ShowMission	(
  2594 		ShowMission	(
  2584 				loc("DUD MINE PLACEMENT MODE"),
  2595 				loc("DUD MINE PLACEMENT MODE"),
  2588 				" " .. "|" ..
  2599 				" " .. "|" ..
  2589 				loc("Change Placement Mode: [Up], [Down]") .. "|" ..
  2600 				loc("Change Placement Mode: [Up], [Down]") .. "|" ..
  2590 				loc("Toggle Help: Precise+1") .. "|" ..
  2601 				loc("Toggle Help: Precise+1") .. "|" ..
  2591 				"", -amMine, 60000
  2602 				"", -amMine, 60000
  2592 				)
  2603 				)
       
  2604 		hedgeEditorMissionPanelShown = false
  2593 
  2605 
  2594 	elseif cat[cIndex] == loc("Sticky Mine Placement Mode") then
  2606 	elseif cat[cIndex] == loc("Sticky Mine Placement Mode") then
  2595 
  2607 
  2596 		ShowMission	(
  2608 		ShowMission	(
  2597 				loc("STiCKY MINE PLACEMENT MODE"),
  2609 				loc("STiCKY MINE PLACEMENT MODE"),
  2601 				" " .. "|" ..
  2613 				" " .. "|" ..
  2602 				loc("Change Placement Mode: [Up], [Down]") .. "|" ..
  2614 				loc("Change Placement Mode: [Up], [Down]") .. "|" ..
  2603 				loc("Toggle Help: Precise+1") .. "|" ..
  2615 				loc("Toggle Help: Precise+1") .. "|" ..
  2604 				"", -amSMine, 60000
  2616 				"", -amSMine, 60000
  2605 				)
  2617 				)
       
  2618 		hedgeEditorMissionPanelShown = false
  2606 
  2619 
  2607 	elseif cat[cIndex] == loc("Air Mine Placement Mode") then
  2620 	elseif cat[cIndex] == loc("Air Mine Placement Mode") then
  2608 
  2621 
  2609 		ShowMission	(
  2622 		ShowMission	(
  2610 				loc("AIR MINE PLACEMENT MODE"),
  2623 				loc("AIR MINE PLACEMENT MODE"),
  2614 				" " .. "|" ..
  2627 				" " .. "|" ..
  2615 				loc("Change Placement Mode: [Up], [Down]") .. "|" ..
  2628 				loc("Change Placement Mode: [Up], [Down]") .. "|" ..
  2616 				loc("Toggle Help: Precise+1") .. "|" ..
  2629 				loc("Toggle Help: Precise+1") .. "|" ..
  2617 				"", -amAirMine, 60000
  2630 				"", -amAirMine, 60000
  2618 				)
  2631 				)
       
  2632 		hedgeEditorMissionPanelShown = false
  2619 
  2633 
  2620 	elseif cat[cIndex] == loc("Weapon Crate Placement Mode") then
  2634 	elseif cat[cIndex] == loc("Weapon Crate Placement Mode") then
  2621 
  2635 
  2622 		ShowMission	(
  2636 		ShowMission	(
  2623 				loc("WEAPON CRATE PLACEMENT MODE"),
  2637 				loc("WEAPON CRATE PLACEMENT MODE"),
  2627 				" " .. "|" ..
  2641 				" " .. "|" ..
  2628 				loc("Change Placement Mode: [Up], [Down]") .. "|" ..
  2642 				loc("Change Placement Mode: [Up], [Down]") .. "|" ..
  2629 				loc("Toggle Help: Precise+1") .. "|" ..
  2643 				loc("Toggle Help: Precise+1") .. "|" ..
  2630 				"", 7, 60000
  2644 				"", 7, 60000
  2631 				)
  2645 				)
       
  2646 		hedgeEditorMissionPanelShown = false
  2632 
  2647 
  2633 	elseif cat[cIndex] == loc("Utility Crate Placement Mode") then
  2648 	elseif cat[cIndex] == loc("Utility Crate Placement Mode") then
  2634 
  2649 
  2635 		ShowMission	(
  2650 		ShowMission	(
  2636 				loc("UTILITY CRATE PLACEMENT MODE"),
  2651 				loc("UTILITY CRATE PLACEMENT MODE"),
  2640 				" " .. "|" ..
  2655 				" " .. "|" ..
  2641 				loc("Change Placement Mode: [Up], [Down]") .. "|" ..
  2656 				loc("Change Placement Mode: [Up], [Down]") .. "|" ..
  2642 				loc("Toggle Help: Precise+1") .. "|" ..
  2657 				loc("Toggle Help: Precise+1") .. "|" ..
  2643 				"", 5, 60000
  2658 				"", 5, 60000
  2644 				)
  2659 				)
       
  2660 		hedgeEditorMissionPanelShown = false
  2645 
  2661 
  2646 	elseif cat[cIndex] == loc("Health Crate Placement Mode") then
  2662 	elseif cat[cIndex] == loc("Health Crate Placement Mode") then
  2647 
  2663 
  2648 		ShowMission	(
  2664 		ShowMission	(
  2649 				loc("HEALTH CRATE PLACEMENT MODE"),
  2665 				loc("HEALTH CRATE PLACEMENT MODE"),
  2653 				" " .. "|" ..
  2669 				" " .. "|" ..
  2654 				loc("Change Placement Mode: [Up], [Down]") .. "|" ..
  2670 				loc("Change Placement Mode: [Up], [Down]") .. "|" ..
  2655 				loc("Toggle Help: Precise+1") .. "|" ..
  2671 				loc("Toggle Help: Precise+1") .. "|" ..
  2656 				"", 6, 60000
  2672 				"", 6, 60000
  2657 				)
  2673 				)
       
  2674 		hedgeEditorMissionPanelShown = false
  2658 
  2675 
  2659 	elseif cat[cIndex] == loc("Repositioning Mode") then
  2676 	elseif cat[cIndex] == loc("Repositioning Mode") then
  2660 
  2677 
  2661 		ShowMission	(
  2678 		ShowMission	(
  2662 				loc("REPOSITIONING MODE"),
  2679 				loc("REPOSITIONING MODE"),
  2666 				" " .. "|" ..
  2683 				" " .. "|" ..
  2667 				loc("Change Placement Mode: [Up], [Down]") .. "|" ..
  2684 				loc("Change Placement Mode: [Up], [Down]") .. "|" ..
  2668 				loc("Toggle Help: Precise+1") .. "|" ..
  2685 				loc("Toggle Help: Precise+1") .. "|" ..
  2669 				"", -amAirAttack, 60000
  2686 				"", -amAirAttack, 60000
  2670 				)
  2687 				)
       
  2688 		hedgeEditorMissionPanelShown = false
  2671 
  2689 
  2672 	elseif cat[cIndex] == loc("Sprite Modification Mode") then
  2690 	elseif cat[cIndex] == loc("Sprite Modification Mode") then
  2673 
  2691 
  2674 		ShowMission	(
  2692 		ShowMission	(
  2675 				loc("SPRITE MODIFICATION MODE"),
  2693 				loc("SPRITE MODIFICATION MODE"),
  2685 				" " .. "|" ..
  2703 				" " .. "|" ..
  2686 				loc("Change Placement Mode: [Up], [Down]") .. "|" ..
  2704 				loc("Change Placement Mode: [Up], [Down]") .. "|" ..
  2687 				loc("Toggle Help: Precise+1") .. "|" ..
  2705 				loc("Toggle Help: Precise+1") .. "|" ..
  2688 				"", -amAirAttack, 60000
  2706 				"", -amAirAttack, 60000
  2689 				)
  2707 				)
       
  2708 		hedgeEditorMissionPanelShown = false
  2690 
  2709 
  2691 	elseif cat[cIndex] == loc("Sprite Placement Mode") then
  2710 	elseif cat[cIndex] == loc("Sprite Placement Mode") then
  2692 
  2711 
  2693 		ShowMission	(
  2712 		ShowMission	(
  2694 				loc("SPRITE PLACEMENT MODE"),
  2713 				loc("SPRITE PLACEMENT MODE"),
  2703 				" " .. "|" ..
  2722 				" " .. "|" ..
  2704 				loc("Change Placement Mode: [Up], [Down]") .. "|" ..
  2723 				loc("Change Placement Mode: [Up], [Down]") .. "|" ..
  2705 				loc("Toggle Help: Precise+1") .. "|" ..
  2724 				loc("Toggle Help: Precise+1") .. "|" ..
  2706 				"", 2, 60000
  2725 				"", 2, 60000
  2707 				)
  2726 				)
       
  2727 		hedgeEditorMissionPanelShown = false
  2708 
  2728 
  2709 	elseif cat[cIndex] == loc("Goal Mode") then
  2729 	elseif cat[cIndex] == loc("Goal Mode") then
  2710 
  2730 
  2711 		ShowMission	(
  2731 		ShowMission	(
  2712 				loc("GOAL MODE"),
  2732 				loc("GOAL MODE"),
  2716 				" " .. "|" ..
  2736 				" " .. "|" ..
  2717 				loc("Change Placement Mode: [Up], [Down]") .. "|" ..
  2737 				loc("Change Placement Mode: [Up], [Down]") .. "|" ..
  2718 				loc("Toggle Help: Precise+1") .. "|" ..
  2738 				loc("Toggle Help: Precise+1") .. "|" ..
  2719 				"", 3, 60000
  2739 				"", 3, 60000
  2720 				)
  2740 				)
       
  2741 		hedgeEditorMissionPanelShown = false
  2721 	elseif cat[cIndex] == loc("Hog Identity Mode") then
  2742 	elseif cat[cIndex] == loc("Hog Identity Mode") then
  2722 
  2743 
  2723 		ShowMission	(
  2744 		ShowMission	(
  2724 				loc("HOG IDENTITY MODE"),
  2745 				loc("HOG IDENTITY MODE"),
  2725 				loc("Use this mode to give a hog a preset identity and weapons."),
  2746 				loc("Use this mode to give a hog a preset identity and weapons."),
  2728 				" " .. "|" ..
  2749 				" " .. "|" ..
  2729 				loc("Change Placement Mode: [Up], [Down]") .. "|" ..
  2750 				loc("Change Placement Mode: [Up], [Down]") .. "|" ..
  2730 				loc("Toggle Help: Precise+1") .. "|" ..
  2751 				loc("Toggle Help: Precise+1") .. "|" ..
  2731 				"", 3, 60000
  2752 				"", 3, 60000
  2732 				)
  2753 				)
       
  2754 		hedgeEditorMissionPanelShown = false
  2733 
  2755 
  2734 	elseif cat[cIndex] == loc("Team Identity Mode") then
  2756 	elseif cat[cIndex] == loc("Team Identity Mode") then
  2735 
  2757 
  2736 		ShowMission	(
  2758 		ShowMission	(
  2737 				loc("TEAM IDENTITY MODE"),
  2759 				loc("TEAM IDENTITY MODE"),
  2741 				" " .. "|" ..
  2763 				" " .. "|" ..
  2742 				loc("Change Placement Mode: [Up], [Down]") .. "|" ..
  2764 				loc("Change Placement Mode: [Up], [Down]") .. "|" ..
  2743 				loc("Toggle Help: Precise+1") .. "|" ..
  2765 				loc("Toggle Help: Precise+1") .. "|" ..
  2744 				"", 3, 60000
  2766 				"", 3, 60000
  2745 				)
  2767 				)
       
  2768 		hedgeEditorMissionPanelShown = false
  2746 
  2769 
  2747 	elseif cat[cIndex] == loc("Health Modification Mode") then
  2770 	elseif cat[cIndex] == loc("Health Modification Mode") then
  2748 
  2771 
  2749 		ShowMission	(
  2772 		ShowMission	(
  2750 				loc("HEALTH MODIFICATION MODE"),
  2773 				loc("HEALTH MODIFICATION MODE"),
  2754 				" " .. "|" ..
  2777 				" " .. "|" ..
  2755 				loc("Change Placement Mode: [Up], [Down]") .. "|" ..
  2778 				loc("Change Placement Mode: [Up], [Down]") .. "|" ..
  2756 				loc("Toggle Help: Precise+1") .. "|" ..
  2779 				loc("Toggle Help: Precise+1") .. "|" ..
  2757 				"", 3, 60000
  2780 				"", 3, 60000
  2758 				)
  2781 				)
       
  2782 		hedgeEditorMissionPanelShown = false
  2759 
  2783 
  2760 	end
  2784 	end
  2761 
  2785 
  2762 
  2786 
  2763 	if helpDisabled == true then
  2787 	if helpDisabled == true then
  3175 		loc("Save Level: Precise+4") .. "|" ..
  3199 		loc("Save Level: Precise+4") .. "|" ..
  3176 		loc("Toggle Editing Weapons and Tools: Precise+2") .. "|" ..
  3200 		loc("Toggle Editing Weapons and Tools: Precise+2") .. "|" ..
  3177 		" " .. "|" ..
  3201 		" " .. "|" ..
  3178 		"", 4, 5000
  3202 		"", 4, 5000
  3179 		)
  3203 		)
       
  3204 	hedgeEditorMissionPanelShown = true
  3180 end
  3205 end
  3181 
  3206 
  3182 function onGameStart()
  3207 function onGameStart()
  3183 
  3208 
  3184 	trackTeams()
  3209 	trackTeams()