From d9f5d36180989ea1c202eb37c827cf3e84374a3c Mon Sep 17 00:00:00 2001 From: Erusman Date: Sat, 27 Jun 2020 13:32:27 -0700 Subject: [PATCH] remove TCG functions in Swgclient, modified ui_ground_hud_buttonbar_skinned will need to be added to /ui as well --- .../src/shared/command/CommandCppFuncs.cpp | 31 ++++++------ .../src/shared/core/CuiActions.h | 2 +- .../src/shared/page/SwgCuiButtonBar.cpp | 50 +++++++++---------- .../src/shared/page/SwgCuiButtonBar.h | 12 ++--- .../src/shared/page/SwgCuiHudAction.cpp | 32 ++++++------ 5 files changed, 63 insertions(+), 64 deletions(-) diff --git a/src/engine/client/library/clientGame/src/shared/command/CommandCppFuncs.cpp b/src/engine/client/library/clientGame/src/shared/command/CommandCppFuncs.cpp index f2793cff7..63177ed1a 100644 --- a/src/engine/client/library/clientGame/src/shared/command/CommandCppFuncs.cpp +++ b/src/engine/client/library/clientGame/src/shared/command/CommandCppFuncs.cpp @@ -231,7 +231,7 @@ namespace CommandCppFuncsNamespace void commandFuncEmptyMail (Command const & command, NetworkId const & actor, NetworkId const & target, Unicode::String const & params); void commandFuncTargetPilot (Command const & command, NetworkId const & actor, NetworkId const & target, Unicode::String const & params); void commandFuncEditBiography (Command const & command, NetworkId const & actor, NetworkId const & target, Unicode::String const & params); - + void commandFuncEcho (Command const & command, NetworkId const & actor, NetworkId const & target, Unicode::String const & params); void commandFuncMacro (Command const & command, NetworkId const & actor, NetworkId const & target, Unicode::String const & params); @@ -267,7 +267,7 @@ namespace CommandCppFuncsNamespace void commandFuncVoiceInvite(Command const & command, NetworkId const & actor, NetworkId const & target, Unicode::String const & params); void commandFuncVoiceKick(Command const & command, NetworkId const & actor, NetworkId const & target, Unicode::String const & params); - void commandFuncTcg(Command const & command, NetworkId const & , NetworkId const & target, Unicode::String const &); + //void commandFuncTcg(Command const & command, NetworkId const & , NetworkId const & target, Unicode::String const &); void commandFuncToggleOutOfCharacter(Command const & command, NetworkId const & actor, NetworkId const & target, Unicode::String const &); @@ -406,7 +406,7 @@ void CommandCppFuncsNamespace::commandFuncEquipAppearance(Command const & comman UNREF(command); UNREF(actor); UNREF(params); - + if(Game::getPlayerObject()) { Object * const targetObject = NetworkIdManager::getObjectById(target); @@ -437,7 +437,7 @@ void CommandCppFuncsNamespace::commandFuncEquipAppearance(Command const & comman return; } } - + if(PlayerObject::isAdmin()) { CuiInventoryManager::equipAppearanceItem(target); @@ -456,7 +456,7 @@ void CommandCppFuncsNamespace::commandFuncUnequipAppearance(Command const & comm void CommandCppFuncsNamespace::commandFuncFindControllers(Command const & , NetworkId const & , NetworkId const & , Unicode::String const &) { int totalJoysticks = DirectInput::getNumberOfJoysticksAvailable(); - + DirectInput::reaquireJoystick(); if(totalJoysticks < DirectInput::getNumberOfJoysticksAvailable()) @@ -695,7 +695,7 @@ void CommandCppFuncsNamespace::commandFuncSitClient (Command const &, NetworkId targetObject = dynamic_cast(findClientObjectFromParam (params)); } else if (targetId.isValid ()) - targetObject = dynamic_cast(NetworkIdManager::getObjectById (targetId)); + targetObject = dynamic_cast(NetworkIdManager::getObjectById (targetId)); // Get the look-at target. NetworkId chairNetworkId; @@ -828,7 +828,7 @@ void CommandCppFuncsNamespace::commandFuncJumpClient (Command const & command, N if(!hardpointName.empty() && hardpointName.find("passenger") != std::string::npos) return; - actorObject = actorObject->getMountedCreature(); + actorObject = actorObject->getMountedCreature(); } // @todo determine if these checks should be done in ClientCommandQueue for all client_only cppHook commands @@ -1871,7 +1871,7 @@ void CommandCppFuncsNamespace::commandFuncEditBiography(Command const & , Networ CreatureObject const * const creatureObject = getCreatureOrPilot(editTarget); PlayerObject const * const playerObject = creatureObject ? creatureObject->getPlayerObject() : NULL; - if (playerObject) + if (playerObject) { Game::debugPrintUi("Requesting player biography..."); CuiActionManager::performAction(CuiActions::editBiography, Unicode::narrowToWide(editTarget.getValueString())); @@ -1975,7 +1975,7 @@ void CommandCppFuncsNamespace::commandFuncDumpPausedCommands (C CuiChatRoomManager::sendPrelocalizedChat(dumpedResult); } else - CuiChatRoomManager::sendPrelocalizedChat (CuiStringIdsCommand::no_paused_commands.localize()); + CuiChatRoomManager::sendPrelocalizedChat (CuiStringIdsCommand::no_paused_commands.localize()); } //---------------------------------------------------------------------- @@ -2180,7 +2180,7 @@ void CommandCppFuncsNamespace::commandFuncMatchSpeed(Command const & , NetworkId if (targetShip == NULL) { - CuiChatRoomManager::sendPrelocalizedChat (CuiStringIdsCommand::no_ship_targetted.localize()); + CuiChatRoomManager::sendPrelocalizedChat (CuiStringIdsCommand::no_ship_targetted.localize()); return; } @@ -2450,10 +2450,10 @@ void CommandCppFuncsNamespace::commandFuncVoiceKick(Command const &, NetworkId c //---------------------------------------------------------------------- -void CommandCppFuncsNamespace::commandFuncTcg(Command const & , NetworkId const & , NetworkId const & , Unicode::String const & params) -{ - CuiActionManager::performAction(CuiActions::tcg, params); -} +//void CommandCppFuncsNamespace::commandFuncTcg(Command const & , NetworkId const & , NetworkId const & , Unicode::String const & params) +//{ +// CuiActionManager::performAction(CuiActions::tcg, params); +//} //---------------------------------------------------------------------- @@ -2638,7 +2638,7 @@ void CommandCppFuncs::install() CommandTable::addCppFunction("voiceInvite", commandFuncVoiceInvite); CommandTable::addCppFunction("voiceKick", commandFuncVoiceKick); - CommandTable::addCppFunction("tcg", commandFuncTcg); + //CommandTable::addCppFunction("tcg", commandFuncTcg); CommandTable::addCppFunction("equipAppearance", commandFuncEquipAppearance); CommandTable::addCppFunction("unequipAppearance", commandFuncUnequipAppearance); @@ -2658,4 +2658,3 @@ void CommandCppFuncs::remove() } // ====================================================================== - diff --git a/src/engine/client/library/clientUserInterface/src/shared/core/CuiActions.h b/src/engine/client/library/clientUserInterface/src/shared/core/CuiActions.h index 0fc447f73..f48046e72 100644 --- a/src/engine/client/library/clientUserInterface/src/shared/core/CuiActions.h +++ b/src/engine/client/library/clientUserInterface/src/shared/core/CuiActions.h @@ -257,7 +257,7 @@ namespace CuiActions MAKE_ACTION(collections); MAKE_ACTION(myCollections); MAKE_ACTION(sendSavedPlayerInterestsToServer); - MAKE_ACTION(tcg); + //MAKE_ACTION(tcg); MAKE_ACTION(appearanceTab); MAKE_ACTION(questBuilder); MAKE_ACTION(rating); diff --git a/src/game/client/library/swgClientUserInterface/src/shared/page/SwgCuiButtonBar.cpp b/src/game/client/library/swgClientUserInterface/src/shared/page/SwgCuiButtonBar.cpp index 2379391d2..7c3e0089a 100644 --- a/src/game/client/library/swgClientUserInterface/src/shared/page/SwgCuiButtonBar.cpp +++ b/src/game/client/library/swgClientUserInterface/src/shared/page/SwgCuiButtonBar.cpp @@ -122,7 +122,7 @@ m_submenuButton(0), m_shipDetailsButton(0), m_homePortButton(0), m_myCollectionsButton(0), -m_tcgButton(0), +//m_tcgButton(0), m_appearanceButton(0), m_questBuilderButton(0), m_gcwInfoButton(0), @@ -157,7 +157,7 @@ m_opacityCallback (0) getCodeDataObject (TUIButton, m_shipDetailsButton, "buttonShipDetails", true); getCodeDataObject (TUIButton, m_homePortButton, "buttonHomePort", true); getCodeDataObject (TUIButton, m_myCollectionsButton, "buttonMyCollections"); - getCodeDataObject (TUIButton, m_tcgButton, "buttonTcg"); + //getCodeDataObject (TUIButton, m_tcgButton, "buttonTcg"); getCodeDataObject (TUIButton, m_appearanceButton, "buttonAppearance"); getCodeDataObject (TUIButton, m_questBuilderButton, "buttonQuestBuilder"); getCodeDataObject (TUIButton, m_gcwInfoButton, "buttonGCW"); @@ -188,7 +188,7 @@ m_opacityCallback (0) registerMediatorObject (*m_serviceButton, true); registerMediatorObject (*m_submenuButton, true); registerMediatorObject (*m_myCollectionsButton, true); - registerMediatorObject (*m_tcgButton, true); + //registerMediatorObject (*m_tcgButton, true); registerMediatorObject (*m_appearanceButton, true); registerMediatorObject (*m_questBuilderButton, true); registerMediatorObject (*m_gcwInfoButton, true); @@ -204,7 +204,7 @@ m_opacityCallback (0) registerMediatorObject (getPage (), true); - for (int buttonStates = 0; buttonStates < MaxButtonStates; ++buttonStates) + for (int buttonStates = 0; buttonStates < MaxButtonStates; ++buttonStates) { m_buttonImages[buttonStates] = NULL; @@ -241,7 +241,7 @@ SwgCuiButtonBar::~SwgCuiButtonBar () m_journalButtonEffector = 0; m_homePortButton = 0; - for (int buttonStates = 0; buttonStates < MaxButtonStates; ++buttonStates) + for (int buttonStates = 0; buttonStates < MaxButtonStates; ++buttonStates) { m_buttonImages[buttonStates] = NULL; } @@ -288,7 +288,7 @@ void SwgCuiButtonBar::turnOffInventoryEffector() m_inventoryButton->SetColor (UIColor::white); m_inventoryButton->SetBackgroundColor (UIColor::white); m_inventoryButton->SetBackgroundTint (UIColor::white); - m_effectingInventoryFull = false; + m_effectingInventoryFull = false; } //---------------------------------------------------------------------- @@ -418,7 +418,7 @@ void SwgCuiButtonBar::update (float deltaTimeSecs) if (!squelchedAndOrLotsOverLimitSpamStr.empty()) CuiTextManager::showSystemStatusString(squelchedAndOrLotsOverLimitSpamStr); - turnOffInventoryEffector(); + turnOffInventoryEffector(); return; } } @@ -427,7 +427,7 @@ void SwgCuiButtonBar::update (float deltaTimeSecs) turnOffInventoryEffector(); return; } - + if (m_effectingNewMail) { if (!hasNewMail) @@ -446,7 +446,7 @@ void SwgCuiButtonBar::update (float deltaTimeSecs) { if (!inventoryFull) { - turnOffInventoryEffector(); + turnOffInventoryEffector(); } } else if (inventoryFull) @@ -466,7 +466,7 @@ void SwgCuiButtonBar::updateMenuPosition() return; UIPoint menuButtonLoc = m_menuButtonPage->GetLocation(); if((menuButtonLoc.x != m_menuButtonRestLoc.x) || (menuButtonLoc.y != m_menuButtonRestLoc.y)) - { + { UIPoint menuButtonDelta = menuButtonLoc - m_menuButtonRestLoc; UIPoint topLoc = getPage().GetLocation(); topLoc += menuButtonDelta; @@ -534,7 +534,7 @@ void SwgCuiButtonBar::updateMenuHighlight() bool SwgCuiButtonBar::OnMessage (UIWidget * context, const UIMessage & msg) { NOT_NULL (context); - + if (context == &getPage ()) { if(msg.Type == UIMessage::LeftMouseUp || msg.Type == UIMessage::LeftMouseDown) @@ -558,10 +558,10 @@ bool SwgCuiButtonBar::OnMessage (UIWidget * context, const UIMessage & msg) UIBaseObject::UIObjectList::iterator buttonListI; parent->GetChildren(childList); buttonListI = childList.begin(); - if(buttonListI == childList.end()) + if(buttonListI == childList.end()) return true; ++buttonListI; - if(buttonListI == childList.end()) + if(buttonListI == childList.end()) return true; UIBaseObject *button = (*buttonListI); if(!button->IsA(TUIButton)) @@ -584,20 +584,20 @@ bool SwgCuiButtonBar::OnMessage (UIWidget * context, const UIMessage & msg) void SwgCuiButtonBar::toggleMenu() { if(m_buttonsComposite->IsVisible()) - { + { m_menuButtonPage->SetOpacity(CuiPreferences::getCommandButtonOpacity()); m_mouseoverPage->SetVisible(false); - m_buttonsComposite->SetVisible(false); - + m_buttonsComposite->SetVisible(false); + CuiManager::requestPointer (false); - + } else { getPage().SetGetsInput(true); m_menuButtonPage->SetOpacity(1.0f); m_buttonsComposite->SetGetsInput(true); - m_buttonsComposite->SetVisible(true); + m_buttonsComposite->SetVisible(true); m_mouseoverPage->SetVisible(true); //Only show the roadmap and expertise options if the correct conditions are met. @@ -609,7 +609,7 @@ void SwgCuiButtonBar::toggleMenu() m_roadmapButton->GetParentWidget()->SetVisible(false); } else - { + { if(m_roadmapButton) { if (RoadmapManager::playerIsOnRoadmap()) @@ -625,7 +625,7 @@ void SwgCuiButtonBar::toggleMenu() if(m_expertiseButton) { if (ClientExpertiseManager::hasExpertiseTrees() && ClientExpertiseManager::getExpertisePointsTotalForPlayer() > 0) - { + { m_expertiseButton->GetParentWidget()->SetVisible(true); ++m_numberButtons; } @@ -683,7 +683,7 @@ void SwgCuiButtonBar::OnButtonPressed (UIWidget * context) { m_mouseoverPage->SetVisible(false); m_buttonsComposite->SetVisible(false); - + CuiManager::requestPointer (false); } @@ -717,14 +717,14 @@ void SwgCuiButtonBar::OnPopupMenuSelection (UIWidget * context) if (sel == pop_horizontal) { const UISize & size_max = getPage ().GetMaximumSize (); - const UISize & size_min = getPage ().GetMinimumSize (); + const UISize & size_min = getPage ().GetMinimumSize (); getPage ().SetSize (UISize (size_max.x, size_min.y)); CuiSoundManager::play (CuiSounds::increment_big); } else if (sel == pop_vertical) { const UISize & size_max = getPage ().GetMaximumSize (); - const UISize & size_min = getPage ().GetMinimumSize (); + const UISize & size_min = getPage ().GetMinimumSize (); getPage ().SetSize (UISize (size_min.x, size_max.y)); CuiSoundManager::play (CuiSounds::increment_big); @@ -833,11 +833,11 @@ void SwgCuiButtonBar::OnHoverIn( UIWidget *Context ) void SwgCuiButtonBar::updateSkinnedImageState() { int const stateIndex = static_cast(m_hoverState) + static_cast(m_buttonsComposite->IsVisible()) * 2; - for (int buttonStates = 0; buttonStates < MaxButtonStates; ++buttonStates) + for (int buttonStates = 0; buttonStates < MaxButtonStates; ++buttonStates) { if (m_buttonImages[buttonStates]) { - if (Game::isHudSceneTypeSpace()) + if (Game::isHudSceneTypeSpace()) { m_buttonImages[buttonStates]->SetVisible(false); } diff --git a/src/game/client/library/swgClientUserInterface/src/shared/page/SwgCuiButtonBar.h b/src/game/client/library/swgClientUserInterface/src/shared/page/SwgCuiButtonBar.h index 003b8c2cf..d2157278b 100644 --- a/src/game/client/library/swgClientUserInterface/src/shared/page/SwgCuiButtonBar.h +++ b/src/game/client/library/swgClientUserInterface/src/shared/page/SwgCuiButtonBar.h @@ -36,7 +36,7 @@ public: bool OnMessage (UIWidget * context, const UIMessage & msg); void OnPopupMenuSelection (UIWidget * context); - void OnButtonPressed (UIWidget * context); + void OnButtonPressed (UIWidget * context); virtual void OnHoverIn(UIWidget * Context); virtual void OnHoverOut(UIWidget * Context); @@ -56,10 +56,10 @@ private: SwgCuiButtonBar (const SwgCuiButtonBar &); SwgCuiButtonBar & operator= (const SwgCuiButtonBar &); - + void turnOffInventoryEffector (); void enableJournalEffector(bool isEnabled); - void updateJournalEffector(); + void updateJournalEffector(); void updateExpertiseEffector(); void updateMenuPosition(); void updateMenuEffector(); @@ -67,7 +67,7 @@ private: void updateSkinnedImageState(); - + private: enum { MaxButtonStates = 4 }; @@ -88,7 +88,7 @@ private: UIButton * m_shipDetailsButton; UIButton * m_homePortButton; UIButton * m_myCollectionsButton; - UIButton * m_tcgButton; + //UIButton * m_tcgButton; UIButton * m_appearanceButton; UIButton * m_questBuilderButton; UIButton * m_gcwInfoButton; @@ -98,7 +98,7 @@ private: UIEffector * m_effectorMenu; UIEffector * m_effectorExpertise; UIEffector * m_journalButtonEffector; - + bool m_effectingNewMail; bool m_effectingInventoryFull; diff --git a/src/game/client/library/swgClientUserInterface/src/shared/page/SwgCuiHudAction.cpp b/src/game/client/library/swgClientUserInterface/src/shared/page/SwgCuiHudAction.cpp index ae2eb5d3f..117bf8256 100644 --- a/src/game/client/library/swgClientUserInterface/src/shared/page/SwgCuiHudAction.cpp +++ b/src/game/client/library/swgClientUserInterface/src/shared/page/SwgCuiHudAction.cpp @@ -284,7 +284,7 @@ m_toggleDownTimeNames (0.0f) CuiActionManager::addAction(CuiActions::sendSavedPlayerInterestsToServer, this, false); CuiActionManager::addAction (SwgCuiActions::toggleVoiceFlyBar, this, false); - CuiActionManager::addAction (CuiActions::tcg, this, false); + //CuiActionManager::addAction (CuiActions::tcg, this, false); CuiActionManager::addAction (CuiActions::appearanceTab, this, false); @@ -1592,22 +1592,22 @@ bool SwgCuiHudAction::performAction (const std::string & id, const Unicode::Str { CuiMediatorFactory::toggleInWorkspace(CuiMediatorTypes::WS_VoiceActiveSpeakers); } - else if (id == CuiActions::tcg) - { - SwgCuiTcgWindow * tcgWindow = safe_cast(CuiMediatorFactory::getInWorkspace(CuiMediatorTypes::WS_TcgWindow, false, false, false)); + //else if (id == CuiActions::tcg) + //{ + //SwgCuiTcgWindow * tcgWindow = safe_cast(CuiMediatorFactory::getInWorkspace(CuiMediatorTypes::WS_TcgWindow, false, false, false)); + + //if (tcgWindow && tcgWindow->isActive()) + //{ + //CuiMediatorFactory::deactivateInWorkspace(CuiMediatorTypes::WS_TcgWindow); + //} + //else + //{ + //SwgCuiTcgManager::setLoginInfo(GameNetwork::getUserName().c_str(), CuiLoginManager::getSessionIdKey(true)); + //SwgCuiTcgManager::launch(); - if (tcgWindow && tcgWindow->isActive()) - { - CuiMediatorFactory::deactivateInWorkspace(CuiMediatorTypes::WS_TcgWindow); - } - else - { - SwgCuiTcgManager::setLoginInfo(GameNetwork::getUserName().c_str(), CuiLoginManager::getSessionIdKey(true)); - SwgCuiTcgManager::launch(); - - tcgWindow = safe_cast(CuiMediatorFactory::activateInWorkspace(CuiMediatorTypes::WS_TcgWindow, false, false)); - } - } + //tcgWindow = safe_cast(CuiMediatorFactory::activateInWorkspace(CuiMediatorTypes::WS_TcgWindow, false, false)); + //} + //} else if (id == CuiActions::appearanceTab) { CuiMediatorFactory::toggleInWorkspace(CuiMediatorTypes::WS_AppearanceTab);