1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159
|
function reticuleManufactureCheck()
{
var structureComplete = false;
var facs = [FACTORY, CYBORG_FACTORY, VTOL_FACTORY,];
for (let i = 0, len = facs.length; i < len; ++i)
{
var onMapFacs = enumStruct(selectedPlayer, facs[i]);
for (let j = 0, len2 = onMapFacs.length; j < len2; ++j)
{
if (onMapFacs[j].status === BUILT)
{
structureComplete = true;
break;
}
}
}
if (structureComplete === true)
{
setReticuleButton(1, _("Manufacture (F1)"), "image_manufacture_up.png", "image_manufacture_down.png");
}
else
{
setReticuleButton(1, _("Manufacture - build factory first"), "", "");
}
}
function reticuleResearchCheck()
{
var structureComplete = false;
var labs = [RESEARCH_LAB,];
for (let i = 0, len = labs.length; i < len; ++i)
{
var onMapResLabs = enumStruct(selectedPlayer, labs[i]);
for (let j = 0, len2 = onMapResLabs.length; j < len2; ++j)
{
if (onMapResLabs[j].status === BUILT)
{
structureComplete = true;
break;
}
}
}
if (structureComplete === true)
{
setReticuleButton(2, _("Research (F2)"), "image_research_up.png", "image_research_down.png");
}
else
{
setReticuleButton(2, _("Research - build research facility first"), "", "");
}
}
function reticuleBuildCheck()
{
if (enumDroid(selectedPlayer, DROID_CONSTRUCT).length > 0)
{
setReticuleButton(3, _("Build (F3)"), "image_build_up.png", "image_build_down.png");
}
else
{
setReticuleButton(3, _("Build - manufacture constructor droids first"), "", "");
}
}
function reticuleDesignCheck()
{
var structureComplete = false;
var HQS = [HQ,];
for (let i = 0, len = HQS.length; i < len; ++i)
{
var onMapHQ = enumStruct(selectedPlayer, HQS[i]);
for (let j = 0, len2 = onMapHQ.length; j < len2; ++j)
{
if (onMapHQ[j].status === BUILT)
{
structureComplete = true;
break;
}
}
}
if (structureComplete === true)
{
setReticuleButton(4, _("Design (F4)"), "image_design_up.png", "image_design_down.png");
setMiniMap(true);
}
else
{
setReticuleButton(4, _("Design - construct HQ first"), "", "");
setMiniMap(false);
}
}
function reticuleCommandCheck()
{
if (enumDroid(selectedPlayer, DROID_COMMAND).length > 0)
{
setReticuleButton(6, _("Commanders (F6)"), "image_commanddroid_up.png", "image_commanddroid_down.png");
}
else
{
setReticuleButton(6, _("Commanders - manufacture commanders first"), "", "");
}
}
function setMainReticule()
{
setReticuleButton(0, _("Close"), "image_cancel_up.png", "image_cancel_down.png");
if (isSpectator(-1))
{
setReticuleButton(1, _("Manufacture - build factory first"), "", "");
setReticuleButton(2, _("Research - build research facility first"), "", "");
setReticuleButton(3, _("Build - manufacture constructor droids first"), "", "");
setReticuleButton(4, _("Design - construct HQ first"), "", "");
setReticuleButton(5, _("Intelligence Display (F5)"), "image_intelmap_up.png", "image_intelmap_down.png");
setReticuleButton(6, _("Commanders - manufacture commanders first"), "", "");
return;
}
reticuleManufactureCheck();
reticuleResearchCheck();
reticuleBuildCheck();
reticuleDesignCheck();
setReticuleButton(5, _("Intelligence Display (F5)"), "image_intelmap_up.png", "image_intelmap_down.png");
reticuleCommandCheck();
}
function reticuleUpdate(obj, eventType)
{
var update_reticule = false;
if (eventType === TRANSFER_LIKE_EVENT)
{
update_reticule = true;
}
else if (obj.player === selectedPlayer && obj.type === STRUCTURE)
{
if (obj.stattype === HQ || obj.stattype === RESEARCH_LAB || obj.stattype === CYBORG_FACTORY ||
obj.stattype === VTOL_FACTORY || obj.stattype === FACTORY || obj.stattype === COMMAND_CONTROL)
{
update_reticule = true;
}
}
else if (obj.player === selectedPlayer && obj.type === DROID)
{
if (obj.droidType === DROID_CONSTRUCT || obj.droidType === DROID_COMMAND)
{
update_reticule = true;
}
}
if (mainReticule && update_reticule)
{
//Wait a tick for the counts to update
queue("setMainReticule", TICK_TIME);
}
}
|