// #autoload // #OdysseyLOH // odysseyLOH by sal9000 package odysseyLOH { function loadFavorite(%index, %echo) { parent::loadFavorite(%index, %echo); $odysseyLastFav = $odysseyCurrentFav; $odysseyCurrentFav = $pref::FavNames[%index]; odysseyLOH.pack.SetValue(""); odysseyLOH.text.setValue($odysseyCurrentFav); } function addQuickPackFavorite(%pack, %item) { parent::addQuickPackFavorite(%pack, %item); 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 = "GuiDefaultProfile"; horizSizing = "right"; vertSizing = "top"; position = "587 696 "; extent = "143 20"; minExtent = "8 8"; visible = "1"; }; odysseyLOH.text = new GuiTextCtrl() { profile = "NewLohProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "1 1"; extent = "141 18"; visible = "1"; }; odysseyLOH.pack = new GuiTextCtrl() { profile = "GuiTextObjHudCenterProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "1 19"; extent = "141 18"; visible = "1"; }; odysseyLOH.add(odysseyLOH.text); odysseyLOH.add(odysseyLOH.pack); if(isObject(HudMover)) hudmover::addhud(odysseyLOH, "odysseyLOH"); playgui.add($odysseyLOH); } } }; $odysseyLOHplayGui = "false"; $odysseyLOHgui = "false"; $odysseyLOHmove = "false"; $odysseyLOHchanged = "false"; $odysseyLOHstate = TRUE; activatePackage(odysseyLOH); new GuiControlProfile("NewLohProfile") { fontType = "arial bold"; fontSize = 10; fontColor = "0 255 0"; justify = "center"; }; // atl nfo $odysseyLOHversion = "1.51 (s)"; $odysseyLOHinfo = "a loadout HUD";