// odysseyLOH - load out HUD - by sal9000 //-------------=== USER EDIT SECTION ===-------------- // set this to "FALSE", if you wish to turn back ON // those 'inventory set to "NAME HERE" messages // from appearing in the chat hud. // leave at TRUE, to stop them from being displayed $odysseyLOHmuteLoadoutChat = "TRUE"; //------------=== END USER EDIT SECTION ===----------- function odysseyLOHconnect() { //odysseyLOH.position = "617 522"; // %posX = getWord(backPackFrame.position, 0); // %posY = getWord(backPackFrame.position, 1); // odysseyLOH.position = %posX @ " "@ (%posY-23); odysseyLOH.extent = "143 20"; } package odysseyLOH { function addMessageHudLine(%text) { if($odysseyLOHmuteLoadoutChat $= "TRUE") { if(strstr(%text, "Inventory set \"") != "-1") return; if(strstr(%text, "Inventory updated to ") != "-1") return; } parent::addMessageHudLine(%text); } function loadFavorite(%index, %echo) { parent::loadFavorite(%index, %echo); $odysseyLastFav = $odysseyCurrentFav; $odysseyCurrentFav = $pref::FavNames[%index]; //odysseyLOH.position = "617 522"; // %posX = getWord(backPackFrame.position, 0); // %posY = getWord(backPackFrame.position, 1); // odysseyLOH.position = %posX @ " "@ (%posY-23); odysseyLOH.extent = "143 20"; odysseyLOH.pack.SetValue(""); odysseyLOH.text.setValue($odysseyCurrentFav); } function addQuickPackFavorite(%pack, %item) { parent::addQuickPackFavorite(%pack, %item); //odysseyLOH.position = "617 502"; // %posX = getWord(backPackFrame.position, 0); // %posY = getWord(backPackFrame.position, 1); // odysseyLOH.position = %posX @ " "@ (%posY-43); odysseyLOH.extent = "143 40"; if(%item $= "") %item = "Pack"; if ( $Hud['inventoryScreen'].staticData[1, 1].getValue() $= "" ) { %CurrentFav = $pref::Favorite[$pref::FavCurrentSelect]; for ( %i = 0; %i < getFieldCount( %CurrentFav ); %i++ ) { %type = getField( %CurrentFav, %i ); %equipment = getField( %CurrentFav, %i++ ); %invalidPack = checkPackValidity(%pack, %equipment, %item ); if(%invalidPack) { odysseyLOH.pack.setValue("\c5cannot use pack with loadout"); return; } else odysseyLOH.pack.setValue("add on: \c5"@%pack); } } else { %armor = $Hud['inventoryScreen'].data[0, 1].getValue(); %invalidPack = checkPackValidity(%pack, %armor, %item ); if(%invalidPack) { odysseyLOH.pack.setValue("\c5cannot use pack with loadout"); return; } %favList = $Hud['inventoryScreen'].data[0, 1].type TAB %armor; for ( %i = 1; %i < $Hud['inventoryScreen'].count; %i++ ) { %type = $Hud['inventoryScreen'].data[%i, 1].type; %equipment = $Hud['inventoryScreen'].data[%i, 1].getValue(); if(%type $= %item) %equipment = %pack; %invalidPack = checkPackValidity(%pack, %equipment, %item ); if(%invalidPack) { odysseyLOH.pack.setValue("\c5cannot use pack with loadout"); return; } else odysseyLOH.pack.setValue("add on: \c5"@%pack); } } } function ClientCmdDisplayHuds() { parent::ClientCmdDisplayHuds(); switch$ ($HudMode) { case "Pilot": odysseyLOH.setVisible(false); case "Passenger": odysseyLOH.setVisible(true); case "Object": odysseyLOH.setVisible($odysseyLOHState); case "Observer": odysseyLOH.setVisible(false); case "PickTeam": odysseyLOH.setVisible(false); default: odysseyLOH.setVisible($odysseyLOHState); } } function DispatchLaunchMode() { addMessageCallback('msgITeamChanged', odysseyLOHconnect); parent::DispatchLaunchMode(); } function LoadingGui::onWake(%this) { if($odysseyLOHgui $= "false") { //position vars here odysseyLOHcreate(); $odysseyLOHgui = "true"; } odysseyLOH.setVisible($odysseyLOHState); parent::onWake(%this); } function OptionsDlg::applyGraphicChanges( %this ) { $odysseyLOHchanged = "true"; parent::applyGraphicChanges( %this ); } function PlayGui::onWake(%this) { if($odysseyLOHplayGUI $= "false") { odysseyLOHconnect(); $odysseyLOHplayGui = "true"; } parent::onWake(%this); if($odysseyLOHchanged $= "true") { odysseyLOHcreate(); $odysseyLOHchanged = "false"; } } function odysseyLOHcreate() { if(!isObject(PlayGui)) return; if(!isObject($odysseyLOH)) { $odysseyLOH = new ShellFieldCtrl(odysseyLOH) { profile = ""; horizSizing = "right"; vertSizing = "top"; position = "617 522"; extent = "143 20"; minExtent = "8 8"; visible = "1"; }; playgui.add($odysseyLOH); odysseyLOH.text = new GuiTextCtrl() { profile = "GuiTextObjHudCenterProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "1 1"; extent = "141 18"; visible = "1"; }; odysseyLOH.add(odysseyLOH.text); odysseyLOH.pack = new GuiTextCtrl() { profile = "GuiTextObjHudCenterProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "1 19"; extent = "141 18"; visible = "1"; }; odysseyLOH.add(odysseyLOH.pack); } // else { // //odysseyLOH.position = "617 522"; // %posX = getWord(backPackFrame.position, 0); // %posY = getWord(backPackFrame.position, 1); // odysseyLOH.position = %posX @ " "@ (%posY-23); // odysseyLOH.extent = "143 20"; // } hudmover::addhud(odysseyLOH, "Odyssey Loadout HUD"); } }; $odysseyLOHplayGui = "false"; $odysseyLOHgui = "false"; $odysseyLOHmove = "false"; $odysseyLOHchanged = "false"; $odysseyLOHstate = TRUE; activatePackage(odysseyLOH); // atl nfo $odysseyLOHversion = "2.0 (s)"; $odysseyLOHinfo = "a loadout HUD";