From 0b24d96e206ff60739079e0998193fb3c27f7e27 Mon Sep 17 00:00:00 2001 From: Xottab-DUTY Date: Sun, 16 Sep 2018 13:35:19 +0500 Subject: [PATCH] Revert "Added xrUICore project. Some ui files moved to xrUICore" This reverts commit 94acc9ac7eb3bdde02345ea1c5982b198c28ee09. --- res/gamedata/configs/localization.ltx | 7 - src/Common/CommonImportExport.inl | 6 - src/Include/xrAPI/xrAPI.h | 2 - src/engine.sln | 14 - src/utils/xrSE_Factory/xrUIXmlParser.cpp | 52 +- src/xrEngine/StringTable/IStringTable.cpp | 4 - src/xrEngine/StringTable/IStringTable.h | 18 - src/xrEngine/xrEngine.vcxproj | 5 - src/xrEngine/xrEngine.vcxproj.filters | 18 - src/xrEngine/xr_input_xinput.cpp | 518 ------- src/xrEngine/xr_input_xinput.h | 165 --- src/xrGame/Actor.cpp | 5 +- src/xrGame/Actor.h | 2 +- src/xrGame/ActorAnimation.cpp | 2 +- src/xrGame/ActorCondition.cpp | 6 +- src/xrGame/ActorInput.cpp | 4 +- src/xrGame/ActorVehicle.cpp | 2 +- src/xrGame/CustomDetector.cpp | 2 +- src/xrGame/DBG_Car.cpp | 2 +- src/xrGame/DestroyablePhysicsObject.cpp | 2 +- src/xrGame/EliteDetector.cpp | 4 +- src/xrGame/GameObject.cpp | 4 +- src/xrGame/GamePersistent.cpp | 21 +- src/xrGame/GamePersistent.h | 1 + src/xrGame/GameTask.cpp | 6 +- src/xrGame/GametaskManager.cpp | 2 +- src/xrGame/HUDCrosshair.cpp | 3 +- src/xrGame/HUDCrosshair.h | 2 +- src/xrGame/HUDManager.cpp | 108 +- src/xrGame/HUDTarget.cpp | 7 +- src/xrGame/HangingLamp.cpp | 2 +- src/xrGame/Helicopter.cpp | 5 +- src/xrGame/Helicopter2.cpp | 2 +- src/xrGame/HelicopterMovementManager.cpp | 2 +- src/xrGame/HitMarker.cpp | 2 +- src/xrGame/HitMarker.h | 2 +- src/xrGame/HudItem.cpp | 2 +- src/xrGame/Inventory.cpp | 2 +- src/xrGame/InventoryBox.cpp | 2 +- src/xrGame/InventoryOwner.cpp | 2 +- src/xrGame/LevelGraphDebugRender.cpp | 2 +- src/xrGame/Level_input.cpp | 2 +- src/xrGame/Level_network.cpp | 8 +- src/xrGame/Level_network_start_client.cpp | 2 +- src/xrGame/Level_start.cpp | 10 +- src/xrGame/MainMenu.cpp | 13 +- src/xrGame/MainMenu.h | 4 +- src/xrGame/Missile.cpp | 2 +- src/xrGame/PHDebug.cpp | 2 +- src/xrGame/PHScriptCall.h | 2 +- src/xrGame/PhraseScript.cpp | 2 +- src/xrGame/PhysicsShellHolder.cpp | 2 +- src/xrGame/ScriptXMLInit.cpp | 25 +- src/xrGame/ScriptXMLInit.h | 2 +- src/xrGame/Spectator.cpp | 17 +- src/xrGame/StdAfx.h | 53 +- src/xrGame/Tracer.h | 2 +- src/xrGame/UIAchivementsIndicator.cpp | 2 +- src/xrGame/UIAchivementsIndicator.h | 2 +- src/{xrUICore/Cursor => xrGame}/UICursor.cpp | 8 +- src/{xrUICore/Cursor => xrGame}/UICursor.h | 3 +- src/xrGame/UIDialogHolder.cpp | 2 +- src/xrGame/UIGameAHunt.cpp | 2 +- src/xrGame/UIGameCTA.cpp | 5 +- src/xrGame/UIGameCustom.cpp | 2 +- src/xrGame/UIGameCustom_script.cpp | 2 +- src/xrGame/UIGameDM.cpp | 2 +- src/xrGame/UIGameMP.cpp | 2 +- src/xrGame/UIGameSP.cpp | 2 +- src/xrGame/UIPlayerItem.cpp | 5 +- src/xrGame/UIPlayerItem.h | 4 +- .../Static => xrGame}/UIStaticItem.cpp | 7 +- .../Static => xrGame}/UIStaticItem.h | 4 +- src/xrGame/UITeamHeader.cpp | 5 +- src/xrGame/UITeamHeader.h | 4 +- src/xrGame/UITeamPanels.cpp | 4 +- src/xrGame/UITeamPanels.h | 4 +- src/xrGame/UITeamState.cpp | 6 +- src/xrGame/UITeamState.h | 4 +- src/xrGame/UIZoneMap.h | 2 +- src/xrGame/Weapon.cpp | 2 +- src/xrGame/WeaponAmmo.cpp | 2 +- src/xrGame/WeaponBinoculars.cpp | 2 +- src/xrGame/WeaponBinocularsVision.cpp | 2 +- src/xrGame/WeaponBinocularsVision.h | 2 +- src/xrGame/WeaponMagazined.cpp | 8 +- src/xrGame/WeaponMagazinedWGrenade.cpp | 4 +- src/xrGame/actor_communication.cpp | 2 +- src/xrGame/ai/crow/ai_crow.cpp | 2 +- .../basemonster/base_monster_feel.cpp | 4 +- .../ai/monsters/controller/controller.cpp | 2 +- src/xrGame/ai/stalker/ai_stalker_debug.cpp | 2 +- src/xrGame/ai/trader/ai_trader.cpp | 2 +- src/xrGame/ai/trader/trader_animation.cpp | 2 +- src/xrGame/alife_storage_manager.cpp | 2 +- src/xrGame/animation_script_callback.cpp | 2 +- src/xrGame/attachable_item.cpp | 2 +- .../Callbacks => xrGame}/callback_info.h | 7 +- src/xrGame/client_spawn_manager.h | 2 +- src/xrGame/console_commands.cpp | 6 +- src/xrGame/debug_text_tree.cpp | 2 +- src/xrGame/doors_door.cpp | 2 +- src/xrGame/encyclopedia_article.cpp | 2 +- src/xrGame/encyclopedia_article.h | 2 +- src/xrGame/enemy_manager.h | 2 +- src/xrGame/entity_alive.cpp | 2 +- src/xrGame/file_transfer.cpp | 2 +- src/xrGame/game_cl_artefacthunt.cpp | 10 +- src/xrGame/game_cl_base.cpp | 8 +- src/xrGame/game_cl_capture_the_artefact.cpp | 14 +- ..._capture_the_artefact_captions_manager.cpp | 8 +- ..._cl_capture_the_artefact_messages_menu.cpp | 5 +- src/xrGame/game_cl_deathmatch.cpp | 4 +- src/xrGame/game_cl_mp.cpp | 59 +- src/xrGame/game_cl_mp.h | 2 +- src/xrGame/game_cl_mp_messages_menu.cpp | 5 +- src/xrGame/game_cl_teamdeathmatch.cpp | 16 +- src/xrGame/game_news.h | 2 +- src/xrGame/game_sv_base.cpp | 5 +- src/xrGame/game_sv_capture_the_artefact.cpp | 2 +- src/xrGame/game_sv_mp.cpp | 10 +- src/xrGame/game_sv_teamdeathmatch.cpp | 2 +- src/xrGame/hit_memory_manager.cpp | 2 +- src/xrGame/inventory_item.cpp | 6 +- src/xrGame/inventory_owner_info.cpp | 2 +- src/xrGame/inventory_upgrade.cpp | 4 +- src/xrGame/inventory_upgrade_property.cpp | 2 +- src/xrGame/level_debug.cpp | 2 +- src/xrGame/level_script.cpp | 2 +- src/xrGame/map_location.cpp | 2 +- src/xrGame/map_manager.cpp | 2 +- src/xrGame/map_spot.cpp | 2 +- src/xrGame/map_spot.h | 2 +- src/xrGame/mixed_delegate.h | 2 +- src/xrGame/patrol_path_manager.cpp | 2 +- src/xrGame/patrol_path_manager.h | 2 +- src/xrGame/player_hud.cpp | 2 +- src/xrGame/player_hud_tune.cpp | 2 +- src/xrGame/saved_game_wrapper.cpp | 2 +- .../script_callback_ex.h | 2 + src/xrGame/script_entity.cpp | 2 +- src/xrGame/script_game_object3.cpp | 2 +- .../script_game_object_inventory_owner.cpp | 2 +- .../script_game_object_smart_covers.cpp | 2 +- src/xrGame/script_game_object_use.cpp | 2 +- src/xrGame/script_zone.cpp | 2 +- .../smart_cover_planner_target_selector.h | 2 +- src/xrGame/space_restrictor.cpp | 2 +- .../stalker_animation_manager_update.cpp | 2 +- src/xrGame/stalker_animation_script.cpp | 2 +- src/xrGame/string_table.cpp | 14 +- src/xrGame/string_table.h | 9 +- .../string_table_defs.h} | 3 + src/xrGame/trade.cpp | 2 +- src/xrGame/trade2.cpp | 2 +- src/xrGame/ui/ArtefactDetectorUI.cpp | 2 +- src/xrGame/ui/ArtefactDetectorUI.h | 2 +- src/xrGame/ui/ChangeWeatherDialog.cpp | 2 +- src/xrGame/ui/FactionState.h | 2 +- src/xrGame/ui/FractionState.h | 2 +- src/xrGame/ui/KillMessageStruct.h | 2 +- src/xrGame/ui/MMSound.cpp | 2 +- src/xrGame/ui/Restrictions.cpp | 2 +- src/xrGame/ui/ServerList.cpp | 41 +- src/xrGame/ui/ServerList.h | 12 +- src/xrGame/ui/TeamInfo.cpp | 8 +- .../Buttons => xrGame/ui}/UI3tButton.cpp | 5 +- .../Buttons => xrGame/ui}/UI3tButton.h | 8 +- src/xrGame/ui/UIAchievements.cpp | 10 +- src/xrGame/ui/UIAchievements.h | 2 +- src/xrGame/ui/UIActorMenu.cpp | 10 +- src/xrGame/ui/UIActorMenu.h | 4 +- src/xrGame/ui/UIActorMenuDeadBodySearch.cpp | 6 +- src/xrGame/ui/UIActorMenuInitialize.cpp | 22 +- src/xrGame/ui/UIActorMenuInventory.cpp | 20 +- src/xrGame/ui/UIActorMenuTrade.cpp | 8 +- src/xrGame/ui/UIActorMenuUpgrade.cpp | 2 +- src/xrGame/ui/UIActorMenu_action.cpp | 8 +- src/xrGame/ui/UIActorStateInfo.cpp | 12 +- src/xrGame/ui/UIActorStateInfo.h | 2 +- .../Static => xrGame/ui}/UIAnimatedStatic.cpp | 69 +- .../Static => xrGame/ui}/UIAnimatedStatic.h | 23 +- src/xrGame/ui/UIBoosterInfo.cpp | 12 +- src/xrGame/ui/UIBoosterInfo.h | 2 +- .../Buttons => xrGame/ui}/UIBtnHint.cpp | 19 +- .../Buttons => xrGame/ui}/UIBtnHint.h | 8 +- .../Buttons => xrGame/ui}/UIButton.cpp | 8 +- .../Buttons => xrGame/ui}/UIButton.h | 5 +- .../Buttons => xrGame/ui}/UIButton_script.cpp | 9 +- src/xrGame/ui/UIBuyWeaponTab.cpp | 2 +- src/xrGame/ui/UIBuyWeaponTab.h | 4 +- src/xrGame/ui/UICDkey.cpp | 22 +- src/xrGame/ui/UICDkey.h | 2 +- src/xrGame/ui/UICellCustomItems.cpp | 2 +- src/xrGame/ui/UICellItem.cpp | 4 +- src/xrGame/ui/UICellItem.h | 2 +- src/xrGame/ui/UIChangeMap.cpp | 10 +- src/xrGame/ui/UICharacterInfo.cpp | 6 +- src/xrGame/ui/UICharacterInfo.h | 2 +- src/xrGame/ui/UIChatWnd.cpp | 4 +- src/xrGame/ui/UIChatWnd.h | 2 +- .../Buttons => xrGame/ui}/UICheckButton.cpp | 10 +- .../Buttons => xrGame/ui}/UICheckButton.h | 7 +- .../ComboBox => xrGame/ui}/UIComboBox.cpp | 39 +- .../ComboBox => xrGame/ui}/UIComboBox.h | 15 +- .../ui}/UIComboBox_script.cpp | 4 +- .../EditBox => xrGame/ui}/UICustomEdit.cpp | 6 +- .../EditBox => xrGame/ui}/UICustomEdit.h | 6 +- .../SpinBox => xrGame/ui}/UICustomSpin.cpp | 8 +- .../SpinBox => xrGame/ui}/UICustomSpin.h | 6 +- src/xrGame/ui/UIDebugFonts.cpp | 4 +- src/xrGame/ui/UIDebugFonts.h | 2 +- src/xrGame/ui/UIDemoPlayControl.cpp | 34 +- src/xrGame/ui/UIDemoPlayControl.h | 2 +- src/xrGame/ui/UIDialogWnd.h | 2 +- .../ui}/UIDoubleProgressBar.cpp | 14 +- .../ui}/UIDoubleProgressBar.h | 8 +- src/xrGame/ui/UIDragDropListEx.cpp | 4 +- src/xrGame/ui/UIDragDropListEx.h | 4 +- src/xrGame/ui/UIDragDropReferenceList.cpp | 4 +- .../EditBox => xrGame/ui}/UIEditBox.cpp | 6 +- .../EditBox => xrGame/ui}/UIEditBox.h | 6 +- .../EditBox => xrGame/ui}/UIEditBoxEx.cpp | 5 +- .../EditBox => xrGame/ui}/UIEditBoxEx.h | 5 +- src/xrGame/ui/UIEditBox_script.cpp | 16 + src/xrGame/ui/UIEditKeyBind.h | 4 +- src/xrGame/ui/UIFactionWarWnd.cpp | 4 +- src/xrGame/ui/UIFactionWarWnd.h | 4 +- .../ui}/UIFixedScrollBar.cpp | 28 +- .../ui}/UIFixedScrollBar.h | 2 +- .../Windows => xrGame/ui}/UIFrameLineWnd.cpp | 4 +- .../Windows => xrGame/ui}/UIFrameLineWnd.h | 3 +- .../Windows => xrGame/ui}/UIFrameWindow.cpp | 7 +- .../Windows => xrGame/ui}/UIFrameWindow.h | 4 +- src/xrGame/ui/UIGameLog.cpp | 2 +- src/xrGame/ui/UIGameLog.h | 2 +- src/xrGame/ui/UIGameTutorial.cpp | 4 +- src/xrGame/ui/UIGameTutorialSimpleItem.cpp | 4 +- src/xrGame/ui/UIGameTutorialVideoItem.cpp | 6 +- src/xrGame/ui/UIHelper.cpp | 14 +- src/{xrUICore/Hint => xrGame/ui}/UIHint.cpp | 31 +- src/{xrUICore/Hint => xrGame/ui}/UIHint.h | 6 +- src/xrGame/ui/UIHudStatesWnd.cpp | 8 +- src/xrGame/ui/UIHudStatesWnd.h | 2 +- .../ui}/UIInteractiveBackground.h | 6 +- src/xrGame/ui/UIInvUpgrade.cpp | 4 +- src/xrGame/ui/UIInvUpgrade.h | 4 +- src/xrGame/ui/UIInvUpgradeInfo.cpp | 26 +- src/xrGame/ui/UIInvUpgradeInfo.h | 4 +- src/xrGame/ui/UIInvUpgradeProperty.cpp | 4 +- src/xrGame/ui/UIInvUpgradeProperty.h | 2 +- src/xrGame/ui/UIInventoryUpgradeWnd.cpp | 8 +- src/xrGame/ui/UIInventoryUpgradeWnd.h | 2 +- src/xrGame/ui/UIInventoryUpgradeWnd_add.cpp | 2 +- src/xrGame/ui/UIInventoryUtilities.cpp | 18 +- src/xrGame/ui/UIInventoryUtilities.h | 2 +- src/xrGame/ui/UIItemInfo.cpp | 12 +- src/xrGame/ui/UIItemInfo.h | 2 +- src/xrGame/ui/UIKeyBinding.cpp | 5 +- src/xrGame/ui/UIKeyBinding.h | 8 +- src/xrGame/ui/UIKickPlayer.cpp | 10 +- .../ui}/UILanimController.cpp | 2 +- .../Static => xrGame/ui}/UILanimController.h | 4 +- src/{xrUICore/Lines => xrGame/ui}/UILine.cpp | 50 +- src/{xrUICore/Lines => xrGame/ui}/UILine.h | 1 + src/{xrUICore/Lines => xrGame/ui}/UILines.cpp | 13 +- src/{xrUICore/Lines => xrGame/ui}/UILines.h | 10 +- .../ListBox => xrGame/ui}/UIListBox.cpp | 10 +- .../ListBox => xrGame/ui}/UIListBox.h | 5 +- .../ListBox => xrGame/ui}/UIListBoxItem.cpp | 7 +- .../ListBox => xrGame/ui}/UIListBoxItem.h | 4 +- .../ui}/UIListBoxItemMsgChain.cpp | 3 +- .../ui}/UIListBoxItemMsgChain.h | 0 src/xrGame/ui/UIListItemServer.cpp | 8 +- src/xrGame/ui/UIListItemServer.h | 4 +- src/xrGame/ui/UILoadingScreen.h | 4 +- src/xrGame/ui/UILogsWnd.cpp | 16 +- src/xrGame/ui/UILogsWnd.h | 6 +- src/xrGame/ui/UIMMShniaga.cpp | 33 +- src/xrGame/ui/UIMMShniaga.h | 18 +- src/xrGame/ui/UIMPAdminMenu.cpp | 8 +- src/xrGame/ui/UIMPAdminMenu.h | 4 +- src/xrGame/ui/UIMPChangeMapAdm.cpp | 10 +- src/xrGame/ui/UIMPChangeMapAdm.h | 4 +- src/xrGame/ui/UIMPPlayersAdm.cpp | 14 +- src/xrGame/ui/UIMPPlayersAdm.h | 4 +- src/xrGame/ui/UIMPServerAdm.cpp | 8 +- src/xrGame/ui/UIMPServerAdm.h | 6 +- src/xrGame/ui/UIMainIngameWnd.cpp | 12 +- src/xrGame/ui/UIMap.h | 4 +- src/xrGame/ui/UIMapDesc.cpp | 8 +- src/xrGame/ui/UIMapInfo.cpp | 24 +- src/xrGame/ui/UIMapInfo.h | 2 +- src/xrGame/ui/UIMapLegend.cpp | 16 +- src/xrGame/ui/UIMapLegend.h | 2 +- src/xrGame/ui/UIMapList.cpp | 26 +- src/xrGame/ui/UIMapList.h | 2 +- src/xrGame/ui/UIMapWnd.cpp | 14 +- src/xrGame/ui/UIMapWnd.h | 4 +- src/xrGame/ui/UIMapWnd2.cpp | 2 +- .../MessageBox => xrGame/ui}/UIMessageBox.cpp | 11 +- .../MessageBox => xrGame/ui}/UIMessageBox.h | 5 +- src/xrGame/ui/UIMessageBoxEx.cpp | 2 +- src/xrGame/ui/UIMessageBoxEx.h | 2 +- .../ui}/UIMessageBox_script.cpp | 12 +- src/{xrUICore => xrGame/ui}/UIMessages.h | 0 src/xrGame/ui/UIMessagesWindow.cpp | 2 +- src/xrGame/ui/UIMessagesWindow.h | 2 +- src/xrGame/ui/UIMoneyIndicator.cpp | 2 +- src/xrGame/ui/UIMoneyIndicator.h | 2 +- src/xrGame/ui/UIMotionIcon.h | 4 +- src/xrGame/ui/UIMpTradeWnd.cpp | 2 +- src/xrGame/ui/UIMpTradeWnd.h | 2 +- src/xrGame/ui/UIMpTradeWnd_init.cpp | 2 +- src/xrGame/ui/UIMpTradeWnd_items.cpp | 2 +- src/xrGame/ui/UIMpTradeWnd_misc.cpp | 4 +- src/xrGame/ui/UIMpTradeWnd_trade.cpp | 20 +- src/xrGame/ui/UINewsItemWnd.cpp | 2 +- src/xrGame/ui/UINewsItemWnd.h | 4 +- .../Options => xrGame/ui}/UIOptionsItem.cpp | 2 +- .../Options => xrGame/ui}/UIOptionsItem.h | 12 +- .../ui}/UIOptionsManager.cpp | 2 +- .../Options => xrGame/ui}/UIOptionsManager.h | 2 +- .../ui}/UIOptionsManagerScript.cpp | 13 +- src/xrGame/ui/UIOptionsManagerScript.h | 15 + src/xrGame/ui/UIOutfitInfo.cpp | 4 +- src/xrGame/ui/UIOutfitInfo.h | 4 +- src/xrGame/ui/UIPdaKillMessage.h | 2 +- src/xrGame/ui/UIPdaMsgListItem.cpp | 2 +- src/xrGame/ui/UIPdaMsgListItem.h | 2 +- src/xrGame/ui/UIPdaWnd.cpp | 18 +- .../ui}/UIProgressBar.cpp | 11 +- .../ProgressBar => xrGame/ui}/UIProgressBar.h | 9 +- src/xrGame/ui/UIProgressBar_script.cpp | 15 + .../ui}/UIProgressShape.cpp | 10 +- .../ui}/UIProgressShape.h | 6 +- .../ui}/UIPropertiesBox.cpp | 9 +- .../ui}/UIPropertiesBox.h | 7 +- .../ui}/UIPropertiesBox_script.cpp | 4 +- .../Buttons => xrGame/ui}/UIRadioButton.cpp | 6 +- .../Buttons => xrGame/ui}/UIRadioButton.h | 4 +- src/xrGame/ui/UIRankIndicator.cpp | 2 +- src/xrGame/ui/UIRankIndicator.h | 2 +- src/xrGame/ui/UIRankingWnd.cpp | 12 +- src/xrGame/ui/UIRankingWnd.h | 5 +- src/xrGame/ui/UIScriptWnd.cpp | 2 +- .../ScrollBar => xrGame/ui}/UIScrollBar.cpp | 24 +- .../ScrollBar => xrGame/ui}/UIScrollBar.h | 4 +- .../ScrollBar => xrGame/ui}/UIScrollBox.cpp | 4 +- .../ScrollBar => xrGame/ui}/UIScrollBox.h | 2 +- .../ScrollView => xrGame/ui}/UIScrollView.cpp | 8 +- .../ScrollView => xrGame/ui}/UIScrollView.h | 10 +- src/xrGame/ui/UISecondTaskWnd.cpp | 18 +- src/xrGame/ui/UISecondTaskWnd.h | 4 +- src/xrGame/ui/UIServerInfo.cpp | 8 +- src/xrGame/ui/UIServerInfo.h | 2 +- src/xrGame/ui/UISkinSelector.cpp | 6 +- src/xrGame/ui/UISleepStatic.cpp | 66 - src/xrGame/ui/UISleepStatic.h | 17 - src/xrGame/ui/UISpawnWnd.cpp | 6 +- src/xrGame/ui/UISpeechMenu.cpp | 6 +- .../SpinBox => xrGame/ui}/UISpinNum.cpp | 8 +- .../SpinBox => xrGame/ui}/UISpinNum.h | 6 +- .../SpinBox => xrGame/ui}/UISpinText.cpp | 11 +- .../SpinBox => xrGame/ui}/UISpinText.h | 4 +- .../Static => xrGame/ui}/UIStatic.cpp | 18 +- src/{xrUICore/Static => xrGame/ui}/UIStatic.h | 14 +- .../Static => xrGame/ui}/UIStatic_script.cpp | 5 +- src/xrGame/ui/UIStatix.h | 2 +- src/xrGame/ui/UIStats.cpp | 4 +- src/xrGame/ui/UIStats.h | 2 +- src/xrGame/ui/UIStatsIcon.cpp | 2 +- src/xrGame/ui/UIStatsIcon.h | 2 +- src/xrGame/ui/UIStatsPlayerInfo.cpp | 5 +- src/xrGame/ui/UIStatsPlayerInfo.h | 2 +- src/xrGame/ui/UIStatsPlayerList.cpp | 11 +- src/xrGame/ui/UIStatsPlayerList.h | 2 +- .../Lines => xrGame/ui}/UISubLine.cpp | 49 +- src/{xrUICore/Lines => xrGame/ui}/UISubLine.h | 0 .../TabControl => xrGame/ui}/UITabButton.cpp | 3 +- .../TabControl => xrGame/ui}/UITabButton.h | 4 +- src/xrGame/ui/UITabButtonMP.h | 2 +- .../TabControl => xrGame/ui}/UITabControl.cpp | 4 +- .../TabControl => xrGame/ui}/UITabControl.h | 8 +- .../ui}/UITabControl_script.cpp | 2 +- src/xrGame/ui/UITalkDialogWnd.cpp | 8 +- src/xrGame/ui/UITalkDialogWnd.h | 8 +- src/xrGame/ui/UITalkWnd.cpp | 7 +- src/xrGame/ui/UITalkWnd.h | 8 +- src/xrGame/ui/UITaskWnd.cpp | 10 +- src/xrGame/ui/UITaskWnd.h | 6 +- src/xrGame/ui/UITextVote.cpp | 2 +- .../XML => xrGame/ui}/UITextureMaster.cpp | 4 +- .../XML => xrGame/ui}/UITextureMaster.h | 4 +- .../TrackBar => xrGame/ui}/UITrackBar.cpp | 10 +- .../TrackBar => xrGame/ui}/UITrackBar.h | 7 +- src/xrGame/ui/UIVote.cpp | 8 +- src/xrGame/ui/UIVoteStatusWnd.cpp | 2 +- src/xrGame/ui/UIVoteStatusWnd.h | 2 +- src/xrGame/ui/UIVotingCategory.cpp | 2 +- src/xrGame/ui/UIWarState.cpp | 2 +- src/xrGame/ui/UIWarState.h | 2 +- .../Windows => xrGame/ui}/UIWindow.cpp | 82 +- .../Windows => xrGame/ui}/UIWindow.h | 15 +- src/xrGame/ui/UIWindow_script.cpp | 195 ++- .../Callbacks => xrGame/ui}/UIWndCallback.cpp | 4 +- .../Callbacks => xrGame/ui}/UIWndCallback.h | 2 +- src/xrGame/ui/UIWpnParams.h | 5 +- src/xrGame/ui/UIXmlInit.cpp | 1129 ++++++++++++++- src/xrGame/ui/UIXmlInit.h | 50 +- .../ui}/UI_IB_Static.cpp | 2 +- .../ui}/UI_IB_Static.h | 5 +- src/xrGame/ui/map_hint.cpp | 4 +- src/xrGame/ui/map_hint.h | 2 +- src/xrGame/ui/ui_af_params.cpp | 10 +- src/xrGame/ui/ui_af_params.h | 2 +- .../arrow => xrGame/ui}/ui_arrow.cpp | 9 +- src/{xrUICore/arrow => xrGame/ui}/ui_arrow.h | 10 +- src/{xrUICore => xrGame/ui}/uiabstract.h | 1 + src/{xrUICore/Lines => xrGame/ui}/uilinestd.h | 1 + src/xrGame/ui/uiscriptwnd_script2.cpp | 22 +- src/xrGame/ui/xrUIXmlParser.cpp | 77 ++ .../XML => xrGame/ui}/xrUIXmlParser.h | 2 +- src/{xrUICore => xrGame}/ui_base.cpp | 11 +- src/{xrUICore => xrGame}/ui_base.h | 41 +- src/{xrUICore => xrGame}/ui_defs.h | 2 +- src/xrGame/ui_export_script.cpp | 9 + src/xrGame/xrGame.cpp | 5 +- src/xrGame/xrGame.vcxproj | 151 +- src/xrGame/xrGame.vcxproj.filters | 402 +++++- src/xrGame/xrServer.cpp | 2 +- src/xrGame/xr_level_controller.cpp | 488 ++++++- src/xrGame/xr_level_controller.h | 132 +- src/xrGame/xrgame_dll_detach.cpp | 23 +- src/xrScriptEngine/xrScriptEngine.vcxproj | 1 - .../xrScriptEngine.vcxproj.filters | 9 - src/xrServerEntities/character_info.cpp | 4 +- src/xrServerEntities/smart_cast.cpp | 2 +- src/xrServerEntities/specific_character.cpp | 2 +- src/xrServerEntities/xml_str_id_loader.h | 4 +- .../xrServer_Objects_ALife_Monsters.cpp | 6 +- src/xrUICore/CMakeLists.txt | 79 -- src/xrUICore/EditBox/UIEditBox_script.cpp | 20 - src/xrUICore/FontManager/FontManager.cpp | 101 -- src/xrUICore/FontManager/FontManager.h | 33 - src/xrUICore/ListBox/UIListBox_script.cpp | 77 -- src/xrUICore/Options/UIOptionsManagerScript.h | 14 - .../ProgressBar/UIProgressBar_script.cpp | 19 - src/xrUICore/Windows/UIWindow_script.cpp | 186 --- src/xrUICore/XML/UIXmlInitBase.cpp | 1215 ----------------- src/xrUICore/XML/UIXmlInitBase.h | 94 -- src/xrUICore/XML/xrUIXmlParser.cpp | 26 - src/xrUICore/packages.config | 5 - src/xrUICore/pch.cpp | 1 - src/xrUICore/pch.hpp | 9 - src/xrUICore/xrUICore.vcxproj | 392 ------ src/xrUICore/xrUICore.vcxproj.filters | 431 ------ 457 files changed, 4313 insertions(+), 4850 deletions(-) delete mode 100644 res/gamedata/configs/localization.ltx delete mode 100644 src/xrEngine/StringTable/IStringTable.cpp delete mode 100644 src/xrEngine/StringTable/IStringTable.h delete mode 100644 src/xrEngine/xr_input_xinput.cpp delete mode 100644 src/xrEngine/xr_input_xinput.h rename src/{xrUICore/Cursor => xrGame}/UICursor.cpp (97%) rename src/{xrUICore/Cursor => xrGame}/UICursor.h (85%) rename src/{xrUICore/Static => xrGame}/UIStaticItem.cpp (97%) rename src/{xrUICore/Static => xrGame}/UIStaticItem.h (96%) rename src/{xrUICore/Callbacks => xrGame}/callback_info.h (78%) rename src/{xrScriptEngine => xrGame}/script_callback_ex.h (99%) rename src/{xrEngine/StringTable/IStringTableDefs.h => xrGame/string_table_defs.h} (59%) rename src/{xrUICore/Buttons => xrGame/ui}/UI3tButton.cpp (99%) rename src/{xrUICore/Buttons => xrGame/ui}/UI3tButton.h (88%) rename src/{xrUICore/Static => xrGame/ui}/UIAnimatedStatic.cpp (54%) rename src/{xrUICore/Static => xrGame/ui}/UIAnimatedStatic.h (82%) rename src/{xrUICore/Buttons => xrGame/ui}/UIBtnHint.cpp (76%) rename src/{xrUICore/Buttons => xrGame/ui}/UIBtnHint.h (66%) rename src/{xrUICore/Buttons => xrGame/ui}/UIButton.cpp (97%) rename src/{xrUICore/Buttons => xrGame/ui}/UIButton.h (95%) rename src/{xrUICore/Buttons => xrGame/ui}/UIButton_script.cpp (92%) rename src/{xrUICore/Buttons => xrGame/ui}/UICheckButton.cpp (93%) rename src/{xrUICore/Buttons => xrGame/ui}/UICheckButton.h (87%) rename src/{xrUICore/ComboBox => xrGame/ui}/UIComboBox.cpp (92%) rename src/{xrUICore/ComboBox => xrGame/ui}/UIComboBox.h (83%) rename src/{xrUICore/ComboBox => xrGame/ui}/UIComboBox_script.cpp (95%) rename src/{xrUICore/EditBox => xrGame/ui}/UICustomEdit.cpp (99%) rename src/{xrUICore/EditBox => xrGame/ui}/UICustomEdit.h (95%) rename src/{xrUICore/SpinBox => xrGame/ui}/UICustomSpin.cpp (97%) rename src/{xrUICore/SpinBox => xrGame/ui}/UICustomSpin.h (87%) rename src/{xrUICore/ProgressBar => xrGame/ui}/UIDoubleProgressBar.cpp (78%) rename src/{xrUICore/ProgressBar => xrGame/ui}/UIDoubleProgressBar.h (72%) rename src/{xrUICore/EditBox => xrGame/ui}/UIEditBox.cpp (91%) rename src/{xrUICore/EditBox => xrGame/ui}/UIEditBox.h (79%) rename src/{xrUICore/EditBox => xrGame/ui}/UIEditBoxEx.cpp (92%) rename src/{xrUICore/EditBox => xrGame/ui}/UIEditBoxEx.h (77%) create mode 100644 src/xrGame/ui/UIEditBox_script.cpp rename src/{xrUICore/ScrollBar => xrGame/ui}/UIFixedScrollBar.cpp (93%) rename src/{xrUICore/ScrollBar => xrGame/ui}/UIFixedScrollBar.h (94%) rename src/{xrUICore/Windows => xrGame/ui}/UIFrameLineWnd.cpp (99%) rename src/{xrUICore/Windows => xrGame/ui}/UIFrameLineWnd.h (95%) rename src/{xrUICore/Windows => xrGame/ui}/UIFrameWindow.cpp (98%) rename src/{xrUICore/Windows => xrGame/ui}/UIFrameWindow.h (92%) rename src/{xrUICore/Hint => xrGame/ui}/UIHint.cpp (80%) rename src/{xrUICore/Hint => xrGame/ui}/UIHint.h (93%) rename src/{xrUICore/InteractiveBackground => xrGame/ui}/UIInteractiveBackground.h (95%) rename src/{xrUICore/Static => xrGame/ui}/UILanimController.cpp (98%) rename src/{xrUICore/Static => xrGame/ui}/UILanimController.h (96%) rename src/{xrUICore/Lines => xrGame/ui}/UILine.cpp (73%) rename src/{xrUICore/Lines => xrGame/ui}/UILine.h (99%) rename src/{xrUICore/Lines => xrGame/ui}/UILines.cpp (97%) rename src/{xrUICore/Lines => xrGame/ui}/UILines.h (94%) rename src/{xrUICore/ListBox => xrGame/ui}/UIListBox.cpp (97%) rename src/{xrUICore/ListBox => xrGame/ui}/UIListBox.h (93%) rename src/{xrUICore/ListBox => xrGame/ui}/UIListBoxItem.cpp (95%) rename src/{xrUICore/ListBox => xrGame/ui}/UIListBoxItem.h (86%) rename src/{xrUICore/ListBox => xrGame/ui}/UIListBoxItemMsgChain.cpp (76%) rename src/{xrUICore/ListBox => xrGame/ui}/UIListBoxItemMsgChain.h (100%) rename src/{xrUICore/MessageBox => xrGame/ui}/UIMessageBox.cpp (98%) rename src/{xrUICore/MessageBox => xrGame/ui}/UIMessageBox.h (94%) rename src/{xrUICore/MessageBox => xrGame/ui}/UIMessageBox_script.cpp (51%) rename src/{xrUICore => xrGame/ui}/UIMessages.h (100%) rename src/{xrUICore/Options => xrGame/ui}/UIOptionsItem.cpp (99%) rename src/{xrUICore/Options => xrGame/ui}/UIOptionsItem.h (79%) rename src/{xrUICore/Options => xrGame/ui}/UIOptionsManager.cpp (99%) rename src/{xrUICore/Options => xrGame/ui}/UIOptionsManager.h (97%) rename src/{xrUICore/Options => xrGame/ui}/UIOptionsManagerScript.cpp (76%) create mode 100644 src/xrGame/ui/UIOptionsManagerScript.h rename src/{xrUICore/ProgressBar => xrGame/ui}/UIProgressBar.cpp (97%) rename src/{xrUICore/ProgressBar => xrGame/ui}/UIProgressBar.h (90%) create mode 100644 src/xrGame/ui/UIProgressBar_script.cpp rename src/{xrUICore/ProgressBar => xrGame/ui}/UIProgressShape.cpp (96%) rename src/{xrUICore/ProgressBar => xrGame/ui}/UIProgressShape.h (75%) rename src/{xrUICore/PropertiesBox => xrGame/ui}/UIPropertiesBox.cpp (97%) rename src/{xrUICore/PropertiesBox => xrGame/ui}/UIPropertiesBox.h (89%) rename src/{xrUICore/PropertiesBox => xrGame/ui}/UIPropertiesBox_script.cpp (85%) rename src/{xrUICore/Buttons => xrGame/ui}/UIRadioButton.cpp (89%) rename src/{xrUICore/Buttons => xrGame/ui}/UIRadioButton.h (85%) rename src/{xrUICore/ScrollBar => xrGame/ui}/UIScrollBar.cpp (95%) rename src/{xrUICore/ScrollBar => xrGame/ui}/UIScrollBar.h (96%) rename src/{xrUICore/ScrollBar => xrGame/ui}/UIScrollBox.cpp (96%) rename src/{xrUICore/ScrollBar => xrGame/ui}/UIScrollBox.h (85%) rename src/{xrUICore/ScrollView => xrGame/ui}/UIScrollView.cpp (98%) rename src/{xrUICore/ScrollView => xrGame/ui}/UIScrollView.h (92%) delete mode 100644 src/xrGame/ui/UISleepStatic.cpp delete mode 100644 src/xrGame/ui/UISleepStatic.h rename src/{xrUICore/SpinBox => xrGame/ui}/UISpinNum.cpp (93%) rename src/{xrUICore/SpinBox => xrGame/ui}/UISpinNum.h (91%) rename src/{xrUICore/SpinBox => xrGame/ui}/UISpinText.cpp (90%) rename src/{xrUICore/SpinBox => xrGame/ui}/UISpinText.h (90%) rename src/{xrUICore/Static => xrGame/ui}/UIStatic.cpp (97%) rename src/{xrUICore/Static => xrGame/ui}/UIStatic.h (92%) rename src/{xrUICore/Static => xrGame/ui}/UIStatic_script.cpp (93%) rename src/{xrUICore/Lines => xrGame/ui}/UISubLine.cpp (52%) rename src/{xrUICore/Lines => xrGame/ui}/UISubLine.h (100%) rename src/{xrUICore/TabControl => xrGame/ui}/UITabButton.cpp (93%) rename src/{xrUICore/TabControl => xrGame/ui}/UITabButton.h (77%) rename src/{xrUICore/TabControl => xrGame/ui}/UITabControl.cpp (98%) rename src/{xrUICore/TabControl => xrGame/ui}/UITabControl.h (93%) rename src/{xrUICore/TabControl => xrGame/ui}/UITabControl_script.cpp (97%) rename src/{xrUICore/XML => xrGame/ui}/UITextureMaster.cpp (98%) rename src/{xrUICore/XML => xrGame/ui}/UITextureMaster.h (96%) rename src/{xrUICore/TrackBar => xrGame/ui}/UITrackBar.cpp (97%) rename src/{xrUICore/TrackBar => xrGame/ui}/UITrackBar.h (89%) rename src/{xrUICore/Windows => xrGame/ui}/UIWindow.cpp (88%) rename src/{xrUICore/Windows => xrGame/ui}/UIWindow.h (94%) rename src/{xrUICore/Callbacks => xrGame/ui}/UIWndCallback.cpp (96%) rename src/{xrUICore/Callbacks => xrGame/ui}/UIWndCallback.h (95%) rename src/{xrUICore/InteractiveBackground => xrGame/ui}/UI_IB_Static.cpp (96%) rename src/{xrUICore/InteractiveBackground => xrGame/ui}/UI_IB_Static.h (80%) rename src/{xrUICore/arrow => xrGame/ui}/ui_arrow.cpp (89%) rename src/{xrUICore/arrow => xrGame/ui}/ui_arrow.h (75%) rename src/{xrUICore => xrGame/ui}/uiabstract.h (99%) rename src/{xrUICore/Lines => xrGame/ui}/uilinestd.h (79%) create mode 100644 src/xrGame/ui/xrUIXmlParser.cpp rename src/{xrUICore/XML => xrGame/ui}/xrUIXmlParser.h (79%) rename src/{xrUICore => xrGame}/ui_base.cpp (97%) rename src/{xrUICore => xrGame}/ui_base.h (66%) rename src/{xrUICore => xrGame}/ui_defs.h (97%) delete mode 100644 src/xrUICore/CMakeLists.txt delete mode 100644 src/xrUICore/EditBox/UIEditBox_script.cpp delete mode 100644 src/xrUICore/FontManager/FontManager.cpp delete mode 100644 src/xrUICore/FontManager/FontManager.h delete mode 100644 src/xrUICore/ListBox/UIListBox_script.cpp delete mode 100644 src/xrUICore/Options/UIOptionsManagerScript.h delete mode 100644 src/xrUICore/ProgressBar/UIProgressBar_script.cpp delete mode 100644 src/xrUICore/Windows/UIWindow_script.cpp delete mode 100644 src/xrUICore/XML/UIXmlInitBase.cpp delete mode 100644 src/xrUICore/XML/UIXmlInitBase.h delete mode 100644 src/xrUICore/XML/xrUIXmlParser.cpp delete mode 100644 src/xrUICore/packages.config delete mode 100644 src/xrUICore/pch.cpp delete mode 100644 src/xrUICore/pch.hpp delete mode 100644 src/xrUICore/xrUICore.vcxproj delete mode 100644 src/xrUICore/xrUICore.vcxproj.filters diff --git a/res/gamedata/configs/localization.ltx b/res/gamedata/configs/localization.ltx deleted file mode 100644 index eb8d571d7f2..00000000000 --- a/res/gamedata/configs/localization.ltx +++ /dev/null @@ -1,7 +0,0 @@ -[string_table] -language = rus -font_prefix = ;_west ;_cent - -[Languages] -eng -rus \ No newline at end of file diff --git a/src/Common/CommonImportExport.inl b/src/Common/CommonImportExport.inl index b8d87e085ce..f92b44275d9 100644 --- a/src/Common/CommonImportExport.inl +++ b/src/Common/CommonImportExport.inl @@ -72,12 +72,6 @@ #define XRSOUND_API XR_IMPORT #endif -#ifdef XRUICORE_EXPORTS -#define XRUICORE_API XR_EXPORT -#else -#define XRUICORE_API XR_IMPORT -#endif - #ifndef ENGINE_API #ifndef NO_ENGINE_API #ifdef ENGINE_BUILD diff --git a/src/Include/xrAPI/xrAPI.h b/src/Include/xrAPI/xrAPI.h index babadad4e79..074eff88a05 100644 --- a/src/Include/xrAPI/xrAPI.h +++ b/src/Include/xrAPI/xrAPI.h @@ -11,7 +11,6 @@ class CRender; class CScriptEngine; class AISpaceBase; class ISoundManager; -class ui_core; class XRAPI_API EngineGlobalEnvironment { @@ -28,7 +27,6 @@ class XRAPI_API EngineGlobalEnvironment CScriptEngine* ScriptEngine; AISpaceBase* AISpace; ISoundManager* Sound; - ui_core* UI; bool isEditor; bool isDedicatedServer; diff --git a/src/engine.sln b/src/engine.sln index f9755cde474..c2355c4bd17 100644 --- a/src/engine.sln +++ b/src/engine.sln @@ -248,8 +248,6 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "xrECore", "editors\xrECore\ EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "xrEditor", "editors\xrEditor\xrEditor.vcxproj", "{BE4B23E7-2CA8-4607-A473-116C4242F23D}" EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "xrUICore", "xrUICore\xrUICore.vcxproj", "{37B3642C-B706-4C93-BC54-BADADC8FC9B1}" -EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|x64 = Debug|x64 @@ -1127,18 +1125,6 @@ Global {BE4B23E7-2CA8-4607-A473-116C4242F23D}.Release|x64.Build.0 = Release|x64 {BE4B23E7-2CA8-4607-A473-116C4242F23D}.Release|x86.ActiveCfg = Release|Win32 {BE4B23E7-2CA8-4607-A473-116C4242F23D}.Release|x86.Build.0 = Release|Win32 - {37B3642C-B706-4C93-BC54-BADADC8FC9B1}.Debug|x64.ActiveCfg = Debug|x64 - {37B3642C-B706-4C93-BC54-BADADC8FC9B1}.Debug|x64.Build.0 = Debug|x64 - {37B3642C-B706-4C93-BC54-BADADC8FC9B1}.Debug|x86.ActiveCfg = Debug|Win32 - {37B3642C-B706-4C93-BC54-BADADC8FC9B1}.Debug|x86.Build.0 = Debug|Win32 - {37B3642C-B706-4C93-BC54-BADADC8FC9B1}.Mixed|x64.ActiveCfg = Mixed|x64 - {37B3642C-B706-4C93-BC54-BADADC8FC9B1}.Mixed|x64.Build.0 = Mixed|x64 - {37B3642C-B706-4C93-BC54-BADADC8FC9B1}.Mixed|x86.ActiveCfg = Mixed|Win32 - {37B3642C-B706-4C93-BC54-BADADC8FC9B1}.Mixed|x86.Build.0 = Mixed|Win32 - {37B3642C-B706-4C93-BC54-BADADC8FC9B1}.Release|x64.ActiveCfg = Release|x64 - {37B3642C-B706-4C93-BC54-BADADC8FC9B1}.Release|x64.Build.0 = Release|x64 - {37B3642C-B706-4C93-BC54-BADADC8FC9B1}.Release|x86.ActiveCfg = Release|Win32 - {37B3642C-B706-4C93-BC54-BADADC8FC9B1}.Release|x86.Build.0 = Release|Win32 EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE diff --git a/src/utils/xrSE_Factory/xrUIXmlParser.cpp b/src/utils/xrSE_Factory/xrUIXmlParser.cpp index f18242be9b1..3376a35b3cb 100644 --- a/src/utils/xrSE_Factory/xrUIXmlParser.cpp +++ b/src/utils/xrSE_Factory/xrUIXmlParser.cpp @@ -14,9 +14,59 @@ shared_str CUIXml::correct_file_name(pcstr path, pcstr fn) return fn; } +//#define LOG_ALL_XMLS +#ifdef LOG_ALL_XMLS +int ListXmlCount = 0; +struct DBGList_ +{ + int num; + bool closed; +}; +xr_vector dbg_list_xmls; +void dump_list_xmls() +{ + Msg("------Total xmls %d", dbg_list_xmls.size()); + xr_vector::iterator _it = dbg_list_xmls.begin(); + for (; _it != dbg_list_xmls.end(); ++_it) + if (!(*_it).closed) + Msg("--leak detected ---- xml = %d", (*_it).num); +} +#else +void dump_list_xmls() {} +#endif + CUIXml::CUIXml() { +#ifdef LOG_ALL_XMLS + ListXmlCount++; + m_dbg_id = ListXmlCount; + dbg_list_xmls.push_back(DBGList_()); + dbg_list_xmls.back().num = m_dbg_id; + dbg_list_xmls.back().closed = false; +#endif } CUIXml::~CUIXml() -{} +{ +#ifdef LOG_ALL_XMLS + xr_vector::iterator _it = dbg_list_xmls.begin(); + bool bOK = false; + for (; _it != dbg_list_xmls.end(); ++_it) + { + if ((*_it).num == m_dbg_id && !(*_it).closed) + { + bOK = true; + (*_it).closed = true; + dbg_list_xmls.erase(_it); + break; + } + if ((*_it).num == m_dbg_id && (*_it).closed) + { + Msg("--XML [%d] already deleted", m_dbg_id); + bOK = true; + } + } + if (!bOK) + Msg("CUIXml::~CUIXml.[%d] cannot find xml in list", m_dbg_id); +#endif +} diff --git a/src/xrEngine/StringTable/IStringTable.cpp b/src/xrEngine/StringTable/IStringTable.cpp deleted file mode 100644 index a5b15ce37ad..00000000000 --- a/src/xrEngine/StringTable/IStringTable.cpp +++ /dev/null @@ -1,4 +0,0 @@ -#include "stdafx.h" -#include "IStringTable.h" - -IStringTable* gStringTable = nullptr; diff --git a/src/xrEngine/StringTable/IStringTable.h b/src/xrEngine/StringTable/IStringTable.h deleted file mode 100644 index b5d455153b7..00000000000 --- a/src/xrEngine/StringTable/IStringTable.h +++ /dev/null @@ -1,18 +0,0 @@ -////////////////////////////////////////////////////////////////////////// -// string_table.h: таблица строк, используемых в игре -////////////////////////////////////////////////////////////////////////// - -#pragma once -#include "xrEngine/StringTable/IStringTableDefs.h" -#include "xrCommon/xr_map.h" - -class IStringTable -{ -public: - virtual ~IStringTable() {}; - - virtual STRING_VALUE translate(const STRING_ID& str_id) const = 0; - virtual void rescan() = 0; -}; - -extern ENGINE_API IStringTable* gStringTable; diff --git a/src/xrEngine/xrEngine.vcxproj b/src/xrEngine/xrEngine.vcxproj index db039ce103c..733e663b6a7 100644 --- a/src/xrEngine/xrEngine.vcxproj +++ b/src/xrEngine/xrEngine.vcxproj @@ -263,8 +263,6 @@ - - @@ -280,7 +278,6 @@ - @@ -375,7 +372,6 @@ Create - @@ -389,7 +385,6 @@ - diff --git a/src/xrEngine/xrEngine.vcxproj.filters b/src/xrEngine/xrEngine.vcxproj.filters index e1cf0c3e893..195442660a3 100644 --- a/src/xrEngine/xrEngine.vcxproj.filters +++ b/src/xrEngine/xrEngine.vcxproj.filters @@ -232,9 +232,6 @@ {e4d34774-3a5b-468f-9400-12c702636fa1} - - {948b4643-0f42-4027-ac44-dbe3702887f4} - @@ -567,15 +564,6 @@ Rendering Device - - Interfaces\Input - - - Game API\StringTable - - - Game API\StringTable - @@ -893,12 +881,6 @@ Rendering Device - - Interfaces\Input - - - Game API\StringTable - diff --git a/src/xrEngine/xr_input_xinput.cpp b/src/xrEngine/xr_input_xinput.cpp deleted file mode 100644 index b92c97e4925..00000000000 --- a/src/xrEngine/xr_input_xinput.cpp +++ /dev/null @@ -1,518 +0,0 @@ -#include "stdafx.h" -#include "xr_input_xinput.h" -#include "xr_input.h" -#include "StringTable/IStringTable.h" - -ENGINE_API _binding g_key_bindings[bindings_count]; -ENGINE_API _key_group g_current_keygroup = _sp; - -// clang-format off -_action actions[] = { - { "left", kLEFT, _both }, - { "right", kRIGHT, _both }, - { "up", kUP, _both }, - { "down", kDOWN, _both }, - { "jump", kJUMP, _both }, - { "crouch", kCROUCH, _both }, - { "accel", kACCEL, _both }, - { "sprint_toggle", kSPRINT_TOGGLE, _both }, - - { "forward", kFWD, _both }, - { "back", kBACK, _both }, - { "lstrafe", kL_STRAFE, _both }, - { "rstrafe", kR_STRAFE, _both }, - - { "llookout", kL_LOOKOUT, _both }, - { "rlookout", kR_LOOKOUT, _both }, - - { "cam_1", kCAM_1, _both }, - { "cam_2", kCAM_2, _both }, - { "cam_3", kCAM_3, _both }, - { "cam_zoom_in", kCAM_ZOOM_IN, _both }, - { "cam_zoom_out", kCAM_ZOOM_OUT, _both }, - - { "torch", kTORCH, _both }, - { "night_vision", kNIGHT_VISION, _both }, - { "show_detector", kDETECTOR, _sp }, - - { "wpn_1", kWPN_1, _both }, - { "wpn_2", kWPN_2, _both }, - { "wpn_3", kWPN_3, _both }, - { "wpn_4", kWPN_4, _both }, - { "wpn_5", kWPN_5, _both }, - { "wpn_6", kWPN_6, _both }, - { "artefact", kARTEFACT, _both /*_mp*/ }, - { "wpn_next", kWPN_NEXT, _both }, // means next ammo type - { "wpn_fire", kWPN_FIRE, _both }, - { "wpn_zoom", kWPN_ZOOM, _both }, - { "wpn_zoom_inc", kWPN_ZOOM_INC, _both }, - { "wpn_zoom_dec", kWPN_ZOOM_DEC, _both }, - { "wpn_reload", kWPN_RELOAD, _both }, - { "wpn_func", kWPN_FUNC, _both }, - { "wpn_firemode_prev", kWPN_FIREMODE_PREV, _both }, - { "wpn_firemode_next", kWPN_FIREMODE_NEXT, _both }, - - { "pause", kPAUSE, _both }, - { "drop", kDROP, _both }, - { "use", kUSE, _both }, - { "scores", kSCORES, _both }, - { "chat", kCHAT, _both }, - { "chat_team", kCHAT_TEAM, _both }, - { "screenshot", kSCREENSHOT, _both }, - { "quit", kQUIT, _both }, - { "console", kCONSOLE, _both }, - { "inventory", kINVENTORY, _both }, - { "buy_menu", kBUY, _both }, - { "skin_menu", kSKIN, _both }, - { "team_menu", kTEAM, _both }, - { "active_jobs", kACTIVE_JOBS, _sp }, - - { "vote_begin", kVOTE_BEGIN, _both }, - { "show_admin_menu", kSHOW_ADMIN_MENU, _both }, - { "vote", kVOTE, _both }, - { "vote_yes", kVOTEYES, _both }, - { "vote_no", kVOTENO, _both }, - - { "next_slot", kNEXT_SLOT, _both }, - { "prev_slot", kPREV_SLOT, _both }, - - { "speech_menu_0", kSPEECH_MENU_0, _both }, - { "speech_menu_1", kSPEECH_MENU_1, _both }, - - { "quick_use_1", kQUICK_USE_1, _both }, - { "quick_use_2", kQUICK_USE_2, _both }, - { "quick_use_3", kQUICK_USE_3, _both }, - { "quick_use_4", kQUICK_USE_4, _both }, - - { "quick_save", kQUICK_SAVE, _sp }, - { "quick_load", kQUICK_LOAD, _sp }, - //{ "alife_command", kALIFE_CMD, _sp}, - - { "custom1", kCUSTOM1, _sp }, - { "custom2", kCUSTOM2, _sp }, - { "custom3", kCUSTOM3, _sp }, - { "custom4", kCUSTOM4, _sp }, - { "custom5", kCUSTOM5, _sp }, - { "custom6", kCUSTOM6, _sp }, - { "custom7", kCUSTOM7, _sp }, - { "custom8", kCUSTOM8, _sp }, - { "custom9", kCUSTOM9, _sp }, - { "custom10", kCUSTOM10, _sp }, - { "custom11", kCUSTOM11, _sp }, - { "custom12", kCUSTOM12, _sp }, - { "custom13", kCUSTOM13, _sp }, - { "custom14", kCUSTOM14, _sp }, - { "custom15", kCUSTOM15, _sp }, - { "cam_autoaim", kCAM_AUTOAIM, _sp }, - { "pda_tab1", kPDA_TAB1, _sp }, - { "pda_tab2", kPDA_TAB2, _sp }, - { "pda_tab3", kPDA_TAB3, _sp }, - { "pda_tab4", kPDA_TAB4, _sp }, - { "pda_tab5", kPDA_TAB5, _sp }, - { "pda_tab6", kPDA_TAB6, _sp }, -#ifdef COC_KICK - { "kick", kKICK, _sp }, -#endif - - { nullptr, kLASTACTION, _both } -}; - -_keyboard keyboards[] = -{ - { "mouse1", MOUSE_1, "Mouse 1" }, - { "mouse2", MOUSE_2, "Mouse 2" }, - { "mouse3", MOUSE_3, "Mouse 3" }, - { "mouse4", MOUSE_4, "Mouse 4" }, - { "mouse5", MOUSE_5, "Mouse 5" }, - { "mouse6", MOUSE_6, "Mouse 6" }, - { "mouse7", MOUSE_7, "Mouse 7" }, - { "mouse8", MOUSE_8, "Mouse 8" }, - - { "kUNKNOWN", SDL_SCANCODE_UNKNOWN, "Unknown" }, - - { "kA", SDL_SCANCODE_A, "A" }, - { "kB", SDL_SCANCODE_B, "B" }, - { "kC", SDL_SCANCODE_C, "C" }, - { "kD", SDL_SCANCODE_D, "D" }, - { "kE", SDL_SCANCODE_E, "E" }, - { "kF", SDL_SCANCODE_F, "F" }, - { "kG", SDL_SCANCODE_G, "G" }, - { "kH", SDL_SCANCODE_H, "H" }, - { "kI", SDL_SCANCODE_I, "I" }, - { "kJ", SDL_SCANCODE_J, "J" }, - { "kK", SDL_SCANCODE_K, "K" }, - { "kL", SDL_SCANCODE_L, "L" }, - { "kM", SDL_SCANCODE_M, "M" }, - { "kN", SDL_SCANCODE_N, "N" }, - { "kO", SDL_SCANCODE_O, "O" }, - { "kP", SDL_SCANCODE_P, "P" }, - { "kQ", SDL_SCANCODE_Q, "Q" }, - { "kR", SDL_SCANCODE_R, "R" }, - { "kS", SDL_SCANCODE_S, "S" }, - { "kT", SDL_SCANCODE_T, "T" }, - { "kU", SDL_SCANCODE_U, "U" }, - { "kV", SDL_SCANCODE_V, "V" }, - { "kW", SDL_SCANCODE_W, "W" }, - { "kX", SDL_SCANCODE_X, "X" }, - { "kY", SDL_SCANCODE_Y, "Y" }, - { "kZ", SDL_SCANCODE_Z, "Z" }, - - { "k1", SDL_SCANCODE_1, "1" }, - { "k2", SDL_SCANCODE_2, "2" }, - { "k3", SDL_SCANCODE_3, "3" }, - { "k4", SDL_SCANCODE_4, "4" }, - { "k5", SDL_SCANCODE_5, "5" }, - { "k6", SDL_SCANCODE_6, "6" }, - { "k7", SDL_SCANCODE_7, "7" }, - { "k8", SDL_SCANCODE_8, "8" }, - { "k9", SDL_SCANCODE_9, "9" }, - { "k0", SDL_SCANCODE_0, "0" }, - - { "kRETURN", SDL_SCANCODE_RETURN, "Return" }, - { "kESCAPE", SDL_SCANCODE_ESCAPE, "Escape" }, - { "kBACK", SDL_SCANCODE_BACKSPACE, "Backspace" }, - { "kTAB", SDL_SCANCODE_TAB, "Tab" }, - { "kSPACE", SDL_SCANCODE_SPACE, "Space" }, - - { "kMINUS", SDL_SCANCODE_MINUS, "Minus" }, - { "kEQUALS", SDL_SCANCODE_EQUALS, "Equals" }, - { "kLBRACKET", SDL_SCANCODE_LEFTBRACKET, "Left bracket" }, - { "kRBRACKET", SDL_SCANCODE_RIGHTBRACKET, "Right bracket" }, - { "kBACKSLASH", SDL_SCANCODE_BACKSLASH, "Backslash" }, - { "kNONUSHASH", SDL_SCANCODE_NONUSHASH, "Non US Hash" }, - - { "kSEMICOLON", SDL_SCANCODE_SEMICOLON, "Semicolon" }, - { "kAPOSTROPHE", SDL_SCANCODE_APOSTROPHE, "Apostrophe" }, - { "kGRAVE", SDL_SCANCODE_GRAVE, "Grave" }, - { "kCOMMA", SDL_SCANCODE_COMMA, "Comma" }, - { "kPERIOD", SDL_SCANCODE_PERIOD, "Period" }, - { "kSLASH", SDL_SCANCODE_SLASH, "Slash" }, - - { "kCAPITAL", SDL_SCANCODE_CAPSLOCK, "Caps Lock" }, - - { "kF1", SDL_SCANCODE_F1, "F1" }, - { "kF2", SDL_SCANCODE_F2, "F2" }, - { "kF3", SDL_SCANCODE_F3, "F3" }, - { "kF4", SDL_SCANCODE_F4, "F4" }, - { "kF5", SDL_SCANCODE_F5, "F5" }, - { "kF6", SDL_SCANCODE_F6, "F6" }, - { "kF7", SDL_SCANCODE_F7, "F7" }, - { "kF8", SDL_SCANCODE_F8, "F8" }, - { "kF9", SDL_SCANCODE_F9, "F9" }, - { "kF10", SDL_SCANCODE_F10, "F10" }, - { "kF11", SDL_SCANCODE_F11, "F11" }, - { "kF12", SDL_SCANCODE_F12, "F12" }, - - { "kPRINTSCREEN", SDL_SCANCODE_PRINTSCREEN, "Print Screen" }, - { "kSCROLL", SDL_SCANCODE_SCROLLLOCK, "Scroll Lock" }, - { "kPAUSE", SDL_SCANCODE_PAUSE, "Pause" }, - { "kINSERT", SDL_SCANCODE_INSERT, "Insert" }, - - { "kHOME", SDL_SCANCODE_HOME, "Home" }, - { "kPGUP", SDL_SCANCODE_PAGEUP, "Page Up" }, - { "kDELETE", SDL_SCANCODE_DELETE, "Delete" }, - { "kEND", SDL_SCANCODE_END, "End" }, - { "kPGDN", SDL_SCANCODE_PAGEDOWN, "Page Down" }, - - { "kRIGHT", SDL_SCANCODE_RIGHT, "Right" }, - { "kLEFT", SDL_SCANCODE_LEFT, "Left" }, - { "kDOWN", SDL_SCANCODE_DOWN, "Down" }, - { "kUP", SDL_SCANCODE_UP, "Up" }, - - { "kNUMLOCK", SDL_SCANCODE_NUMLOCKCLEAR, "Num Lock" }, - - { "kDIVIDE", SDL_SCANCODE_KP_DIVIDE, "Numpad Divide" }, - { "kMULTIPLY", SDL_SCANCODE_KP_MULTIPLY, "Numpad Multiply" }, - { "kSUBTRACT", SDL_SCANCODE_KP_MINUS, "Numpad Minus" }, - { "kADD", SDL_SCANCODE_KP_PLUS, "Numpad Plus" }, - { "kNUMPADENTER", SDL_SCANCODE_KP_ENTER, "Numpad Enter" }, - - { "kNUMPAD1", SDL_SCANCODE_KP_1, "Numpad 1" }, - { "kNUMPAD2", SDL_SCANCODE_KP_2, "Numpad 2" }, - { "kNUMPAD3", SDL_SCANCODE_KP_3, "Numpad 3" }, - { "kNUMPAD4", SDL_SCANCODE_KP_4, "Numpad 4" }, - { "kNUMPAD5", SDL_SCANCODE_KP_5, "Numpad 5" }, - { "kNUMPAD6", SDL_SCANCODE_KP_6, "Numpad 6" }, - { "kNUMPAD7", SDL_SCANCODE_KP_7, "Numpad 7" }, - { "kNUMPAD8", SDL_SCANCODE_KP_8, "Numpad 8" }, - { "kNUMPAD9", SDL_SCANCODE_KP_9, "Numpad 9" }, - { "kNUMPAD0", SDL_SCANCODE_KP_0, "Numpad 0" }, - - { "kNUMPADPERIOD", SDL_SCANCODE_KP_PERIOD, "Numpad Period" }, - { "kNONUSBACKSLASH", SDL_SCANCODE_NONUSBACKSLASH, "Non US Backslash" }, - { "kAPPLICATION", SDL_SCANCODE_APPLICATION, "Application" }, - { "kPOWER", SDL_SCANCODE_POWER, "Power" }, - { "kNUMPADEQUALS", SDL_SCANCODE_KP_EQUALS, "Numpad Equals" }, - - { "kF13", SDL_SCANCODE_F13, "F13" }, - { "kF14", SDL_SCANCODE_F14, "F14" }, - { "kF15", SDL_SCANCODE_F15, "F15" }, - { "kF16", SDL_SCANCODE_F16, "F16" }, - { "kF17", SDL_SCANCODE_F17, "F17" }, - { "kF18", SDL_SCANCODE_F18, "F18" }, - { "kF19", SDL_SCANCODE_F19, "F19" }, - { "kF20", SDL_SCANCODE_F20, "F20" }, - { "kF21", SDL_SCANCODE_F21, "F21" }, - { "kF22", SDL_SCANCODE_F22, "F22" }, - { "kF23", SDL_SCANCODE_F23, "F23" }, - { "kF24", SDL_SCANCODE_F24, "F24" }, - - { "kEXECUTE", SDL_SCANCODE_EXECUTE, "Execute" }, - { "kHELP", SDL_SCANCODE_HELP, "Help" }, - { "kMENU", SDL_SCANCODE_MENU, "Menu" }, - - { "kSELECT", SDL_SCANCODE_SELECT, "Select" }, - { "kSTOP", SDL_SCANCODE_STOP, "Stop" }, - - { "kREDO", SDL_SCANCODE_AGAIN, "Redo" }, - { "kUNDO", SDL_SCANCODE_UNDO, "Undo" }, - - { "kCUT", SDL_SCANCODE_CUT, "Cut" }, - { "kCOPY", SDL_SCANCODE_COPY, "Copy" }, - { "kPASTE", SDL_SCANCODE_PASTE, "Paste" }, - - { "kFIND", SDL_SCANCODE_FIND, "Find" }, - - { "kMUTE", SDL_SCANCODE_MUTE, "Mute" }, - { "kVOLUMEUP", SDL_SCANCODE_VOLUMEUP, "Volume Up" }, - { "kVOLUMEDOWN", SDL_SCANCODE_VOLUMEDOWN, "Volume Down" }, - - { "kNUMPADCOMMA", SDL_SCANCODE_KP_COMMA, "Numpad Comma" }, - { "kNUMPADEQUALSAS400", SDL_SCANCODE_KP_EQUALSAS400, "Equals AS400" }, - - { "kINTERNATIONAL1", SDL_SCANCODE_INTERNATIONAL1 /* Give a better name? */ }, - { "kINTERNATIONAL2", SDL_SCANCODE_INTERNATIONAL2 /* Give a better name? */ }, - { "kYEN", SDL_SCANCODE_INTERNATIONAL3, "Yen" }, - { "kINTERNATIONAL4", SDL_SCANCODE_INTERNATIONAL4 /* Give a better name? */ }, - { "kINTERNATIONAL5", SDL_SCANCODE_INTERNATIONAL5 /* Give a better name? */ }, - { "kINTERNATIONAL6", SDL_SCANCODE_INTERNATIONAL6 /* Give a better name? */ }, - { "kINTERNATIONAL7", SDL_SCANCODE_INTERNATIONAL7 /* Give a better name? */ }, - { "kINTERNATIONAL8", SDL_SCANCODE_INTERNATIONAL8 /* Give a better name? */ }, - { "kINTERNATIONAL9", SDL_SCANCODE_INTERNATIONAL9 /* Give a better name? */ }, - - { "kHANGUL", SDL_SCANCODE_LANG1, "Hangul" }, - { "kHANJA", SDL_SCANCODE_LANG2, "Hanja" }, - { "kKATAKANA", SDL_SCANCODE_LANG3, "Katakana" }, - { "kHIRAGANA", SDL_SCANCODE_LANG4, "Hiragana" }, - { "kZENHANKAKU", SDL_SCANCODE_LANG5, "Zen-Han-kaku" }, - { "kLANG6", SDL_SCANCODE_LANG6 /* Give a better name? */ }, - { "kLANG7", SDL_SCANCODE_LANG7 /* Give a better name? */ }, - { "kLANG8", SDL_SCANCODE_LANG8 /* Give a better name? */ }, - { "kLANG9", SDL_SCANCODE_LANG9 /* Give a better name? */ }, - - { "kALTERASE", SDL_SCANCODE_ALTERASE, "Alterase" }, - { "kCANCEL", SDL_SCANCODE_CANCEL, "Cancel" }, - { "kCLEAR", SDL_SCANCODE_CLEAR, "Clear" }, - { "kPRIOR", SDL_SCANCODE_PRIOR, "Prior" }, - { "kRETURN2", SDL_SCANCODE_RETURN2, "Return 2" }, - { "kSEPARATOR", SDL_SCANCODE_SEPARATOR, "Separator" }, - { "kOUT", SDL_SCANCODE_OUT, "Out" }, - { "kOPER", SDL_SCANCODE_OPER, "Oper" }, - { "kCLEARAGAIN", SDL_SCANCODE_CLEARAGAIN, "Clear Again" }, - { "kCRSEL", SDL_SCANCODE_CRSEL, "Crsel" }, - { "kEXSEL", SDL_SCANCODE_EXSEL, "Excel" }, - - { "kNUMPAD_00", SDL_SCANCODE_KP_00, "Numpad 00" }, - { "kNUMPAD_000", SDL_SCANCODE_KP_000, "Numpad 000" }, - { "kTHOUSANDSSEPARATOR", SDL_SCANCODE_THOUSANDSSEPARATOR, "Thousand Separator" }, - { "kDECIMALSEPARATOR", SDL_SCANCODE_DECIMALSEPARATOR, "Decimal Separator" }, - { "kCURRENCYUNIT", SDL_SCANCODE_CURRENCYUNIT, "Currency Unit" }, - { "kCURRENCYSUBUNIT", SDL_SCANCODE_CURRENCYSUBUNIT, "Currency Subunit" }, - { "kNUMPAD_LEFTPAREN", SDL_SCANCODE_KP_LEFTPAREN, "Numpad Left Paren" }, - { "kNUMPAD_RIGHTPAREN", SDL_SCANCODE_KP_RIGHTPAREN, "Numpad Right Paren" }, - { "kNUMPAD_LEFTBRACE", SDL_SCANCODE_KP_LEFTBRACE, "Numpad Left Brace" }, - { "kNUMPAD_RIGHTBRACE", SDL_SCANCODE_KP_RIGHTBRACE, "Numpad Right Brace" }, - { "kNUMPAD_TAB", SDL_SCANCODE_KP_TAB, "Numpad Tab" }, - { "kNUMPAD_BACKSPACE", SDL_SCANCODE_KP_BACKSPACE, "Numpad Backspace" }, - { "kNUMPAD_A", SDL_SCANCODE_KP_A, "Numpad A" }, - { "kNUMPAD_B", SDL_SCANCODE_KP_B, "Numpad B" }, - { "kNUMPAD_C", SDL_SCANCODE_KP_C, "Numpad C" }, - { "kNUMPAD_D", SDL_SCANCODE_KP_D, "Numpad D" }, - { "kNUMPAD_E", SDL_SCANCODE_KP_E, "Numpad E" }, - { "kNUMPAD_F", SDL_SCANCODE_KP_F, "Numpad F" }, - - { "kNUMPAD_XOR", SDL_SCANCODE_KP_XOR, "Numpad XOR" }, - - { "kNUMPAD_POWER", SDL_SCANCODE_KP_POWER, "Numpad Power" }, - { "kNUMPAD_PERCENT", SDL_SCANCODE_KP_PERCENT, "Numpad Percent" }, - - { "kNUMPAD_LESS", SDL_SCANCODE_KP_LESS, "Numpad Less" }, - { "kNUMPAD_GREATER", SDL_SCANCODE_KP_GREATER, "Numpad Greater" }, - - { "kNUMPAD_AMPERSAND", SDL_SCANCODE_KP_AMPERSAND, "Numpad Ampersand" }, - { "kNUMPAD_DBLAMPERSAND", SDL_SCANCODE_KP_DBLAMPERSAND, "Numpad Double Ampersand" }, - - { "kNUMPAD_VERTICALBAR", SDL_SCANCODE_KP_VERTICALBAR, "Numpad Vertical Bar" }, - { "kNUMPAD_DBLVERTICALBAR", SDL_SCANCODE_KP_DBLVERTICALBAR, "Numpad Double Vertical Bar" }, - - { "kNUMPAD_COLON", SDL_SCANCODE_KP_COLON, "Numpad Colon" }, - { "kNUMPAD_HASH", SDL_SCANCODE_KP_HASH, "Numpad Hash" }, - { "kNUMPAD_SPACE", SDL_SCANCODE_KP_SPACE, "Numpad Space" }, - { "kNUMPAD_AT", SDL_SCANCODE_KP_AT, "Numpad At" }, - { "kNUMPAD_EXCLAM", SDL_SCANCODE_KP_EXCLAM, "Numpad Exclam" }, - - { "kNUMPAD_MEMSTORE", SDL_SCANCODE_KP_MEMSTORE, "Numpad Mem Store" }, - { "kNUMPAD_MEMRECALL", SDL_SCANCODE_KP_MEMRECALL, "Numpad Mem Recall" }, - { "kNUMPAD_MEMCLEAR", SDL_SCANCODE_KP_MEMCLEAR, "Numpad Mem Clear" }, - { "kNUMPAD_MEMADD", SDL_SCANCODE_KP_MEMADD, "Numpad Mem Add" }, - { "kNUMPAD_MEMSUBTRACT", SDL_SCANCODE_KP_MEMSUBTRACT, "Numpad Mem Subtract" }, - { "kNUMPAD_MEMMULTIPLY", SDL_SCANCODE_KP_MEMMULTIPLY, "Numpad Mem Multiply" }, - { "kNUMPAD_MEMDIVIDE", SDL_SCANCODE_KP_MEMDIVIDE, "Numpad Mem Divide" }, - - { "kNUMPAD_PLUSMINUS", SDL_SCANCODE_KP_PLUSMINUS, "Numpad Plus-Minus" }, - { "kNUMPAD_CLEAR", SDL_SCANCODE_KP_CLEAR, "Numpad Clear" }, - { "kNUMPAD_CLEARENTRY", SDL_SCANCODE_KP_CLEARENTRY, "Numpad Clear Entry" }, - { "kNUMPAD_BINARY", SDL_SCANCODE_KP_BINARY, "Numpad Binary" }, - { "kNUMPAD_OCTAL", SDL_SCANCODE_KP_OCTAL, "Numpad Octal" }, - { "kNUMPAD_DECIMAL", SDL_SCANCODE_KP_DECIMAL, "Numpad Decimal" }, - { "kNUMPAD_HEXADECIMAL", SDL_SCANCODE_KP_HEXADECIMAL, "Numpad Hexadecimal" }, - - { "kLCONTROL", SDL_SCANCODE_LCTRL, "Left Ctrl" }, - { "kLSHIFT", SDL_SCANCODE_LSHIFT, "Left shift" }, - { "kLMENU", SDL_SCANCODE_LALT, "Left Alt" }, - { "kLWIN", SDL_SCANCODE_LGUI, "Left Windows" }, - { "kRCONTROL", SDL_SCANCODE_RCTRL, "Right Ctrl" }, - { "kRSHIFT", SDL_SCANCODE_RSHIFT, "Right Shift" }, - { "kRMENU", SDL_SCANCODE_RALT, "Right Alt" }, - { "kRWIN", SDL_SCANCODE_RGUI, "Right Windows" }, - - { "kMODE", SDL_SCANCODE_MODE, "Mode" }, - - { "kAUDIONEXT", SDL_SCANCODE_AUDIONEXT, "Audio Next" }, - { "kAUDIOPREV", SDL_SCANCODE_AUDIOPREV, "Audio Prev" }, - { "kAUDIOSTOP", SDL_SCANCODE_AUDIOSTOP, "Audio Stop" }, - { "kAUDIOPLAY", SDL_SCANCODE_AUDIOPLAY, "Audio Play" }, - { "kAUDIOMUTE", SDL_SCANCODE_AUDIOMUTE, "Audio Mute" }, - - { "kMEDIASELECT", SDL_SCANCODE_MEDIASELECT, "Media Select" }, - { "kWWW", SDL_SCANCODE_WWW, "WWW" }, - { "kMAIL", SDL_SCANCODE_MAIL, "Mail" }, - { "kCALCULATOR", SDL_SCANCODE_CALCULATOR, "Calculator" }, - { "kCOMPUTER", SDL_SCANCODE_COMPUTER, "My Computer" }, - - { "kNUMPAD_AC_SEARCH", SDL_SCANCODE_AC_SEARCH, "AC Search" }, - { "kNUMPAD_AC_HOME", SDL_SCANCODE_AC_HOME, "AC Home" }, - { "kNUMPAD_AC_BACK", SDL_SCANCODE_AC_BACK, "AC Back" }, - { "kNUMPAD_AC_FORWARD", SDL_SCANCODE_AC_FORWARD, "AC Forward" }, - { "kNUMPAD_AC_STOP", SDL_SCANCODE_AC_STOP, "AC Stop" }, - { "kNUMPAD_AC_REFRESH", SDL_SCANCODE_AC_REFRESH, "AC Refresh" }, - { "kNUMPAD_AC_BOOKMARKS", SDL_SCANCODE_AC_BOOKMARKS, "AC Bookmarks" }, - - { "kBRIGHTNESSDOWN", SDL_SCANCODE_BRIGHTNESSDOWN, "Brightness Down" }, - { "kBRIGHTNESSUP", SDL_SCANCODE_BRIGHTNESSUP, "Brightness Up" }, - { "kDISPLAYSWITCH", SDL_SCANCODE_DISPLAYSWITCH, "Display Switch" }, - - { "kKBDILLUMTOGGLE)", SDL_SCANCODE_KBDILLUMTOGGLE, "Illum Toogle" }, - { "kKBDILLUMDOWN", SDL_SCANCODE_KBDILLUMDOWN, "Illum Down" }, - { "kKBDILLUMUP", SDL_SCANCODE_KBDILLUMUP, "Illum Up" }, - - { "kEJECT", SDL_SCANCODE_EJECT, "Eject" }, - { "kSLEEP", SDL_SCANCODE_SLEEP, "Sleep" }, - - { "kAPP1", SDL_SCANCODE_APP1, "App 1" }, - { "kAPP2", SDL_SCANCODE_APP2, "App 2" }, - { nullptr, -1, "(null)" } -}; -// clang-format on - -EGameActions action_name_to_id(pcstr _name) -{ - _action* action = action_name_to_ptr(_name); - if (action) - return action->id; - else - return kNOTBINDED; -} - -_action* action_name_to_ptr(pcstr _name) -{ - int idx = 0; - while (actions[idx].action_name) - { - if (!xr_stricmp(_name, actions[idx].action_name)) - return &actions[idx]; - ++idx; - } - Msg("! [action_name_to_ptr] cant find corresponding 'id' for '%s'", _name); - return NULL; -} - -bool is_binded(EGameActions _action_id, int _dik) -{ - _binding* pbinding = &g_key_bindings[_action_id]; - if (pbinding->m_keyboard[0] && pbinding->m_keyboard[0]->dik == _dik) - return true; - - if (pbinding->m_keyboard[1] && pbinding->m_keyboard[1]->dik == _dik) - return true; - - return false; -} - -int get_action_dik(EGameActions _action_id, int idx) -{ - _binding* pbinding = &g_key_bindings[_action_id]; - - if (idx == -1) - { - if (pbinding->m_keyboard[0]) - return pbinding->m_keyboard[0]->dik; - - if (pbinding->m_keyboard[1]) - return pbinding->m_keyboard[1]->dik; - } - else - { - if (pbinding->m_keyboard[idx]) - return pbinding->m_keyboard[idx]->dik; - } - return SDL_SCANCODE_UNKNOWN; -} - -int keyname_to_dik(pcstr _name) -{ - _keyboard* _kb = keyname_to_ptr(_name); - return _kb->dik; -} - -_keyboard* keyname_to_ptr(pcstr _name) -{ - int idx = 0; - while (keyboards[idx].key_name) - { - _keyboard& kb = keyboards[idx]; - if (!xr_stricmp(_name, kb.key_name)) - return &keyboards[idx]; - ++idx; - } - - Msg("! [keyname_to_ptr] cant find corresponding '_keyboard' for keyname %s", _name); - return NULL; -} - -void GetActionAllBinding(LPCSTR _action, char* dst_buff, int dst_buff_sz) -{ - int action_id = action_name_to_id(_action); - _binding* pbinding = &g_key_bindings[action_id]; - - string128 prim; - string128 sec; - prim[0] = 0; - sec[0] = 0; - - if (pbinding->m_keyboard[0]) - { - xr_strcpy(prim, pbinding->m_keyboard[0]->key_local_name.c_str()); - } - if (pbinding->m_keyboard[1]) - { - xr_strcpy(sec, pbinding->m_keyboard[1]->key_local_name.c_str()); - } - if (NULL == pbinding->m_keyboard[0] && NULL == pbinding->m_keyboard[1]) - { - xr_sprintf(dst_buff, dst_buff_sz, "%s", gStringTable->translate("st_key_notbinded").c_str()); - } - else - xr_sprintf( - dst_buff, dst_buff_sz, "%s%s%s", prim[0] ? prim : "", (sec[0] && prim[0]) ? " , " : "", sec[0] ? sec : ""); -} diff --git a/src/xrEngine/xr_input_xinput.h b/src/xrEngine/xr_input_xinput.h deleted file mode 100644 index 33850949945..00000000000 --- a/src/xrEngine/xr_input_xinput.h +++ /dev/null @@ -1,165 +0,0 @@ -#pragma once -#include "xrCore/xrstring.h" -#include "xrCommon/xr_string.h" -#include "xrCommon/xr_map.h" -#include "xrEngine/xr_input.h" // Don't remove this include - -enum EGameActions -{ - kLEFT, - kRIGHT, - kUP, - kDOWN, - kJUMP, - kCROUCH, - kACCEL, - kSPRINT_TOGGLE, - - kFWD, - kBACK, - kL_STRAFE, - kR_STRAFE, - - kL_LOOKOUT, - kR_LOOKOUT, - - kCAM_1, - kCAM_2, - kCAM_3, - kCAM_ZOOM_IN, - kCAM_ZOOM_OUT, - - kTORCH, - kNIGHT_VISION, - kDETECTOR, - kWPN_1, - kWPN_2, - kWPN_3, - kWPN_4, - kWPN_5, - kWPN_6, - kARTEFACT, - kWPN_NEXT, - kWPN_FIRE, - kWPN_ZOOM, - kWPN_ZOOM_INC, - kWPN_ZOOM_DEC, - kWPN_RELOAD, - kWPN_FUNC, - kWPN_FIREMODE_PREV, - kWPN_FIREMODE_NEXT, - - kPAUSE, - kDROP, - kUSE, - kSCORES, - kCHAT, - kCHAT_TEAM, - kSCREENSHOT, - kQUIT, - kCONSOLE, - kINVENTORY, - kBUY, - kSKIN, - kTEAM, - kACTIVE_JOBS, - - kVOTE_BEGIN, - kSHOW_ADMIN_MENU, - kVOTE, - kVOTEYES, - kVOTENO, - - kNEXT_SLOT, - kPREV_SLOT, - - kSPEECH_MENU_0, - kSPEECH_MENU_1, - - kQUICK_USE_1, - kQUICK_USE_2, - kQUICK_USE_3, - kQUICK_USE_4, - - kQUICK_SAVE, - kQUICK_LOAD, - // kALIFE_CMD, - - kCUSTOM1, - kCUSTOM2, - kCUSTOM3, - kCUSTOM4, - kCUSTOM5, - kCUSTOM6, - kCUSTOM7, - kCUSTOM8, - kCUSTOM9, - kCUSTOM10, - kCUSTOM11, - kCUSTOM12, - kCUSTOM13, - kCUSTOM14, - kCUSTOM15, - - kCAM_AUTOAIM, - - kPDA_TAB1, - kPDA_TAB2, - kPDA_TAB3, - kPDA_TAB4, - kPDA_TAB5, - kPDA_TAB6, - -#ifdef COC_KICK - kKICK, // alpet: kick dynamic objects -#endif - - kLASTACTION, - kNOTBINDED, - kFORCEDWORD = u32(-1) -}; - -struct ENGINE_API _keyboard -{ - pcstr key_name; - int dik; - xr_string key_local_name; -}; -enum _key_group -{ - _both = (1 << 0), - _sp = _both | (1 << 1), - _mp = _both | (1 << 2), -}; - -extern ENGINE_API _key_group g_current_keygroup; - -struct ENGINE_API _action -{ - pcstr action_name; - EGameActions id; - _key_group key_group; -}; - -extern ENGINE_API _action actions[]; -extern ENGINE_API _keyboard keyboards[]; - -#define bindings_count kLASTACTION -struct ENGINE_API _binding -{ - _action* m_action; - _keyboard* m_keyboard[2]; -}; - -extern ENGINE_API _binding g_key_bindings[]; - -ENGINE_API EGameActions action_name_to_id(pcstr _name); -ENGINE_API _action* action_name_to_ptr(pcstr _name); - -ENGINE_API bool is_binded(EGameActions action_id, int dik); -ENGINE_API int get_action_dik(EGameActions action_id, int idx = -1); - -ENGINE_API int keyname_to_dik(pcstr _name); -ENGINE_API _keyboard* keyname_to_ptr(pcstr _name); - -ENGINE_API void GetActionAllBinding(LPCSTR action, char* dst_buff, int dst_buff_sz); diff --git a/src/xrGame/Actor.cpp b/src/xrGame/Actor.cpp index 51d417cd2b0..d2a560b05c6 100644 --- a/src/xrGame/Actor.cpp +++ b/src/xrGame/Actor.cpp @@ -60,7 +60,7 @@ #include "actor_memory.h" #include "Script_Game_Object.h" #include "Game_Object_Space.h" -#include "xrScriptEngine/script_callback_ex.h" +#include "script_callback_ex.h" #include "InventoryBox.h" #include "location_manager.h" #include "player_hud.h" @@ -433,6 +433,7 @@ void CActor::Load(LPCSTR section) m_AutoPickUp_AABB_Offset = READ_IF_EXISTS(pSettings, r_fvector3, section, "AutoPickUp_AABB_offs", Fvector().set(0, 0, 0)); + CStringTable string_table; m_sCharacterUseAction = "character_use"; m_sDeadCharacterUseAction = "dead_character_use"; m_sDeadCharacterUseOrDragAction = "dead_character_use_or_drag"; @@ -1338,7 +1339,7 @@ void CActor::shedule_Update(u32 DT) { if (m_pUsableObject && m_pUsableObject->tip_text()) { - m_sDefaultObjAction = StringTable().translate(m_pUsableObject->tip_text()); + m_sDefaultObjAction = CStringTable().translate(m_pUsableObject->tip_text()); } else { diff --git a/src/xrGame/Actor.h b/src/xrGame/Actor.h index b835f4cb214..0f748333c09 100644 --- a/src/xrGame/Actor.h +++ b/src/xrGame/Actor.h @@ -13,7 +13,7 @@ #include "InventoryOwner.h" #include "xrEngine/StatGraph.h" #include "PhraseDialogManager.h" -#include "xrUICore/ui_defs.h" +#include "ui_defs.h" #include "step_manager.h" diff --git a/src/xrGame/ActorAnimation.cpp b/src/xrGame/ActorAnimation.cpp index b470dd82656..431fab03114 100644 --- a/src/xrGame/ActorAnimation.cpp +++ b/src/xrGame/ActorAnimation.cpp @@ -8,7 +8,7 @@ #include "Level.h" #ifdef DEBUG #include "PHDebug.h" -#include "xrUICore/ui_base.h" +#include "ui_base.h" #include "xrEngine/GameFont.h" #endif #include "hit.h" diff --git a/src/xrGame/ActorCondition.cpp b/src/xrGame/ActorCondition.cpp index 9c7332d5136..9b066c9770a 100644 --- a/src/xrGame/ActorCondition.cpp +++ b/src/xrGame/ActorCondition.cpp @@ -9,10 +9,10 @@ #include "autosave_manager.h" #include "xrserver.h" #include "ai_space.h" -#include "xrScriptEngine/script_callback_ex.h" +#include "script_callback_ex.h" #include "script_game_object.h" #include "game_object_space.h" -#include "xrScriptEngine/script_callback_ex.h" +#include "script_callback_ex.h" #include "Common/object_broker.h" #include "weapon.h" @@ -20,7 +20,7 @@ #include "ai/monsters/basemonster/base_monster.h" #include "UIGameCustom.h" #include "ui/UIMainIngameWnd.h" -#include "xrUICore/Static/UIStatic.h" +#include "ui/UIStatic.h" #define MAX_SATIETY 1.0f #define START_SATIETY 0.5f diff --git a/src/xrGame/ActorInput.cpp b/src/xrGame/ActorInput.cpp index ab9a22044e3..dd133a62e09 100644 --- a/src/xrGame/ActorInput.cpp +++ b/src/xrGame/ActorInput.cpp @@ -19,7 +19,7 @@ #include "actorcondition.h" #include "actor_input_handler.h" #include "string_table.h" -#include "xrUICore/Static/UIStatic.h" +#include "UI/UIStatic.h" #include "UI/UIActorMenu.h" #include "UI/UIDragDropReferenceList.h" #include "CharacterPhysicsSupport.h" @@ -188,7 +188,7 @@ void CActor::IR_OnKeyboardPress(int cmd) StaticDrawableWrapper* _s = CurrentGameUI()->AddCustomStatic("item_used", true); string1024 str; - strconcat(sizeof(str), str, *StringTable().translate("st_item_used"), ": ", itm->NameItem()); + strconcat(sizeof(str), str, *CStringTable().translate("st_item_used"), ": ", itm->NameItem()); _s->wnd()->TextItemControl()->SetText(str); CurrentGameUI()->GetActorMenu().m_pQuickSlot->ReloadReferences(this); diff --git a/src/xrGame/ActorVehicle.cpp b/src/xrGame/ActorVehicle.cpp index 4ed10b020d3..2c9593c05d9 100644 --- a/src/xrGame/ActorVehicle.cpp +++ b/src/xrGame/ActorVehicle.cpp @@ -22,7 +22,7 @@ #include "pch_script.h" #include "game_object_space.h" -#include "xrScriptEngine/script_callback_ex.h" +#include "script_callback_ex.h" #include "script_game_object.h" void CActor::attach_Vehicle(CHolderCustom* vehicle) diff --git a/src/xrGame/CustomDetector.cpp b/src/xrGame/CustomDetector.cpp index 55837e46e40..cdae5822091 100644 --- a/src/xrGame/CustomDetector.cpp +++ b/src/xrGame/CustomDetector.cpp @@ -7,7 +7,7 @@ #include "map_manager.h" #include "ActorEffector.h" #include "actor.h" -#include "xrUICore/Windows/UIWindow.h" +#include "ui/UIWindow.h" #include "player_hud.h" #include "weapon.h" diff --git a/src/xrGame/DBG_Car.cpp b/src/xrGame/DBG_Car.cpp index 915cfca3ecc..40bbdca23f8 100644 --- a/src/xrGame/DBG_Car.cpp +++ b/src/xrGame/DBG_Car.cpp @@ -6,7 +6,7 @@ #include "PHDestroyable.h" #include "Car.h" #include "Level.h" -#include "xrUICore/ui_base.h" +#include "ui_base.h" #include "xrEngine/GameFont.h" void CCar::InitDebug() diff --git a/src/xrGame/DestroyablePhysicsObject.cpp b/src/xrGame/DestroyablePhysicsObject.cpp index e3a3a575c75..a27f089b2e6 100644 --- a/src/xrGame/DestroyablePhysicsObject.cpp +++ b/src/xrGame/DestroyablePhysicsObject.cpp @@ -10,7 +10,7 @@ #include "Include/xrRender/Kinematics.h" #include "xrServer_Objects_ALife.h" #include "game_object_space.h" -#include "xrScriptEngine/script_callback_ex.h" +#include "script_callback_ex.h" #include "script_game_object.h" #include "xrPhysics/PhysicsShell.h" #ifdef DEBUG diff --git a/src/xrGame/EliteDetector.cpp b/src/xrGame/EliteDetector.cpp index 4868ab2e7bc..6ce47686ae9 100644 --- a/src/xrGame/EliteDetector.cpp +++ b/src/xrGame/EliteDetector.cpp @@ -3,8 +3,8 @@ #include "player_hud.h" #include "Include/xrRender/UIRender.h" #include "ui/UIXmlInit.h" -#include "xrUICore/XML/xrUIXmlParser.h" -#include "xrUICore/Static/UIStatic.h" +#include "ui/xrUIXmlParser.h" +#include "ui/UIStatic.h" #include "ui/ArtefactDetectorUI.h" CEliteDetector::CEliteDetector() { m_artefacts.m_af_rank = 3; } diff --git a/src/xrGame/GameObject.cpp b/src/xrGame/GameObject.cpp index d6cc011c1af..b94c5abb8b8 100644 --- a/src/xrGame/GameObject.cpp +++ b/src/xrGame/GameObject.cpp @@ -22,7 +22,7 @@ #include "ai_debug.h" #include "xrEngine/IGame_Level.h" #include "Level.h" -#include "xrScriptEngine/script_callback_ex.h" +#include "script_callback_ex.h" #include "xrPhysics/MathUtils.h" #include "game_cl_base_weapon_usage_statistic.h" #include "game_cl_mp.h" @@ -33,7 +33,7 @@ #include "animation_movement_controller.h" #include "xrEngine/xr_collide_form.h" #include "script_game_object.h" -#include "xrScriptEngine/script_callback_ex.h" +#include "script_callback_ex.h" #include "game_object_space.h" #include "doors_door.h" #include "doors.h" diff --git a/src/xrGame/GamePersistent.cpp b/src/xrGame/GamePersistent.cpp index dbc5b5bd16f..c0059cb0e6e 100644 --- a/src/xrGame/GamePersistent.cpp +++ b/src/xrGame/GamePersistent.cpp @@ -6,7 +6,7 @@ #include "Include/xrRender/Kinematics.h" #include "xrEngine/profiler.h" #include "MainMenu.h" -#include "xrUICore/Cursor/UICursor.h" +#include "UICursor.h" #include "game_base_space.h" #include "Level.h" #include "ParticlesObject.h" @@ -18,7 +18,7 @@ #include "actor.h" #include "spectator.h" -#include "xrUICore/XML/UITextureMaster.h" +#include "UI/UItextureMaster.h" #include "xrEngine/xrSASH.h" #include "ai_space.h" @@ -116,8 +116,9 @@ CGamePersistent::CGamePersistent(void) ZeroMemory(ambient_sound_next_time, sizeof(ambient_sound_next_time)); - m_pMainMenu = nullptr; - m_intro = nullptr; + m_pUI_core = NULL; + m_pMainMenu = NULL; + m_intro = NULL; m_intro_event.bind(this, &CGamePersistent::start_logo_intro); #ifdef DEBUG m_frame_counter = 0; @@ -206,7 +207,7 @@ void CGamePersistent::OnAppStart() GMLib.Load(); init_game_globals(); inherited::OnAppStart(); - GEnv.UI = new ui_core(); + m_pUI_core = new ui_core(); m_pMainMenu = new CMainMenu(); } @@ -216,7 +217,7 @@ void CGamePersistent::OnAppEnd() m_pMainMenu->Activate(false); xr_delete(m_pMainMenu); - xr_delete(GEnv.UI); + xr_delete(m_pUI_core); inherited::OnAppEnd(); @@ -868,7 +869,7 @@ void CGamePersistent::LoadTitle(bool change_tip, shared_str map_name) tip_num = m_functor(map_name.c_str()); } // tip_num = 83; - xr_sprintf(buff, "%s%d:", StringTable().translate("ls_tip_number").c_str(), tip_num); + xr_sprintf(buff, "%s%d:", CStringTable().translate("ls_tip_number").c_str(), tip_num); shared_str tmp = buff; if (is_single) @@ -877,7 +878,7 @@ void CGamePersistent::LoadTitle(bool change_tip, shared_str map_name) xr_sprintf(buff, "ls_mp_tip_%d", tip_num); pApp->LoadTitleInt( - StringTable().translate("ls_header").c_str(), tmp.c_str(), StringTable().translate(buff).c_str()); + CStringTable().translate("ls_header").c_str(), tmp.c_str(), CStringTable().translate(buff).c_str()); } } @@ -886,7 +887,7 @@ void CGamePersistent::SetLoadStageTitle(pcstr ls_title) string256 buff; if (ls_title) { - xr_sprintf(buff, "%s%s", StringTable().translate(ls_title).c_str(), "..."); + xr_sprintf(buff, "%s%s", CStringTable().translate(ls_title).c_str(), "..."); pApp->SetLoadStageTitle(buff); } else @@ -952,5 +953,5 @@ void CGamePersistent::OnSectorChanged(int sector) void CGamePersistent::OnAssetsChanged() { IGame_Persistent::OnAssetsChanged(); - StringTable().rescan(); + CStringTable().rescan(); } diff --git a/src/xrGame/GamePersistent.h b/src/xrGame/GamePersistent.h index 10fa503e2b8..4a3ca4ad873 100644 --- a/src/xrGame/GamePersistent.h +++ b/src/xrGame/GamePersistent.h @@ -53,6 +53,7 @@ class CGamePersistent : public IGame_Persistent, public IEventReceiver void UpdateDof(); public: + ui_core* m_pUI_core; IReader* pDemoFile; u32 uTime2Change; EVENT eDemoStart; diff --git a/src/xrGame/GameTask.cpp b/src/xrGame/GameTask.cpp index c889b81b9d5..4d368aea485 100644 --- a/src/xrGame/GameTask.cpp +++ b/src/xrGame/GameTask.cpp @@ -1,6 +1,6 @@ #include "pch_script.h" #include "GameTask.h" -#include "xrUICore/XML/xrUIXmlParser.h" +#include "ui/xrUIXmlParser.h" #include "encyclopedia_article.h" #include "map_location.h" #include "map_spot.h" @@ -9,7 +9,7 @@ #include "Level.h" #include "actor.h" #include "xrScriptEngine/script_engine.hpp" -#include "xrScriptEngine/script_callback_ex.h" +#include "script_callback_ex.h" #include "script_game_object.h" #include "ai_space.h" #include "alife_object_registry.h" @@ -17,7 +17,7 @@ #include "alife_story_registry.h" #include "game_object_space.h" #include "Common/object_broker.h" -#include "xrUICore/XML/UITextureMaster.h" +#include "ui/uitexturemaster.h" CGameTask::CGameTask() : m_map_object_id(0), m_TimeToComplete(0), m_priority(0) diff --git a/src/xrGame/GametaskManager.cpp b/src/xrGame/GametaskManager.cpp index 2c49b7b6a81..f46518fd48d 100644 --- a/src/xrGame/GametaskManager.cpp +++ b/src/xrGame/GametaskManager.cpp @@ -1,7 +1,7 @@ #include "pch_script.h" #include "GameTaskManager.h" #include "alife_registry_wrappers.h" -#include "xrUICore/XML/xrUIXmlParser.h" +#include "ui/xrUIXmlParser.h" #include "GameTask.h" #include "Level.h" #include "map_manager.h" diff --git a/src/xrGame/HUDCrosshair.cpp b/src/xrGame/HUDCrosshair.cpp index 1f509778511..b1619953d48 100644 --- a/src/xrGame/HUDCrosshair.cpp +++ b/src/xrGame/HUDCrosshair.cpp @@ -5,7 +5,8 @@ #include "stdafx.h" #include "HUDCrosshair.h" -#include "xrUICore/ui_base.h" +//.#include "UIStaticItem.h" +#include "ui_base.h" CHUDCrosshair::CHUDCrosshair() { diff --git a/src/xrGame/HUDCrosshair.h b/src/xrGame/HUDCrosshair.h index 59b9bbdea97..99902091531 100644 --- a/src/xrGame/HUDCrosshair.h +++ b/src/xrGame/HUDCrosshair.h @@ -6,7 +6,7 @@ #define HUD_CURSOR_SECTION "hud_cursor" -#include "xrUICore/ui_defs.h" +#include "ui_defs.h" class CHUDCrosshair { diff --git a/src/xrGame/HUDManager.cpp b/src/xrGame/HUDManager.cpp index c422505d4f5..1665e44a719 100644 --- a/src/xrGame/HUDManager.cpp +++ b/src/xrGame/HUDManager.cpp @@ -10,15 +10,119 @@ #include "spectator.h" #include "Car.h" #include "UIGameCustom.h" -#include "xrUICore/Cursor/UICursor.h" +#include "UICursor.h" #include "string_table.h" #include "game_cl_base.h" +#include "xrEngine/GameFont.h" #ifdef DEBUG #include "phdebug.h" #endif extern CUIGameCustom* CurrentGameUI() { return HUD().GetGameUI(); } +CFontManager::CFontManager() +{ + Device.seqDeviceReset.Add(this, REG_PRIORITY_HIGH); + + m_all_fonts.push_back(&pFontMedium); // used cpp + m_all_fonts.push_back(&pFontDI); // used cpp + m_all_fonts.push_back(&pFontArial14); // used xml + m_all_fonts.push_back(&pFontGraffiti19Russian); + m_all_fonts.push_back(&pFontGraffiti22Russian); + m_all_fonts.push_back(&pFontLetterica16Russian); + m_all_fonts.push_back(&pFontLetterica18Russian); + m_all_fonts.push_back(&pFontGraffiti32Russian); + m_all_fonts.push_back(&pFontGraffiti50Russian); + m_all_fonts.push_back(&pFontLetterica25); + m_all_fonts.push_back(&pFontStat); + + FONTS_VEC_IT it = m_all_fonts.begin(); + FONTS_VEC_IT it_e = m_all_fonts.end(); + for (; it != it_e; ++it) + (**it) = NULL; + + InitializeFonts(); +} + +void CFontManager::InitializeFonts() +{ + InitializeFont(pFontMedium, "hud_font_medium"); + InitializeFont(pFontDI, "hud_font_di", CGameFont::fsGradient | CGameFont::fsDeviceIndependent); + InitializeFont(pFontArial14, "ui_font_arial_14"); + InitializeFont(pFontGraffiti19Russian, "ui_font_graffiti19_russian"); + InitializeFont(pFontGraffiti22Russian, "ui_font_graffiti22_russian"); + InitializeFont(pFontLetterica16Russian, "ui_font_letterica16_russian"); + InitializeFont(pFontLetterica18Russian, "ui_font_letterica18_russian"); + InitializeFont(pFontGraffiti32Russian, "ui_font_graff_32"); + InitializeFont(pFontGraffiti50Russian, "ui_font_graff_50"); + InitializeFont(pFontLetterica25, "ui_font_letter_25"); + InitializeFont(pFontStat, "stat_font", CGameFont::fsDeviceIndependent); + pFontStat->SetInterval(0.75f, 1.0f); +} + +LPCSTR CFontManager::GetFontTexName(LPCSTR section) +{ + constexpr pcstr tex_names[] = { "texture800", "texture", "texture1600" }; + int def_idx = 1; // default 1024x768 + int idx = def_idx; +#if 0 + u32 w = Device.dwWidth; + + if(w<=800) idx = 0; + else if(w<=1280)idx = 1; + else idx = 2; +#else + u32 h = Device.dwHeight; + + if (h <= 600) + idx = 0; + else if (h < 1024) + idx = 1; + else + idx = 2; +#endif + + while (idx >= 0) + { + if (pSettings->line_exist(section, tex_names[idx])) + return pSettings->r_string(section, tex_names[idx]); + --idx; + } + return pSettings->r_string(section, tex_names[def_idx]); +} +void CFontManager::InitializeFont(CGameFont*& F, LPCSTR section, u32 flags) +{ + LPCSTR font_tex_name = GetFontTexName(section); + R_ASSERT(font_tex_name); + + LPCSTR sh_name = pSettings->r_string(section, "shader"); + if (!F) + F = new CGameFont(sh_name, font_tex_name, flags); + else + F->Initialize(sh_name, font_tex_name); + +#ifdef DEBUG + F->m_font_name = section; +#endif +} + +CFontManager::~CFontManager() +{ + Device.seqDeviceReset.Remove(this); + FONTS_VEC_IT it = m_all_fonts.begin(); + FONTS_VEC_IT it_e = m_all_fonts.end(); + for (; it != it_e; ++it) + xr_delete(**it); +} + +void CFontManager::Render() +{ + FONTS_VEC_IT it = m_all_fonts.begin(); + FONTS_VEC_IT it_e = m_all_fonts.end(); + for (; it != it_e; ++it) + (**it)->OnRender(); +} +void CFontManager::OnDeviceReset() { InitializeFonts(); } //-------------------------------------------------------------------- CHUDManager::CHUDManager() : pUIGame(nullptr), m_pHUDTarget(new CHUDTarget()), b_online(false) {} //-------------------------------------------------------------------- @@ -170,7 +274,7 @@ void CHUDManager::RenderUI() { CGameFont* pFont = UI().Font().pFontGraffiti50Russian; pFont->SetColor(0x80FF0000); - LPCSTR _str = StringTable().translate("st_game_paused").c_str(); + LPCSTR _str = CStringTable().translate("st_game_paused").c_str(); Fvector2 _pos; _pos.set(UI_BASE_WIDTH / 2.0f, UI_BASE_HEIGHT / 2.0f); diff --git a/src/xrGame/HUDTarget.cpp b/src/xrGame/HUDTarget.cpp index 684da894e77..3e4dfbbe7d3 100644 --- a/src/xrGame/HUDTarget.cpp +++ b/src/xrGame/HUDTarget.cpp @@ -10,7 +10,7 @@ #include "game_cl_base.h" #include "xrEngine/IGame_Persistent.h" -#include "xrUICore/ui_base.h" +#include "ui_base.h" #include "InventoryOwner.h" #include "relation_registry.h" #include "character_info.h" @@ -180,9 +180,10 @@ void CHUDTarget::Render() if (fuzzyShowInfo > 0.5f) { + CStringTable strtbl; F->SetColor(subst_alpha(C, u8(iFloor(255.f * (fuzzyShowInfo - 0.5f) * 2.f)))); - F->OutNext("%s", *StringTable().translate(others_inv_owner->Name())); - F->OutNext("%s", *StringTable().translate(others_inv_owner->CharacterInfo().Community().id())); + F->OutNext("%s", *strtbl.translate(others_inv_owner->Name())); + F->OutNext("%s", *strtbl.translate(others_inv_owner->CharacterInfo().Community().id())); } } diff --git a/src/xrGame/HangingLamp.cpp b/src/xrGame/HangingLamp.cpp index 75862861f10..38c0afcd72e 100644 --- a/src/xrGame/HangingLamp.cpp +++ b/src/xrGame/HangingLamp.cpp @@ -8,7 +8,7 @@ #include "Include/xrRender/Kinematics.h" #include "Include/xrRender/KinematicsAnimated.h" #include "game_object_space.h" -#include "xrScriptEngine/script_callback_ex.h" +#include "script_callback_ex.h" #include "script_game_object.h" #include "xrScriptEngine/ScriptExporter.hpp" diff --git a/src/xrGame/Helicopter.cpp b/src/xrGame/Helicopter.cpp index 84d6236dec5..b5589edd394 100644 --- a/src/xrGame/Helicopter.cpp +++ b/src/xrGame/Helicopter.cpp @@ -6,12 +6,11 @@ #include "ai_sounds.h" #include "Include/xrRender/Kinematics.h" #include "Include/xrRender/KinematicsAnimated.h" -#include "xrScriptEngine/script_callback_ex.h" +#include "script_callback_ex.h" #include "game_object_space.h" #include "script_game_object.h" #include "xrEngine/LightAnimLibrary.h" -#include "xrUICore/ui_base.h" - +#include "ui_base.h" #ifdef DEBUG #include "xrEngine/GameFont.h" #endif diff --git a/src/xrGame/Helicopter2.cpp b/src/xrGame/Helicopter2.cpp index 124992fd1c4..0483ac8e9f4 100644 --- a/src/xrGame/Helicopter2.cpp +++ b/src/xrGame/Helicopter2.cpp @@ -6,7 +6,7 @@ #include "Include/xrRender/Kinematics.h" #include "xrEngine/LightAnimLibrary.h" -#include "xrScriptEngine/script_callback_ex.h" +#include "script_callback_ex.h" #include "ai/stalker/ai_stalker.h" #include "CustomZone.h" #include "xrPhysics/MathUtils.h" diff --git a/src/xrGame/HelicopterMovementManager.cpp b/src/xrGame/HelicopterMovementManager.cpp index e6a18d5fd3e..cd1ee10fd89 100644 --- a/src/xrGame/HelicopterMovementManager.cpp +++ b/src/xrGame/HelicopterMovementManager.cpp @@ -5,7 +5,7 @@ #include "xrAICore/Navigation/PatrolPath/patrol_path_storage.h" #include "script_game_object.h" #include "game_object_space.h" -#include "xrScriptEngine/script_callback_ex.h" +#include "script_callback_ex.h" SHeliMovementState::~SHeliMovementState() {} void SHeliMovementState::net_Destroy() diff --git a/src/xrGame/HitMarker.cpp b/src/xrGame/HitMarker.cpp index 5df0dc82228..10bfa97d6fa 100644 --- a/src/xrGame/HitMarker.cpp +++ b/src/xrGame/HitMarker.cpp @@ -4,7 +4,7 @@ #include "HitMarker.h" #include "xrEngine/render.h" #include "xrEngine/LightAnimLibrary.h" -#include "xrUICore/Static/UIStaticItem.h" +#include "UIStaticItem.h" #include "grenade.h" diff --git a/src/xrGame/HitMarker.h b/src/xrGame/HitMarker.h index 2d30836bdf4..44a7b9f1d63 100644 --- a/src/xrGame/HitMarker.h +++ b/src/xrGame/HitMarker.h @@ -3,7 +3,7 @@ #define __XR_HITMARKER_H__ #include "Include/xrRender/FactoryPtr.h" -#include "xrUICore/ui_defs.h" +#include "ui_defs.h" #include "Common/Noncopyable.hpp" #include "xrCommon/xr_deque.h" diff --git a/src/xrGame/HudItem.cpp b/src/xrGame/HudItem.cpp index 2cd92434865..6001296de38 100644 --- a/src/xrGame/HudItem.cpp +++ b/src/xrGame/HudItem.cpp @@ -12,7 +12,7 @@ #include "xrCore/Animation/SkeletonMotions.hpp" #include "xrNetServer/NET_Messages.h" -#include "xrUICore/ui_base.h" +#include "ui_base.h" CHudItem::CHudItem() { diff --git a/src/xrGame/Inventory.cpp b/src/xrGame/Inventory.cpp index ab10eeec5bd..9452986d386 100644 --- a/src/xrGame/Inventory.cpp +++ b/src/xrGame/Inventory.cpp @@ -1038,7 +1038,7 @@ CInventoryItem* CInventory::get_object_by_id(ALife::_OBJECT_ID tObjectID) //скушать предмет #include "game_object_space.h" -#include "xrScriptEngine/script_callback_ex.h" +#include "script_callback_ex.h" #include "script_game_object.h" bool CInventory::Eat(PIItem pIItem) { diff --git a/src/xrGame/InventoryBox.cpp b/src/xrGame/InventoryBox.cpp index a99a4ea8ba9..c8744a093fb 100644 --- a/src/xrGame/InventoryBox.cpp +++ b/src/xrGame/InventoryBox.cpp @@ -4,7 +4,7 @@ #include "actor.h" #include "game_object_space.h" -#include "xrScriptEngine/script_callback_ex.h" +#include "script_callback_ex.h" #include "script_game_object.h" #include "ui/UIActorMenu.h" #include "uigamecustom.h" diff --git a/src/xrGame/InventoryOwner.cpp b/src/xrGame/InventoryOwner.cpp index 90312985432..8a136118200 100644 --- a/src/xrGame/InventoryOwner.cpp +++ b/src/xrGame/InventoryOwner.cpp @@ -18,7 +18,7 @@ #include "alife_registry_wrappers.h" #include "relation_registry.h" #include "xrAICore/Navigation/ai_object_location.h" -#include "xrScriptEngine/script_callback_ex.h" +#include "script_callback_ex.h" #include "game_object_space.h" #include "AI/Monsters/BaseMonster/base_monster.h" #include "trade_parameters.h" diff --git a/src/xrGame/LevelGraphDebugRender.cpp b/src/xrGame/LevelGraphDebugRender.cpp index aac9413ce14..7b49d5f6495 100644 --- a/src/xrGame/LevelGraphDebugRender.cpp +++ b/src/xrGame/LevelGraphDebugRender.cpp @@ -25,7 +25,7 @@ #include "alife_monster_movement_manager.h" #include "alife_monster_detail_path_manager.h" #include "ai_space.h" -#include "xrUICore/ui_base.h" +#include "ui_base.h" #include "CustomMonster.h" #include "ai/stalker/ai_stalker.h" #include "team_base_zone.h" diff --git a/src/xrGame/Level_input.cpp b/src/xrGame/Level_input.cpp index 401066aa5f0..3fd6d6a7cc1 100644 --- a/src/xrGame/Level_input.cpp +++ b/src/xrGame/Level_input.cpp @@ -13,7 +13,7 @@ #include "Inventory.h" #include "xrServer.h" #include "autosave_manager.h" -#include "xrScriptEngine/script_callback_ex.h" +#include "script_callback_ex.h" #include "Actor.h" #include "HudItem.h" diff --git a/src/xrGame/Level_network.cpp b/src/xrGame/Level_network.cpp index b8c1525e791..5d7e7e61bc2 100644 --- a/src/xrGame/Level_network.cpp +++ b/src/xrGame/Level_network.cpp @@ -483,11 +483,11 @@ void CLevel::OnConnectResult(NET_Packet* P) { if (!xr_strlen(ResultStr)) { - MainMenu()->OnSessionTerminate(StringTable().translate("st_you_have_been_banned").c_str()); + MainMenu()->OnSessionTerminate(CStringTable().translate("st_you_have_been_banned").c_str()); } else { - MainMenu()->OnSessionTerminate(StringTable().translate(ResultStr).c_str()); + MainMenu()->OnSessionTerminate(CStringTable().translate(ResultStr).c_str()); } } break; @@ -495,11 +495,11 @@ void CLevel::OnConnectResult(NET_Packet* P) { if (!xr_strlen(ResultStr)) { - MainMenu()->OnSessionTerminate(StringTable().translate("st_profile_error").c_str()); + MainMenu()->OnSessionTerminate(CStringTable().translate("st_profile_error").c_str()); } else { - MainMenu()->OnSessionTerminate(StringTable().translate(ResultStr).c_str()); + MainMenu()->OnSessionTerminate(CStringTable().translate(ResultStr).c_str()); } } } diff --git a/src/xrGame/Level_network_start_client.cpp b/src/xrGame/Level_network_start_client.cpp index d482e6cc626..594afb8f057 100644 --- a/src/xrGame/Level_network_start_client.cpp +++ b/src/xrGame/Level_network_start_client.cpp @@ -35,7 +35,7 @@ bool CLevel::net_start_client1() string256 temp; xr_sprintf(temp, "%s %s", - StringTable().translate("st_client_connecting_to").c_str(), + CStringTable().translate("st_client_connecting_to").c_str(), name_of_server); pApp->SetLoadStageTitle(temp); diff --git a/src/xrGame/Level_start.cpp b/src/xrGame/Level_start.cpp index 914e0eb88be..98321b3599b 100644 --- a/src/xrGame/Level_start.cpp +++ b/src/xrGame/Level_start.cpp @@ -274,10 +274,11 @@ bool CLevel::net_start6() LPCSTR level_id_string = NULL; LPCSTR dialog_string = NULL; LPCSTR download_url = !!map_data.m_map_download_url ? map_data.m_map_download_url.c_str() : ""; + CStringTable st; LPCSTR tmp_map_ver = !!map_data.m_map_version ? map_data.m_map_version.c_str() : ""; - STRCONCAT(level_id_string, StringTable().translate("st_level"), ":", map_data.m_name.c_str(), "(", tmp_map_ver, "). "); - STRCONCAT(dialog_string, level_id_string, StringTable().translate("ui_st_map_not_found")); + STRCONCAT(level_id_string, st.translate("st_level"), ":", map_data.m_name.c_str(), "(", tmp_map_ver, "). "); + STRCONCAT(dialog_string, level_id_string, st.translate("ui_st_map_not_found")); DEL_INSTANCE(g_pGameLevel); Console->Execute("main_menu on"); @@ -293,10 +294,11 @@ bool CLevel::net_start6() LPCSTR level_id_string = NULL; LPCSTR dialog_string = NULL; LPCSTR download_url = !!map_data.m_map_download_url ? map_data.m_map_download_url.c_str() : ""; + CStringTable st; LPCSTR tmp_map_ver = !!map_data.m_map_version ? map_data.m_map_version.c_str() : ""; - STRCONCAT(level_id_string, StringTable().translate("st_level"), ":", map_data.m_name.c_str(), "(", tmp_map_ver, "). "); - STRCONCAT(dialog_string, level_id_string, StringTable().translate("ui_st_map_data_corrupted")); + STRCONCAT(level_id_string, st.translate("st_level"), ":", map_data.m_name.c_str(), "(", tmp_map_ver, "). "); + STRCONCAT(dialog_string, level_id_string, st.translate("ui_st_map_data_corrupted")); g_pGameLevel->net_Stop(); DEL_INSTANCE(g_pGameLevel); diff --git a/src/xrGame/MainMenu.cpp b/src/xrGame/MainMenu.cpp index e16a6003c10..f43aeb3b6ce 100644 --- a/src/xrGame/MainMenu.cpp +++ b/src/xrGame/MainMenu.cpp @@ -6,10 +6,10 @@ #include "xrEngine/IGame_Level.h" #include "xrEngine/CameraManager.h" #include "xr_Level_controller.h" -#include "xrUICore/XML/UItextureMaster.h" +#include "ui\UITextureMaster.h" #include "ui\UIXmlInit.h" -#include "xrUICore/Buttons/UIBtnHint.h" -#include "xrUICore/Cursor/UICursor.h" +#include "ui\UIBtnHint.h" +#include "UICursor.h" #include "xrGameSpy/GameSpy_Full.h" #include "xrGameSpy/GameSpy_HTTP.h" #include "xrGameSpy/GameSpy_Available.h" @@ -643,7 +643,8 @@ void CMainMenu::OnSessionTerminate(LPCSTR reason) return; m_start_time = Device.dwTimeGlobal; - LPCSTR str = StringTable().translate("ui_st_kicked_by_server").c_str(); + CStringTable st; + LPCSTR str = st.translate("ui_st_kicked_by_server").c_str(); LPSTR text; if (reason && xr_strlen(reason) && reason[0] == '@') @@ -655,13 +656,13 @@ void CMainMenu::OnSessionTerminate(LPCSTR reason) STRCONCAT(text, str, " ", reason); } - m_pMB_ErrDlgs[SessionTerminate]->SetText(StringTable().translate(text).c_str()); + m_pMB_ErrDlgs[SessionTerminate]->SetText(st.translate(text).c_str()); SetErrorDialog(CMainMenu::SessionTerminate); } void CMainMenu::OnLoadError(LPCSTR module) { - LPCSTR str = StringTable().translate("ui_st_error_loading").c_str(); + LPCSTR str = CStringTable().translate("ui_st_error_loading").c_str(); string1024 Text; strconcat(sizeof(Text), Text, str, " "); xr_strcat(Text, sizeof(Text), module); diff --git a/src/xrGame/MainMenu.h b/src/xrGame/MainMenu.h index 898ae6382ee..6209fad4e20 100644 --- a/src/xrGame/MainMenu.h +++ b/src/xrGame/MainMenu.h @@ -12,8 +12,8 @@ class demo_info_loader; #include "xrEngine/IInputReceiver.h" #include "xrEngine/IGame_Persistent.h" #include "UIDialogHolder.h" -#include "xrUICore/Callbacks/UIWndCallback.h" -#include "xrUICore/ui_base.h" +#include "ui/UIWndCallback.h" +#include "ui_base.h" #include "DemoInfo.h" namespace gamespy_gp diff --git a/src/xrGame/Missile.cpp b/src/xrGame/Missile.cpp index 61483f9b40b..d7dbb78df12 100644 --- a/src/xrGame/Missile.cpp +++ b/src/xrGame/Missile.cpp @@ -22,7 +22,7 @@ #define PLAYING_ANIM_TIME 10000 -#include "xrUICore/ProgressBar/UIProgressShape.h" +#include "ui/UIProgressShape.h" #include "ui/UIXmlInit.h" #include "physicsshellholder.h" diff --git a/src/xrGame/PHDebug.cpp b/src/xrGame/PHDebug.cpp index 57c0c9bd17d..305f812e5ea 100644 --- a/src/xrGame/PHDebug.cpp +++ b/src/xrGame/PHDebug.cpp @@ -22,7 +22,7 @@ #include "xrCore/xr_token.h" #include "xrEngine/GameFont.h" -#include "xrUICore/ui_base.h" +#include "ui_base.h" Flags32 ph_dbg_draw_mask; Flags32 ph_dbg_draw_mask1; diff --git a/src/xrGame/PHScriptCall.h b/src/xrGame/PHScriptCall.h index f95ba5c1659..7fa465c97d7 100644 --- a/src/xrGame/PHScriptCall.h +++ b/src/xrGame/PHScriptCall.h @@ -3,7 +3,7 @@ #include "phcommander.h" #include "xrScriptEngine/script_engine.hpp" #include "xrScriptEngine/script_space_forward.hpp" -#include "xrScriptEngine/script_callback_ex.h" +#include "script_callback_ex.h" #include "xrEngine/xr_object.h" // template<> diff --git a/src/xrGame/PhraseScript.cpp b/src/xrGame/PhraseScript.cpp index 2d74e7428e9..1b985e570b8 100644 --- a/src/xrGame/PhraseScript.cpp +++ b/src/xrGame/PhraseScript.cpp @@ -7,7 +7,7 @@ #include "infoportion.h" #include "inventoryowner.h" #include "ai_debug.h" -#include "xrUICore/XML/xrUIXmlParser.h" +#include "ui/xrUIXmlParser.h" #include "actor.h" //загрузка из XML файла diff --git a/src/xrGame/PhysicsShellHolder.cpp b/src/xrGame/PhysicsShellHolder.cpp index d82bd6a8d75..0742a60aeac 100644 --- a/src/xrGame/PhysicsShellHolder.cpp +++ b/src/xrGame/PhysicsShellHolder.cpp @@ -4,7 +4,7 @@ #include "xrMessages.h" #include "ph_shell_interface.h" #include "Include/xrRender/Kinematics.h" -#include "xrScriptEngine/script_callback_ex.h" +#include "script_callback_ex.h" #include "Level.h" #include "PHCommander.h" #include "PHScriptCall.h" diff --git a/src/xrGame/ScriptXMLInit.cpp b/src/xrGame/ScriptXMLInit.cpp index bf5fd2835b6..fc96f3a562a 100644 --- a/src/xrGame/ScriptXMLInit.cpp +++ b/src/xrGame/ScriptXMLInit.cpp @@ -1,26 +1,25 @@ #include "pch_script.h" #include "ScriptXmlInit.h" #include "ui\UIXmlInit.h" -#include "xrUICore/XML/UItextureMaster.h" -#include "xrUICore/Buttons/UICheckButton.h" -#include "xrUICore/SpinBox/UISpinNum.h" -#include "xrUICore/SpinBox/UISpinText.h" -#include "xrUICore/ComboBox/UIComboBox.h" -#include "xrUICore/TabControl/UITabControl.h" -#include "xrUICore/Windows/UIFrameWindow.h" +#include "ui\UITextureMaster.h" +#include "ui\UICheckButton.h" +#include "ui\UISpinNum.h" +#include "ui\UISpinText.h" +#include "ui\UIComboBox.h" +#include "ui\UITabControl.h" +#include "ui\UIFrameWindow.h" #include "ui\UILabel.h" #include "ui\ServerList.h" #include "ui\UIMapList.h" #include "ui\UIKeyBinding.h" -#include "xrUICore/EditBox/UIEditBox.h" -#include "xrUICore/Static/UIAnimatedStatic.h" -#include "ui/UISleepStatic.h" -#include "xrUICore/TrackBar/UITrackBar.h" +#include "ui\UIEditBox.h" +#include "ui\UIAnimatedStatic.h" +#include "ui\UITrackBar.h" #include "ui\UICDkey.h" #include "ui\UIMapInfo.h" #include "ui\UIMMShniaga.h" -#include "xrUICore/ScrollView/UIScrollView.h" -#include "xrUICore/ProgressBar/UIProgressBar.h" +#include "ui\UIScrollView.h" +#include "ui\UIProgressBar.h" #include "xrScriptEngine/ScriptExporter.hpp" using namespace luabind; diff --git a/src/xrGame/ScriptXMLInit.h b/src/xrGame/ScriptXMLInit.h index 92cae332cee..c8cc9b58a10 100644 --- a/src/xrGame/ScriptXMLInit.h +++ b/src/xrGame/ScriptXMLInit.h @@ -1,6 +1,6 @@ #pragma once -#include "xrUICore/XML/xrUIXmlParser.h" +#include "ui\xrUIXmlParser.h" class CUIWindow; class CUIFrameWindow; diff --git a/src/xrGame/Spectator.cpp b/src/xrGame/Spectator.cpp index 39f61555283..100d7ccccaf 100644 --- a/src/xrGame/Spectator.cpp +++ b/src/xrGame/Spectator.cpp @@ -641,20 +641,21 @@ void CSpectator::GetSpectatorString(string1024& pStr) return; xr_string SpectatorMsg; + CStringTable st; switch (cam_active) { case eacFreeFly: { - SpectatorMsg = *StringTable().translate("mp_spectator"); + SpectatorMsg = *st.translate("mp_spectator"); SpectatorMsg += " "; - SpectatorMsg += *StringTable().translate("mp_free_fly"); + SpectatorMsg += *st.translate("mp_free_fly"); } break; case eacFirstEye: { - SpectatorMsg = *StringTable().translate("mp_spectator"); + SpectatorMsg = *st.translate("mp_spectator"); SpectatorMsg += " "; - SpectatorMsg += *StringTable().translate("mp_first_eye"); + SpectatorMsg += *st.translate("mp_first_eye"); SpectatorMsg += " "; // SpectatorMsg = "SPECTATOR (First-Eye): "; SpectatorMsg += m_pActorToLookAt ? m_pActorToLookAt->Name() : ""; @@ -662,9 +663,9 @@ void CSpectator::GetSpectatorString(string1024& pStr) break; case eacFreeLook: { - SpectatorMsg = *StringTable().translate("mp_spectator"); + SpectatorMsg = *st.translate("mp_spectator"); SpectatorMsg += " "; - SpectatorMsg += *StringTable().translate("mp_free_look"); + SpectatorMsg += *st.translate("mp_free_look"); SpectatorMsg += " "; // SpectatorMsg = "SPECTATOR (Free-Look):"; SpectatorMsg += m_pActorToLookAt ? m_pActorToLookAt->Name() : ""; @@ -672,9 +673,9 @@ void CSpectator::GetSpectatorString(string1024& pStr) break; case eacLookAt: { - SpectatorMsg = *StringTable().translate("mp_spectator"); + SpectatorMsg = *st.translate("mp_spectator"); SpectatorMsg += " "; - SpectatorMsg += *StringTable().translate("mp_look_at"); + SpectatorMsg += *st.translate("mp_look_at"); SpectatorMsg += " "; // SpectatorMsg = "SPECTATOR (Look-At):"; SpectatorMsg += m_pActorToLookAt ? m_pActorToLookAt->Name() : ""; diff --git a/src/xrGame/StdAfx.h b/src/xrGame/StdAfx.h index e900986cdaf..646d6b00b93 100644 --- a/src/xrGame/StdAfx.h +++ b/src/xrGame/StdAfx.h @@ -52,7 +52,7 @@ #include "xrGame/Entity.h" // ~490 #include "xrGame/damage_manager.h" // ~490 #include "xrGame/EntityCondition.h" // ~490 -#include "xrUICore/ui_defs.h" // ~450 +#include "xrGame/ui_defs.h" // ~450 #include "xrGame/entity_alive.h" // ~430 #include "xrCore/XML/XMLDocument.hpp" // ~400 #include "xrPhysics/xrPhysics.h" // ~400 @@ -77,16 +77,16 @@ #include "xrGame/script_entity.h" // ~290 #include "xrEngine/Feel_Vision.h" // ~270 #include "xrGame/CustomMonster.h" // ~265 -#include "xrUICore/ui_base.h" // ~260 +#include "xrGame/ui_base.h" // ~260 #include "xrPhysics/MathUtils.h" // ~260 #include "xrGame/WeaponAmmo.h" // ~250 #include "xrEngine/GameFont.h" // ~250 #include "xrGame/detail_path_manager.h" // ~120 + 120 for its inlines #include "xrPhysics/MovementBoxDynamicActivate.h" // ~240 #include "xrPhysics/PHItemList.h" -#include "xrUICore/EditBox/UIEditBox.h" -#include "xrUICore/Windows/UIWindow.h" // ~225 -#include "xrUICore/UIMessages.h" // ~225 one single enum +#include "xrGame/ui/UIEditBox.h" +#include "xrGame/ui/UIWindow.h" // ~225 +#include "xrGame/ui/UIMessages.h" // ~225 one single enum #include "xrScriptEngine/Functor.hpp" // ~225 // XXX: See to it this goes to pch_script #include "xrGame/fire_disp_controller.h" // ~220 #include "xrGame/Actor.h" // ~220 @@ -94,6 +94,8 @@ #include "xrEngine/CameraManager.h" // ~190 #include "xrCore/PostProcess/PPInfo.hpp" // ~190 #include "xrScriptEngine/script_engine.hpp" // only ~200, VERY heavy! // XXX: See to it this goes to pch_script +//#include "xrGame/ui/UILine.h" // ~190 +//#include "xrGame/ui/UILines.h" // ~190 #include "xrCore/_fbox2.h" // ~155 #include "xrCore/_vector3d_ext.h" #include "xrCore/buffer_vector.h" @@ -105,34 +107,34 @@ //#include "xrCore/dump_string.h" // ~260 //#include "xrCore/Math/Random32.hpp" // ~220 //#include "xrEngine/LightAnimLibrary.h" // ~200 -#include "xrUICore/Cursor/UICursor.h" +#include "xrGame/UICursor.h" #include "xrGame/UIDialogHolder.h" // ~135, somewhat heavy to compile -#include "xrUICore/Static/UIStaticItem.h" // ~190, and quite heavy to compile +#include "xrGame/UIStaticItem.h" // ~190, and quite heavy to compile #include "xrGame/ui/Restrictions.h" -#include "xrUICore/InteractiveBackground/UI_IB_Static.h" // ~60, very heavy to compile -#include "xrUICore/Buttons/UI3tButton.h" // ~60, very heavy to compile +#include "xrGame/ui/UI_IB_Static.h" // ~60, very heavy to compile +#include "xrGame/ui/UI3tButton.h" // ~60, very heavy to compile #include "xrGame/ui/UIActorMenu.h" -#include "xrUICore/Buttons/UIButton.h" // ~80, very heavy to compile +#include "xrGame/ui/UIButton.h" // ~80, very heavy to compile #include "xrGame/ui/UIBuyWndBase.h" #include "xrGame/ui/UIBuyWndShared.h" #include "xrGame/ui/UICellItem.h" -#include "xrUICore/EditBox/UICustomEdit.h" +#include "xrGame/ui/UICustomEdit.h" #include "xrGame/ui/UIDialogWnd.h" // ~100 #include "xrGame/ui/UIDragDropListEx.h" -#include "xrUICore/Windows/UIFrameWindow.h" -#include "xrUICore/Hint/UIHint.h" +#include "xrGame/ui/UIFrameWindow.h" +#include "xrGame/ui/UIHint.h" #include "xrGame/ui/UIInventoryUtilities.h" -#include "xrUICore/Static/UILanimController.h" // ~190 -#include "xrUICore/Lines/UILine.h" // ~190 -#include "xrUICore/Lines/UILines.h" // ~190 -#include "xrUICore/ListBox/UIListBox.h" -#include "xrUICore/Options/UIOptionsItem.h" // ~60, somewhat heavy to compile -//#include "xrUICore/Options/UIOptionsManager.h" // ~60, somewhat heavy to compile -#include "xrUICore/ProgressBar/UIProgressBar.h" // ~23, very heavy to compile -#include "xrUICore/ScrollView/UIScrollView.h" // ~70, quite heavy to compile -#include "xrUICore/Static/UIStatic.h" // ~190 -#include "xrUICore/Lines/UISubLine.h" // ~190 -#include "xrUICore/Callbacks/UIWndCallback.h" // 135, somewhat heavy to compile +#include "xrGame/ui/UILanimController.h" // ~190 +#include "xrGame/ui/UILine.h" // ~190 +#include "xrGame/ui/UILines.h" // ~190 +#include "xrGame/ui/UIListBox.h" +#include "xrGame/ui/UIOptionsItem.h" // ~60, somewhat heavy to compile +//#include "xrGame/ui/UIOptionsManager.h" // ~60, somewhat heavy to compile +#include "xrGame/ui/UIProgressBar.h" // ~23, very heavy to compile +#include "xrGame/ui/UIScrollView.h" // ~70, quite heavy to compile +#include "xrGame/ui/UIStatic.h" // ~190 +#include "xrGame/ui/UISubLine.h" // ~190 +#include "xrGame/ui/UIWndCallback.h" // 135, somewhat heavy to compile #include "xrGame/ui/UIXmlInit.h" // ~105, somewhat heavy to compile #include "xrGame/smart_cover.h" // ~30, VERY heavy to compile #include "xrGame/team_hierarchy_holder.h" // ~35, but quite heavy to compile @@ -186,7 +188,7 @@ #include "xrGame/property_evaluator_const.h" #include "xrGame/quadtree.h" #include "xrGame/Random.hpp" // ~150 -#include "xrScriptEngine/script_callback_ex.h" // ~120, VERY heavy to compile +#include "xrGame/script_callback_ex.h" // ~120, VERY heavy to compile #include "xrGame/seniority_hierarchy_holder.h" #include "xrGame/setup_manager.h" #include "xrGame/sight_action.h" @@ -209,7 +211,6 @@ #include "xrGame/game_cl_mp.h" // ~60, INCREDIBLY heavy to compile #include "xrGame/game_events_handler.h" // ~30, INCREDIBLY heavy to compile #include "xrGame/steering_behaviour.h" // ~30, measurable compile time -#include "xr_level_controller.h" #include "xrGame/UIGameCustom.h" // ~85, quite heavy to compile #include "xrGame/UIGameMP.h" #include "xrGame/UIGameSP.h" diff --git a/src/xrGame/Tracer.h b/src/xrGame/Tracer.h index cbd7a2f5aa2..99de54ba3fc 100644 --- a/src/xrGame/Tracer.h +++ b/src/xrGame/Tracer.h @@ -2,7 +2,7 @@ class CBulletManager; -#include "xrUICore/ui_defs.h" +#include "ui_defs.h" class CTracer { diff --git a/src/xrGame/UIAchivementsIndicator.cpp b/src/xrGame/UIAchivementsIndicator.cpp index 034238fd391..c4c766ec68a 100644 --- a/src/xrGame/UIAchivementsIndicator.cpp +++ b/src/xrGame/UIAchivementsIndicator.cpp @@ -2,7 +2,7 @@ #include "UIAchivementsIndicator.h" #include "ui/UIXmlInit.h" #include "ui/UIGameLog.h" -#include "xrUICore/XML/xrUIXmlParser.h" +#include "ui/xrUIXmlParser.h" #include "ui/UIPdaMsgListItem.h" #include "profile_data_types.h" diff --git a/src/xrGame/UIAchivementsIndicator.h b/src/xrGame/UIAchivementsIndicator.h index 63d5aac3884..6bc6b92146b 100644 --- a/src/xrGame/UIAchivementsIndicator.h +++ b/src/xrGame/UIAchivementsIndicator.h @@ -1,7 +1,7 @@ #ifndef UI_ACHIVEMENTS_INDICATOR_INCLUDED #define UI_ACHIVEMENTS_INDICATOR_INCLUDED -#include "xrUICore/Static/UIStatic.h" +#include "ui/UIStatic.h" #include "ui/KillMessageStruct.h" #include "xrCore/Containers/AssociativeVector.hpp" diff --git a/src/xrUICore/Cursor/UICursor.cpp b/src/xrGame/UICursor.cpp similarity index 97% rename from src/xrUICore/Cursor/UICursor.cpp rename to src/xrGame/UICursor.cpp index 0bdc38cb8eb..c5f4cd751a8 100644 --- a/src/xrUICore/Cursor/UICursor.cpp +++ b/src/xrGame/UICursor.cpp @@ -1,8 +1,8 @@ -#include "pch.hpp" +#include "stdafx.h" #include "uicursor.h" -#include "Static/UIStatic.h" -#include "Buttons/UIBtnHint.h" +#include "ui/UIStatic.h" +#include "ui/UIBtnHint.h" #include "xrEngine/IInputReceiver.h" #include "xrEngine/xr_input.h" @@ -131,6 +131,6 @@ void CUICursor::SetUICursorPosition(Fvector2 pos) POINT p; p.x = iFloor(vPos.x / (UI_BASE_WIDTH / (float)Device.m_rcWindowClient.w)); p.y = iFloor(vPos.y / (UI_BASE_HEIGHT / (float)Device.m_rcWindowClient.h)); - + SDL_WarpMouseInWindow(Device.m_sdlWnd, p.x, p.y); } diff --git a/src/xrUICore/Cursor/UICursor.h b/src/xrGame/UICursor.h similarity index 85% rename from src/xrUICore/Cursor/UICursor.h rename to src/xrGame/UICursor.h index 9fba3196a1c..2b24a1dc1a0 100644 --- a/src/xrUICore/Cursor/UICursor.h +++ b/src/xrGame/UICursor.h @@ -1,8 +1,9 @@ #pragma once +#include "ui_base.h" class CUIStatic; -class XRUICORE_API CUICursor : public pureRender, public pureScreenResolutionChanged +class CUICursor : public pureRender, public pureScreenResolutionChanged { bool bVisible; Fvector2 vPos; diff --git a/src/xrGame/UIDialogHolder.cpp b/src/xrGame/UIDialogHolder.cpp index 2d455f8d4fe..ddb62619ccd 100644 --- a/src/xrGame/UIDialogHolder.cpp +++ b/src/xrGame/UIDialogHolder.cpp @@ -2,7 +2,7 @@ #include "UIDialogHolder.h" #include "ui/UIDialogWnd.h" #include "UIGameCustom.h" -#include "xrUICore/Cursor/UICursor.h" +#include "UICursor.h" #include "Level.h" #include "actor.h" #include "xr_level_controller.h" diff --git a/src/xrGame/UIGameAHunt.cpp b/src/xrGame/UIGameAHunt.cpp index 089bc34aad3..5a1e11671d5 100644 --- a/src/xrGame/UIGameAHunt.cpp +++ b/src/xrGame/UIGameAHunt.cpp @@ -4,7 +4,7 @@ #include "team_base_zone.h" #include "Level.h" #include "game_cl_ArtefactHunt.h" -#include "xrUICore/Static/UIStatic.h" +#include "ui/UIStatic.h" #include "ui/UIXmlInit.h" #include "ui/UIMessageBoxEx.h" #include "ui/UIMoneyIndicator.h" diff --git a/src/xrGame/UIGameCTA.cpp b/src/xrGame/UIGameCTA.cpp index 4efdeffcb7d..958db266dd5 100644 --- a/src/xrGame/UIGameCTA.cpp +++ b/src/xrGame/UIGameCTA.cpp @@ -31,7 +31,7 @@ #include "ui/UIBuyWndShared.h" #include "ui/UIMoneyIndicator.h" #include "ui/UIRankIndicator.h" -#include "xrUICore/ProgressBar/UIProgressShape.h" +#include "ui/UIProgressShape.h" #include "ui/UIMessageBoxEx.h" #include "ui/UIVoteStatusWnd.h" #include "ui/UIActorMenu.h" @@ -732,7 +732,8 @@ void CUIGameCTA::ShowBuySpawn(s32 spawn_cost) if (m_pBuySpawnMsgBox->IsShown()) return; - LPCSTR format_str = StringTable().translate("mp_press_yes2pay").c_str(); + CStringTable st; + LPCSTR format_str = st.translate("mp_press_yes2pay").c_str(); VERIFY(format_str); size_t pay_frm_size = xr_strlen(format_str) * sizeof(char) + 64; PSTR pay_frm_str = static_cast(_alloca(pay_frm_size)); diff --git a/src/xrGame/UIGameCustom.cpp b/src/xrGame/UIGameCustom.cpp index 0dca0ec8f03..b905b909d28 100644 --- a/src/xrGame/UIGameCustom.cpp +++ b/src/xrGame/UIGameCustom.cpp @@ -2,7 +2,7 @@ #include "UIGameCustom.h" #include "Level.h" #include "ui/UIXmlInit.h" -#include "xrUICore/Static/UIStatic.h" +#include "ui/UIStatic.h" #include "Common/object_broker.h" #include "string_table.h" diff --git a/src/xrGame/UIGameCustom_script.cpp b/src/xrGame/UIGameCustom_script.cpp index b410f965061..85072722583 100644 --- a/src/xrGame/UIGameCustom_script.cpp +++ b/src/xrGame/UIGameCustom_script.cpp @@ -1,7 +1,7 @@ #include "pch_script.h" #include "UIGameCustom.h" #include "Level.h" -#include "xrUICore/Static/UIStatic.h" +#include "ui/uistatic.h" #include "xrScriptEngine/ScriptExporter.hpp" using namespace luabind; diff --git a/src/xrGame/UIGameDM.cpp b/src/xrGame/UIGameDM.cpp index 001632b1484..d32d2214968 100644 --- a/src/xrGame/UIGameDM.cpp +++ b/src/xrGame/UIGameDM.cpp @@ -13,7 +13,7 @@ #include "InventoryOwner.h" #include "xrserver_objects_alife_items.h" #include "xr_level_controller.h" -#include "xrUICore/XML/xrUIXmlParser.h" +#include "ui/xrUIXmlParser.h" #include "game_cl_Deathmatch.h" #include "ui/UIMoneyIndicator.h" #include "ui/UIRankIndicator.h" diff --git a/src/xrGame/UIGameMP.cpp b/src/xrGame/UIGameMP.cpp index 0370bf6c99b..a8ae6b409dc 100644 --- a/src/xrGame/UIGameMP.cpp +++ b/src/xrGame/UIGameMP.cpp @@ -3,7 +3,7 @@ #include "UIAchivementsIndicator.h" #include "ui/UIDemoPlayControl.h" #include "ui/UIServerInfo.h" -#include "xrUICore/Cursor/UICursor.h" +#include "UICursor.h" #include "Level.h" #include "game_cl_mp.h" diff --git a/src/xrGame/UIGameSP.cpp b/src/xrGame/UIGameSP.cpp index 26d9494d57e..e5ecfe97da2 100644 --- a/src/xrGame/UIGameSP.cpp +++ b/src/xrGame/UIGameSP.cpp @@ -20,7 +20,7 @@ #include "ui/UIActorMenu.h" #include "ui/UIPdaWnd.h" #include "ui/UITalkWnd.h" -#include "xrUICore/MessageBox/UIMessageBox.h" +#include "ui/UIMessageBox.h" CUIGameSP::CUIGameSP() : m_game(NULL), m_game_objective(NULL) { diff --git a/src/xrGame/UIPlayerItem.cpp b/src/xrGame/UIPlayerItem.cpp index 16ae2cf0a26..425b627a74d 100644 --- a/src/xrGame/UIPlayerItem.cpp +++ b/src/xrGame/UIPlayerItem.cpp @@ -3,7 +3,7 @@ #include "UITeamState.h" #include "UITeamPanels.h" -#include "xrUICore/Static/UIStatic.h" +#include "ui/UIStatic.h" #include "ui/UIStatsIcon.h" #include "game_cl_capture_the_artefact.h" @@ -132,8 +132,9 @@ void UIPlayerItem::GetTextParamValue( } else if (param_name.equal("mp_status")) { + CStringTable st; if (ps->testFlag(GAME_PLAYER_FLAG_READY)) - xr_strcpy(dest.begin(), dest.size(), StringTable().translate("st_mp_ready").c_str()); + xr_strcpy(dest.begin(), dest.size(), st.translate("st_mp_ready").c_str()); } else if (param_name.equal("mp_ping")) { diff --git a/src/xrGame/UIPlayerItem.h b/src/xrGame/UIPlayerItem.h index a43422d32d7..344cb9b6fbf 100644 --- a/src/xrGame/UIPlayerItem.h +++ b/src/xrGame/UIPlayerItem.h @@ -2,8 +2,8 @@ #ifndef UIPLAYERITEM #define UIPLAYERITEM -#include "xrUICore/Windows/UIWindow.h" -#include "xrUICore/XML/xrUIXmlParser.h" +#include "ui/UIWindow.h" +#include "ui/xrUIXmlParser.h" #include "ui/UIXmlInit.h" #include "game_cl_base.h" diff --git a/src/xrUICore/Static/UIStaticItem.cpp b/src/xrGame/UIStaticItem.cpp similarity index 97% rename from src/xrUICore/Static/UIStaticItem.cpp rename to src/xrGame/UIStaticItem.cpp index d3ae44bc347..738de1c2cba 100644 --- a/src/xrUICore/Static/UIStaticItem.cpp +++ b/src/xrGame/UIStaticItem.cpp @@ -1,8 +1,9 @@ -#include "pch.hpp" +#include "stdafx.h" #include "UIStaticItem.h" +#include "ui_base.h" -XRUICORE_API void CreateUIGeom() { GEnv.UIRender->CreateUIGeom(); } -XRUICORE_API void DestroyUIGeom() { GEnv.UIRender->DestroyUIGeom(); } +void CreateUIGeom() { GEnv.UIRender->CreateUIGeom(); } +void DestroyUIGeom() { GEnv.UIRender->DestroyUIGeom(); } CUIStaticItem::CUIStaticItem() { uFlags.zero(); diff --git a/src/xrUICore/Static/UIStaticItem.h b/src/xrGame/UIStaticItem.h similarity index 96% rename from src/xrUICore/Static/UIStaticItem.h rename to src/xrGame/UIStaticItem.h index fe1f011062e..bd3255e97d0 100644 --- a/src/xrUICore/Static/UIStaticItem.h +++ b/src/xrGame/UIStaticItem.h @@ -1,12 +1,12 @@ #pragma once -#include "xrUICore/ui_defs.h" +#include "ui_defs.h" #include "xrCore/_flags.h" #include "xrCore/_vector2.h" #ifdef DEBUG #include "xrCore/xrstring.h" #endif -class XRUICORE_API CUIStaticItem +class CUIStaticItem { protected: public: diff --git a/src/xrGame/UITeamHeader.cpp b/src/xrGame/UITeamHeader.cpp index 80c83d7aee2..459cf92dcce 100644 --- a/src/xrGame/UITeamHeader.cpp +++ b/src/xrGame/UITeamHeader.cpp @@ -1,7 +1,7 @@ #include "stdafx.h" #include "UITeamHeader.h" #include "UITeamState.h" -#include "xrUICore/Static/UIStatic.h" +#include "ui/UIStatic.h" #include "xrCore/buffer_vector.h" UITeamHeader::UITeamHeader(UITeamState const* const parent) : m_parent(parent), m_team_header_root() {} @@ -50,6 +50,7 @@ void UITeamHeader::InitFieldsStatics(CUIXml& uiXml) { VERIFY(m_team_header_root); int tempNumber = uiXml.GetNodesNum(m_team_header_root, FILED_NODE_NAME); + CStringTable st; for (int i = 0; i < tempNumber; ++i) { XML_NODE tempFieldNode = uiXml.NavigateToNode(FILED_NODE_NAME, i); @@ -61,7 +62,7 @@ void UITeamHeader::InitFieldsStatics(CUIXml& uiXml) this->AttachChild(static_cast(tempField)); tempField->SetAutoDelete(true); CUIXmlInit::InitStatic(uiXml, FILED_NODE_NAME, i, tempField); - m_translated_strings.insert(std::make_pair(shared_str(tempFieldName), StringTable().translate(tempFieldName))); + m_translated_strings.insert(std::make_pair(shared_str(tempFieldName), st.translate(tempFieldName))); m_field_fillers.insert(std::make_pair(shared_str(tempFieldName), tempField)); } } diff --git a/src/xrGame/UITeamHeader.h b/src/xrGame/UITeamHeader.h index 78ffc51a9eb..0d8ba16270b 100644 --- a/src/xrGame/UITeamHeader.h +++ b/src/xrGame/UITeamHeader.h @@ -1,8 +1,8 @@ #ifndef UI_TEAM_HEADER #define UI_TEAM_HEADER -#include "xrUICore/Windows/UIWindow.h" -#include "xrUICore/XML/xrUIXmlParser.h" +#include "ui/UIWindow.h" +#include "ui/xrUIXmlParser.h" #include "ui/UIXmlInit.h" #include "game_cl_base.h" diff --git a/src/xrGame/UITeamPanels.cpp b/src/xrGame/UITeamPanels.cpp index 4bb0e2913cc..251ef86bba7 100644 --- a/src/xrGame/UITeamPanels.cpp +++ b/src/xrGame/UITeamPanels.cpp @@ -1,8 +1,8 @@ #include "StdAfx.h" #include "UITeamPanels.h" #include "ui/UIStatsIcon.h" -#include "xrUICore/Windows/UIFrameLineWnd.h" -#include "xrUICore/Static/UIStatic.h" +#include "ui/UIFrameLineWnd.h" +#include "ui/UIStatic.h" UITeamPanels::UITeamPanels() { diff --git a/src/xrGame/UITeamPanels.h b/src/xrGame/UITeamPanels.h index 130a5786b52..e511d307b3d 100644 --- a/src/xrGame/UITeamPanels.h +++ b/src/xrGame/UITeamPanels.h @@ -1,9 +1,9 @@ #ifndef UITEAMPANELS #define UITEAMPANELS -#include "xrUICore/Windows/UIWindow.h" +#include "ui/UIWindow.h" #include "UIPanelsClassFactory.h" -#include "xrUICore/XML/xrUIXmlParser.h" +#include "ui/xrUIXmlParser.h" #include "ui/UIXmlInit.h" class UITeamState; diff --git a/src/xrGame/UITeamState.cpp b/src/xrGame/UITeamState.cpp index 79b99388652..70fa1b4f702 100644 --- a/src/xrGame/UITeamState.cpp +++ b/src/xrGame/UITeamState.cpp @@ -6,9 +6,9 @@ #include "UIPlayerItem.h" #include "UITeamHeader.h" -#include "xrUICore/Windows/UIFrameWindow.h" -#include "xrUICore/ScrollView/UIScrollView.h" -#include "xrUICore/Static/UIStatic.h" +#include "ui/UIFrameWindow.h" +#include "ui/UIScrollView.h" +#include "ui/UIStatic.h" #include "game_cl_mp.h" diff --git a/src/xrGame/UITeamState.h b/src/xrGame/UITeamState.h index e776f888b23..9f9aceba6fc 100644 --- a/src/xrGame/UITeamState.h +++ b/src/xrGame/UITeamState.h @@ -1,8 +1,8 @@ #ifndef UITEAMSTATE #define UITEAMSTATE -#include "xrUICore/Windows/UIWindow.h" -#include "xrUICore/XML/xrUIXmlParser.h" +#include "ui/UIWindow.h" +#include "ui/xrUIXmlParser.h" #include "ui/UIXmlInit.h" #include "game_cl_base.h" diff --git a/src/xrGame/UIZoneMap.h b/src/xrGame/UIZoneMap.h index 11ff7cdb0e8..ab3d8e4011f 100644 --- a/src/xrGame/UIZoneMap.h +++ b/src/xrGame/UIZoneMap.h @@ -1,6 +1,6 @@ #pragma once -#include "xrUICore/Static/UIStatic.h" +#include "ui/UIStatic.h" class CActor; class CUIMiniMap; diff --git a/src/xrGame/Weapon.cpp b/src/xrGame/Weapon.cpp index da071d60061..2f8d40f187f 100644 --- a/src/xrGame/Weapon.cpp +++ b/src/xrGame/Weapon.cpp @@ -21,7 +21,7 @@ #include "static_cast_checked.hpp" #include "clsid_game.h" #include "weaponBinocularsVision.h" -#include "xrUICore/Windows/UIWindow.h" +#include "ui/UIWindow.h" #include "ui/UIXmlInit.h" #include "Torch.h" #include "xrNetServer/NET_Messages.h" diff --git a/src/xrGame/WeaponAmmo.cpp b/src/xrGame/WeaponAmmo.cpp index 9d7027865d5..b8afad81f23 100644 --- a/src/xrGame/WeaponAmmo.cpp +++ b/src/xrGame/WeaponAmmo.cpp @@ -67,7 +67,7 @@ void CCartridge::Load(LPCSTR section, u8 LocalAmmoType) VERIFY(u16(-1) != bullet_material_idx); VERIFY(param_s.fWallmarkSize > 0); - m_InvShortName = StringTable().translate(pSettings->r_string(section, "inv_name_short")); + m_InvShortName = CStringTable().translate(pSettings->r_string(section, "inv_name_short")); } float CCartridge::Weight() const diff --git a/src/xrGame/WeaponBinoculars.cpp b/src/xrGame/WeaponBinoculars.cpp index 8933be25239..8af0f682c97 100644 --- a/src/xrGame/WeaponBinoculars.cpp +++ b/src/xrGame/WeaponBinoculars.cpp @@ -4,7 +4,7 @@ #include "xr_level_controller.h" #include "Level.h" -#include "xrUICore/Windows/UIFrameWindow.h" +#include "ui\UIFrameWindow.h" #include "WeaponBinocularsVision.h" #include "Common/object_broker.h" #include "inventory.h" diff --git a/src/xrGame/WeaponBinocularsVision.cpp b/src/xrGame/WeaponBinocularsVision.cpp index 8b313c9b9d8..ebfb4aac2cd 100644 --- a/src/xrGame/WeaponBinocularsVision.cpp +++ b/src/xrGame/WeaponBinocularsVision.cpp @@ -1,7 +1,7 @@ #include "stdafx.h" #include "WeaponBinocularsVision.h" #include "WeaponBinoculars.h" -#include "xrUICore/Windows/UIFrameWindow.h" +#include "ui\UIFrameWindow.h" #include "entity_alive.h" #include "visual_memory_manager.h" #include "actor.h" diff --git a/src/xrGame/WeaponBinocularsVision.h b/src/xrGame/WeaponBinocularsVision.h index e0b03cd7660..f607193ef30 100644 --- a/src/xrGame/WeaponBinocularsVision.h +++ b/src/xrGame/WeaponBinocularsVision.h @@ -1,5 +1,5 @@ #pragma once -#include "xrUICore/Static/UIStatic.h" +#include "ui\uistatic.h" #include "HudSound.h" class IGameObject; diff --git a/src/xrGame/WeaponMagazined.cpp b/src/xrGame/WeaponMagazined.cpp index 68dbc96995e..5429c3f8803 100644 --- a/src/xrGame/WeaponMagazined.cpp +++ b/src/xrGame/WeaponMagazined.cpp @@ -17,9 +17,9 @@ #include "string_table.h" #include "MPPlayersBag.h" #include "ui/UIXmlInit.h" -#include "xrUICore/Static/UIStatic.h" +#include "ui/UIStatic.h" #include "game_object_space.h" -#include "xrScriptEngine/script_callback_ex.h" +#include "script_callback_ex.h" #include "script_game_object.h" #include "HudSound.h" @@ -1407,13 +1407,13 @@ bool CWeaponMagazined::GetBriefInfo(II_BriefInfo& info) if (ae != 0 && m_magazine.size() != 0) { LPCSTR ammo_type = m_ammoTypes[m_magazine.back().m_LocalAmmoType].c_str(); - info.name = StringTable().translate(pSettings->r_string(ammo_type, "inv_name_short")); + info.name = CStringTable().translate(pSettings->r_string(ammo_type, "inv_name_short")); info.icon = ammo_type; } else { LPCSTR ammo_type = m_ammoTypes[m_ammoType].c_str(); - info.name = StringTable().translate(pSettings->r_string(ammo_type, "inv_name_short")); + info.name = CStringTable().translate(pSettings->r_string(ammo_type, "inv_name_short")); info.icon = ammo_type; } return true; diff --git a/src/xrGame/WeaponMagazinedWGrenade.cpp b/src/xrGame/WeaponMagazinedWGrenade.cpp index 4e402f782bb..99712e025dd 100644 --- a/src/xrGame/WeaponMagazinedWGrenade.cpp +++ b/src/xrGame/WeaponMagazinedWGrenade.cpp @@ -956,13 +956,13 @@ bool CWeaponMagazinedWGrenade::GetBriefInfo(II_BriefInfo& info) if (ae != 0 && m_magazine.size() != 0) { LPCSTR ammo_type = m_ammoTypes[m_magazine.back().m_LocalAmmoType].c_str(); - info.name._set(StringTable().translate(pSettings->r_string(ammo_type, "inv_name_short"))); + info.name._set(CStringTable().translate(pSettings->r_string(ammo_type, "inv_name_short"))); info.icon._set(ammo_type); } else { LPCSTR ammo_type = m_ammoTypes[m_ammoType].c_str(); - info.name._set(StringTable().translate(pSettings->r_string(ammo_type, "inv_name_short"))); + info.name._set(CStringTable().translate(pSettings->r_string(ammo_type, "inv_name_short"))); info.icon._set(ammo_type); } diff --git a/src/xrGame/actor_communication.cpp b/src/xrGame/actor_communication.cpp index e3960e2dfbb..44fc3a172c4 100644 --- a/src/xrGame/actor_communication.cpp +++ b/src/xrGame/actor_communication.cpp @@ -20,7 +20,7 @@ #include "ui/UIPdaWnd.h" #include "ui/UITalkWnd.h" #include "game_object_space.h" -#include "xrScriptEngine/script_callback_ex.h" +#include "script_callback_ex.h" #include "encyclopedia_article.h" #include "GameTaskManager.h" #include "GameTaskdefs.h" diff --git a/src/xrGame/ai/crow/ai_crow.cpp b/src/xrGame/ai/crow/ai_crow.cpp index 8eb2ada057a..b2625cfa57e 100644 --- a/src/xrGame/ai/crow/ai_crow.cpp +++ b/src/xrGame/ai/crow/ai_crow.cpp @@ -15,7 +15,7 @@ #include "Include/xrRender/Kinematics.h" #include "Include/xrRender/KinematicsAnimated.h" #include "Actor.h" -#include "xrScriptEngine/script_callback_ex.h" +#include "script_callback_ex.h" #include "game_object_space.h" #include "script_game_object.h" #include "hit.h" diff --git a/src/xrGame/ai/monsters/basemonster/base_monster_feel.cpp b/src/xrGame/ai/monsters/basemonster/base_monster_feel.cpp index 4fa81482c07..cc46313447a 100644 --- a/src/xrGame/ai/monsters/basemonster/base_monster_feel.cpp +++ b/src/xrGame/ai/monsters/basemonster/base_monster_feel.cpp @@ -14,13 +14,13 @@ #include "Include/xrRender/KinematicsAnimated.h" #include "sound_player.h" #include "Level.h" -#include "xrScriptEngine/script_callback_ex.h" +#include "script_callback_ex.h" #include "script_game_object.h" #include "game_object_space.h" #include "ai_monster_space.h" #include "ai/Monsters/control_animation_base.h" #include "UIGameCustom.h" -#include "xrUICore/Static/UIStatic.h" +#include "UI/UIStatic.h" #include "xrAICore/Navigation/ai_object_location.h" #include "xrEngine/profiler.h" #include "ActorEffector.h" diff --git a/src/xrGame/ai/monsters/controller/controller.cpp b/src/xrGame/ai/monsters/controller/controller.cpp index 0e371096889..ed06f04f4fd 100644 --- a/src/xrGame/ai/monsters/controller/controller.cpp +++ b/src/xrGame/ai/monsters/controller/controller.cpp @@ -11,7 +11,7 @@ #include "sound_player.h" #include "ai_monster_space.h" #include "UIGameCustom.h" -#include "xrUICore/Static/UIStatic.h" +#include "ui/UIStatic.h" #include "ai/Monsters/monster_velocity_space.h" #include "level_debug.h" #include "game_object_space.h" diff --git a/src/xrGame/ai/stalker/ai_stalker_debug.cpp b/src/xrGame/ai/stalker/ai_stalker_debug.cpp index 1477a7fc3aa..f0b30cbff66 100644 --- a/src/xrGame/ai/stalker/ai_stalker_debug.cpp +++ b/src/xrGame/ai/stalker/ai_stalker_debug.cpp @@ -54,7 +54,7 @@ #include "aimers_weapon.h" #include "aimers_bone.h" #include "smart_cover_planner_target_selector.h" -#include "xrUICore/ui_base.h" +#include "ui_base.h" #include "doors_actor.h" #include "xrEngine/GameFont.h" diff --git a/src/xrGame/ai/trader/ai_trader.cpp b/src/xrGame/ai/trader/ai_trader.cpp index 9c811e530fb..f2fcdfd9e52 100644 --- a/src/xrGame/ai/trader/ai_trader.cpp +++ b/src/xrGame/ai/trader/ai_trader.cpp @@ -19,7 +19,7 @@ #include "Common/object_broker.h" #include "sound_player.h" #include "Level.h" -#include "xrScriptEngine/script_callback_ex.h" +#include "script_callback_ex.h" #include "game_object_space.h" #include "trader_animation.h" #include "xrServerEntities/clsid_game.h" diff --git a/src/xrGame/ai/trader/trader_animation.cpp b/src/xrGame/ai/trader/trader_animation.cpp index 8a1bbfd803a..16c00ac381a 100644 --- a/src/xrGame/ai/trader/trader_animation.cpp +++ b/src/xrGame/ai/trader/trader_animation.cpp @@ -1,7 +1,7 @@ #include "pch_script.h" #include "trader_animation.h" #include "ai_trader.h" -#include "xrScriptEngine/script_callback_ex.h" +#include "script_callback_ex.h" #include "game_object_space.h" ///////////////////////////////////////////////////////////////////////////////////////// diff --git a/src/xrGame/alife_storage_manager.cpp b/src/xrGame/alife_storage_manager.cpp index 61bbf28ba71..13fb837fbea 100644 --- a/src/xrGame/alife_storage_manager.cpp +++ b/src/xrGame/alife_storage_manager.cpp @@ -192,7 +192,7 @@ bool CALifeStorageManager::load(LPCSTR save_name_no_check) make_string("%s\nSaved game version mismatch or saved game is corrupted", file_name)); string512 temp; - strconcat(sizeof(temp), temp, StringTable().translate("st_loading_saved_game").c_str(), + strconcat(sizeof(temp), temp, CStringTable().translate("st_loading_saved_game").c_str(), "\"", save_name,SAVE_EXTENSION, "\""); g_pGamePersistent->SetLoadStageTitle(temp); diff --git a/src/xrGame/animation_script_callback.cpp b/src/xrGame/animation_script_callback.cpp index 884506f319f..280efa6b637 100644 --- a/src/xrGame/animation_script_callback.cpp +++ b/src/xrGame/animation_script_callback.cpp @@ -1,7 +1,7 @@ #include "pch_script.h" #include "animation_script_callback.h" -#include "xrScriptEngine/script_callback_ex.h" +#include "script_callback_ex.h" #include "gameobject.h" #include "game_object_space.h" #include "Include/xrRender/KinematicsAnimated.h" diff --git a/src/xrGame/attachable_item.cpp b/src/xrGame/attachable_item.cpp index e8c57f8383b..edff3556c76 100644 --- a/src/xrGame/attachable_item.cpp +++ b/src/xrGame/attachable_item.cpp @@ -12,7 +12,7 @@ #include "inventoryowner.h" #include "inventory.h" #include "xrEngine/xr_input.h" -#include "xrUICore/ui_base.h" +#include "ui_base.h" #include "xrEngine/GameFont.h" #ifdef DEBUG diff --git a/src/xrUICore/Callbacks/callback_info.h b/src/xrGame/callback_info.h similarity index 78% rename from src/xrUICore/Callbacks/callback_info.h rename to src/xrGame/callback_info.h index 5ca3e3dd343..7196298b8cc 100644 --- a/src/xrUICore/Callbacks/callback_info.h +++ b/src/xrGame/callback_info.h @@ -1,8 +1,9 @@ #pragma once -#include "xrScriptEngine/script_callback_ex.h" + +#include "script_callback_ex.h" class CUIWindow; -struct XRUICORE_API SCallbackInfo +struct SCallbackInfo { CScriptCallbackEx m_callback; fastdelegate::FastDelegate2 m_cpp_callback; @@ -12,7 +13,7 @@ struct XRUICORE_API SCallbackInfo SCallbackInfo() : m_control_ptr(NULL), m_event(-1){}; }; -struct XRUICORE_API event_comparer +struct event_comparer { CUIWindow* pWnd; s16 evt; diff --git a/src/xrGame/client_spawn_manager.h b/src/xrGame/client_spawn_manager.h index d9693472f47..1484dd1c5a7 100644 --- a/src/xrGame/client_spawn_manager.h +++ b/src/xrGame/client_spawn_manager.h @@ -9,7 +9,7 @@ #pragma once #include "alife_space.h" -#include "xrScriptEngine/script_callback_ex.h" +#include "script_callback_ex.h" class CGameObject; diff --git a/src/xrGame/console_commands.cpp b/src/xrGame/console_commands.cpp index 5a6fb1d774b..1938312e62f 100644 --- a/src/xrGame/console_commands.cpp +++ b/src/xrGame/console_commands.cpp @@ -32,7 +32,7 @@ #include "ui/UIOptConCom.h" #include "UIGameSP.h" #include "ui/UIActorMenu.h" -#include "xrUICore/Static/UIStatic.h" +#include "ui/UIStatic.h" #include "zone_effector.h" #include "GameTask.h" #include "MainMenu.h" @@ -86,7 +86,7 @@ extern BOOL g_ShowAnimationInfo; extern BOOL g_bShowHitSectors; // extern BOOL g_bDebugDumpPhysicsStep ; extern ESingleGameDifficulty g_SingleGameDifficulty; -XRUICORE_API extern BOOL g_show_wnd_rect2; +extern BOOL g_show_wnd_rect2; //----------------------------------------------------------- extern float g_fTimeFactor; extern BOOL b_toggle_weapon_aim; @@ -570,7 +570,7 @@ class CCC_ALifeSave : public IConsole_Command #endif StaticDrawableWrapper* _s = CurrentGameUI()->AddCustomStatic("game_saved", true); LPSTR save_name; - STRCONCAT(save_name, StringTable().translate("st_game_saved").c_str(), ": ", S); + STRCONCAT(save_name, CStringTable().translate("st_game_saved").c_str(), ": ", S); _s->wnd()->TextItemControl()->SetText(save_name); xr_strcat(S, ".dds"); diff --git a/src/xrGame/debug_text_tree.cpp b/src/xrGame/debug_text_tree.cpp index b20a7313224..359a391363a 100644 --- a/src/xrGame/debug_text_tree.cpp +++ b/src/xrGame/debug_text_tree.cpp @@ -9,7 +9,7 @@ #include "stdafx.h" #include "debug_text_tree.h" #include "Level.h" -#include "xrUICore/ui_base.h" +#include "ui_base.h" #include "xrEngine/GameFont.h" namespace debug diff --git a/src/xrGame/doors_door.cpp b/src/xrGame/doors_door.cpp index dce048b2682..ca2aad486cf 100644 --- a/src/xrGame/doors_door.cpp +++ b/src/xrGame/doors_door.cpp @@ -7,7 +7,7 @@ #include "pch_script.h" #include "doors_door.h" #include "physicobject.h" -#include "xrScriptEngine/script_callback_ex.h" +#include "script_callback_ex.h" #include "script_game_object.h" #include "doors.h" #include "doors_actor.h" diff --git a/src/xrGame/encyclopedia_article.cpp b/src/xrGame/encyclopedia_article.cpp index cab475002fc..872c2bc36e9 100644 --- a/src/xrGame/encyclopedia_article.cpp +++ b/src/xrGame/encyclopedia_article.cpp @@ -5,7 +5,7 @@ #include "stdafx.h" #include "encyclopedia_article.h" -#include "xrUICore/XML/xrUIXmlParser.h" +#include "ui/xrUIXmlParser.h" #include "ui/UIXmlInit.h" #include "ui/UIInventoryUtilities.h" #include "Common/object_broker.h" diff --git a/src/xrGame/encyclopedia_article.h b/src/xrGame/encyclopedia_article.h index 06492376ccb..06a6dcacc7b 100644 --- a/src/xrGame/encyclopedia_article.h +++ b/src/xrGame/encyclopedia_article.h @@ -9,7 +9,7 @@ #include "xml_str_id_loader.h" #include "shared_data.h" -#include "xrUICore/Static/UIStatic.h" +#include "ui\uistatic.h" ////////////////////////////////////////////////////////////////////////// // SInfoPortionData: данные для InfoProtion diff --git a/src/xrGame/enemy_manager.h b/src/xrGame/enemy_manager.h index 2a8b7199037..2a2d13a418b 100644 --- a/src/xrGame/enemy_manager.h +++ b/src/xrGame/enemy_manager.h @@ -11,7 +11,7 @@ #include "object_manager.h" #include "entity_alive.h" #include "custommonster.h" -#include "xrScriptEngine/script_callback_ex.h" +#include "script_callback_ex.h" class CAI_Stalker; diff --git a/src/xrGame/entity_alive.cpp b/src/xrGame/entity_alive.cpp index 621c4ce7d73..f11e0e93c47 100644 --- a/src/xrGame/entity_alive.cpp +++ b/src/xrGame/entity_alive.cpp @@ -16,7 +16,7 @@ #include "hit.h" #include "PHDestroyable.h" #include "CharacterPhysicsSupport.h" -#include "xrScriptEngine/script_callback_ex.h" +#include "script_callback_ex.h" #include "game_object_space.h" #include "material_manager.h" #include "game_base_space.h" diff --git a/src/xrGame/file_transfer.cpp b/src/xrGame/file_transfer.cpp index 966a93b4213..2364902a26f 100644 --- a/src/xrGame/file_transfer.cpp +++ b/src/xrGame/file_transfer.cpp @@ -3,7 +3,7 @@ #include "file_transfer.h" #include "Level.h" #include "xrServer.h" -#include "xrUICore/ui_base.h" +#include "ui_base.h" #include "xrNetServer/NET_Messages.h" #include "xrCore/buffer_vector.h" #ifdef DEBUG diff --git a/src/xrGame/game_cl_artefacthunt.cpp b/src/xrGame/game_cl_artefacthunt.cpp index d562b99a5ff..6c85f73a4e5 100644 --- a/src/xrGame/game_cl_artefacthunt.cpp +++ b/src/xrGame/game_cl_artefacthunt.cpp @@ -13,7 +13,7 @@ #include "ui/UIPdaWnd.h" #include "ui/UIMapDesc.h" #include "ui/UIMessageBoxEx.h" -#include "xrUICore/Static/UIStatic.h" +#include "ui/UIStatic.h" #include "xr_level_controller.h" #include "Artefact.h" #include "map_location.h" @@ -163,7 +163,7 @@ void game_cl_ArtefactHunt::net_import_state(NET_Packet& P) void game_cl_ArtefactHunt::TranslateGameMessage(u32 msg, NET_Packet& P) { - CStringTable& st = StringTable(); + CStringTable st; string512 Text; string512 tmp; // LPSTR Color_Teams[3] = {"%c[255,255,255,255]", "%c[255,64,255,64]", "%c[255,64,64,255]"}; @@ -349,6 +349,7 @@ void game_cl_ArtefactHunt::GetMapEntities(xr_vector& dst) void game_cl_ArtefactHunt::shedule_Update(u32 dt) { + CStringTable st; string1024 msg; inherited::shedule_Update(dt); @@ -390,7 +391,7 @@ void game_cl_ArtefactHunt::shedule_Update(u32 dt) { if (!(pCurBuyMenu && pCurBuyMenu->IsShown()) && !(pCurSkinMenu && pCurSkinMenu->IsShown())) { - xr_sprintf(msg, *StringTable().translate("mp_press_to_buy"), "B"); + xr_sprintf(msg, *st.translate("mp_press_to_buy"), "B"); if (m_game_ui) m_game_ui->SetBuyMsgCaption(msg); }; @@ -676,6 +677,7 @@ void game_cl_ArtefactHunt::UpdateMapLocations() bool game_cl_ArtefactHunt::NeedToSendReady_Spectator(int key, game_PlayerState* ps) { + CStringTable st; bool res = (GAME_PHASE_PENDING == Phase() && kWPN_FIRE == key) || ((kJUMP == key) && GAME_PHASE_INPROGRESS == Phase() && CanBeReady()); @@ -690,7 +692,7 @@ bool game_cl_ArtefactHunt::NeedToSendReady_Spectator(int key, game_PlayerState* { string1024 BuySpawnText; xr_sprintf( - BuySpawnText, *StringTable().translate("mp_press_yes2pay"), abs(local_player->money_for_round), abs(m_iSpawn_Cost)); + BuySpawnText, *st.translate("mp_press_yes2pay"), abs(local_player->money_for_round), abs(m_iSpawn_Cost)); m_game_ui->m_pBuySpawnMsgBox->SetText(BuySpawnText); if (m_bTeamSelected && m_bSkinSelected) diff --git a/src/xrGame/game_cl_base.cpp b/src/xrGame/game_cl_base.cpp index e4f281e1463..6a4df324fc2 100644 --- a/src/xrGame/game_cl_base.cpp +++ b/src/xrGame/game_cl_base.cpp @@ -213,6 +213,8 @@ void game_cl_GameState::net_import_update(NET_Packet& P) void game_cl_GameState::net_signal(NET_Packet& P) {} void game_cl_GameState::TranslateGameMessage(u32 msg, NET_Packet& P) { + CStringTable st; + string512 Text; constexpr char Color_Main[] = "%c[255,192,192,192]"; constexpr pcstr Color_Teams[3] = {"%c[255,255,240,190]", "%c[255,64,255,64]", "%c[255,64,64,255]"}; @@ -239,7 +241,7 @@ void game_cl_GameState::TranslateGameMessage(u32 msg, NET_Packet& P) players.insert(std::make_pair(newClientId, PS)); OnNewPlayerConnected(newClientId); } - xr_sprintf(Text, "%s%s %s%s", Color_Teams[0], PS->getName(), Color_Main, *StringTable().translate("mp_connected")); + xr_sprintf(Text, "%s%s %s%s", Color_Teams[0], PS->getName(), Color_Main, *st.translate("mp_connected")); if (CurrentGameUI()) CurrentGameUI()->CommonMessageOut(Text); //--------------------------------------- @@ -251,7 +253,7 @@ void game_cl_GameState::TranslateGameMessage(u32 msg, NET_Packet& P) string64 PlayerName; P.r_stringZ(PlayerName); - xr_sprintf(Text, "%s%s %s%s", Color_Teams[0], PlayerName, Color_Main, *StringTable().translate("mp_disconnected")); + xr_sprintf(Text, "%s%s %s%s", Color_Teams[0], PlayerName, Color_Main, *st.translate("mp_disconnected")); if (CurrentGameUI()) CurrentGameUI()->CommonMessageOut(Text); //--------------------------------------- @@ -263,7 +265,7 @@ void game_cl_GameState::TranslateGameMessage(u32 msg, NET_Packet& P) string64 PlayerName; P.r_stringZ(PlayerName); - xr_sprintf(Text, "%s%s %s%s", Color_Teams[0], PlayerName, Color_Main, *StringTable().translate("mp_entered_game")); + xr_sprintf(Text, "%s%s %s%s", Color_Teams[0], PlayerName, Color_Main, *st.translate("mp_entered_game")); if (CurrentGameUI()) CurrentGameUI()->CommonMessageOut(Text); } diff --git a/src/xrGame/game_cl_capture_the_artefact.cpp b/src/xrGame/game_cl_capture_the_artefact.cpp index 855695be67d..01b8e8c8a77 100644 --- a/src/xrGame/game_cl_capture_the_artefact.cpp +++ b/src/xrGame/game_cl_capture_the_artefact.cpp @@ -251,7 +251,7 @@ void game_cl_CaptureTheArtefact::UpdateMoneyIndicator() void game_cl_CaptureTheArtefact::TranslateGameMessage(u32 msg, NET_Packet& P) { - CStringTable& st = StringTable(); + CStringTable st; string1024 Text; // string512 tmp; // LPSTR Color_Teams[3] = {"%c[255,255,255,255]", "%c[255,64,255,64]", "%c[255,64,64,255]"}; @@ -1087,6 +1087,7 @@ bool game_cl_CaptureTheArtefact::NeedToSendReady_Actor(int key, game_PlayerState bool game_cl_CaptureTheArtefact::NeedToSendReady_Spectator(int key, game_PlayerState* ps) { + CStringTable st; bool res = inherited::NeedToSendReady_Spectator(key, ps); u32 gphase = Phase(); if ((gphase == GAME_PHASE_INPROGRESS) && (key == kJUMP) && (!m_game_ui->IsBuySpawnShown())) @@ -1237,6 +1238,8 @@ void game_cl_CaptureTheArtefact::OnVoteStart(NET_Packet& P) if (!m_game_ui) return; + CStringTable st; + u32 psize = P.B.count + 1; char* command = static_cast(_alloca(psize)); char* player = static_cast(_alloca(psize)); @@ -1286,7 +1289,7 @@ void game_cl_CaptureTheArtefact::OnVoteStart(NET_Packet& P) { if (!xr_strcmp(cmd_name, ttable[i][0])) { - pcstr ted_str = StringTable().translate(ttable[i][1]).c_str(); + pcstr ted_str = st.translate(ttable[i][1]).c_str(); VERIFY(ted_str); tcmd_len = xr_strlen(ted_str) + 1; tcmd_name = static_cast(_alloca(tcmd_len)); @@ -1307,9 +1310,9 @@ void game_cl_CaptureTheArtefact::OnVoteStart(NET_Packet& P) Msg("---Next cat iteration state: %s", vstr); #endif xr_strcat(vstr, vstr_size, " "); - xr_strcat(vstr, vstr_size, StringTable().translate(args[i]).c_str()); + xr_strcat(vstr, vstr_size, st.translate(args[i]).c_str()); } - pcstr t_vote_str = StringTable().translate("mp_voting_started").c_str(); + pcstr t_vote_str = st.translate("mp_voting_started").c_str(); VERIFY(t_vote_str); u32 fin_str_size = xr_strlen(t_vote_str) + vstr_size + xr_strlen(player) + 1; char* fin_str = static_cast(_alloca(fin_str_size)); @@ -1353,6 +1356,7 @@ void game_cl_CaptureTheArtefact::UpdateVotingTime(u32 current_time) { if (IsVotingEnabled() && IsVotingActive() && (m_dwVoteEndTime >= current_time)) { + CStringTable st; u32 TimeLeft = m_dwVoteEndTime - current_time; string1024 VoteTimeResStr; u32 SecsLeft = (TimeLeft % 60000) / 1000; @@ -1368,7 +1372,7 @@ void game_cl_CaptureTheArtefact::UpdateVotingTime(u32 current_time) NumAgreed++; } - xr_sprintf(VoteTimeResStr, StringTable().translate("mp_timeleft").c_str(), MinitsLeft, SecsLeft, + xr_sprintf(VoteTimeResStr, st.translate("mp_timeleft").c_str(), MinitsLeft, SecsLeft, float(NumAgreed) / players.size()); if (m_game_ui) m_game_ui->SetVoteTimeResultMsg(VoteTimeResStr); diff --git a/src/xrGame/game_cl_capture_the_artefact_captions_manager.cpp b/src/xrGame/game_cl_capture_the_artefact_captions_manager.cpp index 864fdfbe088..a6d7b4d35f2 100644 --- a/src/xrGame/game_cl_capture_the_artefact_captions_manager.cpp +++ b/src/xrGame/game_cl_capture_the_artefact_captions_manager.cpp @@ -49,6 +49,7 @@ void CTAGameClCaptionsManager::ShowInProgressCaptions() if (!control_entity) return; + CStringTable st; if (ps->team == static_cast(etSpectatorsTeam)) { VERIFY(smart_cast(control_entity)); @@ -97,10 +98,11 @@ void CTAGameClCaptionsManager::ShowPendingCaptions() {} void CTAGameClCaptionsManager::ShowScoreCaptions() { VERIFY(m_winner_team != etSpectatorsTeam); + CStringTable st; LPCSTR team_name = CTeamInfo::GetTeam_name(m_winner_team + 1); - u32 win_str_size = StringTable().translate("mp_team_wins").size() + xr_strlen(team_name) + 1; + u32 win_str_size = st.translate("mp_team_wins").size() + xr_strlen(team_name) + 1; char* win_str = static_cast(_alloca(win_str_size)); - xr_sprintf(win_str, win_str_size, StringTable().translate("mp_team_wins").c_str(), team_name); + xr_sprintf(win_str, win_str_size, st.translate("mp_team_wins").c_str(), team_name); parent_game_ui->SetRoundResultCaption(win_str); } @@ -174,7 +176,7 @@ u32 CTAGameClCaptionsManager::SetWarmupTime(u32 current_warmup_time, u32 current u32 time_remains = current_warmup_time - current_time; string64 time_str; - CStringTable& st = StringTable(); + CStringTable st; ConvertTime2String(time_str, time_remains); warmup_message[0] = 0; // bad style diff --git a/src/xrGame/game_cl_capture_the_artefact_messages_menu.cpp b/src/xrGame/game_cl_capture_the_artefact_messages_menu.cpp index f71c827dd02..e8e9e77c043 100644 --- a/src/xrGame/game_cl_capture_the_artefact_messages_menu.cpp +++ b/src/xrGame/game_cl_capture_the_artefact_messages_menu.cpp @@ -30,8 +30,9 @@ void game_cl_CaptureTheArtefact::OnSpeechMessage(NET_Packet& P) if (ps->team == local_player->team) { + CStringTable st; if (CurrentGameUI()) - CurrentGameUI()->m_pMessagesWnd->AddChatMessage(*StringTable().translate(*(pMMessage->pMessage)), ps->getName()); + CurrentGameUI()->m_pMessagesWnd->AddChatMessage(*st.translate(*(pMMessage->pMessage)), ps->getName()); if (!Level().MapManager().HasMapLocation(FRIEND_RADION_LOCATION, ps->GameID)) { @@ -59,7 +60,7 @@ void game_cl_CaptureTheArtefact::OnSpeechMessage(NET_Packet& P) { pMSound->mSound_Radio.play_at_pos(NULL, Fvector().set(0, 0, 0), sm_2D, 0); } - Msg("%s said: %s", ps->getName(), *StringTable().translate(pMMessage->pMessage)); + Msg("%s said: %s", ps->getName(), *CStringTable().translate(pMMessage->pMessage)); } else { diff --git a/src/xrGame/game_cl_deathmatch.cpp b/src/xrGame/game_cl_deathmatch.cpp index 4eb1cdf8078..c9235a54291 100644 --- a/src/xrGame/game_cl_deathmatch.cpp +++ b/src/xrGame/game_cl_deathmatch.cpp @@ -440,7 +440,7 @@ void game_cl_Deathmatch::OnConnected() void game_cl_Deathmatch::shedule_Update(u32 dt) { - CStringTable& st = StringTable(); + CStringTable st; inherited::shedule_Update(dt); @@ -800,7 +800,7 @@ bool game_cl_Deathmatch::OnKeyboardRelease(int key) #define MAX_VOTE_PARAMS 5 void game_cl_Deathmatch::OnVoteStart(NET_Packet& P) { - CStringTable& st = StringTable(); + CStringTable st; inherited::OnVoteStart(P); string1024 Command = ""; diff --git a/src/xrGame/game_cl_mp.cpp b/src/xrGame/game_cl_mp.cpp index 30eec354bef..81711d07590 100644 --- a/src/xrGame/game_cl_mp.cpp +++ b/src/xrGame/game_cl_mp.cpp @@ -14,8 +14,8 @@ #include "ui/UIChatWnd.h" #include "ui/UIGameLog.h" #include "ui/UIMainIngameWnd.h" -#include "xrUICore/Static/UIStatic.h" -#include "xrUICore/XML/UITextureMaster.h" +#include "ui/UIStatic.h" +#include "ui/UITextureMaster.h" #include "ui/UIVotingCategory.h" #include "ui/UIMPAdminMenu.h" #include "ui/UIVote.h" @@ -164,6 +164,7 @@ bool game_cl_mp::OnKeyboardPress(int key) if (inherited::OnKeyboardPress(key)) return true; + CStringTable st; if (kJUMP == key || kWPN_FIRE == key) { bool b_need_to_send_ready = false; @@ -224,7 +225,7 @@ bool game_cl_mp::OnKeyboardPress(int key) R_ASSERT(!pChatWnd->IsShown()); string512 prefix; xr_sprintf( - prefix, "%s> ", StringTable().translate((kCHAT_TEAM == key) ? "st_mp_say_to_team" : "st_mp_say_to_all").c_str()); + prefix, "%s> ", st.translate((kCHAT_TEAM == key) ? "st_mp_say_to_team" : "st_mp_say_to_all").c_str()); pChatWnd->ChatToAll(kCHAT == key); pChatWnd->SetEditBoxPrefix(prefix); pChatWnd->ShowDialog(false); @@ -248,7 +249,7 @@ bool game_cl_mp::OnKeyboardPress(int key) VotingBegin(); else OnCantVoteMsg( - StringTable().translate((IsVotingEnabled()) ? "st_mp_only_one_voting" : "st_mp_disabled_voting").c_str()); + st.translate((IsVotingEnabled()) ? "st_mp_only_one_voting" : "st_mp_disabled_voting").c_str()); } break; case kVOTE: @@ -258,9 +259,9 @@ bool game_cl_mp::OnKeyboardPress(int key) else { if (!IsVotingEnabled()) - OnCantVoteMsg(StringTable().translate("st_mp_disabled_voting").c_str()); + OnCantVoteMsg(st.translate("st_mp_disabled_voting").c_str()); else - OnCantVoteMsg(StringTable().translate("st_mp_no_current_voting").c_str()); + OnCantVoteMsg(st.translate("st_mp_no_current_voting").c_str()); } } break; @@ -346,6 +347,7 @@ constexpr char Color_Green[] = "%c[255,1,255,1]"; void game_cl_mp::TranslateGameMessage(u32 msg, NET_Packet& P) { string4096 Text; + CStringTable st; switch (msg) { @@ -356,7 +358,7 @@ void game_cl_mp::TranslateGameMessage(u32 msg, NET_Packet& P) break; case GAME_EVENT_VOTE_START: { - xr_sprintf(Text, "%s%s", Color_Main, *StringTable().translate("mp_voting_started_msg")); + xr_sprintf(Text, "%s%s", Color_Main, *st.translate("mp_voting_started_msg")); if (CurrentGameUI()) CurrentGameUI()->CommonMessageOut(Text); OnVoteStart(P); @@ -364,7 +366,7 @@ void game_cl_mp::TranslateGameMessage(u32 msg, NET_Packet& P) break; case GAME_EVENT_VOTE_STOP: { - xr_sprintf(Text, "%s%s", Color_Main, *StringTable().translate("mp_voting_broken")); + xr_sprintf(Text, "%s%s", Color_Main, *st.translate("mp_voting_broken")); if (CurrentGameUI()) CurrentGameUI()->CommonMessageOut(Text); @@ -375,7 +377,7 @@ void game_cl_mp::TranslateGameMessage(u32 msg, NET_Packet& P) { string4096 Reason; P.r_stringZ(Reason); - xr_sprintf(Text, "%s%s", Color_Main, *StringTable().translate(Reason)); + xr_sprintf(Text, "%s%s", Color_Main, *st.translate(Reason)); if (CurrentGameUI()) CurrentGameUI()->CommonMessageOut(Text); OnVoteEnd(P); @@ -412,7 +414,7 @@ void game_cl_mp::TranslateGameMessage(u32 msg, NET_Packet& P) { string1024 mess; P.r_stringZ(mess); - xr_sprintf(Text, "%s%s", Color_Red, *StringTable().translate(mess)); + xr_sprintf(Text, "%s%s", Color_Red, *st.translate(mess)); if (CurrentGameUI()) CurrentGameUI()->CommonMessageOut(Text); } @@ -537,11 +539,12 @@ void game_cl_mp::OnChatMessage(NET_Packet* P) P->r_s16(team); ///#ifdef DEBUG + CStringTable st; switch (team) { - case 0: Msg("%s: %s : %s", *StringTable().translate("mp_chat"), PlayerName.c_str(), ChatMsg.c_str()); break; - case 1: Msg("- %s: %s : %s", *StringTable().translate("mp_chat"), PlayerName.c_str(), ChatMsg.c_str()); break; - case 2: Msg("@ %s: %s : %s", *StringTable().translate("mp_chat"), PlayerName.c_str(), ChatMsg.c_str()); break; + case 0: Msg("%s: %s : %s", *st.translate("mp_chat"), PlayerName.c_str(), ChatMsg.c_str()); break; + case 1: Msg("- %s: %s : %s", *st.translate("mp_chat"), PlayerName.c_str(), ChatMsg.c_str()); break; + case 2: Msg("@ %s: %s : %s", *st.translate("mp_chat"), PlayerName.c_str(), ChatMsg.c_str()); break; } //#endif @@ -679,10 +682,11 @@ void game_cl_mp::OnPlayerVoted(game_PlayerState* ps) if (ps->m_bCurrentVoteAgreed == 2) return; + CStringTable st; string1024 resStr; xr_sprintf(resStr, "%s\"%s\" %s%s %s\"%s\"", Color_Teams[ps->team], ps->getName(), Color_Main, - *StringTable().translate("mp_voted"), ps->m_bCurrentVoteAgreed ? Color_Green : Color_Red, - *StringTable().translate(ps->m_bCurrentVoteAgreed ? "mp_voted_yes" : "mp_voted_no")); + *st.translate("mp_voted"), ps->m_bCurrentVoteAgreed ? Color_Green : Color_Red, + *st.translate(ps->m_bCurrentVoteAgreed ? "mp_voted_yes" : "mp_voted_no")); if (CurrentGameUI()) CurrentGameUI()->CommonMessageOut(resStr); } @@ -819,6 +823,7 @@ const ui_shader& game_cl_mp::GetRankIconsShader() void game_cl_mp::OnPlayerKilled(NET_Packet& P) { + CStringTable st; //----------------------------------------------------------- KILL_TYPE KillType = KILL_TYPE(P.r_u8()); u16 KilledID = P.r_u16(); @@ -869,13 +874,13 @@ void game_cl_mp::OnPlayerKilled(NET_Packet& P) KMS.m_initiator.m_rect.y1 = 202; KMS.m_initiator.m_rect.x2 = KMS.m_initiator.m_rect.x1 + 31; KMS.m_initiator.m_rect.y2 = KMS.m_initiator.m_rect.y1 + 30; - xr_sprintf(sWeapon, *StringTable().translate("mp_by_explosion")); + xr_sprintf(sWeapon, *st.translate("mp_by_explosion")); } else { KMS.m_initiator.m_rect = pIItem->GetKillMsgRect(); KMS.m_initiator.m_rect.rb.add(KMS.m_initiator.m_rect.lt); - xr_sprintf(sWeapon, "%s %s", StringTable().translate("mp_from").c_str(), pIItem->NameShort()); + xr_sprintf(sWeapon, "%s %s", st.translate("mp_from").c_str(), pIItem->NameShort()); } } else @@ -888,7 +893,7 @@ void game_cl_mp::OnPlayerKilled(NET_Packet& P) KMS.m_initiator.m_rect.y1 = 202; KMS.m_initiator.m_rect.x2 = KMS.m_initiator.m_rect.x1 + 31; KMS.m_initiator.m_rect.y2 = KMS.m_initiator.m_rect.y1 + 30; - xr_sprintf(sWeapon, *StringTable().translate("mp_by_anomaly")); + xr_sprintf(sWeapon, *st.translate("mp_by_anomaly")); } } } @@ -944,7 +949,7 @@ void game_cl_mp::OnPlayerKilled(NET_Packet& P) KMS.m_ext_info.m_rect.y2 = pBS->IconRects[0].y1 + pBS->IconRects[0].y2; }; - xr_sprintf(sSpecial, *StringTable().translate("mp_with_headshot")); + xr_sprintf(sSpecial, *st.translate("mp_with_headshot")); if (pOKiller && pOKiller == Level().CurrentViewEntity()) PlaySndMessage(ID_HEADSHOT); @@ -963,7 +968,7 @@ void game_cl_mp::OnPlayerKilled(NET_Packet& P) KMS.m_ext_info.m_rect.y2 = pBS->IconRects[0].y1 + pBS->IconRects[0].y2; }; - xr_sprintf(sSpecial, *StringTable().translate("mp_with_eyeshot")); + xr_sprintf(sSpecial, *st.translate("mp_with_eyeshot")); if (pOKiller && pOKiller == Level().CurrentViewEntity()) PlaySndMessage(ID_ASSASSIN); @@ -982,7 +987,7 @@ void game_cl_mp::OnPlayerKilled(NET_Packet& P) KMS.m_ext_info.m_rect.y2 = pBS->IconRects[0].y1 + pBS->IconRects[0].y2; }; - xr_sprintf(sSpecial, *StringTable().translate("mp_with_backstab")); + xr_sprintf(sSpecial, *st.translate("mp_with_backstab")); if (pOKiller && pOKiller == Level().CurrentViewEntity()) PlaySndMessage(ID_ASSASSIN); } @@ -1070,6 +1075,8 @@ extern void WritePlayerName_ToRegistry(LPSTR name); void game_cl_mp::OnPlayerChangeName(NET_Packet& P) { + CStringTable st; + u16 ObjID = P.r_u16(); s16 Team = P.r_s16(); string1024 OldName, NewName; @@ -1077,7 +1084,7 @@ void game_cl_mp::OnPlayerChangeName(NET_Packet& P) P.r_stringZ(NewName); string1024 resStr; - xr_sprintf(resStr, "%s\"%s\" %s%s %s\"%s\"", Color_Teams[Team], OldName, Color_Main, *StringTable().translate("mp_is_now"), + xr_sprintf(resStr, "%s\"%s\" %s%s %s\"%s\"", Color_Teams[Team], OldName, Color_Main, *st.translate("mp_is_now"), Color_Teams[Team], NewName); if (CurrentGameUI()) CurrentGameUI()->CommonMessageOut(resStr); @@ -1106,11 +1113,12 @@ void game_cl_mp::LoadSndMessages() void game_cl_mp::OnRankChanged(u8 OldRank) { + CStringTable st; string256 tmp; string1024 RankStr; xr_sprintf(tmp, "rank_%d", local_player->rank); - xr_sprintf(RankStr, "%s : %s", *StringTable().translate("mp_your_rank"), - *StringTable().translate(READ_IF_EXISTS(pSettings, r_string, tmp, "rank_name", ""))); + xr_sprintf(RankStr, "%s : %s", *st.translate("mp_your_rank"), + *st.translate(READ_IF_EXISTS(pSettings, r_string, tmp, "rank_name", ""))); if (CurrentGameUI()) CurrentGameUI()->CommonMessageOut(RankStr); #ifdef DEBUG @@ -1319,7 +1327,8 @@ void game_cl_mp::OnGameRoundStarted() { // xr_sprintf(Text, "%sRound started !!!",Color_Main); string512 Text; - xr_sprintf(Text, "%s%s", Color_Main, *StringTable().translate("mp_match_started")); + CStringTable st; + xr_sprintf(Text, "%s%s", Color_Main, *st.translate("mp_match_started")); if (CurrentGameUI()) CurrentGameUI()->CommonMessageOut(Text); OnSwitchPhase_InProgress(); diff --git a/src/xrGame/game_cl_mp.h b/src/xrGame/game_cl_mp.h index aafe618b4b3..6dae99f44d8 100644 --- a/src/xrGame/game_cl_mp.h +++ b/src/xrGame/game_cl_mp.h @@ -1,7 +1,7 @@ #pragma once #include "game_cl_base.h" -#include "xrUICore/ui_defs.h" +#include "ui_defs.h" #include "Spectator.h" #include "file_transfer.h" #include "screenshot_manager.h" diff --git a/src/xrGame/game_cl_mp_messages_menu.cpp b/src/xrGame/game_cl_mp_messages_menu.cpp index a495647721e..6b2bfdebbca 100644 --- a/src/xrGame/game_cl_mp_messages_menu.cpp +++ b/src/xrGame/game_cl_mp_messages_menu.cpp @@ -174,9 +174,10 @@ void game_cl_mp::OnSpeechMessage(NET_Packet& P) if (ps->team == local_player->team) { + CStringTable st; if (CurrentGameUI()) CurrentGameUI()->m_pMessagesWnd->AddChatMessage( - StringTable().translate(pMMessage->pMessage.c_str()).c_str(), ps->getName()); + st.translate(pMMessage->pMessage.c_str()).c_str(), ps->getName()); if (!Level().MapManager().HasMapLocation(FRIEND_RADION_LOCATION, ps->GameID)) { @@ -202,7 +203,7 @@ void game_cl_mp::OnSpeechMessage(NET_Packet& P) { pMSound->mSound_Radio.play_at_pos(NULL, Fvector().set(0, 0, 0), sm_2D, 0); } - Msg("%s said: %s", ps->getName(), *StringTable().translate(pMMessage->pMessage)); + Msg("%s said: %s", ps->getName(), *CStringTable().translate(pMMessage->pMessage)); } else { diff --git a/src/xrGame/game_cl_teamdeathmatch.cpp b/src/xrGame/game_cl_teamdeathmatch.cpp index 1690ad8df93..8217e142db9 100644 --- a/src/xrGame/game_cl_teamdeathmatch.cpp +++ b/src/xrGame/game_cl_teamdeathmatch.cpp @@ -109,6 +109,7 @@ void game_cl_TeamDeathmatch::net_import_state(NET_Packet& P) } void game_cl_TeamDeathmatch::TranslateGameMessage(u32 msg, NET_Packet& P) { + CStringTable st; string512 Text; // LPSTR Color_Teams[3] = {"%c[255,255,255,255]", "%c[255,64,255,64]", "%c[255,64,64,255]"}; char Color_Main[] = "%c[255,192,192,192]"; @@ -125,12 +126,12 @@ void game_cl_TeamDeathmatch::TranslateGameMessage(u32 msg, NET_Packet& P) xr_sprintf(Text, "%s%s %s%s %s%s", "", // no color - PlayerName, Color_Main, *StringTable().translate("mp_joined"), CTeamInfo::GetTeam_color_tag(int(Team)), + PlayerName, Color_Main, *st.translate("mp_joined"), CTeamInfo::GetTeam_color_tag(int(Team)), CTeamInfo::GetTeam_name(int(Team))); if (CurrentGameUI()) CurrentGameUI()->CommonMessageOut(Text); //--------------------------------------- - Msg("%s %s %s", PlayerName, *StringTable().translate("mp_joined"), CTeamInfo::GetTeam_name(int(Team))); + Msg("%s %s %s", PlayerName, *st.translate("mp_joined"), CTeamInfo::GetTeam_name(int(Team))); } break; @@ -146,12 +147,12 @@ void game_cl_TeamDeathmatch::TranslateGameMessage(u32 msg, NET_Packet& P) break; xr_sprintf(Text, "%s%s %s%s %s%s", CTeamInfo::GetTeam_color_tag(int(OldTeam)), pPlayer->getName(), Color_Main, - *StringTable().translate("mp_switched_to"), CTeamInfo::GetTeam_color_tag(int(NewTeam)), + *st.translate("mp_switched_to"), CTeamInfo::GetTeam_color_tag(int(NewTeam)), CTeamInfo::GetTeam_name(int(NewTeam))); if (CurrentGameUI()) CurrentGameUI()->CommonMessageOut(Text); //--------------------------------------- - Msg("%s *s %s", pPlayer->getName(), *StringTable().translate("mp_switched_to"), CTeamInfo::GetTeam_name(int(NewTeam))); + Msg("%s *s %s", pPlayer->getName(), *st.translate("mp_switched_to"), CTeamInfo::GetTeam_name(int(NewTeam))); } break; @@ -391,6 +392,7 @@ pcstr game_cl_TeamDeathmatch::getTeamSection(int Team) void game_cl_TeamDeathmatch::shedule_Update(u32 dt) { + CStringTable st; string512 msg; inherited::shedule_Update(dt); @@ -410,7 +412,7 @@ void game_cl_TeamDeathmatch::shedule_Update(u32 dt) { case GAME_PHASE_TEAM1_SCORES: { - xr_sprintf(msg, StringTable().translate("mp_team_wins").c_str(), CTeamInfo::GetTeam_name(1)); + xr_sprintf(msg, st.translate("mp_team_wins").c_str(), CTeamInfo::GetTeam_name(1)); m_game_ui->SetRoundResultCaption(msg); m_game_ui->UpdateTeamPanels(); @@ -421,7 +423,7 @@ void game_cl_TeamDeathmatch::shedule_Update(u32 dt) break; case GAME_PHASE_TEAM2_SCORES: { - xr_sprintf(msg, StringTable().translate("mp_team_wins").c_str(), CTeamInfo::GetTeam_name(2)); + xr_sprintf(msg, st.translate("mp_team_wins").c_str(), CTeamInfo::GetTeam_name(2)); m_game_ui->SetRoundResultCaption(msg); m_game_ui->UpdateTeamPanels(); @@ -449,7 +451,7 @@ void game_cl_TeamDeathmatch::shedule_Update(u32 dt) !local_player->testFlag(GAME_PLAYER_FLAG_VERY_VERY_DEAD)) { string1024 msg; - xr_sprintf(msg, *StringTable().translate("mp_press_to_buy"), "B"); + xr_sprintf(msg, *st.translate("mp_press_to_buy"), "B"); if (m_game_ui) m_game_ui->SetBuyMsgCaption(msg); m_bBuyEnabled = true; diff --git a/src/xrGame/game_news.h b/src/xrGame/game_news.h index bd0e16e60a5..904598fca6f 100644 --- a/src/xrGame/game_news.h +++ b/src/xrGame/game_news.h @@ -1,7 +1,7 @@ #pragma once #include "alife_space.h" -#include "xrEngine/StringTable/IStringTableDefs.h" +#include "string_table_defs.h" #include "Common/object_interfaces.h" #define DEFAULT_NEWS_SHOW_TIME 5000 diff --git a/src/xrGame/game_sv_base.cpp b/src/xrGame/game_sv_base.cpp index 0756f5ff8cb..ca0dc86256f 100644 --- a/src/xrGame/game_sv_base.cpp +++ b/src/xrGame/game_sv_base.cpp @@ -968,14 +968,15 @@ void game_sv_GameState::MapRotation_ListMaps() Msg("- Currently there are no any maps in list."); return; } + CStringTable st; Msg("- ----------- Maps ---------------"); for (u32 i = 0; i < m_pMapRotation_List.size(); i++) { SMapRot& R = m_pMapRotation_List[i]; if (i == 0) - Msg("~ %d. %s (%s) (current)", i + 1, StringTable().translate(R.map_name).c_str(), R.map_name.c_str()); + Msg("~ %d. %s (%s) (current)", i + 1, st.translate(R.map_name).c_str(), R.map_name.c_str()); else - Msg(" %d. %s (%s)", i + 1, StringTable().translate(R.map_name).c_str(), R.map_name.c_str()); + Msg(" %d. %s (%s)", i + 1, st.translate(R.map_name).c_str(), R.map_name.c_str()); } Msg("- --------------------------------"); }; diff --git a/src/xrGame/game_sv_capture_the_artefact.cpp b/src/xrGame/game_sv_capture_the_artefact.cpp index 877efc44f2b..3c0f4643bed 100644 --- a/src/xrGame/game_sv_capture_the_artefact.cpp +++ b/src/xrGame/game_sv_capture_the_artefact.cpp @@ -1383,7 +1383,7 @@ bool game_sv_CaptureTheArtefact::OnKillResult(KILL_RES KillResult, game_PlayerSt if (tmp_client) { LPSTR reason; - STRCONCAT(reason, StringTable().translate("st_kicked_by_server").c_str()); + STRCONCAT(reason, CStringTable().translate("st_kicked_by_server").c_str()); m_server->DisconnectClient(tmp_client, reason); } } diff --git a/src/xrGame/game_sv_mp.cpp b/src/xrGame/game_sv_mp.cpp index 0b49085e172..ba705430f04 100644 --- a/src/xrGame/game_sv_mp.cpp +++ b/src/xrGame/game_sv_mp.cpp @@ -1928,10 +1928,10 @@ void game_sv_mp::DumpOnlineStatistic() ini.w_u32(current_section.c_str(), "players_total_cnt", m_server->GetClientsCount()); - xr_sprintf(str_buff, "\"%s\"", StringTable().translate(Level().name().c_str()).c_str()); + xr_sprintf(str_buff, "\"%s\"", CStringTable().translate(Level().name().c_str()).c_str()); ini.w_string(current_section.c_str(), "current_map_name", str_buff); - xr_sprintf(str_buff, "%s", StringTable().translate(type_name()).c_str()); + xr_sprintf(str_buff, "%s", CStringTable().translate(type_name()).c_str()); ini.w_string(current_section.c_str(), "game_mode", str_buff); auto it = m_pMapRotation_List.begin(); @@ -1940,7 +1940,7 @@ void game_sv_mp::DumpOnlineStatistic() { string16 num_buf; xr_sprintf(num_buf, "%d", idx); - xr_sprintf(str_buff, "\"%s\"", StringTable().translate((*it).map_name.c_str()).c_str()); + xr_sprintf(str_buff, "\"%s\"", CStringTable().translate((*it).map_name.c_str()).c_str()); ini.w_string("map_rotation", num_buf, str_buff); } @@ -2130,10 +2130,10 @@ void game_sv_mp::DumpRoundStatistics() timestamp(str_current_time); ini.w_string(current_section.c_str(), "end_time", str_current_time); - xr_sprintf(str_buff, "%s", StringTable().translate(type_name()).c_str()); + xr_sprintf(str_buff, "%s", CStringTable().translate(type_name()).c_str()); ini.w_string(current_section.c_str(), "game_mode", str_buff); - xr_sprintf(str_buff, "\"%s\"", StringTable().translate(Level().name().c_str()).c_str()); + xr_sprintf(str_buff, "\"%s\"", CStringTable().translate(Level().name().c_str()).c_str()); ini.w_string(current_section.c_str(), "current_map_name", str_buff); xr_sprintf(str_buff, "\"%s\"", Level().name().c_str()); diff --git a/src/xrGame/game_sv_teamdeathmatch.cpp b/src/xrGame/game_sv_teamdeathmatch.cpp index 91188f6fde0..1ae9c0bf54d 100644 --- a/src/xrGame/game_sv_teamdeathmatch.cpp +++ b/src/xrGame/game_sv_teamdeathmatch.cpp @@ -413,7 +413,7 @@ void game_sv_TeamDeathmatch::OnPlayerKillPlayer(game_PlayerState* ps_killer, gam Msg("--- Kicking player %s", tmp_client->ps->getName()); #endif LPSTR reason; - STRCONCAT(reason, StringTable().translate("st_kicked_by_server").c_str()); + STRCONCAT(reason, CStringTable().translate("st_kicked_by_server").c_str()); m_server->DisconnectClient(tmp_client, reason); } } diff --git a/src/xrGame/hit_memory_manager.cpp b/src/xrGame/hit_memory_manager.cpp index 2befd17922f..27db4d6034a 100644 --- a/src/xrGame/hit_memory_manager.cpp +++ b/src/xrGame/hit_memory_manager.cpp @@ -12,7 +12,7 @@ #include "custommonster.h" #include "xrAICore/Navigation/ai_object_location.h" #include "xrAICore/Navigation/level_graph.h" -#include "xrScriptEngine/script_callback_ex.h" +#include "script_callback_ex.h" #include "script_game_object.h" #include "agent_manager.h" #include "agent_member_manager.h" diff --git a/src/xrGame/inventory_item.cpp b/src/xrGame/inventory_item.cpp index e2e4726f7fd..d3e853df966 100644 --- a/src/xrGame/inventory_item.cpp +++ b/src/xrGame/inventory_item.cpp @@ -93,8 +93,8 @@ void CInventoryItem::Load(LPCSTR section) self->GetSpatialData().type |= STYPE_VISIBLEFORAI; m_section_id._set(section); - m_name = StringTable().translate(pSettings->r_string(section, "inv_name")); - m_nameShort = StringTable().translate(pSettings->r_string(section, "inv_name_short")); + m_name = CStringTable().translate(pSettings->r_string(section, "inv_name")); + m_nameShort = CStringTable().translate(pSettings->r_string(section, "inv_name_short")); m_weight = pSettings->r_float(section, "inv_weight"); R_ASSERT(m_weight >= 0.f); @@ -103,7 +103,7 @@ void CInventoryItem::Load(LPCSTR section) u32 sl = pSettings->r_u32(section, "slot"); m_ItemCurrPlace.base_slot_id = (sl == -1) ? 0 : (sl + 1); - m_Description = StringTable().translate(pSettings->r_string(section, "description")); + m_Description = CStringTable().translate(pSettings->r_string(section, "description")); m_flags.set(Fbelt, READ_IF_EXISTS(pSettings, r_bool, section, "belt", FALSE)); m_can_trade = READ_IF_EXISTS(pSettings, r_bool, section, "can_trade", TRUE); diff --git a/src/xrGame/inventory_owner_info.cpp b/src/xrGame/inventory_owner_info.cpp index dafc764a4ad..498bdcd7c56 100644 --- a/src/xrGame/inventory_owner_info.cpp +++ b/src/xrGame/inventory_owner_info.cpp @@ -15,7 +15,7 @@ #include "Level.h" #include "infoportion.h" #include "alife_registry_wrappers.h" -#include "xrScriptEngine/script_callback_ex.h" +#include "script_callback_ex.h" #include "game_object_space.h" void CInventoryOwner::OnEvent(NET_Packet& P, u16 type) diff --git a/src/xrGame/inventory_upgrade.cpp b/src/xrGame/inventory_upgrade.cpp index 90f2c91b761..48159912728 100644 --- a/src/xrGame/inventory_upgrade.cpp +++ b/src/xrGame/inventory_upgrade.cpp @@ -29,8 +29,8 @@ void Upgrade::construct(const shared_str& upgrade_id, Group& parental_group, Man m_parent_group = &parental_group; // name : StringTable(); icon; description; - m_name = StringTable().translate(pSettings->r_string(id(), "name")); - m_description = StringTable().translate(pSettings->r_string(id(), "description")); + m_name = CStringTable().translate(pSettings->r_string(id(), "name")); + m_description = CStringTable().translate(pSettings->r_string(id(), "description")); m_icon._set(pSettings->r_string(id(), "icon")); // section -------------------------------------------------------------------------- diff --git a/src/xrGame/inventory_upgrade_property.cpp b/src/xrGame/inventory_upgrade_property.cpp index 270bdc11a96..cc7db0ef667 100644 --- a/src/xrGame/inventory_upgrade_property.cpp +++ b/src/xrGame/inventory_upgrade_property.cpp @@ -26,7 +26,7 @@ void Property::construct(shared_str const& property_id, Manager& manager_r) VERIFY2( pSettings->section_exist(m_id), make_string("Section of upgrade property [%s] does not exist!", m_id.c_str())); - m_name = StringTable().translate(pSettings->r_string(id(), "name")); + m_name = CStringTable().translate(pSettings->r_string(id(), "name")); m_icon._set(pSettings->r_string(id(), "icon")); // functor diff --git a/src/xrGame/level_debug.cpp b/src/xrGame/level_debug.cpp index e22e379bcb3..df3def0bb9b 100644 --- a/src/xrGame/level_debug.cpp +++ b/src/xrGame/level_debug.cpp @@ -9,7 +9,7 @@ // Lain: added #include "debug_text_tree.h" #include "ai/monsters/basemonster/base_monster.h" -#include "xrUICore/ui_base.h" +#include "ui_base.h" #endif #ifdef DEBUG diff --git a/src/xrGame/level_script.cpp b/src/xrGame/level_script.cpp index 68b21adb9a4..ca494f52bc8 100644 --- a/src/xrGame/level_script.cpp +++ b/src/xrGame/level_script.cpp @@ -573,7 +573,7 @@ void stop_tutorial() g_tutorial->Stop(); } -LPCSTR translate_string(LPCSTR str) { return *StringTable().translate(str); } +LPCSTR translate_string(LPCSTR str) { return *CStringTable().translate(str); } bool has_active_tutotial() { return (g_tutorial != NULL); } //Alundaio: namespace level exports extension diff --git a/src/xrGame/map_location.cpp b/src/xrGame/map_location.cpp index e5e29c73577..1d064e1bb0e 100644 --- a/src/xrGame/map_location.cpp +++ b/src/xrGame/map_location.cpp @@ -621,7 +621,7 @@ LPCSTR CMapLocation::GetHint() { return NULL; } - return StringTable().translate(m_hint).c_str(); + return CStringTable().translate(m_hint).c_str(); }; CMapSpotPointer* CMapLocation::GetSpotPointer(CMapSpot* sp) diff --git a/src/xrGame/map_manager.cpp b/src/xrGame/map_manager.cpp index 91ef1d68759..7cfa9b3cae2 100644 --- a/src/xrGame/map_manager.cpp +++ b/src/xrGame/map_manager.cpp @@ -10,7 +10,7 @@ #include "GameTaskManager.h" #include "xrServer.h" #include "game_object_space.h" -#include "xrScriptEngine/script_callback_ex.h" +#include "script_callback_ex.h" struct FindLocationBySpotID { diff --git a/src/xrGame/map_spot.cpp b/src/xrGame/map_spot.cpp index 85758f89c8a..a597c57afb6 100644 --- a/src/xrGame/map_spot.cpp +++ b/src/xrGame/map_spot.cpp @@ -8,7 +8,7 @@ #include "ui/UIInventoryUtilities.h" #include "xrEngine/xr_object.h" #include "Common/object_broker.h" -#include "xrUICore/XML/UITextureMaster.h" +#include "ui/UITextureMaster.h" #include "ui/UIHelper.h" #include "Include/xrRender/UIShader.h" diff --git a/src/xrGame/map_spot.h b/src/xrGame/map_spot.h index eb0e8435bd9..832e2594657 100644 --- a/src/xrGame/map_spot.h +++ b/src/xrGame/map_spot.h @@ -1,6 +1,6 @@ #pragma once -#include "xrUICore/Static/UIStatic.h" +#include "ui/UIStatic.h" #include "alife_space.h" class CMapLocation; diff --git a/src/xrGame/mixed_delegate.h b/src/xrGame/mixed_delegate.h index 0863d553dd0..3b6ef79fdf0 100644 --- a/src/xrGame/mixed_delegate.h +++ b/src/xrGame/mixed_delegate.h @@ -4,7 +4,7 @@ #include "xrCore/fastdelegate.h" //#include "pch_script.h" // Don't include PCH headers from a header. It frequently creates circular dependencies! -#include "xrScriptEngine/script_callback_ex.h" +#include "script_callback_ex.h" #include "mixed_delegate_unique_tags.h" template diff --git a/src/xrGame/patrol_path_manager.cpp b/src/xrGame/patrol_path_manager.cpp index daa7501f53d..3d6aa6a1cda 100644 --- a/src/xrGame/patrol_path_manager.cpp +++ b/src/xrGame/patrol_path_manager.cpp @@ -15,7 +15,7 @@ #include "xrScriptEngine/script_engine.hpp" #include "xrAICore/Navigation/ai_object_location.h" #include "script_entity_space.h" -#include "xrScriptEngine/script_callback_ex.h" +#include "script_callback_ex.h" #include "game_object_space.h" #include "xrAICore/Navigation/level_graph.h" diff --git a/src/xrGame/patrol_path_manager.h b/src/xrGame/patrol_path_manager.h index b8b11c982f9..a689ee6b547 100644 --- a/src/xrGame/patrol_path_manager.h +++ b/src/xrGame/patrol_path_manager.h @@ -12,7 +12,7 @@ #include "xrScriptEngine/script_engine.hpp" #include "xrAICore/Navigation/PatrolPath/patrol_path_storage.h" #include "xrAICore/Navigation/PatrolPath/patrol_path.h" -#include "xrScriptEngine/script_callback_ex.h" +#include "script_callback_ex.h" template class CScriptCallbackEx; diff --git a/src/xrGame/player_hud.cpp b/src/xrGame/player_hud.cpp index bab070038d3..e6aeb4b3e71 100644 --- a/src/xrGame/player_hud.cpp +++ b/src/xrGame/player_hud.cpp @@ -1,7 +1,7 @@ #include "stdafx.h" #include "player_hud.h" #include "HudItem.h" -#include "xrUICore/ui_base.h" +#include "ui_base.h" #include "actor.h" #include "physic_item.h" #include "static_cast_checked.hpp" diff --git a/src/xrGame/player_hud_tune.cpp b/src/xrGame/player_hud_tune.cpp index 9a43539a0f0..898b99c558f 100644 --- a/src/xrGame/player_hud_tune.cpp +++ b/src/xrGame/player_hud_tune.cpp @@ -8,7 +8,7 @@ #include "xrEngine/Effector.h" #include "xrEngine/CameraManager.h" #include "xrEngine/FDemoRecord.h" -#include "xrUICore/ui_base.h" +#include "ui_base.h" #include "debug_renderer.h" #include "xrEngine/GameFont.h" diff --git a/src/xrGame/saved_game_wrapper.cpp b/src/xrGame/saved_game_wrapper.cpp index a5dee356cbe..771de54ab4f 100644 --- a/src/xrGame/saved_game_wrapper.cpp +++ b/src/xrGame/saved_game_wrapper.cpp @@ -164,7 +164,7 @@ CSavedGameWrapper::CSavedGameWrapper(LPCSTR saved_game_name) if (graph.header().level_exist(m_level_id)) m_level_name = graph.header().level(m_level_id).name(); else - m_level_name = StringTable().translate("ui_st_error"); + m_level_name = CStringTable().translate("ui_st_error"); } chunk->close(); diff --git a/src/xrScriptEngine/script_callback_ex.h b/src/xrGame/script_callback_ex.h similarity index 99% rename from src/xrScriptEngine/script_callback_ex.h rename to src/xrGame/script_callback_ex.h index 2eb2e0637c8..af5ffbb43c1 100644 --- a/src/xrScriptEngine/script_callback_ex.h +++ b/src/xrGame/script_callback_ex.h @@ -7,6 +7,8 @@ //////////////////////////////////////////////////////////////////////////// #pragma once + +#include "ai_space.h" #include "xrScriptEngine/script_engine.hpp" IC bool compare_safe(const luabind::object& o1, const luabind::object& o2) diff --git a/src/xrGame/script_entity.cpp b/src/xrGame/script_entity.cpp index 00c56cf0793..cd0e4322109 100644 --- a/src/xrGame/script_entity.cpp +++ b/src/xrGame/script_entity.cpp @@ -26,7 +26,7 @@ #include "visual_memory_manager.h" #include "xrAICore/Navigation/ai_object_location.h" #include "movement_manager.h" -#include "xrScriptEngine/script_callback_ex.h" +#include "script_callback_ex.h" #include "game_object_space.h" void __stdcall ActionCallback(IKinematics* tpKinematics); diff --git a/src/xrGame/script_game_object3.cpp b/src/xrGame/script_game_object3.cpp index 0d77c319bb8..622951b2e88 100644 --- a/src/xrGame/script_game_object3.cpp +++ b/src/xrGame/script_game_object3.cpp @@ -46,7 +46,7 @@ #include "CharacterPhysicsSupport.h" #include "player_hud.h" #include "eatable_item.h" -#include "xrScriptEngine/script_callback_ex.h" +#include "script_callback_ex.h" #include "xrEngine/feel_touch.h" #endif //-Alundaio diff --git a/src/xrGame/script_game_object_inventory_owner.cpp b/src/xrGame/script_game_object_inventory_owner.cpp index e216aa37bff..ae77430195e 100644 --- a/src/xrGame/script_game_object_inventory_owner.cpp +++ b/src/xrGame/script_game_object_inventory_owner.cpp @@ -36,7 +36,7 @@ #include "stalker_animation_manager.h" #include "CameraFirstEye.h" #include "stalker_movement_manager_smart_cover.h" -#include "xrScriptEngine/script_callback_ex.h" +#include "script_callback_ex.h" #include "memory_manager.h" #include "enemy_manager.h" #include "ai/stalker/ai_stalker_impl.h" diff --git a/src/xrGame/script_game_object_smart_covers.cpp b/src/xrGame/script_game_object_smart_covers.cpp index 183e8e7badc..e7db00f05b0 100644 --- a/src/xrGame/script_game_object_smart_covers.cpp +++ b/src/xrGame/script_game_object_smart_covers.cpp @@ -11,7 +11,7 @@ #include "script_game_object_impl.h" #include "ai/stalker/ai_stalker.h" #include "stalker_movement_manager_smart_cover.h" -#include "xrScriptEngine/script_callback_ex.h" +#include "script_callback_ex.h" #include "smart_cover.h" bool CScriptGameObject::use_smart_covers_only() const diff --git a/src/xrGame/script_game_object_use.cpp b/src/xrGame/script_game_object_use.cpp index d0aca0c0efb..d53d875f4fb 100644 --- a/src/xrGame/script_game_object_use.cpp +++ b/src/xrGame/script_game_object_use.cpp @@ -6,7 +6,7 @@ #include "stalker_planner.h" #include "ai/stalker/ai_stalker.h" #include "searchlight.h" -#include "xrScriptEngine/script_callback_ex.h" +#include "script_callback_ex.h" #include "game_object_space.h" #include "memory_manager.h" #include "enemy_manager.h" diff --git a/src/xrGame/script_zone.cpp b/src/xrGame/script_zone.cpp index eb714ba0cda..712f872fef8 100644 --- a/src/xrGame/script_zone.cpp +++ b/src/xrGame/script_zone.cpp @@ -11,7 +11,7 @@ #include "script_game_object.h" #include "xrserver_objects_alife_monsters.h" #include "xrEngine/xr_collide_form.h" -#include "xrScriptEngine/script_callback_ex.h" +#include "script_callback_ex.h" #include "game_object_space.h" #ifdef DEBUG diff --git a/src/xrGame/smart_cover_planner_target_selector.h b/src/xrGame/smart_cover_planner_target_selector.h index 74b4b607395..89e442aa863 100644 --- a/src/xrGame/smart_cover_planner_target_selector.h +++ b/src/xrGame/smart_cover_planner_target_selector.h @@ -11,7 +11,7 @@ #include "Common/Noncopyable.hpp" #include "smart_cover_detail.h" #include "action_planner_action.h" -#include "xrScriptEngine/script_callback_ex.h" +#include "script_callback_ex.h" namespace smart_cover { diff --git a/src/xrGame/space_restrictor.cpp b/src/xrGame/space_restrictor.cpp index 8d35c078223..4a9aa6745be 100644 --- a/src/xrGame/space_restrictor.cpp +++ b/src/xrGame/space_restrictor.cpp @@ -217,7 +217,7 @@ bool CSpaceRestrictor::prepared_inside(const Fsphere& sphere) const #ifdef DEBUG #include "customzone.h" -#include "xrUICore/ui_base.h" +#include "ui_base.h" extern Flags32 dbg_net_Draw_Flags; diff --git a/src/xrGame/stalker_animation_manager_update.cpp b/src/xrGame/stalker_animation_manager_update.cpp index 5eb8f00f633..13b0829ba65 100644 --- a/src/xrGame/stalker_animation_manager_update.cpp +++ b/src/xrGame/stalker_animation_manager_update.cpp @@ -10,7 +10,7 @@ #include "stalker_animation_manager.h" #include "ai/stalker/ai_stalker.h" #include "game_object_space.h" -#include "xrScriptEngine/script_callback_ex.h" +#include "script_callback_ex.h" #include "xrEngine/profiler.h" #include "stalker_movement_manager_smart_cover.h" diff --git a/src/xrGame/stalker_animation_script.cpp b/src/xrGame/stalker_animation_script.cpp index 1951225fb4a..f4b71d679ee 100644 --- a/src/xrGame/stalker_animation_script.cpp +++ b/src/xrGame/stalker_animation_script.cpp @@ -11,7 +11,7 @@ #include "ai/stalker/ai_stalker.h" #include "xrScriptEngine/script_engine.hpp" #include "game_object_space.h" -#include "xrScriptEngine/script_callback_ex.h" +#include "script_callback_ex.h" #include "ai_space.h" void CStalkerAnimationManager::script_play_callback(CBlend* blend) diff --git a/src/xrGame/string_table.cpp b/src/xrGame/string_table.cpp index b817b1b6b87..68b9ec08515 100644 --- a/src/xrGame/string_table.cpp +++ b/src/xrGame/string_table.cpp @@ -1,19 +1,13 @@ #include "stdafx.h" #include "string_table.h" -#include "xrUICore/XML/xrUIXmlParser.h" -#include "xr_level_controller.h" -CStringTable& StringTable() { return *((CStringTable*)gStringTable); } +#include "ui/xrUIXmlParser.h" +#include "xr_level_controller.h" STRING_TABLE_DATA* CStringTable::pData = NULL; BOOL CStringTable::m_bWriteErrorsToLog = FALSE; -CStringTable::CStringTable() -{ - pData = nullptr; -} - -CStringTable::~CStringTable() { Destroy(); } +CStringTable::CStringTable() { Init(); } void CStringTable::Destroy() { xr_delete(pData); } void CStringTable::rescan() { @@ -102,11 +96,13 @@ void CStringTable::ReparseKeyBindings() STRING_VALUE CStringTable::ParseLine(LPCSTR str, LPCSTR skey, bool bFirst) { + // LPCSTR str = "1 $$action_left$$ 2 $$action_right$$ 3 $$action_left$$ 4"; xr_string res; int k = 0; const char* b; #define ACTION_STR "$$ACTION_" +//. int LEN = (int)xr_strlen(ACTION_STR); #define LEN 9 string256 buff; diff --git a/src/xrGame/string_table.h b/src/xrGame/string_table.h index 1bc9ed8c773..c25bcd2a8bf 100644 --- a/src/xrGame/string_table.h +++ b/src/xrGame/string_table.h @@ -3,7 +3,7 @@ ////////////////////////////////////////////////////////////////////////// #pragma once -#include "xrEngine/StringTable/IStringTable.h" +#include "string_table_defs.h" #include "xrCommon/xr_map.h" using STRING_TABLE_MAP = xr_map; @@ -17,13 +17,11 @@ struct STRING_TABLE_DATA STRING_TABLE_MAP m_string_key_binding; }; -class CStringTable : public IStringTable +class CStringTable { public: CStringTable(); - virtual ~CStringTable(); - void Init(); static void Destroy(); STRING_VALUE translate(const STRING_ID& str_id) const; @@ -33,9 +31,8 @@ class CStringTable : public IStringTable static void ReparseKeyBindings(); private: + void Init(); void Load(LPCSTR xml_file); static STRING_VALUE ParseLine(LPCSTR str, LPCSTR key, bool bFirst); static STRING_TABLE_DATA* pData; }; - -CStringTable& StringTable(); diff --git a/src/xrEngine/StringTable/IStringTableDefs.h b/src/xrGame/string_table_defs.h similarity index 59% rename from src/xrEngine/StringTable/IStringTableDefs.h rename to src/xrGame/string_table_defs.h index e6050ded88b..aad68a952db 100644 --- a/src/xrEngine/StringTable/IStringTableDefs.h +++ b/src/xrGame/string_table_defs.h @@ -2,4 +2,7 @@ #include "xrCore/xrstring.h" typedef shared_str STRING_ID; +//. typedef int STRING_INDEX; typedef shared_str STRING_VALUE; + +//. #define NO_STRING STRING_INDEX(-1) diff --git a/src/xrGame/trade.cpp b/src/xrGame/trade.cpp index 5090350d752..57718c6a36c 100644 --- a/src/xrGame/trade.cpp +++ b/src/xrGame/trade.cpp @@ -9,7 +9,7 @@ #include "character_info.h" #include "relation_registry.h" #include "Level.h" -#include "xrScriptEngine/script_callback_ex.h" +#include "script_callback_ex.h" #include "script_game_object.h" #include "game_object_space.h" diff --git a/src/xrGame/trade2.cpp b/src/xrGame/trade2.cpp index 93f53c5b067..acc43127a3d 100644 --- a/src/xrGame/trade2.cpp +++ b/src/xrGame/trade2.cpp @@ -9,7 +9,7 @@ #include "character_info.h" #include "relation_registry.h" #include "Level.h" -#include "xrScriptEngine/script_callback_ex.h" +#include "script_callback_ex.h" #include "script_game_object.h" #include "game_object_space.h" #include "trade_parameters.h" diff --git a/src/xrGame/ui/ArtefactDetectorUI.cpp b/src/xrGame/ui/ArtefactDetectorUI.cpp index fdb7d1c561b..daca4624dd0 100644 --- a/src/xrGame/ui/ArtefactDetectorUI.cpp +++ b/src/xrGame/ui/ArtefactDetectorUI.cpp @@ -1,7 +1,7 @@ #include "stdafx.h" #include "ArtefactDetectorUI.h" #include "UIXmlInit.h" -#include "xrUICore/XML/xrUIXmlParser.h" +#include "xrUIXmlParser.h" void CUIDetectorWave::SetVelocity(float v) { m_curr_v = v; } void CUIDetectorWave::Update() diff --git a/src/xrGame/ui/ArtefactDetectorUI.h b/src/xrGame/ui/ArtefactDetectorUI.h index afab27f389d..ec6ef7f0a68 100644 --- a/src/xrGame/ui/ArtefactDetectorUI.h +++ b/src/xrGame/ui/ArtefactDetectorUI.h @@ -1,5 +1,5 @@ #pragma once -#include "xrUICore/Windows/UIFrameLineWnd.h" +#include "UIFrameLineWnd.h" class CUIStatic; class CUIFrameLineWnd; diff --git a/src/xrGame/ui/ChangeWeatherDialog.cpp b/src/xrGame/ui/ChangeWeatherDialog.cpp index ca0a63bc357..44e7f824ebc 100644 --- a/src/xrGame/ui/ChangeWeatherDialog.cpp +++ b/src/xrGame/ui/ChangeWeatherDialog.cpp @@ -1,7 +1,7 @@ #include "stdafx.h" #include "ChangeWeatherDialog.hpp" #include "UIXmlInit.h" -#include "xrUICore/Buttons/UI3tButton.h" +#include "UI3tButton.h" #include "game_cl_teamdeathmatch.h" #include "UIKickPlayer.h" #include "UIChangeMap.h" diff --git a/src/xrGame/ui/FactionState.h b/src/xrGame/ui/FactionState.h index fda72446858..7d17be53f16 100644 --- a/src/xrGame/ui/FactionState.h +++ b/src/xrGame/ui/FactionState.h @@ -6,7 +6,7 @@ //////////////////////////////////////////////////////////////////////////// #pragma once -#include "xrUICore/Windows/UIWindow.h" +#include "UIWindow.h" class FactionState { diff --git a/src/xrGame/ui/FractionState.h b/src/xrGame/ui/FractionState.h index 89de1cc1d23..3f8b3b0fd3a 100644 --- a/src/xrGame/ui/FractionState.h +++ b/src/xrGame/ui/FractionState.h @@ -7,7 +7,7 @@ //////////////////////////////////////////////////////////////////////////// #pragma once -#include "xrUICore/Windows/UIWindow.h" +#include "UIWindow.h" class FractionState { diff --git a/src/xrGame/ui/KillMessageStruct.h b/src/xrGame/ui/KillMessageStruct.h index 1741d33f437..7d6c27819f6 100644 --- a/src/xrGame/ui/KillMessageStruct.h +++ b/src/xrGame/ui/KillMessageStruct.h @@ -7,7 +7,7 @@ #pragma once -#include "xrUICore/ui_defs.h" +#include "ui_defs.h" struct ColoredName { diff --git a/src/xrGame/ui/MMSound.cpp b/src/xrGame/ui/MMSound.cpp index 61a6495b3b7..4e0ad886998 100644 --- a/src/xrGame/ui/MMSound.cpp +++ b/src/xrGame/ui/MMSound.cpp @@ -1,7 +1,7 @@ #include "StdAfx.h" #include "MMSound.h" -#include "xrUICore/XML/xrUIXmlParser.h" +#include "xrUIXmlParser.h" CMMSound::CMMSound() {} CMMSound::~CMMSound() { all_Stop(); } diff --git a/src/xrGame/ui/Restrictions.cpp b/src/xrGame/ui/Restrictions.cpp index 27e66633e87..42c8801dfbd 100644 --- a/src/xrGame/ui/Restrictions.cpp +++ b/src/xrGame/ui/Restrictions.cpp @@ -74,7 +74,7 @@ void CRestrictions::InitGroups() xr_sprintf(rank, "rank_%d", i); AddRestriction4rank(i, pSettings->r_string(rank, "amount_restriction")); - m_names[i] = StringTable().translate(pSettings->r_string(rank, "rank_name")); + m_names[i] = CStringTable().translate(pSettings->r_string(rank, "rank_name")); } #ifndef MASTER_GOLD diff --git a/src/xrGame/ui/ServerList.cpp b/src/xrGame/ui/ServerList.cpp index 724a60efa47..47937be527f 100644 --- a/src/xrGame/ui/ServerList.cpp +++ b/src/xrGame/ui/ServerList.cpp @@ -3,9 +3,9 @@ #include "UIXmlInit.h" #include "string_table.h" #include "xrEngine/xr_ioconsole.h" -#include "xrUICore/EditBox/UIEditBox.h" +#include "UIEditBox.h" #include "UIMessageBoxEx.h" -#include "xrUICore/MessageBox/UIMessageBox.h" +#include "UIMessageBox.h" #include "TeamInfo.h" #include "MainMenu.h" #include "login_manager.h" @@ -209,58 +209,63 @@ void CServerList::AddServerDetail(const GameInfo& info) void CServerList::AddBoolED(const char* keyName, bool value) { + CStringTable st; AddServerDetail( - GameInfo(*StringTable().translate(keyName), value ? *StringTable().translate("mp_si_enabled") : - *StringTable().translate("mp_si_disabled"))); + GameInfo(*st.translate(keyName), value ? *st.translate("mp_si_enabled") : *st.translate("mp_si_disabled"))); } void CServerList::AddBoolYN(const char* keyName, bool value) { - AddServerDetail(GameInfo(*StringTable().translate(keyName), value ? *StringTable().translate("mp_si_yes") : - *StringTable().translate("mp_si_no"))); + CStringTable st; + AddServerDetail(GameInfo(*st.translate(keyName), value ? *st.translate("mp_si_yes") : *st.translate("mp_si_no"))); } void CServerList::AddBoolKeyED(void* s, const char* keyName, int k) { AddBoolED(keyName, browser().GetBool(s, k)); } void CServerList::AddBoolKeyYN(void* s, const char* keyName, int k) { AddBoolYN(keyName, browser().GetBool(s, k)); } void CServerList::AddIntKey(void* s, const char* keyName, int k) { + CStringTable st; string256 tmp; xr_sprintf(tmp, "%d", browser().GetInt(s, k)); - AddServerDetail(GameInfo(*StringTable().translate(keyName), tmp)); + AddServerDetail(GameInfo(*st.translate(keyName), tmp)); } void CServerList::AddIntKeyN(void* s, float m, const char* keyName, const char* suffix, int k) { + CStringTable st; if (browser().GetInt(s, k)) { string256 tmp; xr_sprintf(tmp, "%d%s", int(browser().GetInt(s, k) * m), suffix); - AddServerDetail(GameInfo(*StringTable().translate(keyName), tmp)); + AddServerDetail(GameInfo(*st.translate(keyName), tmp)); } else - AddServerDetail(GameInfo(*StringTable().translate(keyName), *StringTable().translate("mp_si_no"))); + AddServerDetail(GameInfo(*st.translate(keyName), *st.translate("mp_si_no"))); } void CServerList::AddTimeKey(void* s, const char* keyName, const char* format, const char* suffix, int k) { + CStringTable st; if (browser().GetInt(s, k)) { string256 tmp; - xr_sprintf(tmp, format, browser().GetFloat(s, k), *StringTable().translate(suffix)); - AddServerDetail(GameInfo(*StringTable().translate(keyName), tmp)); + xr_sprintf(tmp, format, browser().GetFloat(s, k), *st.translate(suffix)); + AddServerDetail(GameInfo(*st.translate(keyName), tmp)); } else - AddServerDetail(GameInfo(*StringTable().translate(keyName), *StringTable().translate("mp_si_no"))); + AddServerDetail(GameInfo(*st.translate(keyName), *st.translate("mp_si_no"))); } void CServerList::AddString(const char* key, const char* value) { - AddServerDetail(GameInfo(*StringTable().translate(key), value)); + CStringTable st; + AddServerDetail(GameInfo(*st.translate(key), value)); } void CServerList::AddStringSt(const char* key, const char* value) { - AddServerDetail(GameInfo(*StringTable().translate(key), *StringTable().translate(value))); + CStringTable st; + AddServerDetail(GameInfo(*st.translate(key), *st.translate(value))); } void CServerList::FillUpDetailedServerInfo() @@ -295,7 +300,7 @@ void CServerList::FillUpDetailedServerInfo() continue; if (!t1) // add header { - STRCONCAT(_buff, StringTable().translate("ui_st_team").c_str(), "\"", + STRCONCAT(_buff, CStringTable().translate("ui_st_team").c_str(), "\"", CTeamInfo::GetTeam1_name().c_str(), "\""); pItemAdv = m_list[LST_PLAYERS].AddItem(); pItemAdv->SetTextColor(m_list[LST_PLAYERS].GetTextColor()); @@ -326,7 +331,7 @@ void CServerList::FillUpDetailedServerInfo() continue; if (!t2) { - STRCONCAT(_buff, StringTable().translate("ui_st_team").c_str(), "\"", + STRCONCAT(_buff, CStringTable().translate("ui_st_team").c_str(), "\"", CTeamInfo::GetTeam2_name().c_str(), "\""); m_list[LST_PLAYERS].AddTextItem(_buff); t2 = true; @@ -350,7 +355,7 @@ void CServerList::FillUpDetailedServerInfo() continue; if (!spect) { - pItemAdv = m_list[LST_PLAYERS].AddTextItem(StringTable().translate("mp_spectator").c_str()); + pItemAdv = m_list[LST_PLAYERS].AddTextItem(CStringTable().translate("mp_spectator").c_str()); spect = true; } pItemAdv = m_list[LST_PLAYERS].AddItem(); @@ -383,7 +388,7 @@ void CServerList::FillUpDetailedServerInfo() pItemAdv->AddTextField(buf, m_header2[3].GetWidth()); } } - + CStringTable st; void* sv = browser().GetServerByIndex(serverIndex); AddString("mp_si_servername", srvInfo.m_ServerName); AddString("mp_si_version", srvInfo.m_ServerVersion); diff --git a/src/xrGame/ui/ServerList.h b/src/xrGame/ui/ServerList.h index 114001347bb..e4105b783d3 100644 --- a/src/xrGame/ui/ServerList.h +++ b/src/xrGame/ui/ServerList.h @@ -1,13 +1,13 @@ #pragma once -#include "xrUICore/Windows/UIWindow.h" +#include "UIWindow.h" -#include "xrUICore/ListBox/UIListBox.h" +#include "UIListBox.h" #include "UIListItemServer.h" -#include "xrUICore/Windows/UIFrameWindow.h" -#include "xrUICore/Windows/UIFrameLineWnd.h" -#include "xrUICore/EditBox/UIEditBox.h" -#include "xrUICore/Buttons/UI3tButton.h" +#include "UIFrameWindow.h" +#include "UIFrameLineWnd.h" +#include "UIEditBox.h" +#include "UI3tButton.h" #include "mixed_delegate.h" class CUIXml; diff --git a/src/xrGame/ui/TeamInfo.cpp b/src/xrGame/ui/TeamInfo.cpp index bd4a5bc769e..ee857398e61 100644 --- a/src/xrGame/ui/TeamInfo.cpp +++ b/src/xrGame/ui/TeamInfo.cpp @@ -46,7 +46,9 @@ shared_str CTeamInfo::GetTeam1_name() if (flags.test(flTeam1_name)) return team1_name; - team1_name = StringTable().translate(pSettings->r_string_wb("team1", "name")); + CStringTable st; + + team1_name = st.translate(pSettings->r_string_wb("team1", "name")); flags.set(flTeam1_name, true); return team1_name; @@ -57,7 +59,9 @@ shared_str CTeamInfo::GetTeam2_name() if (flags.test(flTeam2_name)) return team2_name; - team2_name = StringTable().translate(pSettings->r_string_wb("team2", "name")); + CStringTable st; + + team2_name = st.translate(pSettings->r_string_wb("team2", "name")); flags.set(flTeam2_name, true); return team2_name; diff --git a/src/xrUICore/Buttons/UI3tButton.cpp b/src/xrGame/ui/UI3tButton.cpp similarity index 99% rename from src/xrUICore/Buttons/UI3tButton.cpp rename to src/xrGame/ui/UI3tButton.cpp index cf9e7caa593..9744d9a2ce4 100644 --- a/src/xrUICore/Buttons/UI3tButton.cpp +++ b/src/xrGame/ui/UI3tButton.cpp @@ -1,6 +1,7 @@ -#include "pch.hpp" +#include "StdAfx.h" #include "UI3tButton.h" -#include "Hint/UIHint.h" +#include "UIXmlInit.h" +#include "UIHint.h" CUI3tButton::CUI3tButton() { diff --git a/src/xrUICore/Buttons/UI3tButton.h b/src/xrGame/ui/UI3tButton.h similarity index 88% rename from src/xrUICore/Buttons/UI3tButton.h rename to src/xrGame/ui/UI3tButton.h index af5364f0b00..fdb55bff542 100644 --- a/src/xrUICore/Buttons/UI3tButton.h +++ b/src/xrGame/ui/UI3tButton.h @@ -1,12 +1,12 @@ #pragma once -#include "xrUICore/Buttons/UIButton.h" -#include "xrUICore/InteractiveBackground/UI_IB_Static.h" +#include "UIButton.h" +#include "UI_IB_Static.h" #include "xrSound/Sound.h" -class XRUICORE_API CUI3tButton : public CUIButton +class CUI3tButton : public CUIButton { typedef CUIButton inherited; - friend class CUIXmlInitBase; + friend class CUIXmlInit; //. using CUIButton::SetTextColor; public: CUI3tButton(); diff --git a/src/xrGame/ui/UIAchievements.cpp b/src/xrGame/ui/UIAchievements.cpp index fe7a8b2793c..3be2c9d2344 100644 --- a/src/xrGame/ui/UIAchievements.cpp +++ b/src/xrGame/ui/UIAchievements.cpp @@ -1,11 +1,11 @@ #include "pch_script.h" #include "UIAchievements.h" -#include "xrUICore/ScrollView/UIScrollView.h" +#include "UIScrollView.h" #include "UIXmlInit.h" #include "UIHelper.h" -#include "xrUICore/Hint/UIHint.h" -#include "xrUICore/Static/UIStatic.h" -#include "xrUICore/Cursor/UICursor.h" +#include "UIHint.h" +#include "UIStatic.h" +#include "UICursor.h" #include "ai_space.h" #include "xrScriptEngine/script_engine.hpp" #include "string_table.h" @@ -68,7 +68,7 @@ void CUIAchievements::SetDescription(LPCSTR desc) SetWndSize(Fvector2().set(GetWndSize().x, descr_size.y)); } -void CUIAchievements::SetHint(LPCSTR hint) { m_hint->set_text(StringTable().translate(hint).c_str()); } +void CUIAchievements::SetHint(LPCSTR hint) { m_hint->set_text(CStringTable().translate(hint).c_str()); } void CUIAchievements::SetIcon(LPCSTR icon) { m_icon->InitTexture(icon); } void CUIAchievements::SetFunctor(LPCSTR func) { diff --git a/src/xrGame/ui/UIAchievements.h b/src/xrGame/ui/UIAchievements.h index bcc091029dc..a8d539d02ce 100644 --- a/src/xrGame/ui/UIAchievements.h +++ b/src/xrGame/ui/UIAchievements.h @@ -1,5 +1,5 @@ #pragma once -#include "xrUICore/Windows/UIWindow.h" +#include "UIWindow.h" class CUIXml; class CUIStatic; diff --git a/src/xrGame/ui/UIActorMenu.cpp b/src/xrGame/ui/UIActorMenu.cpp index e61694ae45e..e925eba6a62 100644 --- a/src/xrGame/ui/UIActorMenu.cpp +++ b/src/xrGame/ui/UIActorMenu.cpp @@ -21,18 +21,18 @@ #include "CustomOutfit.h" #include "CustomDetector.h" #include "eatable_item.h" -#include "xrUICore/ProgressBar/UIProgressBar.h" -#include "xrUICore/Cursor/UICursor.h" +#include "UIProgressBar.h" +#include "UICursor.h" #include "UICellItem.h" #include "UICharacterInfo.h" #include "UIItemInfo.h" #include "UIDragDropListEx.h" #include "UIDragDropReferenceList.h" #include "UIInventoryUpgradeWnd.h" -#include "xrUICore/Buttons/UI3tButton.h" -#include "xrUICore/Buttons/UIBtnHint.h" +#include "UI3tButton.h" +#include "UIBtnHint.h" #include "UIMessageBoxEx.h" -#include "xrUICore/PropertiesBox/UIPropertiesBox.h" +#include "UIPropertiesBox.h" #include "UIMainIngameWnd.h" #include "Trade.h" diff --git a/src/xrGame/ui/UIActorMenu.h b/src/xrGame/ui/UIActorMenu.h index 27556b86807..bc4a16b422b 100644 --- a/src/xrGame/ui/UIActorMenu.h +++ b/src/xrGame/ui/UIActorMenu.h @@ -1,9 +1,9 @@ #pragma once #include "UIDialogWnd.h" -#include "xrUICore/Callbacks/UIWndCallback.h" +#include "UIWndCallback.h" #include "xrServerEntities/inventory_space.h" -#include "xrUICore/Hint/UIHint.h" +#include "UIHint.h" class CUICharacterInfo; class CUIDragDropListEx; diff --git a/src/xrGame/ui/UIActorMenuDeadBodySearch.cpp b/src/xrGame/ui/UIActorMenuDeadBodySearch.cpp index 823839eed28..433ddc3191b 100644 --- a/src/xrGame/ui/UIActorMenuDeadBodySearch.cpp +++ b/src/xrGame/ui/UIActorMenuDeadBodySearch.cpp @@ -3,10 +3,10 @@ #include "UIDragDropListEx.h" #include "UICharacterInfo.h" #include "UIInventoryUtilities.h" -#include "xrUICore/Buttons/UI3tButton.h" +#include "UI3tButton.h" #include "UICellItem.h" #include "UICellItemFactory.h" -#include "xrUICore/Windows/UIFrameLineWnd.h" +#include "UIFrameLineWnd.h" #include "xrMessages.h" #include "alife_registry_wrappers.h" #include "GameObject.h" @@ -186,7 +186,7 @@ void CUIActorMenu::UpdateDeadBodyBag() { string64 buf; - LPCSTR kg_str = StringTable().translate("st_kg").c_str(); + LPCSTR kg_str = CStringTable().translate("st_kg").c_str(); float total = CalcItemsWeight(m_pDeadBodyBagList); xr_sprintf(buf, "%.1f %s", total, kg_str); m_PartnerWeight->SetText(buf); diff --git a/src/xrGame/ui/UIActorMenuInitialize.cpp b/src/xrGame/ui/UIActorMenuInitialize.cpp index c7c5fbbee19..ccf25e2ad00 100644 --- a/src/xrGame/ui/UIActorMenuInitialize.cpp +++ b/src/xrGame/ui/UIActorMenuInitialize.cpp @@ -1,16 +1,16 @@ #include "stdafx.h" #include "UIActorMenu.h" #include "UIXmlInit.h" -#include "xrUICore/XML/xrUIXmlParser.h" +#include "xrUIXmlParser.h" #include "UICharacterInfo.h" #include "UIDragDropListEx.h" #include "UIDragDropReferenceList.h" #include "UIActorStateInfo.h" #include "UIItemInfo.h" -#include "xrUICore/Windows/UIFrameLineWnd.h" +#include "UIFrameLineWnd.h" #include "UIMessageBoxEx.h" -#include "xrUICore/PropertiesBox/UIPropertiesBox.h" -#include "xrUICore/Buttons/UI3tButton.h" +#include "UIPropertiesBox.h" +#include "UI3tButton.h" #include "UIInventoryUpgradeWnd.h" #include "UIInvUpgradeInfo.h" @@ -18,10 +18,10 @@ #include "ai_space.h" #include "alife_simulator.h" #include "Common/object_broker.h" -#include "xrUICore/Callbacks/UIWndCallback.h" +#include "UIWndCallback.h" #include "UIHelper.h" -#include "xrUICore/ProgressBar/UIProgressBar.h" -#include "xrUICore/ui_base.h" +#include "UIProgressBar.h" +#include "ui_base.h" #include "string_table.h" CUIActorMenu::CUIActorMenu() @@ -347,25 +347,25 @@ void CUIActorMenu::InitCallbacks() void CUIActorMenu::UpdateButtonsLayout() { string32 tmp; - LPCSTR str = StringTable().translate("quick_use_str_1").c_str(); + LPCSTR str = CStringTable().translate("quick_use_str_1").c_str(); strncpy_s(tmp, sizeof(tmp), str, 3); if (tmp[2] == ',') tmp[1] = '\0'; m_QuickSlot1->SetTextST(tmp); - str = StringTable().translate("quick_use_str_2").c_str(); + str = CStringTable().translate("quick_use_str_2").c_str(); strncpy_s(tmp, sizeof(tmp), str, 3); if (tmp[2] == ',') tmp[1] = '\0'; m_QuickSlot2->SetTextST(tmp); - str = StringTable().translate("quick_use_str_3").c_str(); + str = CStringTable().translate("quick_use_str_3").c_str(); strncpy_s(tmp, sizeof(tmp), str, 3); if (tmp[2] == ',') tmp[1] = '\0'; m_QuickSlot3->SetTextST(tmp); - str = StringTable().translate("quick_use_str_4").c_str(); + str = CStringTable().translate("quick_use_str_4").c_str(); strncpy_s(tmp, sizeof(tmp), str, 3); if (tmp[2] == ',') tmp[1] = '\0'; diff --git a/src/xrGame/ui/UIActorMenuInventory.cpp b/src/xrGame/ui/UIActorMenuInventory.cpp index 3c258c6b540..99c68526600 100644 --- a/src/xrGame/ui/UIActorMenuInventory.cpp +++ b/src/xrGame/ui/UIActorMenuInventory.cpp @@ -10,9 +10,9 @@ #include "UIDragDropReferenceList.h" #include "UICellCustomItems.h" #include "UIItemInfo.h" -#include "xrUICore/Windows/UIFrameLineWnd.h" -#include "xrUICore/PropertiesBox/UIPropertiesBox.h" -#include "xrUICore/ListBox/UIListBoxItem.h" +#include "UIFrameLineWnd.h" +#include "UIPropertiesBox.h" +#include "UIListBoxItem.h" #include "UIMainIngameWnd.h" #include "UIGameCustom.h" #include "eatable_item_object.h" @@ -27,7 +27,7 @@ #include "Antirad.h" #include "CustomOutfit.h" #include "ActorHelmet.h" -#include "xrUICore/Cursor/UICursor.h" +#include "UICursor.h" #include "MPPlayersBag.h" #include "player_hud.h" #include "CustomDetector.h" @@ -1038,7 +1038,7 @@ void CUIActorMenu::PropertiesBoxForAddon(PIItem item, bool& b_show) { if (item_in_slot_2 && item_in_slot_2->CanAttach(pScope)) { - shared_str str = StringTable().translate("st_attach_scope_to_pistol"); + shared_str str = CStringTable().translate("st_attach_scope_to_pistol"); str.printf("%s %s", str.c_str(), item_in_slot_2->m_name.c_str()); m_UIPropertiesBox->AddItem(str.c_str(), (void*)item_in_slot_2, INVENTORY_ATTACH_ADDON); // m_UIPropertiesBox->AddItem( "st_attach_scope_to_pistol", (void*)item_in_slot_2, @@ -1047,7 +1047,7 @@ void CUIActorMenu::PropertiesBoxForAddon(PIItem item, bool& b_show) } if (item_in_slot_3 && item_in_slot_3->CanAttach(pScope)) { - shared_str str = StringTable().translate("st_attach_scope_to_pistol"); + shared_str str = CStringTable().translate("st_attach_scope_to_pistol"); str.printf("%s %s", str.c_str(), item_in_slot_3->m_name.c_str()); m_UIPropertiesBox->AddItem(str.c_str(), (void*)item_in_slot_3, INVENTORY_ATTACH_ADDON); // m_UIPropertiesBox->AddItem( "st_attach_scope_to_rifle", (void*)item_in_slot_3, @@ -1061,7 +1061,7 @@ void CUIActorMenu::PropertiesBoxForAddon(PIItem item, bool& b_show) { if (item_in_slot_2 && item_in_slot_2->CanAttach(pSilencer)) { - shared_str str = StringTable().translate("st_attach_silencer_to_pistol"); + shared_str str = CStringTable().translate("st_attach_silencer_to_pistol"); str.printf("%s %s", str.c_str(), item_in_slot_2->m_name.c_str()); m_UIPropertiesBox->AddItem(str.c_str(), (void*)item_in_slot_2, INVENTORY_ATTACH_ADDON); // m_UIPropertiesBox->AddItem( "st_attach_silencer_to_pistol", (void*)item_in_slot_2, @@ -1070,7 +1070,7 @@ void CUIActorMenu::PropertiesBoxForAddon(PIItem item, bool& b_show) } if (item_in_slot_3 && item_in_slot_3->CanAttach(pSilencer)) { - shared_str str = StringTable().translate("st_attach_silencer_to_pistol"); + shared_str str = CStringTable().translate("st_attach_silencer_to_pistol"); str.printf("%s %s", str.c_str(), item_in_slot_3->m_name.c_str()); m_UIPropertiesBox->AddItem(str.c_str(), (void*)item_in_slot_3, INVENTORY_ATTACH_ADDON); // m_UIPropertiesBox->AddItem( "st_attach_silencer_to_rifle", (void*)item_in_slot_3, @@ -1084,7 +1084,7 @@ void CUIActorMenu::PropertiesBoxForAddon(PIItem item, bool& b_show) { if (item_in_slot_2 && item_in_slot_2->CanAttach(pGrenadeLauncher)) { - shared_str str = StringTable().translate("st_attach_gl_to_rifle"); + shared_str str = CStringTable().translate("st_attach_gl_to_rifle"); str.printf("%s %s", str.c_str(), item_in_slot_2->m_name.c_str()); m_UIPropertiesBox->AddItem(str.c_str(), (void*)item_in_slot_2, INVENTORY_ATTACH_ADDON); // m_UIPropertiesBox->AddItem( "st_attach_gl_to_pistol", (void*)item_in_slot_2, @@ -1094,7 +1094,7 @@ void CUIActorMenu::PropertiesBoxForAddon(PIItem item, bool& b_show) } if (item_in_slot_3 && item_in_slot_3->CanAttach(pGrenadeLauncher)) { - shared_str str = StringTable().translate("st_attach_gl_to_rifle"); + shared_str str = CStringTable().translate("st_attach_gl_to_rifle"); str.printf("%s %s", str.c_str(), item_in_slot_3->m_name.c_str()); m_UIPropertiesBox->AddItem(str.c_str(), (void*)item_in_slot_3, INVENTORY_ATTACH_ADDON); // m_UIPropertiesBox->AddItem( "st_attach_gl_to_rifle", (void*)item_in_slot_3, diff --git a/src/xrGame/ui/UIActorMenuTrade.cpp b/src/xrGame/ui/UIActorMenuTrade.cpp index d4381c23272..313f7870447 100644 --- a/src/xrGame/ui/UIActorMenuTrade.cpp +++ b/src/xrGame/ui/UIActorMenuTrade.cpp @@ -1,10 +1,10 @@ #include "pch_script.h" #include "UIActorMenu.h" -#include "xrUICore/Buttons/UI3tButton.h" +#include "UI3tButton.h" #include "UIDragDropListEx.h" #include "UIDragDropReferenceList.h" #include "UICharacterInfo.h" -#include "xrUICore/Windows/UIFrameLineWnd.h" +#include "UIFrameLineWnd.h" #include "UICellItem.h" #include "UIInventoryUtilities.h" #include "UICellItemFactory.h" @@ -370,7 +370,7 @@ void CUIActorMenu::UpdatePartnerBag() m_PartnerMoney->SetText(buf); } - LPCSTR kg_str = StringTable().translate("st_kg").c_str(); + LPCSTR kg_str = CStringTable().translate("st_kg").c_str(); float total = CalcItemsWeight(m_pTradePartnerBagList); xr_sprintf(buf, "%.1f %s", total, kg_str); m_PartnerWeight->SetText(buf); @@ -385,7 +385,7 @@ void CUIActorMenu::UpdatePartnerBag() void CUIActorMenu::UpdatePrices() { - LPCSTR kg_str = StringTable().translate("st_kg").c_str(); + LPCSTR kg_str = CStringTable().translate("st_kg").c_str(); UpdateActor(); UpdatePartnerBag(); diff --git a/src/xrGame/ui/UIActorMenuUpgrade.cpp b/src/xrGame/ui/UIActorMenuUpgrade.cpp index 20376f2a144..c688b98df93 100644 --- a/src/xrGame/ui/UIActorMenuUpgrade.cpp +++ b/src/xrGame/ui/UIActorMenuUpgrade.cpp @@ -11,7 +11,7 @@ #include "Inventory.h" #include "Actor.h" #include "UIGameSP.h" -#include "xrUICore/Buttons/UI3tButton.h" +#include "UI3tButton.h" #include "inventory_upgrade.h" #include "UITalkWnd.h" diff --git a/src/xrGame/ui/UIActorMenu_action.cpp b/src/xrGame/ui/UIActorMenu_action.cpp index f531cbf56e1..05b3473facb 100644 --- a/src/xrGame/ui/UIActorMenu_action.cpp +++ b/src/xrGame/ui/UIActorMenu_action.cpp @@ -16,16 +16,16 @@ #include "Common/object_broker.h" #include "UIInventoryUtilities.h" #include "game_cl_base.h" -#include "xrUICore/Cursor/UICursor.h" +#include "UICursor.h" #include "UICellItem.h" #include "UICharacterInfo.h" #include "UIItemInfo.h" #include "UIDragDropListEx.h" #include "UIInventoryUpgradeWnd.h" -#include "xrUICore/Buttons/UI3tButton.h" -#include "xrUICore/Buttons/UIBtnHint.h" +#include "UI3tButton.h" +#include "UIBtnHint.h" #include "UIMessageBoxEx.h" -#include "xrUICore/PropertiesBox/UIPropertiesBox.h" +#include "UIPropertiesBox.h" #include "UIMainIngameWnd.h" bool CUIActorMenu::AllowItemDrops(EDDListType from, EDDListType to) diff --git a/src/xrGame/ui/UIActorStateInfo.cpp b/src/xrGame/ui/UIActorStateInfo.cpp index 2e90525f0c0..66a2daeb9db 100644 --- a/src/xrGame/ui/UIActorStateInfo.cpp +++ b/src/xrGame/ui/UIActorStateInfo.cpp @@ -7,15 +7,15 @@ #include "stdafx.h" #include "UIActorStateInfo.h" -#include "xrUICore/ProgressBar/UIProgressBar.h" -#include "xrUICore/ProgressBar/UIProgressShape.h" -#include "xrUICore/ScrollView/UIScrollView.h" -#include "xrUICore/Windows/UIFrameWindow.h" -#include "xrUICore/Static/UIStatic.h" +#include "UIProgressBar.h" +#include "UIProgressShape.h" +#include "UIScrollView.h" +#include "UIFrameWindow.h" +#include "UIStatic.h" #include "UIXmlInit.h" #include "Common/object_broker.h" #include "UIHelper.h" -#include "xrUICore/arrow/ui_arrow.h" +#include "ui_arrow.h" #include "UIHudStatesWnd.h" #include "Level.h" #include "location_manager.h" diff --git a/src/xrGame/ui/UIActorStateInfo.h b/src/xrGame/ui/UIActorStateInfo.h index 5eabf4fad9b..9e009200b8f 100644 --- a/src/xrGame/ui/UIActorStateInfo.h +++ b/src/xrGame/ui/UIActorStateInfo.h @@ -9,7 +9,7 @@ #define UI_ACTOR_STATE_INFO_H_INCLUDED #include "alife_space.h" -#include "xrUICore/Hint/UIHint.h" +#include "UIHint.h" class CUIProgressBar; class CUIProgressShape; diff --git a/src/xrUICore/Static/UIAnimatedStatic.cpp b/src/xrGame/ui/UIAnimatedStatic.cpp similarity index 54% rename from src/xrUICore/Static/UIAnimatedStatic.cpp rename to src/xrGame/ui/UIAnimatedStatic.cpp index 16be9323f6c..10e3b2b9aa2 100644 --- a/src/xrUICore/Static/UIAnimatedStatic.cpp +++ b/src/xrGame/ui/UIAnimatedStatic.cpp @@ -6,7 +6,7 @@ // Статик для отображения анимированной иконки //============================================================================= -#include "pch.hpp" +#include "stdafx.h" #include "UIAnimatedStatic.h" ////////////////////////////////////////////////////////////////////////// @@ -89,3 +89,70 @@ void CUIAnimatedStatic::SetAnimPos(float pos) SetFrame(m_uCurFrame); } } +//----------------------------------------------------------------------------------------- +// Static for sleep control----------------------------------------------------------------- +//----------------------------------------------------------------------------------------- +#include "Actor_Flags.h" +#include "Level.h" +#include "date_time.h" +#include "UITextureMaster.h" + +CUISleepStatic::CUISleepStatic() : m_cur_time(0){}; + +void CUISleepStatic::Draw() +{ + // inherited::Draw(); + m_UIStaticItem.Render(); + m_UIStaticItem2.Render(); +} + +void CUISleepStatic::Update() +{ + u32 year = 0, month = 0, day = 0, hours = 0, mins = 0, secs = 0, milisecs = 0; + split_time(Level().GetGameTime(), year, month, day, hours, mins, secs, milisecs); + + u32 start_pixel = 0, end_pixel = 0, start_pixel2 = 0, end_pixel2 = 0; + hours += psActorSleepTime - 1; + if (hours >= 24) + hours -= 24; + + start_pixel = hours * 85; + end_pixel = (hours + 7) * 85; + if (end_pixel > 2048) + { + end_pixel2 = end_pixel - 2048; + end_pixel = 2048; + } + + Fvector2 parent_pos = GetParent()->GetWndPos(); + Fvector2 pos = GetWndPos(); + pos.x += parent_pos.x; + pos.y += parent_pos.y; + + Frect r = Frect().set((float)start_pixel, 0.0f, (float)end_pixel, 128.0f); + m_UIStaticItem.SetTextureRect(r); + m_UIStaticItem.SetSize(Fvector2().set(iFloor((end_pixel - start_pixel) * UI().get_current_kx()), 128)); + m_UIStaticItem.SetPos(pos.x, pos.y); + if (end_pixel2 > 0) + { + r.set((float)start_pixel2, 0.0f, (float)end_pixel2, 128.0f); + m_UIStaticItem2.SetTextureRect(r); + m_UIStaticItem2.SetSize(Fvector2().set(iFloor(end_pixel2 * UI().get_current_kx()), 128)); + m_UIStaticItem2.SetPos(m_UIStaticItem.GetPosX() + m_UIStaticItem.GetSize().x, m_UIStaticItem.GetPosY()); + } + else + m_UIStaticItem2.SetSize(Fvector2().set(1, 1)); +} + +void CUISleepStatic::InitTextureEx(LPCSTR tex_name, LPCSTR sh_name) +{ + inherited::InitTextureEx(tex_name, sh_name); + + LPCSTR res_shname = GEnv.UIRender->UpdateShaderName(tex_name, sh_name); + CUITextureMaster::InitTexture(tex_name, &m_UIStaticItem2, res_shname); + + Fvector2 p = GetWndPos(); + m_UIStaticItem2.SetPos(p.x, p.y); + p.set(1, 1); + m_UIStaticItem2.SetSize(p); +} diff --git a/src/xrUICore/Static/UIAnimatedStatic.h b/src/xrGame/ui/UIAnimatedStatic.h similarity index 82% rename from src/xrUICore/Static/UIAnimatedStatic.h rename to src/xrGame/ui/UIAnimatedStatic.h index 5a4b291bae7..a9442f0083f 100644 --- a/src/xrUICore/Static/UIAnimatedStatic.h +++ b/src/xrGame/ui/UIAnimatedStatic.h @@ -1,7 +1,12 @@ + +#ifndef UI_ANIMATED_STATIC_H_ +#define UI_ANIMATED_STATIC_H_ + #pragma once + #include "UIStatic.h" -class XRUICORE_API CUIAnimatedStatic : public CUIStatic +class CUIAnimatedStatic : public CUIStatic { typedef CUIStatic inherited; // Количекство кадров анимации @@ -73,3 +78,19 @@ class XRUICORE_API CUIAnimatedStatic : public CUIStatic virtual void Update(); }; + +class CUISleepStatic : public CUIStatic +{ +private: + typedef CUIStatic inherited; + + int m_cur_time; + CUIStaticItem m_UIStaticItem2; + +public: + CUISleepStatic(); + virtual void Draw(); + virtual void Update(); + virtual void InitTextureEx(LPCSTR tex_name, LPCSTR sh_name = "hud\\default"); +}; +#endif // UI_ANIMATED_STATIC_H_ diff --git a/src/xrGame/ui/UIBoosterInfo.cpp b/src/xrGame/ui/UIBoosterInfo.cpp index 84bcbfa12da..55bc289e8df 100644 --- a/src/xrGame/ui/UIBoosterInfo.cpp +++ b/src/xrGame/ui/UIBoosterInfo.cpp @@ -1,6 +1,6 @@ #include "stdafx.h" #include "UIBoosterInfo.h" -#include "xrUICore/Static/UIStatic.h" +#include "UIStatic.h" #include "Common/object_broker.h" #include "EntityCondition.h" #include "Actor.h" @@ -56,7 +56,7 @@ void CUIBoosterInfo::InitFromXml(CUIXml& xml) m_booster_items[i]->Init(xml, ef_boosters_section_names[i]); m_booster_items[i]->SetAutoDelete(false); - LPCSTR name = StringTable().translate(boost_influence_caption[i]).c_str(); + LPCSTR name = CStringTable().translate(boost_influence_caption[i]).c_str(); m_booster_items[i]->SetCaption(name); xml.SetLocalRoot(base_node); @@ -65,21 +65,21 @@ void CUIBoosterInfo::InitFromXml(CUIXml& xml) m_booster_satiety = new UIBoosterInfoItem(); m_booster_satiety->Init(xml, "boost_satiety"); m_booster_satiety->SetAutoDelete(false); - LPCSTR name = StringTable().translate("ui_inv_satiety").c_str(); + LPCSTR name = CStringTable().translate("ui_inv_satiety").c_str(); m_booster_satiety->SetCaption(name); xml.SetLocalRoot(base_node); m_booster_anabiotic = new UIBoosterInfoItem(); m_booster_anabiotic->Init(xml, "boost_anabiotic"); m_booster_anabiotic->SetAutoDelete(false); - name = StringTable().translate("ui_inv_survive_surge").c_str(); + name = CStringTable().translate("ui_inv_survive_surge").c_str(); m_booster_anabiotic->SetCaption(name); xml.SetLocalRoot(base_node); m_booster_time = new UIBoosterInfoItem(); m_booster_time->Init(xml, "boost_time"); m_booster_time->SetAutoDelete(false); - name = StringTable().translate("ui_inv_effect_time").c_str(); + name = CStringTable().translate("ui_inv_effect_time").c_str(); m_booster_time->SetCaption(name); xml.SetLocalRoot(stored_root); @@ -207,7 +207,7 @@ void UIBoosterInfoItem::Init(CUIXml& xml, LPCSTR section) m_show_sign = (xml.ReadAttribInt("value", 0, "show_sign", 1) == 1); LPCSTR unit_str = xml.ReadAttrib("value", 0, "unit_str", ""); - m_unit_str._set(StringTable().translate(unit_str)); + m_unit_str._set(CStringTable().translate(unit_str)); LPCSTR texture_minus = xml.Read("texture_minus", 0, ""); if (texture_minus && xr_strlen(texture_minus)) diff --git a/src/xrGame/ui/UIBoosterInfo.h b/src/xrGame/ui/UIBoosterInfo.h index 1e22a35f9fb..cca33af008d 100644 --- a/src/xrGame/ui/UIBoosterInfo.h +++ b/src/xrGame/ui/UIBoosterInfo.h @@ -1,5 +1,5 @@ #pragma once -#include "xrUICore/Windows/UIWindow.h" +#include "UIWindow.h" #include "EntityCondition.h" class CUIXml; diff --git a/src/xrUICore/Buttons/UIBtnHint.cpp b/src/xrGame/ui/UIBtnHint.cpp similarity index 76% rename from src/xrUICore/Buttons/UIBtnHint.cpp rename to src/xrGame/ui/UIBtnHint.cpp index bb302df1340..b01dd6ae719 100644 --- a/src/xrUICore/Buttons/UIBtnHint.cpp +++ b/src/xrGame/ui/UIBtnHint.cpp @@ -1,16 +1,17 @@ -#include "pch.hpp" +#include "stdafx.h" #include "UIBtnHint.h" -#include "Static/UIStatic.h" -#include "XML/UIXmlInitBase.h" +#include "UIFrameWindow.h" +#include "UIStatic.h" +#include "UIXmlInit.h" CUIButtonHint* g_btnHint = NULL; CUIButtonHint* g_statHint = NULL; -CUIButtonHint::CUIButtonHint() -: m_ownerWnd(NULL) -, m_enabledOnFrame(false) +CUIButtonHint::CUIButtonHint() : m_ownerWnd(NULL), m_enabledOnFrame(false) { - CUIXmlInitBase xml_init; + // Device.seqRender.Add (this, REG_PRIORITY_LOW-1000); + + CUIXmlInit xml_init; CUIXml uiXml; uiXml.Load(CONFIG_PATH, UI_PATH, "hint_item.xml"); xml_init.InitFrameWindow(uiXml, "button_hint", 0, this); @@ -22,7 +23,9 @@ CUIButtonHint::CUIButtonHint() } CUIButtonHint::~CUIButtonHint() -{} +{ + // Device.seqRender.Remove (this); +} void CUIButtonHint::OnRender() { diff --git a/src/xrUICore/Buttons/UIBtnHint.h b/src/xrGame/ui/UIBtnHint.h similarity index 66% rename from src/xrUICore/Buttons/UIBtnHint.h rename to src/xrGame/ui/UIBtnHint.h index 4fc2ee9f030..fd52ae55192 100644 --- a/src/xrUICore/Buttons/UIBtnHint.h +++ b/src/xrGame/ui/UIBtnHint.h @@ -1,9 +1,9 @@ #pragma once -#include "xrUICore/Windows/UIFrameWindow.h" +#include "UIFrameWindow.h" class CUITextWnd; -class XRUICORE_API CUIButtonHint : public CUIFrameWindow +class CUIButtonHint : public CUIFrameWindow { CUIWindow* m_ownerWnd; @@ -20,5 +20,5 @@ class XRUICORE_API CUIButtonHint : public CUIFrameWindow void SetHintText(CUIWindow* w, LPCSTR text); }; -XRUICORE_API extern CUIButtonHint* g_btnHint; -XRUICORE_API extern CUIButtonHint* g_statHint; +extern CUIButtonHint* g_btnHint; +extern CUIButtonHint* g_statHint; diff --git a/src/xrUICore/Buttons/UIButton.cpp b/src/xrGame/ui/UIButton.cpp similarity index 97% rename from src/xrUICore/Buttons/UIButton.cpp rename to src/xrGame/ui/UIButton.cpp index 7e7bc5ecb40..66e567c53f4 100644 --- a/src/xrUICore/Buttons/UIButton.cpp +++ b/src/xrGame/ui/UIButton.cpp @@ -1,10 +1,10 @@ -#include "pch.hpp" +#include "stdafx.h" #include "UIButton.h" #include "UIBtnHint.h" -#include "Cursor/UICursor.h" +#include "UICursor.h" +#include "ui_base.h" #include "xrEngine/xr_input.h" -#include "Windows/UIWindow.h" -#include "xrEngine/xr_input_xinput.h" +#include "xr_level_controller.h" #define PUSH_OFFSET_RIGHT 1 #define PUSH_OFFSET_DOWN 1 diff --git a/src/xrUICore/Buttons/UIButton.h b/src/xrGame/ui/UIButton.h similarity index 95% rename from src/xrUICore/Buttons/UIButton.h rename to src/xrGame/ui/UIButton.h index 9c9c7c48ac4..4694b661890 100644 --- a/src/xrUICore/Buttons/UIButton.h +++ b/src/xrGame/ui/UIButton.h @@ -1,7 +1,8 @@ #pragma once -#include "xrUICore/Static/UIStatic.h" -class XRUICORE_API CUIButton : public CUIStatic +#include "UIStatic.h" + +class CUIButton : public CUIStatic { private: typedef CUIStatic inherited; diff --git a/src/xrUICore/Buttons/UIButton_script.cpp b/src/xrGame/ui/UIButton_script.cpp similarity index 92% rename from src/xrUICore/Buttons/UIButton_script.cpp rename to src/xrGame/ui/UIButton_script.cpp index 6a1d69faef5..5d905e88bd9 100644 --- a/src/xrUICore/Buttons/UIButton_script.cpp +++ b/src/xrGame/ui/UIButton_script.cpp @@ -1,10 +1,11 @@ -#include "pch.hpp" +#include "pch_script.h" #include "UIButton.h" #include "UI3tButton.h" #include "UICheckButton.h" -#include "SpinBox/UISpinNum.h" -#include "SpinBox/UISpinText.h" -#include "TrackBar/UITrackBar.h" +#include "UIRadioButton.h" +#include "UISpinNum.h" +#include "UISpinText.h" +#include "UITrackBar.h" #include "xrScriptEngine/ScriptExporter.hpp" using namespace luabind; diff --git a/src/xrGame/ui/UIBuyWeaponTab.cpp b/src/xrGame/ui/UIBuyWeaponTab.cpp index 0e739316051..14e3de7ba95 100644 --- a/src/xrGame/ui/UIBuyWeaponTab.cpp +++ b/src/xrGame/ui/UIBuyWeaponTab.cpp @@ -1,6 +1,6 @@ #include "StdAfx.h" #include "UIBuyWeaponTab.h" -#include "xrUICore/TabControl/UITabButton.h" +#include "UITabButton.h" void CUIBuyWeaponTab::SendMessage(CUIWindow* pWnd, s16 msg, void* pData) { diff --git a/src/xrGame/ui/UIBuyWeaponTab.h b/src/xrGame/ui/UIBuyWeaponTab.h index 7f4d269767f..f01b45d4019 100644 --- a/src/xrGame/ui/UIBuyWeaponTab.h +++ b/src/xrGame/ui/UIBuyWeaponTab.h @@ -1,7 +1,7 @@ #pragma once -#include "xrUICore/TabControl/UITabControl.h" -#include "xrUICore/Static/UIStatic.h" +#include "UITabControl.h" +#include "UIStatic.h" class CUIXml; diff --git a/src/xrGame/ui/UICDkey.cpp b/src/xrGame/ui/UICDkey.cpp index e3af59f0038..1cbbf599610 100644 --- a/src/xrGame/ui/UICDkey.cpp +++ b/src/xrGame/ui/UICDkey.cpp @@ -1,6 +1,6 @@ #include "stdafx.h" #include "UICDkey.h" -#include "xrUICore/Lines/UILines.h" +#include "UILines.h" #include "xrEngine/line_edit_control.h" #include "MainMenu.h" #include "xrEngine/xr_IOConsole.h" @@ -90,10 +90,10 @@ void CUICDkey::Draw() GetAbsoluteRect(rect); Fvector2 out; - out.y = (m_wndSize.y - TextItemControl()->GetFont()->CurrentHeight_()) / 2.0f; + out.y = (m_wndSize.y - TextItemControl()->m_pFont->CurrentHeight_()) / 2.0f; out.x = TextItemControl()->m_TextOffset.x + TextItemControl()->GetIndentByAlign(); - TextItemControl()->GetFont()->SetColor(TextItemControl()->GetTextColor()); - TextItemControl()->GetFont()->SetAligment(TextItemControl()->GetTextAlignment()); + TextItemControl()->m_pFont->SetColor(TextItemControl()->GetTextColor()); + TextItemControl()->m_pFont->SetAligment(TextItemControl()->GetTextAlignment()); Fvector2 pos; pos.set(rect.left + out.x, rect.top + out.y); @@ -121,20 +121,20 @@ void CUICDkey::Draw() LPCSTR res = (m_view_access) ? edt_str : xx_str; LPCSTR res1 = (m_view_access) ? edt_str1 : xx_str1; - TextItemControl()->GetFont()->Out(pos.x, pos.y, "%s", AddHyphens(res)); + TextItemControl()->m_pFont->Out(pos.x, pos.y, "%s", AddHyphens(res)); - float _h = TextItemControl()->GetFont()->CurrentHeight_(); + float _h = TextItemControl()->m_pFont->CurrentHeight_(); UI().ClientToScreenScaledHeight(_h); out.y = rect.top + (m_wndSize.y - _h) / 2.0f; float w_tmp = 0.0f; int i = (int)xr_strlen(res1); - w_tmp = TextItemControl()->GetFont()->SizeOf_(res1); + w_tmp = TextItemControl()->m_pFont->SizeOf_(res1); UI().ClientToScreenScaledWidth(w_tmp); out.x = rect.left + w_tmp; - w_tmp = TextItemControl()->GetFont()->SizeOf_("-"); + w_tmp = TextItemControl()->m_pFont->SizeOf_("-"); UI().ClientToScreenScaledWidth(w_tmp); if (i > 3) @@ -145,13 +145,13 @@ void CUICDkey::Draw() out.x += w_tmp; UI().ClientToScreenScaled(out); - TextItemControl()->GetFont()->Out(out.x, out.y, "_"); + TextItemControl()->m_pFont->Out(out.x, out.y, "_"); } else { - TextItemControl()->GetFont()->Out(pos.x, pos.y, "%s", AddHyphens(xx_str)); + TextItemControl()->m_pFont->Out(pos.x, pos.y, "%s", AddHyphens(xx_str)); } - TextItemControl()->GetFont()->OnRender(); + TextItemControl()->m_pFont->OnRender(); } LPCSTR CUICDkey::GetText() { return AddHyphens(inherited::GetText()); } diff --git a/src/xrGame/ui/UICDkey.h b/src/xrGame/ui/UICDkey.h index 51cefcbf34e..eacc3b0c61d 100644 --- a/src/xrGame/ui/UICDkey.h +++ b/src/xrGame/ui/UICDkey.h @@ -1,6 +1,6 @@ // #pragma once -#include "xrUICore/EditBox/UIEditBox.h" +#include "UIEditBox.h" class CUICDkey : public CUIEditBox { diff --git a/src/xrGame/ui/UICellCustomItems.cpp b/src/xrGame/ui/UICellCustomItems.cpp index eb801e0181b..98ebb7ae625 100644 --- a/src/xrGame/ui/UICellCustomItems.cpp +++ b/src/xrGame/ui/UICellCustomItems.cpp @@ -3,7 +3,7 @@ #include "UIInventoryUtilities.h" #include "Weapon.h" #include "UIDragDropListEx.h" -#include "xrUICore/ProgressBar/UIProgressBar.h" +#include "UIProgressBar.h" #define INV_GRID_WIDTHF 50.0f #define INV_GRID_HEIGHTF 50.0f diff --git a/src/xrGame/ui/UICellItem.cpp b/src/xrGame/ui/UICellItem.cpp index b9eca5c7e38..1c86ec02490 100644 --- a/src/xrGame/ui/UICellItem.cpp +++ b/src/xrGame/ui/UICellItem.cpp @@ -1,6 +1,6 @@ #include "stdafx.h" #include "UICellItem.h" -#include "xrUICore/Cursor/UICursor.h" +#include "uicursor.h" #include "inventory_item.h" #include "UIDragDropListEx.h" #include "eatable_item.h" @@ -9,7 +9,7 @@ #include "Level.h" #include "Common/object_broker.h" #include "UIXmlInit.h" -#include "xrUICore/ProgressBar/UIProgressBar.h" +#include "UIProgressBar.h" #include "Weapon.h" #include "CustomOutfit.h" #include "ActorHelmet.h" diff --git a/src/xrGame/ui/UICellItem.h b/src/xrGame/ui/UICellItem.h index f800fee882b..b2f1fc7a6b1 100644 --- a/src/xrGame/ui/UICellItem.h +++ b/src/xrGame/ui/UICellItem.h @@ -1,6 +1,6 @@ #pragma once -#include "xrUICore/Static/UIStatic.h" +#include "UIStatic.h" #include "UIDialogWnd.h" class CUIDragItem; diff --git a/src/xrGame/ui/UIChangeMap.cpp b/src/xrGame/ui/UIChangeMap.cpp index bc56f77f5a5..5efae44013c 100644 --- a/src/xrGame/ui/UIChangeMap.cpp +++ b/src/xrGame/ui/UIChangeMap.cpp @@ -2,9 +2,9 @@ #include "UIChangeMap.h" #include "UIVotingCategory.h" #include "UIXmlInit.h" -#include "xrUICore/Buttons/UI3tButton.h" -#include "xrUICore/ListBox/UIListBox.h" -#include "xrUICore/ListBox/UIListBoxItem.h" +#include "UI3tButton.h" +#include "UIListBox.h" +#include "UIListBoxItem.h" #include "Level.h" #include "game_cl_teamdeathmatch.h" #include "xrEngine/xr_ioconsole.h" @@ -12,7 +12,7 @@ #include "Common/object_broker.h" #include "UIGameCustom.h" #include "UIDialogHolder.h" -#include "xrUICore/Windows/UIFrameWindow.h" +#include "UIFrameWindow.h" CUIChangeMap::CUIChangeMap() { @@ -150,7 +150,7 @@ void CUIChangeMap::FillUpList() u32 cnt = M.m_map_names.size(); for (u32 i = 0; i < cnt; ++i) { - CUIListBoxItem* itm = lst->AddTextItem(StringTable().translate(M.m_map_names[i].map_name).c_str()); + CUIListBoxItem* itm = lst->AddTextItem(CStringTable().translate(M.m_map_names[i].map_name).c_str()); itm->Enable(true); // m_pExtraContentFilter->IsDataEnabled(M.m_map_names[i].map_name.c_str())); } } diff --git a/src/xrGame/ui/UICharacterInfo.cpp b/src/xrGame/ui/UICharacterInfo.cpp index a38b8f61cfb..7292e322182 100644 --- a/src/xrGame/ui/UICharacterInfo.cpp +++ b/src/xrGame/ui/UICharacterInfo.cpp @@ -9,11 +9,11 @@ #include "string_table.h" #include "relation_registry.h" -#include "xrUICore/XML/xrUIXmlParser.h" +#include "xrUIXmlParser.h" #include "UIXmlInit.h" -#include "xrUICore/Static/UIStatic.h" -#include "xrUICore/ScrollView/UIScrollView.h" +#include "uistatic.h" +#include "UIScrollView.h" #include "alife_simulator.h" #include "ai_space.h" diff --git a/src/xrGame/ui/UICharacterInfo.h b/src/xrGame/ui/UICharacterInfo.h index c7617e70481..f3ab1ca6d97 100644 --- a/src/xrGame/ui/UICharacterInfo.h +++ b/src/xrGame/ui/UICharacterInfo.h @@ -3,7 +3,7 @@ ////////////////////////////////////////////////////////////////////// #pragma once -#include "xrUICore/Windows/UIWindow.h" +#include "uiwindow.h" #include "xrServerEntities/alife_space.h" #include "character_info_defs.h" diff --git a/src/xrGame/ui/UIChatWnd.cpp b/src/xrGame/ui/UIChatWnd.cpp index 83ab8719fc5..f291fd75d5c 100644 --- a/src/xrGame/ui/UIChatWnd.cpp +++ b/src/xrGame/ui/UIChatWnd.cpp @@ -1,10 +1,10 @@ #include #include "UIChatWnd.h" #include "UIGameLog.h" -#include "xrUICore/EditBox/UIEditBox.h" +#include "UIEditBox.h" #include "UIXmlInit.h" #include "UIHelper.h" -#include "xrUICore/XML/xrUIXmlParser.h" +#include "xrUIXmlParser.h" #include "UIDialogHolder.h" #include "game_cl_base.h" #include "xr_level_controller.h" diff --git a/src/xrGame/ui/UIChatWnd.h b/src/xrGame/ui/UIChatWnd.h index 90fd24e1f3d..01bed2fa650 100644 --- a/src/xrGame/ui/UIChatWnd.h +++ b/src/xrGame/ui/UIChatWnd.h @@ -1,6 +1,6 @@ #pragma once #include "UIDialogWnd.h" -#include "xrUICore/Callbacks/UIWndCallback.h" +#include "UIWndCallback.h" class CUIXml; class CUIGameLog; diff --git a/src/xrUICore/Buttons/UICheckButton.cpp b/src/xrGame/ui/UICheckButton.cpp similarity index 93% rename from src/xrUICore/Buttons/UICheckButton.cpp rename to src/xrGame/ui/UICheckButton.cpp index b9e60c3cd5a..71f21343eb2 100644 --- a/src/xrUICore/Buttons/UICheckButton.cpp +++ b/src/xrGame/ui/UICheckButton.cpp @@ -2,11 +2,11 @@ // с галочкой и без ////////////////////////////////////////////////////////////////////// -#include "pch.hpp" -#include "UICheckButton.h" -#include "Hint/UIHint.h" +#include "stdafx.h" +#include ".\uicheckbutton.h" +#include "UIXmlInit.h" +#include "UIHint.h" #include "xrEngine/xr_input.h" -#include "xrEngine/xr_input_xinput.h" CUICheckButton::CUICheckButton() { @@ -25,6 +25,7 @@ void CUICheckButton::Update() void CUICheckButton::SetCurrentOptValue() { + CUIOptionsItem::SetCurrentOptValue(); SetCheck(GetOptBoolValue()); } @@ -36,6 +37,7 @@ void CUICheckButton::SaveOptValue() void CUICheckButton::SaveBackUpOptValue() { + CUIOptionsItem::SaveBackUpOptValue(); m_opt_backup_value = GetCheck(); } diff --git a/src/xrUICore/Buttons/UICheckButton.h b/src/xrGame/ui/UICheckButton.h similarity index 87% rename from src/xrUICore/Buttons/UICheckButton.h rename to src/xrGame/ui/UICheckButton.h index 1036ff3abfd..f37c18d6691 100644 --- a/src/xrUICore/Buttons/UICheckButton.h +++ b/src/xrGame/ui/UICheckButton.h @@ -1,10 +1,11 @@ #pragma once -#include "xrUICore/Buttons/UI3tButton.h" -#include "xrUICore/Options/UIOptionsItem.h" + +#include "ui3tbutton.h" +#include "UIOptionsItem.h" class UIHint; -class XRUICORE_API CUICheckButton : public CUI3tButton, public CUIOptionsItem +class CUICheckButton : public CUI3tButton, public CUIOptionsItem { typedef CUI3tButton inherited; diff --git a/src/xrUICore/ComboBox/UIComboBox.cpp b/src/xrGame/ui/UIComboBox.cpp similarity index 92% rename from src/xrUICore/ComboBox/UIComboBox.cpp rename to src/xrGame/ui/UIComboBox.cpp index 6e5b830afc6..62284a15230 100644 --- a/src/xrUICore/ComboBox/UIComboBox.cpp +++ b/src/xrGame/ui/UIComboBox.cpp @@ -1,9 +1,9 @@ -#include "pch.hpp" +#include "StdAfx.h" #include "UIComboBox.h" -#include "XML/UITextureMaster.h" -#include "ScrollBar/UIScrollBar.h" -#include "ListBox/UIListBoxItem.h" -#include "xrEngine/StringTable/IStringTable.h" +#include "UITextureMaster.h" +#include "UIScrollBar.h" +#include "uilistboxitem.h" +#include "string_table.h" #include "xrCore/xr_token.h" #define CB_HEIGHT 20.0f @@ -118,23 +118,28 @@ void CUIComboBox::enable_id(int id) void CUIComboBox::SetCurrentOptValue() { + CUIOptionsItem::SetCurrentOptValue(); + m_list_box.Clear(); const xr_token* tok = GetOptToken(); - - R_ASSERT3(tok, "Option token doesnt exist:", m_entry.c_str()); - - while (tok->name) + + if (tok) { - if (m_disabled.end() == std::find(m_disabled.begin(), m_disabled.end(), tok->id)) + while (tok->name) { - AddItem_(tok->name, tok->id); + if (m_disabled.end() == std::find(m_disabled.begin(), m_disabled.end(), tok->id)) + { + AddItem_(tok->name, tok->id); + } + tok++; } - tok++; + + LPCSTR cur_val = *CStringTable().translate(GetOptTokenValue()); + m_text.SetText(cur_val); + m_list_box.SetSelectedText(cur_val); } - - LPCSTR cur_val = *gStringTable->translate(GetOptTokenValue()); - m_text.SetText(cur_val); - m_list_box.SetSelectedText(cur_val); + else + m_text.SetText("-"); CUIListBoxItem* itm = m_list_box.GetSelectedItem(); if (itm) @@ -145,6 +150,7 @@ void CUIComboBox::SetCurrentOptValue() void CUIComboBox::SaveBackUpOptValue() { + CUIOptionsItem::SaveBackUpOptValue(); m_opt_backup_value = m_itoken_id; } @@ -159,7 +165,6 @@ void CUIComboBox::UndoOptValue() void CUIComboBox::SaveOptValue() { CUIOptionsItem::SaveOptValue(); - const xr_token* tok = GetOptToken(); if (tok) { diff --git a/src/xrUICore/ComboBox/UIComboBox.h b/src/xrGame/ui/UIComboBox.h similarity index 83% rename from src/xrUICore/ComboBox/UIComboBox.h rename to src/xrGame/ui/UIComboBox.h index 816af8f37e3..8524b5804a5 100644 --- a/src/xrUICore/ComboBox/UIComboBox.h +++ b/src/xrGame/ui/UIComboBox.h @@ -1,15 +1,16 @@ #pragma once -#include "xrUICore/EditBox/UIEditBox.h" -#include "xrUICore/ListBox/UIListBox.h" -#include "xrUICore/InteractiveBackground/UIInteractiveBackground.h" -#include "xrUICore/Options/UIOptionsItem.h" -#include "xrUICore/Windows/UIFrameWindow.h" + +#include "UIEditBox.h" +#include "UIListBox.h" +#include "UIInteractiveBackground.h" +#include "UIOptionsItem.h" +#include "UIFrameWindow.h" class CUIListBoxItem; -class XRUICORE_API CUIComboBox : public CUIWindow, public CUIOptionsItem, public pureRender +class CUIComboBox : public CUIWindow, public CUIOptionsItem, public pureRender { - friend class CUIXmlInitBase; + friend class CUIXmlInit; typedef enum { LIST_EXPANDED, LIST_FONDED } E_COMBO_STATE; xr_vector m_disabled; diff --git a/src/xrUICore/ComboBox/UIComboBox_script.cpp b/src/xrGame/ui/UIComboBox_script.cpp similarity index 95% rename from src/xrUICore/ComboBox/UIComboBox_script.cpp rename to src/xrGame/ui/UIComboBox_script.cpp index cae7862171c..b446808b520 100644 --- a/src/xrUICore/ComboBox/UIComboBox_script.cpp +++ b/src/xrGame/ui/UIComboBox_script.cpp @@ -7,9 +7,9 @@ // Copyright 2004 GSC Game World // -#include "pch.hpp" +#include "pch_script.h" #include "UIComboBox.h" -#include "ListBox\UIListBoxItem.h" +#include "UIListBoxItem.h" #include "xrScriptEngine/ScriptExporter.hpp" using namespace luabind; diff --git a/src/xrUICore/EditBox/UICustomEdit.cpp b/src/xrGame/ui/UICustomEdit.cpp similarity index 99% rename from src/xrUICore/EditBox/UICustomEdit.cpp rename to src/xrGame/ui/UICustomEdit.cpp index e3b68471f68..6008c24a73e 100644 --- a/src/xrUICore/EditBox/UICustomEdit.cpp +++ b/src/xrGame/ui/UICustomEdit.cpp @@ -1,6 +1,8 @@ -#include "pch.hpp" +#include "stdafx.h" + #include "UICustomEdit.h" -#include "Lines/UILines.h" +#include "UILines.h" + #include "xrEngine/line_edit_control.h" #include "xrEngine/xr_input.h" diff --git a/src/xrUICore/EditBox/UICustomEdit.h b/src/xrGame/ui/UICustomEdit.h similarity index 95% rename from src/xrUICore/EditBox/UICustomEdit.h rename to src/xrGame/ui/UICustomEdit.h index 81c4067969f..4348bfaae20 100644 --- a/src/xrUICore/EditBox/UICustomEdit.h +++ b/src/xrGame/ui/UICustomEdit.h @@ -1,5 +1,7 @@ + #pragma once -#include "xrUICore/Static/UIStatic.h" + +#include "UIStatic.h" namespace text_editor { @@ -7,7 +9,7 @@ class ENGINE_API line_edit_control; enum init_mode; }; -class XRUICORE_API CUICustomEdit : public CUIStatic +class CUICustomEdit : public CUIStatic { private: typedef CUIStatic inherited; diff --git a/src/xrUICore/SpinBox/UICustomSpin.cpp b/src/xrGame/ui/UICustomSpin.cpp similarity index 97% rename from src/xrUICore/SpinBox/UICustomSpin.cpp rename to src/xrGame/ui/UICustomSpin.cpp index 9124ee7f951..be7b8f584db 100644 --- a/src/xrUICore/SpinBox/UICustomSpin.cpp +++ b/src/xrGame/ui/UICustomSpin.cpp @@ -6,10 +6,10 @@ // // copyright 2005 GSC Game World -#include "pch.hpp" -#include "Buttons/UI3tButton.h" -#include "Windows/UIFrameLineWnd.h" -#include "Lines/UILines.h" +#include "StdAfx.h" +#include "UI3tButton.h" +#include "UIFrameLineWnd.h" +#include "UILines.h" #include "UICustomSpin.h" #define SPIN_HEIGHT 20.0f diff --git a/src/xrUICore/SpinBox/UICustomSpin.h b/src/xrGame/ui/UICustomSpin.h similarity index 87% rename from src/xrUICore/SpinBox/UICustomSpin.h rename to src/xrGame/ui/UICustomSpin.h index 2fe3bbe05d4..bd7c4937d1c 100644 --- a/src/xrUICore/SpinBox/UICustomSpin.h +++ b/src/xrGame/ui/UICustomSpin.h @@ -7,14 +7,14 @@ // copyright 2005 GSC Game World #pragma once -#include "xrUICore/Windows/UIWindow.h" -#include "xrUICore/Options/UIOptionsItem.h" +#include "UIWindow.h" +#include "UIOptionsItem.h" class CUI3tButton; class CUIFrameLineWnd; class CUILines; -class XRUICORE_API CUICustomSpin : public CUIWindow, public CUIOptionsItem +class CUICustomSpin : public CUIWindow, public CUIOptionsItem { public: CUICustomSpin(); diff --git a/src/xrGame/ui/UIDebugFonts.cpp b/src/xrGame/ui/UIDebugFonts.cpp index 43f56b35396..fe3c357c1f0 100644 --- a/src/xrGame/ui/UIDebugFonts.cpp +++ b/src/xrGame/ui/UIDebugFonts.cpp @@ -46,9 +46,7 @@ void CUIDebugFonts::FillUpList() CUITextWnd* pItem = new CUITextWnd(); pItem->SetWndPos(pos); pItem->SetWndSize(sz); -#ifdef DEBUG - xr_sprintf(str, "%s:%s", F->m_font_name.c_str(), StringTable().translate("Test_Font_String").c_str()); -#endif + xr_sprintf(str, "%s:%s", F->m_font_name.c_str(), CStringTable().translate("Test_Font_String").c_str()); pItem->SetFont(F); pItem->SetText(str); pItem->SetTextComplexMode(false); diff --git a/src/xrGame/ui/UIDebugFonts.h b/src/xrGame/ui/UIDebugFonts.h index 234768b1d9d..2f6cdf14e28 100644 --- a/src/xrGame/ui/UIDebugFonts.h +++ b/src/xrGame/ui/UIDebugFonts.h @@ -8,7 +8,7 @@ #pragma once -#include "xrUICore/Static/UIStatic.h" +#include "UIStatic.h" #include "UIDialogWnd.h" class CUIDebugFonts : public CUIDialogWnd diff --git a/src/xrGame/ui/UIDemoPlayControl.cpp b/src/xrGame/ui/UIDemoPlayControl.cpp index 3f4381a3347..30f7ecf6710 100644 --- a/src/xrGame/ui/UIDemoPlayControl.cpp +++ b/src/xrGame/ui/UIDemoPlayControl.cpp @@ -1,12 +1,12 @@ #include "stdafx.h" #include "UIXmlInit.h" -#include "xrUICore/Buttons/UI3tButton.h" -#include "xrUICore/ProgressBar/UIProgressBar.h" -#include "xrUICore/PropertiesBox/UIPropertiesBox.h" -#include "xrUICore/ListBox/UIListBox.h" -#include "xrUICore/ListBox/UIListBoxItem.h" +#include "UI3tButton.h" +#include "UIProgressBar.h" +#include "UIPropertiesBox.h" +#include "UIListBox.h" +#include "UIListBoxItem.h" #include "UIDemoPlayControl.h" -#include "xrUICore/Cursor/UICursor.h" +#include "UICursor.h" #include "xrEngine/XR_IOConsole.h" #include "string_table.h" #include "Level.h" @@ -132,13 +132,14 @@ void CUIDemoPlayControl::Init() void CUIDemoPlayControl::InitRewindTypeList() { + CStringTable st; m_rewind_type->InitPropertiesBox(Fvector2().set(0, 0), Fvector2().set(100, 200)); - m_rewind_type->AddItem(StringTable().translate("mpd_rewind_until_start").c_str(), NULL, eRewindUntilStart); - m_rewind_type->AddItem(StringTable().translate("mpd_rewind_until_kill").c_str(), NULL, eRewindUntilKill); - m_rewind_type->AddItem(StringTable().translate("mpd_rewind_until_die").c_str(), NULL, eRewindUntilDie); - m_rewind_type->AddItem(StringTable().translate("mpd_rewind_until_arttake").c_str(), NULL, eRewindUntilArtTake); - m_rewind_type->AddItem(StringTable().translate("mpd_rewind_until_artdrop").c_str(), NULL, eRewindUntilArtDrop); - m_rewind_type->AddItem(StringTable().translate("mpd_rewind_until_artdeliver").c_str(), NULL, eRewindUntilArtDeliver); + m_rewind_type->AddItem(st.translate("mpd_rewind_until_start").c_str(), NULL, eRewindUntilStart); + m_rewind_type->AddItem(st.translate("mpd_rewind_until_kill").c_str(), NULL, eRewindUntilKill); + m_rewind_type->AddItem(st.translate("mpd_rewind_until_die").c_str(), NULL, eRewindUntilDie); + m_rewind_type->AddItem(st.translate("mpd_rewind_until_arttake").c_str(), NULL, eRewindUntilArtTake); + m_rewind_type->AddItem(st.translate("mpd_rewind_until_artdrop").c_str(), NULL, eRewindUntilArtDrop); + m_rewind_type->AddItem(st.translate("mpd_rewind_until_artdeliver").c_str(), NULL, eRewindUntilArtDeliver); m_rewind_type->AutoUpdateSize(); m_rewind_type->Hide(); } @@ -153,8 +154,9 @@ void CUIDemoPlayControl::InitAllPlayers() m_players_store = xr_malloc(players_count * sizeof(shared_str)); m_players = new players_collection_t(m_players_store, players_count); + CStringTable st; m_all_players->InitPropertiesBox(Fvector2().set(0, 0), Fvector2().set(100, 200)); - m_all_players->AddItem(StringTable().translate("mpd_any_player").c_str(), NULL, 0); // warning ! zero tag means Any player ! + m_all_players->AddItem(st.translate("mpd_any_player").c_str(), NULL, 0); // warning ! zero tag means Any player ! m_players->clear(); for (u32 i = 0; i != players_count; ++i) @@ -313,12 +315,14 @@ void CUIDemoPlayControl::Update() LPCSTR demo_play_string = NULL; string32 demo_pos; string32 demo_speed; + // st.translate("demo play active : ").c_str() (need to translate ?) + CStringTable st; xr_sprintf(demo_pos, ": %2d %%, ", int(Level().GetDemoPlayPos() * 100)); xr_sprintf(demo_speed, ": %1.1fx", Level().GetDemoPlaySpeed()); - STRCONCAT(demo_play_string, Device.Paused() ? StringTable().translate("mpdemoplay_paused") : StringTable().translate("mpdemoplay_active"), - demo_pos, StringTable().translate("mpdemoplay_speed"), demo_speed); + STRCONCAT(demo_play_string, Device.Paused() ? st.translate("mpdemoplay_paused") : st.translate("mpdemoplay_active"), + demo_pos, st.translate("mpdemoplay_speed"), demo_speed); // m_game_ui->SetDemoPlayCaption(demo_play_string); m_progress_bar->SetProgressPos(Level().GetDemoPlayPos()); m_static_demo_status->SetText(demo_play_string); diff --git a/src/xrGame/ui/UIDemoPlayControl.h b/src/xrGame/ui/UIDemoPlayControl.h index e9199e82b78..13d41d507ec 100644 --- a/src/xrGame/ui/UIDemoPlayControl.h +++ b/src/xrGame/ui/UIDemoPlayControl.h @@ -3,7 +3,7 @@ #define UIDEMOPLAY_CONTROL #include "UIDialogWnd.h" -#include "xrUICore/Callbacks/UIWndCallback.h" +#include "UIWndCallback.h" #include "xrCore/buffer_vector.h" class CUI3tButton; diff --git a/src/xrGame/ui/UIDialogWnd.h b/src/xrGame/ui/UIDialogWnd.h index af1681cfaaf..72436c52f87 100644 --- a/src/xrGame/ui/UIDialogWnd.h +++ b/src/xrGame/ui/UIDialogWnd.h @@ -1,5 +1,5 @@ #pragma once -#include "xrUICore/Windows/UIWindow.h" +#include "uiwindow.h" #include "UIDialogHolder.h" class CDialogHolder; diff --git a/src/xrUICore/ProgressBar/UIDoubleProgressBar.cpp b/src/xrGame/ui/UIDoubleProgressBar.cpp similarity index 78% rename from src/xrUICore/ProgressBar/UIDoubleProgressBar.cpp rename to src/xrGame/ui/UIDoubleProgressBar.cpp index 9976aadb2b5..925eb5bfe07 100644 --- a/src/xrUICore/ProgressBar/UIDoubleProgressBar.cpp +++ b/src/xrGame/ui/UIDoubleProgressBar.cpp @@ -1,6 +1,8 @@ -#include "pch.hpp" +// sea 08.01.2008 + +#include "StdAfx.h" #include "UIDoubleProgressBar.h" -#include "XML/UIXmlInitBase.h" +#include "UIXmlInit.h" CUIDoubleProgressBar::CUIDoubleProgressBar() { @@ -11,14 +13,14 @@ CUIDoubleProgressBar::CUIDoubleProgressBar() CUIDoubleProgressBar::~CUIDoubleProgressBar() {} void CUIDoubleProgressBar::InitFromXml(CUIXml& xml_doc, LPCSTR path) { - CUIXmlInitBase::InitProgressBar(xml_doc, path, 0, &m_progress_one); - CUIXmlInitBase::InitProgressBar(xml_doc, path, 0, &m_progress_two); + CUIXmlInit::InitProgressBar(xml_doc, path, 0, &m_progress_one); + CUIXmlInit::InitProgressBar(xml_doc, path, 0, &m_progress_two); string256 buf; strconcat(sizeof(buf), buf, path, ":color_less"); - m_less_color = CUIXmlInitBase::GetColor(xml_doc, buf, 0, color_rgba(255, 0, 0, 255)); + m_less_color = CUIXmlInit::GetColor(xml_doc, buf, 0, color_rgba(255, 0, 0, 255)); strconcat(sizeof(buf), buf, path, ":color_more"); - m_more_color = CUIXmlInitBase::GetColor(xml_doc, buf, 0, color_rgba(0, 255, 0, 255)); + m_more_color = CUIXmlInit::GetColor(xml_doc, buf, 0, color_rgba(0, 255, 0, 255)); m_progress_one.SetRange(0.0f, 100.0f); m_progress_two.SetRange(0.0f, 100.0f); diff --git a/src/xrUICore/ProgressBar/UIDoubleProgressBar.h b/src/xrGame/ui/UIDoubleProgressBar.h similarity index 72% rename from src/xrUICore/ProgressBar/UIDoubleProgressBar.h rename to src/xrGame/ui/UIDoubleProgressBar.h index 71c7acd0603..7303a72417a 100644 --- a/src/xrUICore/ProgressBar/UIDoubleProgressBar.h +++ b/src/xrGame/ui/UIDoubleProgressBar.h @@ -1,8 +1,10 @@ +// sea 08.01.2008 #pragma once -#include "xrUICore/Windows/UIWindow.h" -#include "xrUICore/ProgressBar/UIProgressBar.h" -class XRUICORE_API CUIDoubleProgressBar : public CUIWindow +#include "UIWindow.h" +#include "UIProgressBar.h" + +class CUIDoubleProgressBar : public CUIWindow { public: // func CUIDoubleProgressBar(); diff --git a/src/xrGame/ui/UIDragDropListEx.cpp b/src/xrGame/ui/UIDragDropListEx.cpp index 013b272a9a6..08462030b2a 100644 --- a/src/xrGame/ui/UIDragDropListEx.cpp +++ b/src/xrGame/ui/UIDragDropListEx.cpp @@ -1,9 +1,9 @@ #include "stdafx.h" #include "UIDragDropListEx.h" -#include "xrUICore/ScrollBar/UIScrollBar.h" +#include "UIScrollBar.h" #include "Common/object_broker.h" #include "UICellItem.h" -#include "xrUICore/Cursor/UICursor.h" +#include "UICursor.h" //Alundaio #include "Inventory.h" //-Alundaio diff --git a/src/xrGame/ui/UIDragDropListEx.h b/src/xrGame/ui/UIDragDropListEx.h index 3c83a00f393..eabadce780e 100644 --- a/src/xrGame/ui/UIDragDropListEx.h +++ b/src/xrGame/ui/UIDragDropListEx.h @@ -1,7 +1,7 @@ #pragma once -#include "xrUICore/Windows/UIWindow.h" -#include "xrUICore/Callbacks/UIWndCallback.h" +#include "UIWindow.h" +#include "UIWndCallback.h" class CUICellContainer; class CUIScrollBar; diff --git a/src/xrGame/ui/UIDragDropReferenceList.cpp b/src/xrGame/ui/UIDragDropReferenceList.cpp index ce359f41d2c..1ab530e6f68 100644 --- a/src/xrGame/ui/UIDragDropReferenceList.cpp +++ b/src/xrGame/ui/UIDragDropReferenceList.cpp @@ -2,14 +2,14 @@ #include "UIDragDropReferenceList.h" #include "UICellItem.h" #include "UICellItemFactory.h" -#include "xrUICore/Static/UIStatic.h" +#include "UIStatic.h" #include "Inventory.h" #include "inventoryOwner.h" #include "Actor.h" #include "actor_defs.h" #include "UIInventoryUtilities.h" #include "xrEngine/xr_input.h" -#include "xrUICore/Cursor/UICursor.h" +#include "UICursor.h" #include "UICellItemFactory.h" CUIDragDropReferenceList::CUIDragDropReferenceList() diff --git a/src/xrUICore/EditBox/UIEditBox.cpp b/src/xrGame/ui/UIEditBox.cpp similarity index 91% rename from src/xrUICore/EditBox/UIEditBox.cpp rename to src/xrGame/ui/UIEditBox.cpp index a5b20b05c6a..82a3c9f0d01 100644 --- a/src/xrUICore/EditBox/UIEditBox.cpp +++ b/src/xrGame/ui/UIEditBox.cpp @@ -2,9 +2,9 @@ // ////////////////////////////////////////////////////////////////////// -#include "pch.hpp" +#include "stdafx.h" #include "uieditbox.h" -#include "Windows/UIFrameLineWnd.h" +#include "UIFrameLineWnd.h" CUIEditBox::CUIEditBox() : m_frameLine(NULL) {} void CUIEditBox::InitCustomEdit(Fvector2 pos, Fvector2 size) @@ -33,6 +33,7 @@ void CUIEditBox::InitTextureEx(LPCSTR texture, LPCSTR shader) void CUIEditBox::InitTexture(LPCSTR texture) { InitTextureEx(texture, "hud\\default"); } void CUIEditBox::SetCurrentOptValue() { + CUIOptionsItem::SetCurrentOptValue(); SetText(GetOptStringValue()); } @@ -44,6 +45,7 @@ void CUIEditBox::SaveOptValue() void CUIEditBox::SaveBackUpOptValue() { + CUIOptionsItem::SaveBackUpOptValue(); m_opt_backup_value = GetText(); } diff --git a/src/xrUICore/EditBox/UIEditBox.h b/src/xrGame/ui/UIEditBox.h similarity index 79% rename from src/xrUICore/EditBox/UIEditBox.h rename to src/xrGame/ui/UIEditBox.h index 1d864893174..912a6655e83 100644 --- a/src/xrUICore/EditBox/UIEditBox.h +++ b/src/xrGame/ui/UIEditBox.h @@ -1,10 +1,10 @@ #pragma once -#include "xrUICore/Options/UIOptionsItem.h" -#include "xrUICore/EditBox/UICustomEdit.h" +#include "UIOptionsItem.h" +#include "UICustomEdit.h" class CUIFrameLineWnd; -class XRUICORE_API CUIEditBox : public CUIOptionsItem, public CUICustomEdit +class CUIEditBox : public CUIOptionsItem, public CUICustomEdit { public: CUIEditBox(); diff --git a/src/xrUICore/EditBox/UIEditBoxEx.cpp b/src/xrGame/ui/UIEditBoxEx.cpp similarity index 92% rename from src/xrUICore/EditBox/UIEditBoxEx.cpp rename to src/xrGame/ui/UIEditBoxEx.cpp index 5cc16e5fbaf..0ea980c3710 100644 --- a/src/xrUICore/EditBox/UIEditBoxEx.cpp +++ b/src/xrGame/ui/UIEditBoxEx.cpp @@ -1,6 +1,7 @@ -#include "pch.hpp" +#include "stdafx.h" + #include "UIEditBoxEx.h" -#include "Windows/UIFrameWindow.h" +#include "UIFrameWindow.h" CUIEditBoxEx::CUIEditBoxEx() { diff --git a/src/xrUICore/EditBox/UIEditBoxEx.h b/src/xrGame/ui/UIEditBoxEx.h similarity index 77% rename from src/xrUICore/EditBox/UIEditBoxEx.h rename to src/xrGame/ui/UIEditBoxEx.h index 842f1060ad0..cb7a01fdfc5 100644 --- a/src/xrUICore/EditBox/UIEditBoxEx.h +++ b/src/xrGame/ui/UIEditBoxEx.h @@ -1,9 +1,10 @@ #pragma once -#include "xrUICore/EditBox/UICustomEdit.h" + +#include "UICustomEdit.h" class CUIFrameWindow; -class CUIEditBoxEx : public CUICustomEdit +class CUIEditBoxEx : /*public CUIMultiTextureOwner, */ public CUICustomEdit { public: CUIEditBoxEx(); diff --git a/src/xrGame/ui/UIEditBox_script.cpp b/src/xrGame/ui/UIEditBox_script.cpp new file mode 100644 index 00000000000..b3abe1ba8bb --- /dev/null +++ b/src/xrGame/ui/UIEditBox_script.cpp @@ -0,0 +1,16 @@ +#include "pch_script.h" +#include "UIEditBox.h" +#include "xrScriptEngine/ScriptExporter.hpp" + +using namespace luabind; + +SCRIPT_EXPORT(CUIEditBox, (CUIWindow), { + module(luaState)[class_("CUICustomEdit") + .def("SetText", &CUICustomEdit::SetText) + .def("GetText", &CUICustomEdit::GetText) + .def("CaptureFocus", &CUICustomEdit::CaptureFocus) + .def("SetNextFocusCapturer", &CUICustomEdit::SetNextFocusCapturer), + class_("CUIEditBox") + .def(constructor<>()) + .def("InitTexture", &CUIEditBox::InitTexture)]; +}); diff --git a/src/xrGame/ui/UIEditKeyBind.h b/src/xrGame/ui/UIEditKeyBind.h index 301dd3653f6..21e9f0df22e 100644 --- a/src/xrGame/ui/UIEditKeyBind.h +++ b/src/xrGame/ui/UIEditKeyBind.h @@ -1,7 +1,7 @@ #pragma once -#include "xrUICore/Static/UIStatic.h" -#include "xrUICore/Options/UIOptionsItem.h" +#include "UIStatic.h" +#include "UIOptionsItem.h" struct _action; struct _keyboard; diff --git a/src/xrGame/ui/UIFactionWarWnd.cpp b/src/xrGame/ui/UIFactionWarWnd.cpp index e3e4dfeebaa..698eb19f8ff 100644 --- a/src/xrGame/ui/UIFactionWarWnd.cpp +++ b/src/xrGame/ui/UIFactionWarWnd.cpp @@ -10,8 +10,8 @@ #include "UIFactionWarWnd.h" #include "UIXmlInit.h" -#include "xrUICore/ProgressBar/UIProgressBar.h" -#include "xrUICore/Windows/UIFrameLineWnd.h" +#include "UIProgressBar.h" +#include "UIFrameLineWnd.h" #include "UIHelper.h" #include "FactionState.h" diff --git a/src/xrGame/ui/UIFactionWarWnd.h b/src/xrGame/ui/UIFactionWarWnd.h index 15f55ba83b6..f6df7c59c07 100644 --- a/src/xrGame/ui/UIFactionWarWnd.h +++ b/src/xrGame/ui/UIFactionWarWnd.h @@ -6,8 +6,8 @@ //////////////////////////////////////////////////////////////////////////// #pragma once -#include "xrUICore/Windows/UIWindow.h" -#include "xrUICore/Callbacks/UIWndCallback.h" +#include "UIWindow.h" +#include "UIWndCallback.h" #include "FactionState.h" #include "UIWarState.h" diff --git a/src/xrUICore/ScrollBar/UIFixedScrollBar.cpp b/src/xrGame/ui/UIFixedScrollBar.cpp similarity index 93% rename from src/xrUICore/ScrollBar/UIFixedScrollBar.cpp rename to src/xrGame/ui/UIFixedScrollBar.cpp index 7925184e776..d7faf60a3bb 100644 --- a/src/xrUICore/ScrollBar/UIFixedScrollBar.cpp +++ b/src/xrGame/ui/UIFixedScrollBar.cpp @@ -1,11 +1,9 @@ -#include "pch.hpp" +#include "stdafx.h" #include "UIFixedScrollbar.h" -#include "Buttons/UI3tButton.h" -#include "Windows/UIFrameLineWnd.h" +#include "UI3tButton.h" +#include "UIFrameLineWnd.h" #include "UIScrollBox.h" -#include "XML/UIXmlInitBase.h" -#include "Cursor/UICursor.h" -#include "xrEngine/xr_input_xinput.h" +#include "UIXmlInit.h" CUIFixedScrollBar::CUIFixedScrollBar() { @@ -36,16 +34,16 @@ void CUIFixedScrollBar::InitScrollBar(Fvector2 pos, bool horizontal, LPCSTR prof inherited::SetWndSize(Fvector2().set(width, height)); strconcat(sizeof(_path), _path, profile, ":left_arrow"); - CUIXmlInitBase::Init3tButton(xml_doc, _path, 0, m_DecButton); + CUIXmlInit::Init3tButton(xml_doc, _path, 0, m_DecButton); strconcat(sizeof(_path), _path, profile, ":right_arrow"); - CUIXmlInitBase::Init3tButton(xml_doc, _path, 0, m_IncButton); + CUIXmlInit::Init3tButton(xml_doc, _path, 0, m_IncButton); strconcat(sizeof(_path), _path, profile, ":box"); - CUIXmlInitBase::Init3tButton(xml_doc, _path, 0, m_ScrollBox); + CUIXmlInit::Init3tButton(xml_doc, _path, 0, m_ScrollBox); strconcat(sizeof(_path), _path, profile, ":back"); - CUIXmlInitBase::InitFrameLine(xml_doc, _path, 0, m_FrameBackground); + CUIXmlInit::InitFrameLine(xml_doc, _path, 0, m_FrameBackground); m_ScrollWorkArea = _max(0, iFloor(GetWidth() - 2 * height)); } @@ -54,16 +52,16 @@ void CUIFixedScrollBar::InitScrollBar(Fvector2 pos, bool horizontal, LPCSTR prof inherited::SetWndSize(Fvector2().set(width_v, height_v)); strconcat(sizeof(_path), _path, profile, ":up_arrow"); - CUIXmlInitBase::Init3tButton(xml_doc, _path, 0, m_DecButton); + CUIXmlInit::Init3tButton(xml_doc, _path, 0, m_DecButton); strconcat(sizeof(_path), _path, profile, ":down_arrow"); - CUIXmlInitBase::Init3tButton(xml_doc, _path, 0, m_IncButton); + CUIXmlInit::Init3tButton(xml_doc, _path, 0, m_IncButton); strconcat(sizeof(_path), _path, profile, ":box_v"); - CUIXmlInitBase::Init3tButton(xml_doc, _path, 0, m_ScrollBox); + CUIXmlInit::Init3tButton(xml_doc, _path, 0, m_ScrollBox); strconcat(sizeof(_path), _path, profile, ":back_v"); - CUIXmlInitBase::InitFrameLine(xml_doc, _path, 0, m_FrameBackground); + CUIXmlInit::InitFrameLine(xml_doc, _path, 0, m_FrameBackground); m_ScrollWorkArea = _max(0, iFloor(GetHeight() - 2 * width_v)); } @@ -136,6 +134,8 @@ void CUIFixedScrollBar::ClampByViewRect() } } +#include "UICursor.h" + u32 last_hold_tm = 0; bool CUIFixedScrollBar::OnKeyboardHold(int dik) { diff --git a/src/xrUICore/ScrollBar/UIFixedScrollBar.h b/src/xrGame/ui/UIFixedScrollBar.h similarity index 94% rename from src/xrUICore/ScrollBar/UIFixedScrollBar.h rename to src/xrGame/ui/UIFixedScrollBar.h index b108b8c7bd6..d38a6b0ff2a 100644 --- a/src/xrUICore/ScrollBar/UIFixedScrollBar.h +++ b/src/xrGame/ui/UIFixedScrollBar.h @@ -5,7 +5,7 @@ class CUI3tButton; class CUIScrollBox; class CUIFrameLineWnd; -class XRUICORE_API CUIFixedScrollBar : public CUIScrollBar +class CUIFixedScrollBar : public CUIScrollBar { private: typedef CUIWindow inherited; diff --git a/src/xrUICore/Windows/UIFrameLineWnd.cpp b/src/xrGame/ui/UIFrameLineWnd.cpp similarity index 99% rename from src/xrUICore/Windows/UIFrameLineWnd.cpp rename to src/xrGame/ui/UIFrameLineWnd.cpp index 2609426635d..be03a435923 100644 --- a/src/xrUICore/Windows/UIFrameLineWnd.cpp +++ b/src/xrGame/ui/UIFrameLineWnd.cpp @@ -1,6 +1,6 @@ -#include "pch.hpp" +#include "stdafx.h" #include "UIFrameLineWnd.h" -#include "XML/UITextureMaster.h" +#include "UITextureMaster.h" CUIFrameLineWnd::CUIFrameLineWnd() : bHorizontal(true), m_bTextureVisible(false) { diff --git a/src/xrUICore/Windows/UIFrameLineWnd.h b/src/xrGame/ui/UIFrameLineWnd.h similarity index 95% rename from src/xrUICore/Windows/UIFrameLineWnd.h rename to src/xrGame/ui/UIFrameLineWnd.h index 1cd262b136a..137db0b8f23 100644 --- a/src/xrUICore/Windows/UIFrameLineWnd.h +++ b/src/xrGame/ui/UIFrameLineWnd.h @@ -1,7 +1,8 @@ #pragma once + #include "UIWindow.h" -class XRUICORE_API CUIFrameLineWnd : public CUIWindow +class CUIFrameLineWnd : public CUIWindow { typedef CUIWindow inherited; diff --git a/src/xrUICore/Windows/UIFrameWindow.cpp b/src/xrGame/ui/UIFrameWindow.cpp similarity index 98% rename from src/xrUICore/Windows/UIFrameWindow.cpp rename to src/xrGame/ui/UIFrameWindow.cpp index 4a7e681f0c2..0fdfd7bbc02 100644 --- a/src/xrUICore/Windows/UIFrameWindow.cpp +++ b/src/xrGame/ui/UIFrameWindow.cpp @@ -1,7 +1,8 @@ -#include "pch.hpp" +#include "stdafx.h" #include "UIFrameWindow.h" -#include "XML/UITextureMaster.h" -#include "Static/UIStatic.h" +#include "UITextureMaster.h" +#include "UIXmlInit.h" +#include "UIStatic.h" void draw_rect(Fvector2 LTp, Fvector2 RBp, Fvector2 LTt, Fvector2 RBt, u32 clr, Fvector2 const& ts); diff --git a/src/xrUICore/Windows/UIFrameWindow.h b/src/xrGame/ui/UIFrameWindow.h similarity index 92% rename from src/xrUICore/Windows/UIFrameWindow.h rename to src/xrGame/ui/UIFrameWindow.h index 08542d43677..91a7a2e7fad 100644 --- a/src/xrUICore/Windows/UIFrameWindow.h +++ b/src/xrGame/ui/UIFrameWindow.h @@ -1,7 +1,7 @@ #pragma once -#include "UIWindow.h" +#include "uiwindow.h" -class XRUICORE_API CUIFrameWindow : public CUIWindow, public ITextureOwner +class CUIFrameWindow : public CUIWindow, public ITextureOwner { typedef CUIWindow inherited; diff --git a/src/xrGame/ui/UIGameLog.cpp b/src/xrGame/ui/UIGameLog.cpp index 4a986e165cc..25433886eef 100644 --- a/src/xrGame/ui/UIGameLog.cpp +++ b/src/xrGame/ui/UIGameLog.cpp @@ -10,7 +10,7 @@ #include "UIXmlInit.h" #include "UIPdaMsgListItem.h" #include "UIPdaKillMessage.h" -#include "xrUICore/Lines/UILines.h" +#include "UILines.h" CUIGameLog::CUIGameLog() { diff --git a/src/xrGame/ui/UIGameLog.h b/src/xrGame/ui/UIGameLog.h index 995633bfb4a..64e1d18298c 100644 --- a/src/xrGame/ui/UIGameLog.h +++ b/src/xrGame/ui/UIGameLog.h @@ -8,7 +8,7 @@ #pragma once -#include "xrUICore/ScrollView/UIScrollView.h" +#include "UIScrollView.h" class CUIXml; class CUIPdaKillMessage; diff --git a/src/xrGame/ui/UIGameTutorial.cpp b/src/xrGame/ui/UIGameTutorial.cpp index c061c6cdd6d..b3aa13265c2 100644 --- a/src/xrGame/ui/UIGameTutorial.cpp +++ b/src/xrGame/ui/UIGameTutorial.cpp @@ -1,7 +1,7 @@ #include "pch_script.h" #include "UIGameTutorial.h" -#include "xrUICore/Windows/UIWindow.h" -#include "xrUICore/Static/UIStatic.h" +#include "UIWindow.h" +#include "UIStatic.h" #include "UIXmlInit.h" #include "Common/object_broker.h" #include "xrEngine/xr_input.h" diff --git a/src/xrGame/ui/UIGameTutorialSimpleItem.cpp b/src/xrGame/ui/UIGameTutorialSimpleItem.cpp index c426afb9b14..5d34ee69854 100644 --- a/src/xrGame/ui/UIGameTutorialSimpleItem.cpp +++ b/src/xrGame/ui/UIGameTutorialSimpleItem.cpp @@ -1,7 +1,7 @@ #include "pch_script.h" #include "UIGameTutorial.h" -#include "xrUICore/Static/UIStatic.h" -#include "xrUICore/Cursor/UICursor.h" +#include "UIStatic.h" +#include "uicursor.h" #include "UIXmlInit.h" #include "Common/object_broker.h" #include "xrEngine/xr_input.h" diff --git a/src/xrGame/ui/UIGameTutorialVideoItem.cpp b/src/xrGame/ui/UIGameTutorialVideoItem.cpp index 5afa8dba990..add563cd38a 100644 --- a/src/xrGame/ui/UIGameTutorialVideoItem.cpp +++ b/src/xrGame/ui/UIGameTutorialVideoItem.cpp @@ -1,7 +1,7 @@ #include "pch_script.h" #include "UIGameTutorial.h" -#include "xrUICore/Windows/UIWindow.h" -#include "xrUICore/Static/UIStatic.h" +#include "UIWindow.h" +#include "UIStatic.h" #include "UIXmlInit.h" #include "Common/object_broker.h" #include "xrEngine/xr_input.h" @@ -10,7 +10,7 @@ #include "Include/xrRender/UISequenceVideoItem.h" #include "Include/xrRender/UIShader.h" #include "Include/xrRender/UIRender.h" -#include "xrUICore/Cursor/UICursor.h" +#include "uicursor.h" extern ENGINE_API BOOL bShowPauseString; diff --git a/src/xrGame/ui/UIHelper.cpp b/src/xrGame/ui/UIHelper.cpp index 919e7b9809c..c4f826df712 100644 --- a/src/xrGame/ui/UIHelper.cpp +++ b/src/xrGame/ui/UIHelper.cpp @@ -9,14 +9,14 @@ #include "UIHelper.h" #include "UIXmlInit.h" -#include "xrUICore/ProgressBar/UIProgressBar.h" -#include "xrUICore/Windows/UIFrameLineWnd.h" -#include "xrUICore/Windows/UIFrameWindow.h" -#include "xrUICore/Buttons/UI3tButton.h" -#include "xrUICore/Buttons/UICheckButton.h" -#include "xrUICore/Hint/UIHint.h" +#include "UIProgressBar.h" +#include "UIFrameLineWnd.h" +#include "UIFrameWindow.h" +#include "UI3tButton.h" +#include "UICheckButton.h" +#include "UIHint.h" #include "UIDragDropReferenceList.h" -#include "xrUICore/EditBox/UIEditBox.h" +#include "UIEditBox.h" CUIStatic* UIHelper::CreateStatic(CUIXml& xml, LPCSTR ui_path, CUIWindow* parent) { diff --git a/src/xrUICore/Hint/UIHint.cpp b/src/xrGame/ui/UIHint.cpp similarity index 80% rename from src/xrUICore/Hint/UIHint.cpp rename to src/xrGame/ui/UIHint.cpp index a971d29905a..c749fccd820 100644 --- a/src/xrUICore/Hint/UIHint.cpp +++ b/src/xrGame/ui/UIHint.cpp @@ -5,13 +5,14 @@ // Description : UI Hint (for UIHintWindow) window class implementation //////////////////////////////////////////////////////////////////////////// -#include "pch.hpp" +#include "stdafx.h" #include "UIHint.h" -#include "Static/UIStatic.h" -#include "Windows/UIFrameWindow.h" -#include "XML/UIXmlInitBase.h" -#include "xrEngine/StringTable/IStringTable.h" +#include "UIStatic.h" +#include "UIFrameWindow.h" +#include "UIXmlInit.h" +#include "UIHelper.h" +#include "string_table.h" UIHint::UIHint() { @@ -21,22 +22,14 @@ UIHint::UIHint() void UIHint::init_from_xml(CUIXml& xml, LPCSTR path) { - CUIXmlInitBase::InitWindow(xml, path, 0, this); + CUIXmlInit::InitWindow(xml, path, 0, this); XML_NODE stored_root = xml.GetLocalRoot(); XML_NODE new_root = xml.NavigateToNode(path, 0); xml.SetLocalRoot(new_root); - m_background = new CUIFrameWindow(); - AttachChild(m_background); - m_background->SetAutoDelete(true); - CUIXmlInitBase::InitFrameWindow(xml, "background", 0, m_background); - - m_text = new CUITextWnd(); - AttachChild(m_text); - m_text->SetAutoDelete(true); - CUIXmlInitBase::InitTextWnd(xml, "text", 0, m_text); - + m_background = UIHelper::CreateFrameWindow(xml, "background", this); + m_text = UIHelper::CreateTextWnd(xml, "text", this); m_border = xml.ReadAttribFlt("background", 0, "border", 0.0f); xml.SetLocalRoot(stored_root); @@ -102,11 +95,7 @@ void UIHintWindow::set_hint_text(shared_str const& text) } } -void UIHintWindow::set_hint_text_ST(shared_str const& text) -{ - set_hint_text(gStringTable->translate(text)); -} - +void UIHintWindow::set_hint_text_ST(shared_str const& text) { set_hint_text(CStringTable().translate(text)); } void UIHintWindow::update_hint_text() { if (!m_bCursorOverWindow || !m_hint_text.size() || !m_enable) diff --git a/src/xrUICore/Hint/UIHint.h b/src/xrGame/ui/UIHint.h similarity index 93% rename from src/xrUICore/Hint/UIHint.h rename to src/xrGame/ui/UIHint.h index b9d223bc5b9..bd1a9ff98e4 100644 --- a/src/xrUICore/Hint/UIHint.h +++ b/src/xrGame/ui/UIHint.h @@ -8,14 +8,14 @@ #ifndef UI_HINT_H_INCLUDED #define UI_HINT_H_INCLUDED -#include "xrUICore/Windows/UIWindow.h" +#include "UIWindow.h" class CUIStatic; class CUITextWnd; class CUIFrameWindow; class CUIXml; -class XRUICORE_API UIHint : public CUIWindow +class UIHint : public CUIWindow { private: typedef CUIWindow inherited; @@ -47,7 +47,7 @@ class XRUICORE_API UIHint : public CUIWindow // ================================================================================================= // UIHintWindow = Owner of UIHint -class XRUICORE_API UIHintWindow : public CUIWindow +class UIHintWindow : public CUIWindow { typedef CUIWindow inherited; diff --git a/src/xrGame/ui/UIHudStatesWnd.cpp b/src/xrGame/ui/UIHudStatesWnd.cpp index 3db1143bdb3..07cf3e79de2 100644 --- a/src/xrGame/ui/UIHudStatesWnd.cpp +++ b/src/xrGame/ui/UIHudStatesWnd.cpp @@ -7,12 +7,12 @@ #include "ActorHelmet.h" #include "Inventory.h" #include "RadioactiveZone.h" -#include "xrUICore/Static/UIStatic.h" -#include "xrUICore/ProgressBar/UIProgressBar.h" -#include "xrUICore/ProgressBar/UIProgressShape.h" +#include "UIStatic.h" +#include "UIProgressBar.h" +#include "UIProgressShape.h" #include "UIXmlInit.h" #include "UIHelper.h" -#include "xrUICore/arrow/ui_arrow.h" +#include "ui_arrow.h" #include "UIInventoryUtilities.h" #include "CustomDetector.h" #include "ai/Monsters/BaseMonster/base_monster.h" diff --git a/src/xrGame/ui/UIHudStatesWnd.h b/src/xrGame/ui/UIHudStatesWnd.h index e71b3ed5b01..d4ab4fd7d0a 100644 --- a/src/xrGame/ui/UIHudStatesWnd.h +++ b/src/xrGame/ui/UIHudStatesWnd.h @@ -1,5 +1,5 @@ #pragma once -#include "xrUICore/Windows/UIWindow.h" +#include "UIWindow.h" #include "xrServerEntities/alife_space.h" #include "xrServerEntities/inventory_space.h" #include "actor_defs.h" diff --git a/src/xrUICore/InteractiveBackground/UIInteractiveBackground.h b/src/xrGame/ui/UIInteractiveBackground.h similarity index 95% rename from src/xrUICore/InteractiveBackground/UIInteractiveBackground.h rename to src/xrGame/ui/UIInteractiveBackground.h index 9c9054651d3..f13c530a5bd 100644 --- a/src/xrUICore/InteractiveBackground/UIInteractiveBackground.h +++ b/src/xrGame/ui/UIInteractiveBackground.h @@ -12,9 +12,9 @@ #pragma once -#include "xrUICore/Windows/UIFrameWindow.h" -#include "xrUICore/Windows/UIWindow.h" -#include "xrUICore/Windows/UIFrameLineWnd.h" +#include "UIFrameWindow.h" +#include "UIWindow.h" +#include "UIFrameLineWnd.h" enum IBState { diff --git a/src/xrGame/ui/UIInvUpgrade.cpp b/src/xrGame/ui/UIInvUpgrade.cpp index 0fbcc8f383d..d7a1708aad6 100644 --- a/src/xrGame/ui/UIInvUpgrade.cpp +++ b/src/xrGame/ui/UIInvUpgrade.cpp @@ -12,7 +12,7 @@ #include "UIInvUpgrade.h" -#include "xrUICore/XML/xrUIXmlParser.h" +#include "xrUIXmlParser.h" #include "UIXmlInit.h" #include "ai_space.h" @@ -248,7 +248,7 @@ void UIUpgrade::OnClick() if (m_state == STATE_ENABLED || m_state == STATE_FOCUSED || m_state == STATE_TOUCHED) { m_parent_wnd->AskUsing( - make_string("%s %s", StringTable().translate("st_upgrade_install").c_str(), get_upgrade()->name()).c_str(), + make_string("%s %s", CStringTable().translate("st_upgrade_install").c_str(), get_upgrade()->name()).c_str(), get_upgrade()->id_str()); } m_parent_wnd->set_info_cur_upgrade(NULL); diff --git a/src/xrGame/ui/UIInvUpgrade.h b/src/xrGame/ui/UIInvUpgrade.h index 09dc5381317..c3d8fa684f2 100644 --- a/src/xrGame/ui/UIInvUpgrade.h +++ b/src/xrGame/ui/UIInvUpgrade.h @@ -9,9 +9,9 @@ #ifndef UI_INVENTORY_UPGRADE_H_INCLUDED #define UI_INVENTORY_UPGRADE_H_INCLUDED -#include "xrUICore/Static/UIStatic.h" +#include "UIStatic.h" -#include "xrUICore/XML/xrUIXmlParser.h" +#include "xrUIXmlParser.h" #include "UIXmlInit.h" namespace inventory diff --git a/src/xrGame/ui/UIInvUpgradeInfo.cpp b/src/xrGame/ui/UIInvUpgradeInfo.cpp index aa514466ff5..a8d0a432379 100644 --- a/src/xrGame/ui/UIInvUpgradeInfo.cpp +++ b/src/xrGame/ui/UIInvUpgradeInfo.cpp @@ -11,9 +11,9 @@ #include "string_table.h" #include "Actor.h" -#include "xrUICore/Static/UIStatic.h" +#include "UIStatic.h" #include "UIXmlInit.h" -#include "xrUICore/Windows/UIFrameWindow.h" +#include "UIFrameWindow.h" #include "UIInvUpgradeProperty.h" @@ -115,34 +115,34 @@ bool UIInvUpgradeInfo::init_upgrade(Upgrade_type* upgr, CInventoryItem* inv_item if (upg_res == inventory::upgrade::result_e_installed) { m_prereq->SetTextColor(color_rgba(117, 255, 123, 255)); - xr_sprintf(str_res, sizeof(str_res), "%s", StringTable().translate("st_upgr_installed").c_str()); + xr_sprintf(str_res, sizeof(str_res), "%s", CStringTable().translate("st_upgr_installed").c_str()); } else if (upg_res == inventory::upgrade::result_e_unknown) { - xr_sprintf(str_res, sizeof(str_res), "%s:\\n - %s", StringTable().translate("st_upgr_disable").c_str(), - StringTable().translate("st_upgr_unknown").c_str()); + xr_sprintf(str_res, sizeof(str_res), "%s:\\n - %s", CStringTable().translate("st_upgr_disable").c_str(), + CStringTable().translate("st_upgr_unknown").c_str()); m_cost->Show(false); } else if (upg_res == inventory::upgrade::result_e_group) - xr_sprintf(str_res, sizeof(str_res), "%s:\\n - %s", StringTable().translate("st_upgr_disable").c_str(), - StringTable().translate("st_upgr_group").c_str()); + xr_sprintf(str_res, sizeof(str_res), "%s:\\n - %s", CStringTable().translate("st_upgr_disable").c_str(), + CStringTable().translate("st_upgr_group").c_str()); else if (upg_res_script == inventory::upgrade::result_e_precondition_money) - xr_sprintf(str_res, sizeof(str_res), "%s:\\n - %s", StringTable().translate("st_upgr_disable").c_str(), - StringTable().translate("st_upgr_cant_do").c_str()); + xr_sprintf(str_res, sizeof(str_res), "%s:\\n - %s", CStringTable().translate("st_upgr_disable").c_str(), + CStringTable().translate("st_upgr_cant_do").c_str()); else { if (upg_res != inventory::upgrade::result_ok) { - xr_sprintf(str_res, sizeof(str_res), "%s:\\n%s", StringTable().translate("st_upgr_disable").c_str(), + xr_sprintf(str_res, sizeof(str_res), "%s:\\n%s", CStringTable().translate("st_upgr_disable").c_str(), m_upgrade->get_prerequisites()); if (upg_res == inventory::upgrade::result_e_parents) xr_sprintf(str_res, sizeof(str_res), "%s\\n - %s", str_res, - StringTable().translate("st_upgr_parents").c_str()); + CStringTable().translate("st_upgr_parents").c_str()); if (upg_res == inventory::upgrade::result_e_precondition_money) xr_sprintf(str_res, sizeof(str_res), "%s:\\n - %s", - StringTable().translate("st_upgr_disable").c_str(), - StringTable().translate("st_upgr_cant_do").c_str()); + CStringTable().translate("st_upgr_disable").c_str(), + CStringTable().translate("st_upgr_cant_do").c_str()); } } m_prereq->SetText(str_res); diff --git a/src/xrGame/ui/UIInvUpgradeInfo.h b/src/xrGame/ui/UIInvUpgradeInfo.h index 353ffc95af6..93557e7f00a 100644 --- a/src/xrGame/ui/UIInvUpgradeInfo.h +++ b/src/xrGame/ui/UIInvUpgradeInfo.h @@ -9,8 +9,8 @@ #ifndef UI_INVENTORY_UPGRADE_INFO_H_INCLUDED #define UI_INVENTORY_UPGRADE_INFO_H_INCLUDED -#include "xrUICore/Windows/UIWindow.h" -#include "xrUICore/XML/xrUIXmlParser.h" +#include "UIWindow.h" +#include "xrUIXmlParser.h" namespace inventory { diff --git a/src/xrGame/ui/UIInvUpgradeProperty.cpp b/src/xrGame/ui/UIInvUpgradeProperty.cpp index 030f56a296d..f8367c15567 100644 --- a/src/xrGame/ui/UIInvUpgradeProperty.cpp +++ b/src/xrGame/ui/UIInvUpgradeProperty.cpp @@ -10,8 +10,8 @@ #include "UIInvUpgradeProperty.h" #include "UIInvUpgradeInfo.h" -#include "xrUICore/Static/UIStatic.h" -#include "xrUICore/XML/xrUIXmlParser.h" +#include "UIStatic.h" +#include "xrUIXmlParser.h" #include "UIXmlInit.h" #include "ai_space.h" diff --git a/src/xrGame/ui/UIInvUpgradeProperty.h b/src/xrGame/ui/UIInvUpgradeProperty.h index a1443a12aaf..4992fb93633 100644 --- a/src/xrGame/ui/UIInvUpgradeProperty.h +++ b/src/xrGame/ui/UIInvUpgradeProperty.h @@ -9,7 +9,7 @@ #ifndef UI_INVENTORY_UPGRADE_PROPERTY_H_INCLUDED #define UI_INVENTORY_UPGRADE_PROPERTY_H_INCLUDED -#include "xrUICore/Static/UIStatic.h" +#include "UIStatic.h" #include "inventory_item.h" #include "inventory_upgrade_property.h" diff --git a/src/xrGame/ui/UIInventoryUpgradeWnd.cpp b/src/xrGame/ui/UIInventoryUpgradeWnd.cpp index 12aad0d0e3a..a5435e9b54a 100644 --- a/src/xrGame/ui/UIInventoryUpgradeWnd.cpp +++ b/src/xrGame/ui/UIInventoryUpgradeWnd.cpp @@ -10,7 +10,7 @@ #include "Common/object_broker.h" #include "UIInventoryUpgradeWnd.h" -#include "xrUICore/XML/xrUIXmlParser.h" +#include "xrUIXmlParser.h" #include "UIXmlInit.h" #include "string_table.h" #include "Actor.h" @@ -24,10 +24,10 @@ #include "UIInventoryUtilities.h" #include "UIActorMenu.h" #include "UIItemInfo.h" -#include "xrUICore/Windows/UIFrameLineWnd.h" -#include "xrUICore/Buttons/UI3tButton.h" +#include "UIFrameLineWnd.h" +#include "UI3tButton.h" #include "UIHelper.h" -#include "xrUICore/ui_defs.h" +#include "ui_defs.h" #include "Weapon.h" #include "WeaponRPG7.h" #include "CustomOutfit.h" diff --git a/src/xrGame/ui/UIInventoryUpgradeWnd.h b/src/xrGame/ui/UIInventoryUpgradeWnd.h index 6043c4f3005..cb5bb05d88d 100644 --- a/src/xrGame/ui/UIInventoryUpgradeWnd.h +++ b/src/xrGame/ui/UIInventoryUpgradeWnd.h @@ -9,7 +9,7 @@ #ifndef UI_INVENTORY_UPGRADE_WND_H_INCLUDED #define UI_INVENTORY_UPGRADE_WND_H_INCLUDED -#include "xrUICore/Static/UIStatic.h" +#include "UIStatic.h" #include "UIInvUpgrade.h" extern const LPCSTR g_inventory_upgrade_xml; diff --git a/src/xrGame/ui/UIInventoryUpgradeWnd_add.cpp b/src/xrGame/ui/UIInventoryUpgradeWnd_add.cpp index 62fe71918d9..f5a7b534012 100644 --- a/src/xrGame/ui/UIInventoryUpgradeWnd_add.cpp +++ b/src/xrGame/ui/UIInventoryUpgradeWnd_add.cpp @@ -9,7 +9,7 @@ #include "pch_script.h" #include "Common/object_broker.h" #include "UIInventoryUpgradeWnd.h" -#include "xrUICore/XML/xrUIXmlParser.h" +#include "xrUIXmlParser.h" #include "UIXmlInit.h" #include "string_table.h" diff --git a/src/xrGame/ui/UIInventoryUtilities.cpp b/src/xrGame/ui/UIInventoryUtilities.cpp index a7be671a841..a3d5b256aff 100644 --- a/src/xrGame/ui/UIInventoryUtilities.cpp +++ b/src/xrGame/ui/UIInventoryUtilities.cpp @@ -1,8 +1,8 @@ #include "pch_script.h" #include "UIInventoryUtilities.h" #include "WeaponAmmo.h" -#include "xrUICore/Static/UIStaticItem.h" -#include "xrUICore/Static/UIStatic.h" +#include "UIStaticItem.h" +#include "UIStatic.h" #include "eatable_item.h" #include "Level.h" #include "date_time.h" @@ -321,7 +321,7 @@ const shared_str InventoryUtilities::GetDateAsString(ALife::_TIME_ID date, EDate split_time(date, year, month, day, hours, mins, secs, milisecs); VERIFY(1 <= month && month <= 12); - LPCSTR month_str = StringTable().translate(st_months[month - 1]).c_str(); + LPCSTR month_str = CStringTable().translate(st_months[month - 1]).c_str(); // Date switch (datePrec) @@ -348,20 +348,20 @@ LPCSTR InventoryUtilities::GetTimePeriodAsString(LPSTR _buff, u32 buff_sz, ALife if (month1 != month2) cnt = xr_sprintf( - _buff + cnt, buff_sz - cnt, "%d %s ", month2 - month1, *StringTable().translate("ui_st_months")); + _buff + cnt, buff_sz - cnt, "%d %s ", month2 - month1, *CStringTable().translate("ui_st_months")); if (!cnt && day1 != day2) - cnt = xr_sprintf(_buff + cnt, buff_sz - cnt, "%d %s", day2 - day1, *StringTable().translate("ui_st_days")); + cnt = xr_sprintf(_buff + cnt, buff_sz - cnt, "%d %s", day2 - day1, *CStringTable().translate("ui_st_days")); if (!cnt && hours1 != hours2) cnt = - xr_sprintf(_buff + cnt, buff_sz - cnt, "%d %s", hours2 - hours1, *StringTable().translate("ui_st_hours")); + xr_sprintf(_buff + cnt, buff_sz - cnt, "%d %s", hours2 - hours1, *CStringTable().translate("ui_st_hours")); if (!cnt && mins1 != mins2) - cnt = xr_sprintf(_buff + cnt, buff_sz - cnt, "%d %s", mins2 - mins1, *StringTable().translate("ui_st_mins")); + cnt = xr_sprintf(_buff + cnt, buff_sz - cnt, "%d %s", mins2 - mins1, *CStringTable().translate("ui_st_mins")); if (!cnt && secs1 != secs2) - cnt = xr_sprintf(_buff + cnt, buff_sz - cnt, "%d %s", secs2 - secs1, *StringTable().translate("ui_st_secs")); + cnt = xr_sprintf(_buff + cnt, buff_sz - cnt, "%d %s", secs2 - secs1, *CStringTable().translate("ui_st_secs")); return _buff; } @@ -376,7 +376,7 @@ void InventoryUtilities::UpdateWeightStr(CUITextWnd& wnd, CUITextWnd& wnd_max, C float total = pInvOwner->inventory().CalcTotalWeight(); float max = pInvOwner->MaxCarryWeight(); - LPCSTR kg_str = StringTable().translate("st_kg").c_str(); + LPCSTR kg_str = CStringTable().translate("st_kg").c_str(); xr_sprintf(buf, "%.1f %s", total, kg_str); wnd.SetText(buf); diff --git a/src/xrGame/ui/UIInventoryUtilities.h b/src/xrGame/ui/UIInventoryUtilities.h index 485c759f13f..6cf2020d867 100644 --- a/src/xrGame/ui/UIInventoryUtilities.h +++ b/src/xrGame/ui/UIInventoryUtilities.h @@ -1,7 +1,7 @@ #pragma once #include "inventory_item.h" #include "character_info_defs.h" -#include "xrUICore/ui_defs.h" +#include "ui_defs.h" class CUITextWnd; diff --git a/src/xrGame/ui/UIItemInfo.cpp b/src/xrGame/ui/UIItemInfo.cpp index ba3a6c561d2..f4b898768a3 100644 --- a/src/xrGame/ui/UIItemInfo.cpp +++ b/src/xrGame/ui/UIItemInfo.cpp @@ -1,10 +1,10 @@ #include "pch_script.h" #include "uiiteminfo.h" -#include "xrUICore/Static/UIStatic.h" +#include "uistatic.h" #include "UIXmlInit.h" -#include "xrUICore/ProgressBar/UIProgressBar.h" -#include "xrUICore/ScrollView/UIScrollView.h" -#include "xrUICore/Windows/UIFrameWindow.h" +#include "UIProgressBar.h" +#include "UIScrollView.h" +#include "UIFrameWindow.h" #include "ai_space.h" #include "alife_simulator.h" #include "string_table.h" @@ -206,7 +206,7 @@ void CUIItemInfo::InitItem(CUICellItem* pCellItem, CInventoryItem* pCompareItem, } if (UIWeight) { - LPCSTR kg_str = StringTable().translate("st_kg").c_str(); + LPCSTR kg_str = CStringTable().translate("st_kg").c_str(); float weight = pInvItem->Weight(); if (!weight) @@ -265,7 +265,7 @@ void CUIItemInfo::InitItem(CUICellItem* pCellItem, CInventoryItem* pCompareItem, UITradeTip->Show(false); else { - UITradeTip->SetText(StringTable().translate(trade_tip).c_str()); + UITradeTip->SetText(CStringTable().translate(trade_tip).c_str()); UITradeTip->AdjustHeightToText(); UITradeTip->SetWndPos(pos); UITradeTip->Show(true); diff --git a/src/xrGame/ui/UIItemInfo.h b/src/xrGame/ui/UIItemInfo.h index 4279b5ee8c3..a35e16f98c6 100644 --- a/src/xrGame/ui/UIItemInfo.h +++ b/src/xrGame/ui/UIItemInfo.h @@ -1,5 +1,5 @@ #pragma once -#include "xrUICore/Windows/UIWindow.h" +#include "uiwindow.h" class CInventoryItem; class CUIStatic; diff --git a/src/xrGame/ui/UIKeyBinding.cpp b/src/xrGame/ui/UIKeyBinding.cpp index 991b3409945..687328507e8 100644 --- a/src/xrGame/ui/UIKeyBinding.cpp +++ b/src/xrGame/ui/UIKeyBinding.cpp @@ -1,9 +1,9 @@ #include "StdAfx.h" #include "UIKeyBinding.h" #include "UIXmlInit.h" -#include "xrUICore/XML/xrUIXmlParser.h" +#include "xrUIXmlParser.h" #include "UIEditKeyBind.h" -#include "xrUICore/ScrollView/UIScrollView.h" +#include "UIScrollView.h" #include "xr_level_controller.h" #include "string_table.h" @@ -36,6 +36,7 @@ void CUIKeyBinding::FillUpList(CUIXml& xml_doc_ui, LPCSTR path_ui) { string256 buf; CUIXml xml_doc; + CStringTable st; xml_doc.Load(CONFIG_PATH, UI_PATH, "ui_keybinding.xml"); int groupsCount = xml_doc.GetNodesNum("", 0, "group"); diff --git a/src/xrGame/ui/UIKeyBinding.h b/src/xrGame/ui/UIKeyBinding.h index 8967d9313ef..f44825fd70a 100644 --- a/src/xrGame/ui/UIKeyBinding.h +++ b/src/xrGame/ui/UIKeyBinding.h @@ -1,9 +1,9 @@ #pragma once -#include "xrUICore/Windows/UIWindow.h" +#include "UIWindow.h" -#include "xrUICore/Windows/UIFrameWindow.h" -#include "xrUICore/Windows/UIFrameLineWnd.h" -#include "xrUICore/EditBox/UIEditBox.h" +#include "UIFrameWindow.h" +#include "UIFrameLineWnd.h" +#include "UIEditBox.h" class CUIXml; class CUIScrollView; diff --git a/src/xrGame/ui/UIKickPlayer.cpp b/src/xrGame/ui/UIKickPlayer.cpp index e0c6d1a15d9..fb079561ef9 100644 --- a/src/xrGame/ui/UIKickPlayer.cpp +++ b/src/xrGame/ui/UIKickPlayer.cpp @@ -2,12 +2,12 @@ #include "UIKickPlayer.h" #include "UIVotingCategory.h" #include "UIXmlInit.h" -#include "xrUICore/Buttons/UI3tButton.h" -#include "xrUICore/ListBox/UIListBox.h" -#include "xrUICore/ListBox/UIListBoxItem.h" -#include "xrUICore/SpinBox/UISpinNum.h" +#include "UI3tButton.h" +#include "UIListBox.h" +#include "UIListBoxItem.h" +#include "UISpinNum.h" #include "UIGameCustom.h" -#include "xrUICore/Windows/UIFrameWindow.h" +#include "UIFrameWindow.h" #include "Level.h" #include "game_cl_base.h" #include "game_cl_teamdeathmatch.h" diff --git a/src/xrUICore/Static/UILanimController.cpp b/src/xrGame/ui/UILanimController.cpp similarity index 98% rename from src/xrUICore/Static/UILanimController.cpp rename to src/xrGame/ui/UILanimController.cpp index a847d080a07..a6054ca1a8c 100644 --- a/src/xrUICore/Static/UILanimController.cpp +++ b/src/xrGame/ui/UILanimController.cpp @@ -1,4 +1,4 @@ -#include "pch.hpp" +#include "stdafx.h" #include "UILanimController.h" #include "xrEngine/LightAnimLibrary.h" diff --git a/src/xrUICore/Static/UILanimController.h b/src/xrGame/ui/UILanimController.h similarity index 96% rename from src/xrUICore/Static/UILanimController.h rename to src/xrGame/ui/UILanimController.h index 68d408e79ce..731a25f20d2 100644 --- a/src/xrUICore/Static/UILanimController.h +++ b/src/xrGame/ui/UILanimController.h @@ -1,6 +1,6 @@ #pragma once -#include "xrUICore/Windows/UIWindow.h" +#include "uiwindow.h" #include "xrEngine/LightAnimLibrary.h" #include "xrCore/_color.h" @@ -111,7 +111,7 @@ class CUILightAnimColorConrollerImpl : public CUILightAnimColorConroller } }; -class XRUICORE_API CUIColorAnimConrollerContainer : public CUIWindow, public CUILightAnimColorConrollerImpl +class CUIColorAnimConrollerContainer : public CUIWindow, public CUILightAnimColorConrollerImpl { typedef CUIWindow inherited; diff --git a/src/xrUICore/Lines/UILine.cpp b/src/xrGame/ui/UILine.cpp similarity index 73% rename from src/xrUICore/Lines/UILine.cpp rename to src/xrGame/ui/UILine.cpp index 023b8e3f129..337e2a09bd0 100644 --- a/src/xrUICore/Lines/UILine.cpp +++ b/src/xrGame/ui/UILine.cpp @@ -6,26 +6,74 @@ // // Copyright 2005 GSC Game World -#include "pch.hpp" +#include "StdAfx.h" #include "UILine.h" #include "uilinestd.h" #include "ui_base.h" #include "xrEngine/GameFont.h" +//#define LOG_ALL_LINES +#ifdef LOG_ALL_LINES +int ListLinesCount = 0; +struct DBGList +{ + CUILine* wnd; + int num; +}; +xr_vector dbg_list_lines; +void dump_list_lines() +{ + Msg("------Total Lines %d", dbg_list_lines.size()); + xr_vector::iterator _it = dbg_list_lines.begin(); + for (; _it != dbg_list_lines.end(); ++_it) + Msg("--leak detected ---- Line = %d", (*_it).num); +} +#else +void dump_list_lines() {} +#endif + CUILine::CUILine() { m_tmpLine = NULL; +#ifdef LOG_ALL_LINES + ListLinesCount++; + dbg_list_lines.push_back(DBGList()); + dbg_list_lines.back().wnd = this; + dbg_list_lines.back().num = ListLinesCount; +#endif } CUILine::~CUILine() { xr_delete(m_tmpLine); + +#ifdef LOG_ALL_LINES + xr_vector::iterator _it = dbg_list_lines.begin(); + bool bOK = false; + for (; _it != dbg_list_lines.end(); ++_it) + { + if ((*_it).wnd == this) + { + bOK = true; + dbg_list_lines.erase(_it); + break; + } + } + if (!bOK) + Msg("CUILine::~CUILine()!!!!!!!!!!!!!!!!!!!!!!! cannot find window in list"); +#endif } CUILine::CUILine(const CUILine& other) { m_subLines = other.m_subLines; m_tmpLine = NULL; +#ifdef LOG_ALL_LINES + ListLinesCount++; + dbg_list_lines.push_back(DBGList()); + dbg_list_lines.back().wnd = this; + dbg_list_lines.back().num = ListLinesCount; +#endif } CUILine& CUILine::operator=(const CUILine& other) diff --git a/src/xrUICore/Lines/UILine.h b/src/xrGame/ui/UILine.h similarity index 99% rename from src/xrUICore/Lines/UILine.h rename to src/xrGame/ui/UILine.h index 9e7ba94e873..7e27cadf5a4 100644 --- a/src/xrUICore/Lines/UILine.h +++ b/src/xrGame/ui/UILine.h @@ -7,6 +7,7 @@ // Copyright 2005 GSC Game World #pragma once + #include "UISubLine.h" class Word diff --git a/src/xrUICore/Lines/UILines.cpp b/src/xrGame/ui/UILines.cpp similarity index 97% rename from src/xrUICore/Lines/UILines.cpp rename to src/xrGame/ui/UILines.cpp index 007e23ea3d0..66662af0a3d 100644 --- a/src/xrUICore/Lines/UILines.cpp +++ b/src/xrGame/ui/UILines.cpp @@ -6,11 +6,12 @@ // // Copyright 2005 GSC Game World -#include "pch.hpp" +#include "StdAfx.h" + #include "UILines.h" -#include "XML/UIXmlInitBase.h" +#include "UIXmlInit.h" #include "uilinestd.h" -#include "xrEngine/StringTable/IStringTable.h" +#include "string_table.h" #include "xrCore/Text/StringConversion.hpp" CUILines::CUILines() @@ -69,7 +70,7 @@ void CUILines::SetText(const char* text) Reset(); } } -void CUILines::SetTextST(LPCSTR str_id) { SetText(*gStringTable->translate(str_id)); } +void CUILines::SetTextST(LPCSTR str_id) { SetText(*CStringTable().translate(str_id)); } LPCSTR CUILines::GetText() { return m_text.c_str(); } void CUILines::Reset() { m_lines.clear(); } float get_str_width(CGameFont* pFont, char ch) @@ -446,8 +447,8 @@ u32 CUILines::GetColorFromText(const xr_string& str) const return m_dwTextColor; // Try predefined in XML colors - for (CUIXmlInitBase::ColorDefs::const_iterator it = CUIXmlInitBase::GetColorDefs()->begin(); - it != CUIXmlInitBase::GetColorDefs()->end(); ++it) + for (CUIXmlInit::ColorDefs::const_iterator it = CUIXmlInit::GetColorDefs()->begin(); + it != CUIXmlInit::GetColorDefs()->end(); ++it) { int cmp = str.compare(begin + 3, end - begin - 3, *it->first); if (cmp == 0) diff --git a/src/xrUICore/Lines/UILines.h b/src/xrGame/ui/UILines.h similarity index 94% rename from src/xrUICore/Lines/UILines.h rename to src/xrGame/ui/UILines.h index 4ad0634eb34..43612ed7ac0 100644 --- a/src/xrUICore/Lines/UILines.h +++ b/src/xrGame/ui/UILines.h @@ -1,10 +1,12 @@ #pragma once -#include "xrUICore/Lines/UILine.h" -#include "xrUICore/uiabstract.h" -class XRUICORE_API CUILines : public CDeviceResetNotifier +#include "UILine.h" +#include "uiabstract.h" + +class CUILines : public CDeviceResetNotifier { friend class CUICustomEdit; + friend class CUICDkey; public: CUILines(); @@ -39,7 +41,6 @@ class XRUICORE_API CUILines : public CDeviceResetNotifier void Reset(); void ParseText(bool force = false); float GetVisibleHeight(); - float GetIndentByAlign() const; Fvector2 m_TextOffset; Fvector2 m_wndSize; @@ -48,6 +49,7 @@ class XRUICORE_API CUILines : public CDeviceResetNotifier protected: // %c[255,255,255,255] u32 GetColorFromText(const xr_string& str) const; + float GetIndentByAlign() const; float GetVIndentByAlign(); void CutFirstColoredTextEntry(xr_string& entry, u32& color, xr_string& text) const; CUILine* ParseTextToColoredLine(const xr_string& str); diff --git a/src/xrUICore/ListBox/UIListBox.cpp b/src/xrGame/ui/UIListBox.cpp similarity index 97% rename from src/xrUICore/ListBox/UIListBox.cpp rename to src/xrGame/ui/UIListBox.cpp index b853306310e..f9f187f2d36 100644 --- a/src/xrUICore/ListBox/UIListBox.cpp +++ b/src/xrGame/ui/UIListBox.cpp @@ -1,9 +1,8 @@ -#include "pch.hpp" +#include "stdafx.h" #include "UIListBox.h" #include "UIListBoxItem.h" -#include "ScrollBar/UIScrollBar.h" -#include "Static/UIStatic.h" -#include "xrEngine/StringTable/IStringTable.h" +#include "UIScrollBar.h" +#include "UIStatic.h" CUIListBox::CUIListBox() { @@ -39,13 +38,14 @@ bool CUIListBox::OnMouseAction(float x, float y, EUIMessages mouse_action) return false; } +#include "string_table.h" CUIListBoxItem* CUIListBox::AddTextItem(LPCSTR text) { CUIListBoxItem* pItem = AddItem(); pItem->SetWndSize(Fvector2().set(GetDesiredChildWidth(), m_def_item_height)); pItem->SetTextColor(m_text_color); - pItem->SetText(gStringTable->translate(text).c_str()); + pItem->SetText(CStringTable().translate(text).c_str()); pItem->GetTextItem()->SetWidth(GetDesiredChildWidth()); return pItem; } diff --git a/src/xrUICore/ListBox/UIListBox.h b/src/xrGame/ui/UIListBox.h similarity index 93% rename from src/xrUICore/ListBox/UIListBox.h rename to src/xrGame/ui/UIListBox.h index ef980eeb4f1..14ae135aeff 100644 --- a/src/xrUICore/ListBox/UIListBox.h +++ b/src/xrGame/ui/UIListBox.h @@ -1,9 +1,10 @@ #pragma once -#include "xrUICore/ScrollView/UIScrollView.h" + +#include "UIScrollView.h" class CUIListBoxItem; -class XRUICORE_API CUIListBox : public CUIScrollView +class CUIListBox : public CUIScrollView { public: CUIListBox(); diff --git a/src/xrUICore/ListBox/UIListBoxItem.cpp b/src/xrGame/ui/UIListBoxItem.cpp similarity index 95% rename from src/xrUICore/ListBox/UIListBoxItem.cpp rename to src/xrGame/ui/UIListBoxItem.cpp index 363f9ad8b33..c5fcf18acd3 100644 --- a/src/xrUICore/ListBox/UIListBoxItem.cpp +++ b/src/xrGame/ui/UIListBoxItem.cpp @@ -1,9 +1,8 @@ -#include "pch.hpp" +#include "StdAfx.h" #include "UIListBoxItem.h" -#include "ScrollView/UIScrollView.h" +#include "UIScrollView.h" #include "Common/object_broker.h" -#include "Static/UIStatic.h" -#include "xrEngine/xr_input_xinput.h" +#include "UIStatic.h" CUIListBoxItem::CUIListBoxItem(float height) : m_text(NULL), tag(u32(-1)) { diff --git a/src/xrUICore/ListBox/UIListBoxItem.h b/src/xrGame/ui/UIListBoxItem.h similarity index 86% rename from src/xrUICore/ListBox/UIListBoxItem.h rename to src/xrGame/ui/UIListBoxItem.h index cef7d8016ad..19779a37c01 100644 --- a/src/xrUICore/ListBox/UIListBoxItem.h +++ b/src/xrGame/ui/UIListBoxItem.h @@ -1,10 +1,10 @@ #pragma once -#include "xrUICore/Windows/UIFrameLineWnd.h" +#include "UIFrameLineWnd.h" class CUITextWnd; class CUIStatic; -class XRUICORE_API CUIListBoxItem : public CUIFrameLineWnd, public CUISelectable +class CUIListBoxItem : public CUIFrameLineWnd, public CUISelectable { typedef CUIFrameLineWnd inherited; diff --git a/src/xrUICore/ListBox/UIListBoxItemMsgChain.cpp b/src/xrGame/ui/UIListBoxItemMsgChain.cpp similarity index 76% rename from src/xrUICore/ListBox/UIListBoxItemMsgChain.cpp rename to src/xrGame/ui/UIListBoxItemMsgChain.cpp index 33a6895c762..934623bffd7 100644 --- a/src/xrUICore/ListBox/UIListBoxItemMsgChain.cpp +++ b/src/xrGame/ui/UIListBoxItemMsgChain.cpp @@ -1,5 +1,6 @@ -#include "pch.hpp" +#include "stdafx.h" #include "UIListBoxItemMsgChain.h" +#include "UIScrollView.h" bool CUIListBoxItemMsgChain::OnMouseDown(int mouse_btn) { diff --git a/src/xrUICore/ListBox/UIListBoxItemMsgChain.h b/src/xrGame/ui/UIListBoxItemMsgChain.h similarity index 100% rename from src/xrUICore/ListBox/UIListBoxItemMsgChain.h rename to src/xrGame/ui/UIListBoxItemMsgChain.h diff --git a/src/xrGame/ui/UIListItemServer.cpp b/src/xrGame/ui/UIListItemServer.cpp index 54caae939c0..03064683ce9 100644 --- a/src/xrGame/ui/UIListItemServer.cpp +++ b/src/xrGame/ui/UIListItemServer.cpp @@ -1,7 +1,7 @@ #include "StdAfx.h" #include "UIListItemServer.h" -#include "xrUICore/XML/UITextureMaster.h" +#include "UITextureMaster.h" CUIListItemServer::CUIListItemServer(float height) : inherited(height) { @@ -105,15 +105,15 @@ void CUIListItemServer::SetParams(LIST_SRV_ITEM& params) { string1024 buff; - LPCSTR _srv_name = StringTable().translate(params.info.server).c_str(); + LPCSTR _srv_name = CStringTable().translate(params.info.server).c_str(); cut_string_by_length(m_map->GetFont(), _srv_name, buff, sizeof(buff), m_server->GetWidth()); m_server->SetText(buff); - LPCSTR _map_name = StringTable().translate(params.info.map).c_str(); + LPCSTR _map_name = CStringTable().translate(params.info.map).c_str(); cut_string_by_length(m_map->GetFont(), _map_name, buff, sizeof(buff), m_map->GetWidth()); m_map->SetText(buff); - LPCSTR _game_name = StringTable().translate(params.info.game).c_str(); + LPCSTR _game_name = CStringTable().translate(params.info.game).c_str(); cut_string_by_length(m_game->GetFont(), _game_name, buff, sizeof(buff), m_game->GetWidth()); m_game->SetText(buff); diff --git a/src/xrGame/ui/UIListItemServer.h b/src/xrGame/ui/UIListItemServer.h index 40d8b9d7d98..b4b8b44a3ed 100644 --- a/src/xrGame/ui/UIListItemServer.h +++ b/src/xrGame/ui/UIListItemServer.h @@ -1,7 +1,7 @@ #pragma once -#include "xrUICore/Static/UIStatic.h" -#include "xrUICore/ListBox/UIListBoxItem.h" +#include "UIStatic.h" +#include "UIListBoxItem.h" struct LIST_SRV_SIZES { diff --git a/src/xrGame/ui/UILoadingScreen.h b/src/xrGame/ui/UILoadingScreen.h index 071b75b06a8..f8f0ab5b517 100644 --- a/src/xrGame/ui/UILoadingScreen.h +++ b/src/xrGame/ui/UILoadingScreen.h @@ -9,8 +9,8 @@ #pragma once #include "xrEngine/ILoadingScreen.h" -#include "xrUICore/Static/UIStatic.h" -#include "xrUICore/Windows/UIWindow.h" +#include "UIStatic.h" +#include "UIWindow.h" class CApplication; diff --git a/src/xrGame/ui/UILogsWnd.cpp b/src/xrGame/ui/UILogsWnd.cpp index d895b25c3be..dc8884e459c 100644 --- a/src/xrGame/ui/UILogsWnd.cpp +++ b/src/xrGame/ui/UILogsWnd.cpp @@ -8,13 +8,13 @@ #include "stdafx.h" #include "UILogsWnd.h" #include "UIXmlInit.h" -#include "xrUICore/ProgressBar/UIProgressBar.h" -#include "xrUICore/Windows/UIFrameLineWnd.h" -#include "xrUICore/Windows/UIFrameWindow.h" -#include "xrUICore/ScrollBar/UIScrollBar.h" -#include "xrUICore/ScrollBar/UIFixedScrollBar.h" -#include "xrUICore/ScrollView/UIScrollView.h" -#include "xrUICore/Buttons/UICheckButton.h" +#include "UIProgressBar.h" +#include "UIFrameLineWnd.h" +#include "UIFrameWindow.h" +#include "UIScrollBar.h" +#include "UIFixedScrollBar.h" +#include "UIScrollView.h" +#include "UICheckButton.h" #include "UIHelper.h" #include "UICharacterInfo.h" #include "UIInventoryUtilities.h" @@ -106,7 +106,7 @@ void CUILogsWnd::Init() string256 buf; xr_strcpy(buf, sizeof(buf), m_center_caption->GetText()); - xr_strcat(buf, sizeof(buf), StringTable().translate("ui_logs_center_caption").c_str()); + xr_strcat(buf, sizeof(buf), CStringTable().translate("ui_logs_center_caption").c_str()); m_center_caption->SetText(buf); CUIFixedScrollBar* tmp_scroll = new CUIFixedScrollBar(); diff --git a/src/xrGame/ui/UILogsWnd.h b/src/xrGame/ui/UILogsWnd.h index 1e66909bddc..c3b58f166f2 100644 --- a/src/xrGame/ui/UILogsWnd.h +++ b/src/xrGame/ui/UILogsWnd.h @@ -8,12 +8,12 @@ #ifndef UI_PDA_LOGS_WND_H_INCLUDED #define UI_PDA_LOGS_WND_H_INCLUDED -#include "xrUICore/Windows/UIWindow.h" -#include "xrUICore/Callbacks/UIWndCallback.h" +#include "UIWindow.h" +#include "UIWndCallback.h" #include "ai_space.h" #include "xrServerEntities/alife_space.h" -#include "xrUICore/XML/xrUIXmlParser.h" +#include "xrUIXmlParser.h" class CUIStatic; class CUITextWnd; diff --git a/src/xrGame/ui/UIMMShniaga.cpp b/src/xrGame/ui/UIMMShniaga.cpp index b84f4e16689..0aef3bed277 100644 --- a/src/xrGame/ui/UIMMShniaga.cpp +++ b/src/xrGame/ui/UIMMShniaga.cpp @@ -1,8 +1,8 @@ #include "StdAfx.h" #include "UIMMShniaga.h" -#include "xrUICore/Cursor/UICursor.h" -#include "xrUICore/Static/UIStatic.h" -#include "xrUICore/ScrollView/UIScrollView.h" +#include "UICursor.h" +#include "UIStatic.h" +#include "UIScrollView.h" #include "UIXmlInit.h" #include "MMsound.h" #include "game_base_space.h" @@ -17,31 +17,6 @@ extern string_path g_last_saved_game; -CUIMMMagnifer::CUIMMMagnifer() : m_bPP(false) {} -CUIMMMagnifer::~CUIMMMagnifer() -{ - if (GetPPMode()) - MainMenu()->UnregisterPPDraw(this); -} - -void CUIMMMagnifer::SetPPMode() -{ - m_bPP = true; - MainMenu()->RegisterPPDraw(this); - Show(false); -}; - -void CUIMMMagnifer::ResetPPMode() -{ - if (GetPPMode()) - { - MainMenu()->UnregisterPPDraw(this); - m_bPP = false; - } -} - -//////////////////////////////////////////// - CUIMMShniaga::CUIMMShniaga() { m_sound = new CMMSound(); @@ -50,7 +25,7 @@ CUIMMShniaga::CUIMMShniaga() AttachChild(m_view); m_shniaga = new CUIStatic(); AttachChild(m_shniaga); - m_magnifier = new CUIMMMagnifer(); + m_magnifier = new CUIStatic(); m_shniaga->AttachChild(m_magnifier); m_magnifier->SetPPMode(); m_mag_pos = 0; diff --git a/src/xrGame/ui/UIMMShniaga.h b/src/xrGame/ui/UIMMShniaga.h index 347516e757a..a85ee8bbc0f 100644 --- a/src/xrGame/ui/UIMMShniaga.h +++ b/src/xrGame/ui/UIMMShniaga.h @@ -1,5 +1,6 @@ #pragma once -#include "xrUICore/Windows/UIWindow.h" + +#include "UIWindow.h" class CUIStatic; class CUITextWnd; @@ -7,19 +8,6 @@ class CUIXml; class CUIScrollView; class CMMSound; -class CUIMMMagnifer : public CUIStatic -{ -public: - CUIMMMagnifer(); - virtual ~CUIMMMagnifer(); - void SetPPMode(); - void ResetPPMode(); - bool GetPPMode() { return m_bPP; }; - -protected: - bool m_bPP; -}; - class CUIMMShniaga : public CUIWindow, public CDeviceResetNotifier { public: @@ -63,7 +51,7 @@ class CUIMMShniaga : public CUIWindow, public CDeviceResetNotifier float pos(float x1, float x2, u32 t); CUIStatic* m_shniaga; - CUIMMMagnifer* m_magnifier; + CUIStatic* m_magnifier; CUIScrollView* m_view; u32 m_start_time; diff --git a/src/xrGame/ui/UIMPAdminMenu.cpp b/src/xrGame/ui/UIMPAdminMenu.cpp index 043f4cf5072..980d1f95577 100644 --- a/src/xrGame/ui/UIMPAdminMenu.cpp +++ b/src/xrGame/ui/UIMPAdminMenu.cpp @@ -5,10 +5,10 @@ #include "UIMPChangeMapAdm.h" #include "UIXmlInit.h" #include "Common/object_broker.h" -#include "xrUICore/TabControl/UITabControl.h" -#include "xrUICore/Static/UIStatic.h" -#include "xrUICore/Buttons/UI3tButton.h" -#include "xrUICore/MessageBox/UIMessageBox.h" +#include "UITabControl.h" +#include "UIStatic.h" +#include "UI3tButton.h" +#include "UIMessageBox.h" #include "UIMessageBoxEx.h" #include "xrEngine/xr_ioconsole.h" diff --git a/src/xrGame/ui/UIMPAdminMenu.h b/src/xrGame/ui/UIMPAdminMenu.h index f311da392ab..3a5fdc1e8bf 100644 --- a/src/xrGame/ui/UIMPAdminMenu.h +++ b/src/xrGame/ui/UIMPAdminMenu.h @@ -1,8 +1,8 @@ #pragma once #include "UIDialogWnd.h" -#include "xrUICore/Callbacks/UIWndCallback.h" -#include "xrUICore/MessageBox/UIMessageBox.h" +#include "UIWndCallback.h" +#include "UIMessageBox.h" class CUIStatic; class CUITabControl; diff --git a/src/xrGame/ui/UIMPChangeMapAdm.cpp b/src/xrGame/ui/UIMPChangeMapAdm.cpp index c3121af57e4..2f6a7dd23d8 100644 --- a/src/xrGame/ui/UIMPChangeMapAdm.cpp +++ b/src/xrGame/ui/UIMPChangeMapAdm.cpp @@ -1,10 +1,10 @@ #include "stdafx.h" #include "UIMPChangeMapAdm.h" #include "UIXmlInit.h" -#include "xrUICore/ListBox/UIListBox.h" -#include "xrUICore/ListBox/UIListBoxItem.h" -#include "xrUICore/Static/UIStatic.h" -#include "xrUICore/Buttons/UI3tButton.h" +#include "UIListBox.h" +#include "UIListBoxItem.h" +#include "UIStatic.h" +#include "UI3tButton.h" #include "UIDialogWnd.h" #include "Level.h" #include "xrEngine/xr_ioconsole.h" @@ -102,7 +102,7 @@ void CUIMpChangeMapAdm::FillUpList() u32 cnt = M.m_map_names.size(); for (u32 i = 0; i < cnt; ++i) { - CUIListBoxItem* itm = lst->AddTextItem(StringTable().translate(M.m_map_names[i].map_name).c_str()); + CUIListBoxItem* itm = lst->AddTextItem(CStringTable().translate(M.m_map_names[i].map_name).c_str()); itm->Enable(true); } } diff --git a/src/xrGame/ui/UIMPChangeMapAdm.h b/src/xrGame/ui/UIMPChangeMapAdm.h index ac2ca498a9b..f83b68bade0 100644 --- a/src/xrGame/ui/UIMPChangeMapAdm.h +++ b/src/xrGame/ui/UIMPChangeMapAdm.h @@ -1,7 +1,7 @@ #pragma once -#include "xrUICore/Windows/UIWindow.h" -#include "xrUICore/Callbacks/UIWndCallback.h" +#include "UIWindow.h" +#include "UIWndCallback.h" class CUIXml; class CUIStatic; diff --git a/src/xrGame/ui/UIMPPlayersAdm.cpp b/src/xrGame/ui/UIMPPlayersAdm.cpp index 6a877515310..cd25d3a65d0 100644 --- a/src/xrGame/ui/UIMPPlayersAdm.cpp +++ b/src/xrGame/ui/UIMPPlayersAdm.cpp @@ -1,12 +1,12 @@ #include "stdafx.h" #include "UIMPPlayersAdm.h" #include "UIXmlInit.h" -#include "xrUICore/ListBox/UIListBox.h" -#include "xrUICore/ListBox/UIListBoxItem.h" -#include "xrUICore/Static/UIStatic.h" -#include "xrUICore/Buttons/UI3tButton.h" -#include "xrUICore/TrackBar/UITrackBar.h" -#include "xrUICore/ComboBox/UIComboBox.h" +#include "UIListBox.h" +#include "UIListBoxItem.h" +#include "UIStatic.h" +#include "UI3tButton.h" +#include "UITrackBar.h" +#include "UIComboBox.h" #include "Level.h" #include "xrServer.h" #include "game_cl_base.h" @@ -177,7 +177,7 @@ void CUIMpPlayersAdm::SetMaxPingLimitText() { int ping_limit = m_pPingLimitTrack->GetIValue(); string512 tmp_string; - xr_sprintf(tmp_string, "%s %d", StringTable().translate("ui_mp_am_ping_limit").c_str(), ping_limit * 10); + xr_sprintf(tmp_string, "%s %d", CStringTable().translate("ui_mp_am_ping_limit").c_str(), ping_limit * 10); m_pPingLimitText->SetText(tmp_string); } void CUIMpPlayersAdm::GetSelPlayerScreenshot() diff --git a/src/xrGame/ui/UIMPPlayersAdm.h b/src/xrGame/ui/UIMPPlayersAdm.h index 99cf3a7c094..bacdc78afac 100644 --- a/src/xrGame/ui/UIMPPlayersAdm.h +++ b/src/xrGame/ui/UIMPPlayersAdm.h @@ -1,7 +1,7 @@ #pragma once -#include "xrUICore/Windows/UIWindow.h" -#include "xrUICore/Callbacks/UIWndCallback.h" +#include "UIWindow.h" +#include "UIWndCallback.h" class CUIXml; class CUIListBox; diff --git a/src/xrGame/ui/UIMPServerAdm.cpp b/src/xrGame/ui/UIMPServerAdm.cpp index ef42775149f..43dfc40432c 100644 --- a/src/xrGame/ui/UIMPServerAdm.cpp +++ b/src/xrGame/ui/UIMPServerAdm.cpp @@ -1,10 +1,10 @@ #include "stdafx.h" #include "UIMPServerAdm.h" #include "UIXmlInit.h" -#include "xrUICore/Buttons/UI3tButton.h" -#include "xrUICore/EditBox/UIEditBox.h" -#include "xrUICore/SpinBox/UISpinNum.h" -#include "xrUICore/Buttons/UICheckButton.h" +#include "UI3tButton.h" +#include "UIEditBox.h" +#include "UISpinNum.h" +#include "UICheckButton.h" #include "xrEngine/xr_ioconsole.h" #include "UIDialogWnd.h" diff --git a/src/xrGame/ui/UIMPServerAdm.h b/src/xrGame/ui/UIMPServerAdm.h index f8873a3c1b1..6f70f385137 100644 --- a/src/xrGame/ui/UIMPServerAdm.h +++ b/src/xrGame/ui/UIMPServerAdm.h @@ -1,8 +1,8 @@ #pragma once -#include "xrUICore/Windows/UIWindow.h" -#include "xrUICore/Callbacks/UIWndCallback.h" -#include "xrUICore/Buttons/UI3tButton.h" +#include "UIWindow.h" +#include "UIWndCallback.h" +#include "UI3tButton.h" class CUIXml; class CUI3tButton; diff --git a/src/xrGame/ui/UIMainIngameWnd.cpp b/src/xrGame/ui/UIMainIngameWnd.cpp index 4b42bb9ca6f..73e647ceeac 100644 --- a/src/xrGame/ui/UIMainIngameWnd.cpp +++ b/src/xrGame/ui/UIMainIngameWnd.cpp @@ -35,14 +35,13 @@ #include "attachable_item.h" #include "xrEngine/xr_input.h" #endif -#include "xrUICore/ScrollView/UIScrollView.h" +#include "UIScrollView.h" #include "map_hint.h" #include "game_news.h" #include "static_cast_checked.hpp" #include "game_cl_capture_the_artefact.h" #include "UIHudStatesWnd.h" #include "UIActorMenu.h" -#include "xrUICore/ProgressBar/UIProgressShape.h" void test_draw(); void test_key(int dik); @@ -72,6 +71,7 @@ CUIMainIngameWnd::CUIMainIngameWnd() UIZoneMap = new CUIZoneMap(); } +#include "UIProgressShape.h" extern CUIProgressShape* g_MissileForceShape; CUIMainIngameWnd::~CUIMainIngameWnd() @@ -773,25 +773,25 @@ void CUIMainIngameWnd::UpdateMainIndicators() void CUIMainIngameWnd::UpdateQuickSlots() { string32 tmp; - LPCSTR str = StringTable().translate("quick_use_str_1").c_str(); + LPCSTR str = CStringTable().translate("quick_use_str_1").c_str(); strncpy_s(tmp, sizeof(tmp), str, 3); if (tmp[2] == ',') tmp[1] = '\0'; m_QuickSlotText1->SetTextST(tmp); - str = StringTable().translate("quick_use_str_2").c_str(); + str = CStringTable().translate("quick_use_str_2").c_str(); strncpy_s(tmp, sizeof(tmp), str, 3); if (tmp[2] == ',') tmp[1] = '\0'; m_QuickSlotText2->SetTextST(tmp); - str = StringTable().translate("quick_use_str_3").c_str(); + str = CStringTable().translate("quick_use_str_3").c_str(); strncpy_s(tmp, sizeof(tmp), str, 3); if (tmp[2] == ',') tmp[1] = '\0'; m_QuickSlotText3->SetTextST(tmp); - str = StringTable().translate("quick_use_str_4").c_str(); + str = CStringTable().translate("quick_use_str_4").c_str(); strncpy_s(tmp, sizeof(tmp), str, 3); if (tmp[2] == ',') tmp[1] = '\0'; diff --git a/src/xrGame/ui/UIMap.h b/src/xrGame/ui/UIMap.h index 94fe4938739..e4726454b4f 100644 --- a/src/xrGame/ui/UIMap.h +++ b/src/xrGame/ui/UIMap.h @@ -1,6 +1,6 @@ #pragma once -#include "xrUICore/Static/UIStatic.h" -#include "xrUICore/Callbacks/UIWndCallback.h" +#include "UIStatic.h" +#include "UIWndCallback.h" class CUIGlobalMapSpot; class CUIMapWnd; diff --git a/src/xrGame/ui/UIMapDesc.cpp b/src/xrGame/ui/UIMapDesc.cpp index 0952fc78ad8..56f298095af 100644 --- a/src/xrGame/ui/UIMapDesc.cpp +++ b/src/xrGame/ui/UIMapDesc.cpp @@ -1,10 +1,10 @@ #include "stdafx.h" #include "UIMapDesc.h" -#include "xrUICore/Static/UIStatic.h" -#include "xrUICore/Cursor/UICursor.h" -#include "xrUICore/ScrollView/UIScrollView.h" +#include "UIStatic.h" +#include "UICursor.h" +#include "UIScrollView.h" #include "UIXmlInit.h" -#include "xrUICore/Buttons/UI3tButton.h" +#include "UI3tButton.h" #include "UIGameCustom.h" #include "Level.h" #include "game_cl_teamdeathmatch.h" diff --git a/src/xrGame/ui/UIMapInfo.cpp b/src/xrGame/ui/UIMapInfo.cpp index cfb21af2655..c85e6eb4f20 100644 --- a/src/xrGame/ui/UIMapInfo.cpp +++ b/src/xrGame/ui/UIMapInfo.cpp @@ -1,8 +1,8 @@ #include "StdAfx.h" #include "UIMapInfo.h" -#include "xrUICore/ScrollView/UIScrollView.h" +#include "UIScrollView.h" #include "UIXmlInit.h" -#include "xrUICore/Static/UIStatic.h" +#include "UIStatic.h" #include "string_table.h" CUIMapInfo::CUIMapInfo() @@ -23,13 +23,13 @@ void CUIMapInfo::InitMapInfo(Fvector2 pos, Fvector2 size) } #define ADD_TEXT(x, y, z) \ - text = *StringTable().translate(x); \ + text = *str_tbl.translate(x); \ text += ": "; \ text += txt_color_tag; \ if (ltx.line_exist("map_info", y)) \ - text += *StringTable().translate(ltx.r_string_wb("map_info", y)); \ + text += *str_tbl.translate(ltx.r_string_wb("map_info", y)); \ else \ - text += *StringTable().translate(z); \ + text += *str_tbl.translate(z); \ text += "%c[default]\\n"; \ st = new CUITextWnd(); \ st->SetTextComplexMode(true); \ @@ -46,6 +46,8 @@ void CUIMapInfo::InitMap(LPCSTR map_name, LPCSTR map_ver) if (NULL == map_name) return; + CStringTable str_tbl; + CUIXml xml_doc; xml_doc.Load(CONFIG_PATH, UI_PATH, "ui_mapinfo.xml"); @@ -66,7 +68,7 @@ void CUIMapInfo::InitMap(LPCSTR map_name, LPCSTR map_ver) st = new CUITextWnd(); CUIXmlInit::InitTextWnd(xml_doc, "map_name", 0, st); - xr_string S = StringTable().translate(map_name).c_str(); + xr_string S = str_tbl.translate(map_name).c_str(); if (map_ver) { S += "["; @@ -91,27 +93,27 @@ void CUIMapInfo::InitMap(LPCSTR map_name, LPCSTR map_ver) shared_str _modes = ltx.r_string_wb("map_info", "modes"); - text = *StringTable().translate("modes"); + text = *str_tbl.translate("modes"); text += ": "; text += txt_color_tag; bool b_ = false; if (strstr(_modes.c_str(), "st_deathmatch")) { - text += *StringTable().translate("st_deathmatch"); + text += *str_tbl.translate("st_deathmatch"); b_ = true; } if (strstr(_modes.c_str(), "st_team_deathmatch")) { if (b_) text += ", "; - text += *StringTable().translate("st_team_deathmatch"); + text += *str_tbl.translate("st_team_deathmatch"); b_ = true; } if (strstr(_modes.c_str(), "st_artefacthunt")) { if (b_) text += ", "; - text += *StringTable().translate("st_artefacthunt"); + text += *str_tbl.translate("st_artefacthunt"); } text += "%c[default]\\n"; @@ -128,7 +130,7 @@ void CUIMapInfo::InitMap(LPCSTR map_name, LPCSTR map_ver) ADD_TEXT("mp_description", "short_desc", ""); if (ltx.line_exist("map_info", "large_desc")) - m_large_desc = StringTable().translate(ltx.r_string_wb("map_info", "large_desc")); + m_large_desc = str_tbl.translate(ltx.r_string_wb("map_info", "large_desc")); } else { diff --git a/src/xrGame/ui/UIMapInfo.h b/src/xrGame/ui/UIMapInfo.h index 896fdc409a8..46fb72f9656 100644 --- a/src/xrGame/ui/UIMapInfo.h +++ b/src/xrGame/ui/UIMapInfo.h @@ -1,6 +1,6 @@ #pragma once -#include "xrUICore/Windows/UIWindow.h" +#include "UIWindow.h" class CUIScrollView; diff --git a/src/xrGame/ui/UIMapLegend.cpp b/src/xrGame/ui/UIMapLegend.cpp index fbc6f85c04a..1ddc3f21e07 100644 --- a/src/xrGame/ui/UIMapLegend.cpp +++ b/src/xrGame/ui/UIMapLegend.cpp @@ -8,17 +8,17 @@ #include "stdafx.h" #include "UIMapLegend.h" -#include "xrUICore/XML/xrUIXmlParser.h" +#include "xrUIXmlParser.h" #include "UIXmlInit.h" #include "UIHelper.h" -#include "xrUICore/Windows/UIFrameWindow.h" -#include "xrUICore/ScrollView/UIScrollView.h" -#include "xrUICore/Static/UIStatic.h" -#include "xrUICore/Buttons/UI3tButton.h" -#include "xrUICore/Buttons/UICheckButton.h" -#include "xrUICore/Windows/UIFrameLineWnd.h" -#include "xrUICore/Hint/UIHint.h" +#include "UIFrameWindow.h" +#include "UIScrollView.h" +#include "UIStatic.h" +#include "UI3tButton.h" +#include "UICheckButton.h" +#include "UIFrameLineWnd.h" +#include "UIHint.h" #include "UIInventoryUtilities.h" #include "string_table.h" diff --git a/src/xrGame/ui/UIMapLegend.h b/src/xrGame/ui/UIMapLegend.h index 78d7c77c17d..4d9f08fbcc2 100644 --- a/src/xrGame/ui/UIMapLegend.h +++ b/src/xrGame/ui/UIMapLegend.h @@ -8,7 +8,7 @@ #ifndef UI_MAP_LEGEND_WND_H_INCLUDED #define UI_MAP_LEGEND_WND_H_INCLUDED -#include "xrUICore/Windows/UIWindow.h" +#include "UIWindow.h" class CUIXml; class CUIFrameWindow; diff --git a/src/xrGame/ui/UIMapList.cpp b/src/xrGame/ui/UIMapList.cpp index 0920fb4bb6e..c9f6c546ef1 100644 --- a/src/xrGame/ui/UIMapList.cpp +++ b/src/xrGame/ui/UIMapList.cpp @@ -1,14 +1,14 @@ #include "StdAfx.h" #include "UIMapList.h" -#include "xrUICore/ListBox/UIListBox.h" -#include "xrUICore/Windows/UIFrameWindow.h" -#include "xrUICore/Windows/UIFrameLineWnd.h" -#include "xrUICore/Buttons/UI3tButton.h" -#include "xrUICore/SpinBox/UISpinText.h" +#include "UIListBox.h" +#include "UIFrameWindow.h" +#include "UIFrameLineWnd.h" +#include "UI3tButton.h" +#include "UISpinText.h" #include "UIXmlInit.h" #include "UIMapInfo.h" -#include "xrUICore/ComboBox/UIComboBox.h" -#include "xrUICore/ListBox/UIListBoxItem.h" +#include "UIComboBox.h" +#include "UIListBoxItem.h" #include "xrEngine/xr_ioconsole.h" #include "string_table.h" #include "Common/object_broker.h" @@ -154,13 +154,13 @@ EGameIDs CUIMapList::GetCurGameType() if (combo_ms) { text = combo_ms->GetText(); - if (0 == xr_strcmp(text, StringTable().translate(get_token_name(g_GameModes, eGameIDDeathmatch)))) + if (0 == xr_strcmp(text, CStringTable().translate(get_token_name(g_GameModes, eGameIDDeathmatch)))) return eGameIDDeathmatch; - else if (0 == xr_strcmp(text, StringTable().translate(get_token_name(g_GameModes, eGameIDTeamDeathmatch)))) + else if (0 == xr_strcmp(text, CStringTable().translate(get_token_name(g_GameModes, eGameIDTeamDeathmatch)))) return eGameIDTeamDeathmatch; - else if (0 == xr_strcmp(text, StringTable().translate(get_token_name(g_GameModes, eGameIDArtefactHunt)))) + else if (0 == xr_strcmp(text, CStringTable().translate(get_token_name(g_GameModes, eGameIDArtefactHunt)))) return eGameIDArtefactHunt; - else if (0 == xr_strcmp(text, StringTable().translate(get_token_name(g_GameModes, eGameIDCaptureTheArtefact)))) + else if (0 == xr_strcmp(text, CStringTable().translate(get_token_name(g_GameModes, eGameIDCaptureTheArtefact)))) return eGameIDCaptureTheArtefact; else NODEFAULT; @@ -281,7 +281,7 @@ void CUIMapList::SetModeSelector(CUIWindow* ms) { m_pModeSelector = ms; } void CUIMapList::SetMapPic(CUIStatic* map_pic) { m_pMapPic = map_pic; } void CUIMapList::SetMapInfo(CUIMapInfo* map_info) { m_pMapInfo = map_info; } void CUIMapList::SetServerParams(LPCSTR params) { m_srv_params = params; } -#include "xrUICore/ListBox/UIListBoxItem.h" +#include "uilistboxitem.h" void CUIMapList::AddWeather(const shared_str& WeatherType, const shared_str& WeatherTime, u32 _id) { R_ASSERT2(m_pWeatherSelector, "m_pWeatherSelector == NULL"); @@ -318,7 +318,7 @@ void CUIMapList::UpdateMapList(EGameIDs GameType) u32 cnt = M.m_map_names.size(); for (u32 i = 0; i < cnt; ++i) { - CUIListBoxItem* itm = m_pList1->AddTextItem(StringTable().translate(M.m_map_names[i].map_name).c_str()); + CUIListBoxItem* itm = m_pList1->AddTextItem(CStringTable().translate(M.m_map_names[i].map_name).c_str()); itm->SetData((void*)(__int64)i); itm->Enable(true); } diff --git a/src/xrGame/ui/UIMapList.h b/src/xrGame/ui/UIMapList.h index 6c901dbfcb5..58f14142508 100644 --- a/src/xrGame/ui/UIMapList.h +++ b/src/xrGame/ui/UIMapList.h @@ -1,5 +1,5 @@ #pragma once -#include "xrUICore/Windows/UIWindow.h" +#include "UIWindow.h" #include "gametype_chooser.h" #include "uiGameCustom.h" diff --git a/src/xrGame/ui/UIMapWnd.cpp b/src/xrGame/ui/UIMapWnd.cpp index 97093943814..7408c19cdf6 100644 --- a/src/xrGame/ui/UIMapWnd.cpp +++ b/src/xrGame/ui/UIMapWnd.cpp @@ -7,16 +7,16 @@ #include "UIInventoryUtilities.h" #include "map_spot.h" #include "map_location.h" -#include "xrUICore/ScrollBar/UIFixedScrollBar.h" -#include "xrUICore/Windows/UIFrameWindow.h" -#include "xrUICore/Windows/UIFrameLineWnd.h" -#include "xrUICore/TabControl/UITabControl.h" -#include "xrUICore/Buttons/UI3tButton.h" +#include "UIFixedScrollBar.h" +#include "UIFrameWindow.h" +#include "UIFrameLineWnd.h" +#include "UITabControl.h" +#include "UI3tButton.h" #include "UIMapWndActions.h" #include "UIMapWndActionsSpace.h" -#include "xrUICore/Hint/UIHint.h" +#include "UIHint.h" #include "map_hint.h" -#include "xrUICore/Cursor/UICursor.h" +#include "uicursor.h" #include "xrEngine/xr_input.h" //remove me !!! CUIMapWnd* g_map_wnd = NULL; // quick temporary solution -( diff --git a/src/xrGame/ui/UIMapWnd.h b/src/xrGame/ui/UIMapWnd.h index 236b3868349..c8958f2eeb3 100644 --- a/src/xrGame/ui/UIMapWnd.h +++ b/src/xrGame/ui/UIMapWnd.h @@ -1,7 +1,7 @@ #pragma once -#include "xrUICore/Windows/UIWindow.h" -#include "xrUICore/Callbacks/UIWndCallback.h" +#include "UIWindow.h" +#include "UIWndCallback.h" class CUICustomMap; class CUIGlobalMap; diff --git a/src/xrGame/ui/UIMapWnd2.cpp b/src/xrGame/ui/UIMapWnd2.cpp index 950b498eb93..533bae0ba75 100644 --- a/src/xrGame/ui/UIMapWnd2.cpp +++ b/src/xrGame/ui/UIMapWnd2.cpp @@ -2,7 +2,7 @@ #include "UIMapWnd.h" #include "UIMap.h" #include "UIXmlInit.h" -#include "xrUICore/Buttons/UI3tButton.h" +#include "UI3tButton.h" #include "UIHelper.h" #include "UITaskWnd.h" diff --git a/src/xrUICore/MessageBox/UIMessageBox.cpp b/src/xrGame/ui/UIMessageBox.cpp similarity index 98% rename from src/xrUICore/MessageBox/UIMessageBox.cpp rename to src/xrGame/ui/UIMessageBox.cpp index 6a4543467c6..4337a4dba91 100644 --- a/src/xrUICore/MessageBox/UIMessageBox.cpp +++ b/src/xrGame/ui/UIMessageBox.cpp @@ -1,8 +1,9 @@ -#include "pch.hpp" +#include "stdafx.h" #include "UIMessageBox.h" -#include "XML/UIXmlInitBase.h" -#include "Buttons/UI3tButton.h" -#include "EditBox/UIEditBox.h" +#include "UIXmlInit.h" +#include "UI3tButton.h" +#include "UIEditBox.h" +#include "string_table.h" CUIMessageBox::CUIMessageBox() { @@ -53,7 +54,7 @@ void CUIMessageBox::InitMessageBox(LPCSTR box_template) Clear(); CUIXml uiXml; uiXml.Load(CONFIG_PATH, UI_PATH, "message_box.xml"); - CUIXmlInitBase xml_init; + CUIXmlInit xml_init; string512 str; diff --git a/src/xrUICore/MessageBox/UIMessageBox.h b/src/xrGame/ui/UIMessageBox.h similarity index 94% rename from src/xrUICore/MessageBox/UIMessageBox.h rename to src/xrGame/ui/UIMessageBox.h index 5784b84ff23..5b805b9f958 100644 --- a/src/xrUICore/MessageBox/UIMessageBox.h +++ b/src/xrGame/ui/UIMessageBox.h @@ -1,10 +1,11 @@ #pragma once -#include "xrUICore/Static/UIStatic.h" + +#include "UIStatic.h" class CUI3tButton; class CUIEditBox; -class XRUICORE_API CUIMessageBox : public CUIStatic +class CUIMessageBox : public CUIStatic { private: typedef CUIStatic inherited; diff --git a/src/xrGame/ui/UIMessageBoxEx.cpp b/src/xrGame/ui/UIMessageBoxEx.cpp index 8ee7dc426d7..8f2a26dfc87 100644 --- a/src/xrGame/ui/UIMessageBoxEx.cpp +++ b/src/xrGame/ui/UIMessageBoxEx.cpp @@ -1,5 +1,5 @@ #include "stdafx.h" -#include "xrUICore/MessageBox/UIMessageBox.h" +#include "UIMessageBox.h" #include "UIMessageBoxEx.h" #include "UIDialogHolder.h" diff --git a/src/xrGame/ui/UIMessageBoxEx.h b/src/xrGame/ui/UIMessageBoxEx.h index 700c2eb469b..707bf7967d8 100644 --- a/src/xrGame/ui/UIMessageBoxEx.h +++ b/src/xrGame/ui/UIMessageBoxEx.h @@ -1,6 +1,6 @@ #pragma once #include "UIDialogWnd.h" -#include "xrUICore/Callbacks/UIWndCallback.h" +#include "UIWndCallback.h" class CUIMessageBox; diff --git a/src/xrUICore/MessageBox/UIMessageBox_script.cpp b/src/xrGame/ui/UIMessageBox_script.cpp similarity index 51% rename from src/xrUICore/MessageBox/UIMessageBox_script.cpp rename to src/xrGame/ui/UIMessageBox_script.cpp index 3698ae73e08..64594087f3c 100644 --- a/src/xrUICore/MessageBox/UIMessageBox_script.cpp +++ b/src/xrGame/ui/UIMessageBox_script.cpp @@ -1,5 +1,6 @@ -#include "pch.hpp" +#include "pch_script.h" #include "UIMessageBox.h" +#include "UIMessageBoxEx.h" #include "xrScriptEngine/ScriptExporter.hpp" using namespace luabind; @@ -12,3 +13,12 @@ SCRIPT_EXPORT(CUIMessageBox, (CUIStatic), { .def("GetHost", &CUIMessageBox::GetHost) .def("GetPassword", &CUIMessageBox::GetPassword)]; }); + +SCRIPT_EXPORT(CUIMessageBoxEx, (CUIDialogWnd), { + module(luaState)[class_("CUIMessageBoxEx") + .def(constructor<>()) + .def("InitMessageBox", &CUIMessageBoxEx::InitMessageBox) + .def("SetText", &CUIMessageBoxEx::SetText) + .def("GetHost", &CUIMessageBoxEx::GetHost) + .def("GetPassword", &CUIMessageBoxEx::GetPassword)]; +}); diff --git a/src/xrUICore/UIMessages.h b/src/xrGame/ui/UIMessages.h similarity index 100% rename from src/xrUICore/UIMessages.h rename to src/xrGame/ui/UIMessages.h diff --git a/src/xrGame/ui/UIMessagesWindow.cpp b/src/xrGame/ui/UIMessagesWindow.cpp index 1a7390fa678..47ef564ddb5 100644 --- a/src/xrGame/ui/UIMessagesWindow.cpp +++ b/src/xrGame/ui/UIMessagesWindow.cpp @@ -10,7 +10,7 @@ #include "UIMessagesWindow.h" #include "UIGameLog.h" #include "UIChatWnd.h" -#include "xrUICore/XML/xrUIXmlParser.h" +#include "xrUIXmlParser.h" #include "UIXmlInit.h" #include "UIInventoryUtilities.h" #include "game_news.h" diff --git a/src/xrGame/ui/UIMessagesWindow.h b/src/xrGame/ui/UIMessagesWindow.h index 3a5f80c514b..c6842475d2f 100644 --- a/src/xrGame/ui/UIMessagesWindow.h +++ b/src/xrGame/ui/UIMessagesWindow.h @@ -8,7 +8,7 @@ #pragma once -#include "xrUICore/Windows/UIWindow.h" +#include "UIWindow.h" class CUIGameLog; class CUIChatWnd; diff --git a/src/xrGame/ui/UIMoneyIndicator.cpp b/src/xrGame/ui/UIMoneyIndicator.cpp index a5a0d2a6d32..5e25263109a 100644 --- a/src/xrGame/ui/UIMoneyIndicator.cpp +++ b/src/xrGame/ui/UIMoneyIndicator.cpp @@ -1,6 +1,6 @@ #include "stdafx.h" #include "UIMoneyIndicator.h" -#include "xrUICore/XML/xrUIXmlParser.h" +#include "xrUIXmlParser.h" #include "UIXmlInit.h" #include "UIGameLog.h" diff --git a/src/xrGame/ui/UIMoneyIndicator.h b/src/xrGame/ui/UIMoneyIndicator.h index e5cd005f64b..1f82d6e4c04 100644 --- a/src/xrGame/ui/UIMoneyIndicator.h +++ b/src/xrGame/ui/UIMoneyIndicator.h @@ -1,6 +1,6 @@ #pragma once -#include "xrUICore/Static/UIStatic.h" +#include "UIStatic.h" #include "KillMessageStruct.h" class CUIXml; diff --git a/src/xrGame/ui/UIMotionIcon.h b/src/xrGame/ui/UIMotionIcon.h index 79792314b7f..cfd41c1384d 100644 --- a/src/xrGame/ui/UIMotionIcon.h +++ b/src/xrGame/ui/UIMotionIcon.h @@ -1,6 +1,6 @@ #pragma once -#include "xrUICore/ProgressBar/UIProgressBar.h" -#include "xrUICore/ProgressBar/UIProgressShape.h" +#include "UIProgressBar.h" +#include "UIProgressShape.h" class CUIMotionIcon : public CUIWindow { diff --git a/src/xrGame/ui/UIMpTradeWnd.cpp b/src/xrGame/ui/UIMpTradeWnd.cpp index cf850e3654e..40ee200ed59 100644 --- a/src/xrGame/ui/UIMpTradeWnd.cpp +++ b/src/xrGame/ui/UIMpTradeWnd.cpp @@ -2,7 +2,7 @@ #include "UIMpTradeWnd.h" #include "UIMpItemsStoreWnd.h" #include "UITabButtonMP.h" -#include "xrUICore/TabControl/UITabControl.h" +#include "UITabControl.h" #include "UIDragDropListEx.h" #include "UICellItem.h" #include "UIDialogHolder.h" diff --git a/src/xrGame/ui/UIMpTradeWnd.h b/src/xrGame/ui/UIMpTradeWnd.h index 4e6b50f8a40..ceeabe69812 100644 --- a/src/xrGame/ui/UIMpTradeWnd.h +++ b/src/xrGame/ui/UIMpTradeWnd.h @@ -2,7 +2,7 @@ #include "UIBuyWndShared.h" #include "UIBuyWndBase.h" -#include "xrUICore/Callbacks/UIWndCallback.h" +#include "UIWndCallback.h" #include "restrictions.h" #include "UIMpItemsStoreWnd.h" diff --git a/src/xrGame/ui/UIMpTradeWnd_init.cpp b/src/xrGame/ui/UIMpTradeWnd_init.cpp index bf138bbeaf8..6fc71ed60b3 100644 --- a/src/xrGame/ui/UIMpTradeWnd_init.cpp +++ b/src/xrGame/ui/UIMpTradeWnd_init.cpp @@ -3,7 +3,7 @@ #include "UIXmlInit.h" #include "UIMpItemsStoreWnd.h" -#include "xrUICore/TabControl/UITabControl.h" +#include "UITabControl.h" #include "UITabButtonMP.h" #include "UIDragDropListEx.h" #include "UIItemInfo.h" diff --git a/src/xrGame/ui/UIMpTradeWnd_items.cpp b/src/xrGame/ui/UIMpTradeWnd_items.cpp index a7d780c4e77..6bba4e8402a 100644 --- a/src/xrGame/ui/UIMpTradeWnd_items.cpp +++ b/src/xrGame/ui/UIMpTradeWnd_items.cpp @@ -536,7 +536,7 @@ void CUIMpTradeWnd::StorePreset(ETradePreset idx, bool bSilent, bool check_allow if (!bSilent) { string512 buff; - xr_sprintf(buff, "%s [%d]", StringTable().translate("ui_st_preset_stored_to").c_str(), idx); + xr_sprintf(buff, "%s [%d]", CStringTable().translate("ui_st_preset_stored_to").c_str(), idx); SetInfoString(buff); } auto it = m_all_items.begin(); diff --git a/src/xrGame/ui/UIMpTradeWnd_misc.cpp b/src/xrGame/ui/UIMpTradeWnd_misc.cpp index 43020d80a16..02fe96f09f0 100644 --- a/src/xrGame/ui/UIMpTradeWnd_misc.cpp +++ b/src/xrGame/ui/UIMpTradeWnd_misc.cpp @@ -2,10 +2,10 @@ #include "UIMpTradeWnd.h" #include "UIMpItemsStoreWnd.h" #include "UICellItem.h" -#include "xrUICore/TabControl/UITabControl.h" +#include "UITabControl.h" #include "UIDragDropListEx.h" #include "UIItemInfo.h" -#include "xrUICore/Buttons/UI3tButton.h" +#include "UI3tButton.h" #include "inventory_item.h" #include "PhysicsShellHolder.h" #include "Common/object_broker.h" diff --git a/src/xrGame/ui/UIMpTradeWnd_trade.cpp b/src/xrGame/ui/UIMpTradeWnd_trade.cpp index 44076a27055..b957c51c215 100644 --- a/src/xrGame/ui/UIMpTradeWnd_trade.cpp +++ b/src/xrGame/ui/UIMpTradeWnd_trade.cpp @@ -214,10 +214,10 @@ bool CUIMpTradeWnd::CheckBuyPossibility(const shared_str& sect_name, u32 buy_fla { if (!b_silent) xr_sprintf(info_buffer, "%s. %s. %s[%d] %s[%d]", - StringTable().translate("ui_inv_cant_buy_item").c_str(), - StringTable().translate("ui_inv_not_enought_money").c_str(), - StringTable().translate("ui_inv_has").c_str(), GetMoneyAmount(), - StringTable().translate("ui_inv_need").c_str(), _item_cost); + CStringTable().translate("ui_inv_cant_buy_item").c_str(), + CStringTable().translate("ui_inv_not_enought_money").c_str(), + CStringTable().translate("ui_inv_has").c_str(), GetMoneyAmount(), + CStringTable().translate("ui_inv_need").c_str(), _item_cost); b_can_buy = false; }; } @@ -225,9 +225,9 @@ bool CUIMpTradeWnd::CheckBuyPossibility(const shared_str& sect_name, u32 buy_fla if (b_can_buy && (buy_flags & bf_check_rank_restr) && !g_mp_restrictions.IsAvailable(sect_name)) { if (!b_silent) - xr_sprintf(info_buffer, "%s. %s. %s[%s] %s[%s] ", StringTable().translate("ui_inv_cant_buy_item").c_str(), - StringTable().translate("ui_inv_rank_restr").c_str(), StringTable().translate("ui_inv_has").c_str(), - g_mp_restrictions.GetRankName(GetRank()).c_str(), StringTable().translate("ui_inv_need").c_str(), + xr_sprintf(info_buffer, "%s. %s. %s[%s] %s[%s] ", CStringTable().translate("ui_inv_cant_buy_item").c_str(), + CStringTable().translate("ui_inv_rank_restr").c_str(), CStringTable().translate("ui_inv_has").c_str(), + g_mp_restrictions.GetRankName(GetRank()).c_str(), CStringTable().translate("ui_inv_need").c_str(), g_mp_restrictions.GetRankName(get_rank(sect_name)).c_str()); b_can_buy = false; } @@ -243,9 +243,9 @@ bool CUIMpTradeWnd::CheckBuyPossibility(const shared_str& sect_name, u32 buy_fla if (cnt_have >= cnt_restr) { if (!b_silent) - xr_sprintf(info_buffer, "%s. %s. %s [%d]", StringTable().translate("ui_inv_cant_buy_item").c_str(), - StringTable().translate("ui_inv_count_restr").c_str(), - StringTable().translate("ui_inv_you_already_have").c_str(), cnt_have); + xr_sprintf(info_buffer, "%s. %s. %s [%d]", CStringTable().translate("ui_inv_cant_buy_item").c_str(), + CStringTable().translate("ui_inv_count_restr").c_str(), + CStringTable().translate("ui_inv_you_already_have").c_str(), cnt_have); b_can_buy = false; } } diff --git a/src/xrGame/ui/UINewsItemWnd.cpp b/src/xrGame/ui/UINewsItemWnd.cpp index af442aa742b..61508c68ad0 100644 --- a/src/xrGame/ui/UINewsItemWnd.cpp +++ b/src/xrGame/ui/UINewsItemWnd.cpp @@ -1,7 +1,7 @@ #include "stdafx.h" #include "UINewsItemWnd.h" #include "UIXmlInit.h" -#include "xrUICore/Static/UIStatic.h" +#include "UIStatic.h" #include "game_news.h" #include "date_time.h" #include "UIInventoryUtilities.h" diff --git a/src/xrGame/ui/UINewsItemWnd.h b/src/xrGame/ui/UINewsItemWnd.h index 786f2d4de8a..02cddbbde38 100644 --- a/src/xrGame/ui/UINewsItemWnd.h +++ b/src/xrGame/ui/UINewsItemWnd.h @@ -1,6 +1,6 @@ #pragma once -#include "xrUICore/Windows/UIWindow.h" -#include "xrUICore/XML/xrUIXmlParser.h" +#include "UIWindow.h" +#include "xrUIXmlParser.h" class CUIStatic; class CUITextWnd; diff --git a/src/xrUICore/Options/UIOptionsItem.cpp b/src/xrGame/ui/UIOptionsItem.cpp similarity index 99% rename from src/xrUICore/Options/UIOptionsItem.cpp rename to src/xrGame/ui/UIOptionsItem.cpp index ddf7894a369..68ca6c0d25b 100644 --- a/src/xrUICore/Options/UIOptionsItem.cpp +++ b/src/xrGame/ui/UIOptionsItem.cpp @@ -1,4 +1,4 @@ -#include "pch.hpp" +#include "StdAfx.h" #include "UIOptionsItem.h" #include "UIOptionsManager.h" #include "xrEngine/xr_ioconsole.h" diff --git a/src/xrUICore/Options/UIOptionsItem.h b/src/xrGame/ui/UIOptionsItem.h similarity index 79% rename from src/xrUICore/Options/UIOptionsItem.h rename to src/xrGame/ui/UIOptionsItem.h index 5e5c92894c2..edda81e40fc 100644 --- a/src/xrUICore/Options/UIOptionsItem.h +++ b/src/xrGame/ui/UIOptionsItem.h @@ -4,7 +4,7 @@ // fwd. decl. struct xr_token; -class XRUICORE_API CUIOptionsItem +class CUIOptionsItem { public: enum ESystemDepends @@ -25,11 +25,11 @@ class XRUICORE_API CUIOptionsItem static CUIOptionsManager* GetOptionsManager() { return &m_optionsManager; } virtual void OnMessage(LPCSTR message); - virtual void SetCurrentOptValue() {} // opt->current - virtual void SaveBackUpOptValue() {} // current->backup - virtual void SaveOptValue(); // current->opt - virtual void UndoOptValue(); // backup->current - virtual bool IsChangedOptValue() const = 0; // backup!=current + virtual void SetCurrentOptValue() = 0 {}; // opt->current + virtual void SaveBackUpOptValue() = 0 {}; // current->backup + virtual void SaveOptValue() = 0; // current->opt + virtual void UndoOptValue() = 0; // backup->current + virtual bool IsChangedOptValue() const = 0 {}; // backup!=current void OnChangedOptValue(); protected: diff --git a/src/xrUICore/Options/UIOptionsManager.cpp b/src/xrGame/ui/UIOptionsManager.cpp similarity index 99% rename from src/xrUICore/Options/UIOptionsManager.cpp rename to src/xrGame/ui/UIOptionsManager.cpp index 97780728008..c69ff24efff 100644 --- a/src/xrUICore/Options/UIOptionsManager.cpp +++ b/src/xrGame/ui/UIOptionsManager.cpp @@ -1,4 +1,4 @@ -#include "pch.hpp" +#include "StdAfx.h" #include "UIOptionsManager.h" #include "UIOptionsItem.h" #include "xrEngine/xr_ioconsole.h" diff --git a/src/xrUICore/Options/UIOptionsManager.h b/src/xrGame/ui/UIOptionsManager.h similarity index 97% rename from src/xrUICore/Options/UIOptionsManager.h rename to src/xrGame/ui/UIOptionsManager.h index 953f713cbdb..e76d0cc7830 100644 --- a/src/xrUICore/Options/UIOptionsManager.h +++ b/src/xrGame/ui/UIOptionsManager.h @@ -5,7 +5,7 @@ class CUIOptionsItem; -class XRUICORE_API CUIOptionsManager +class CUIOptionsManager { public: CUIOptionsManager(); diff --git a/src/xrUICore/Options/UIOptionsManagerScript.cpp b/src/xrGame/ui/UIOptionsManagerScript.cpp similarity index 76% rename from src/xrUICore/Options/UIOptionsManagerScript.cpp rename to src/xrGame/ui/UIOptionsManagerScript.cpp index d938406952f..ce9d1bc7ff1 100644 --- a/src/xrUICore/Options/UIOptionsManagerScript.cpp +++ b/src/xrGame/ui/UIOptionsManagerScript.cpp @@ -1,31 +1,30 @@ -#include "pch.hpp" +#include "pch_script.h" #include "UIOptionsItem.h" #include "UIOptionsManagerScript.h" #include "xrScriptEngine/ScriptExporter.hpp" using namespace luabind; -void CUIOptionsManagerScript::SetCurrentValues(pcstr group) +void CUIOptionsManagerScript::SetCurrentValues(const char* group) { CUIOptionsItem::GetOptionsManager()->SetCurrentValues(group); } -void CUIOptionsManagerScript::SaveBackupValues(pcstr group) +void CUIOptionsManagerScript::SaveBackupValues(const char* group) { CUIOptionsItem::GetOptionsManager()->SaveBackupValues(group); } -void CUIOptionsManagerScript::SaveValues(pcstr group) { CUIOptionsItem::GetOptionsManager()->SaveValues(group); } -void CUIOptionsManagerScript::UndoGroup(pcstr group) { CUIOptionsItem::GetOptionsManager()->UndoGroup(group); } +void CUIOptionsManagerScript::SaveValues(const char* group) { CUIOptionsItem::GetOptionsManager()->SaveValues(group); } +void CUIOptionsManagerScript::UndoGroup(const char* group) { CUIOptionsItem::GetOptionsManager()->UndoGroup(group); } void CUIOptionsManagerScript::OptionsPostAccept() { CUIOptionsItem::GetOptionsManager()->OptionsPostAccept(); } -void CUIOptionsManagerScript::SendMessage2Group(pcstr group, pcstr message) +void CUIOptionsManagerScript::SendMessage2Group(const char* group, const char* message) { CUIOptionsItem::GetOptionsManager()->SendMessage2Group(group, message); } bool CUIOptionsManagerScript::NeedSystemRestart() { return CUIOptionsItem::GetOptionsManager()->NeedSystemRestart(); } bool CUIOptionsManagerScript::NeedVidRestart() { return CUIOptionsItem::GetOptionsManager()->NeedVidRestart(); } - SCRIPT_EXPORT(CUIOptionsManagerScript, (), { module(luaState)[class_("COptionsManager") .def(constructor<>()) diff --git a/src/xrGame/ui/UIOptionsManagerScript.h b/src/xrGame/ui/UIOptionsManagerScript.h new file mode 100644 index 00000000000..7b922717508 --- /dev/null +++ b/src/xrGame/ui/UIOptionsManagerScript.h @@ -0,0 +1,15 @@ + +#pragma once + +class CUIOptionsManagerScript +{ +public: + void SaveBackupValues(LPCSTR group); + void SetCurrentValues(LPCSTR group); + void SaveValues(LPCSTR group); + void UndoGroup(LPCSTR group); + void OptionsPostAccept(); + void SendMessage2Group(LPCSTR group, LPCSTR message); + bool NeedSystemRestart(); + bool NeedVidRestart(); +}; diff --git a/src/xrGame/ui/UIOutfitInfo.cpp b/src/xrGame/ui/UIOutfitInfo.cpp index 509e09b8f25..bdb42f77f0b 100644 --- a/src/xrGame/ui/UIOutfitInfo.cpp +++ b/src/xrGame/ui/UIOutfitInfo.cpp @@ -1,8 +1,8 @@ #include "StdAfx.h" #include "UIOutfitInfo.h" #include "UIXmlInit.h" -#include "xrUICore/Static/UIStatic.h" -#include "xrUICore/ProgressBar/UIDoubleProgressBar.h" +#include "UIStatic.h" +#include "UIDoubleProgressBar.h" #include "CustomOutfit.h" #include "ActorHelmet.h" #include "string_table.h" diff --git a/src/xrGame/ui/UIOutfitInfo.h b/src/xrGame/ui/UIOutfitInfo.h index f97af99d453..01a178102a4 100644 --- a/src/xrGame/ui/UIOutfitInfo.h +++ b/src/xrGame/ui/UIOutfitInfo.h @@ -1,6 +1,6 @@ #pragma once -#include "xrUICore/Windows/UIWindow.h" -#include "xrUICore/ProgressBar/UIDoubleProgressBar.h" +#include "UIWindow.h" +#include "UIDoubleProgressBar.h" #include "xrServerEntities/alife_space.h" class CCustomOutfit; diff --git a/src/xrGame/ui/UIPdaKillMessage.h b/src/xrGame/ui/UIPdaKillMessage.h index 960a2ded1ad..ba65e0dd132 100644 --- a/src/xrGame/ui/UIPdaKillMessage.h +++ b/src/xrGame/ui/UIPdaKillMessage.h @@ -1,7 +1,7 @@ #pragma once #include "KillMessageStruct.h" -#include "xrUICore/Static/UIStatic.h" +#include "UIStatic.h" class CUIPdaKillMessage : public CUIColorAnimConrollerContainer { diff --git a/src/xrGame/ui/UIPdaMsgListItem.cpp b/src/xrGame/ui/UIPdaMsgListItem.cpp index 65d06830a43..75dba3d7a7d 100644 --- a/src/xrGame/ui/UIPdaMsgListItem.cpp +++ b/src/xrGame/ui/UIPdaMsgListItem.cpp @@ -1,6 +1,6 @@ #include "stdafx.h" #include "UIPdaMsgListItem.h" -#include "xrUICore/XML/xrUIXmlParser.h" +#include "xrUIXmlParser.h" #include "UIXmlInit.h" void CUIPdaMsgListItem::SetFont(CGameFont* pFont) diff --git a/src/xrGame/ui/UIPdaMsgListItem.h b/src/xrGame/ui/UIPdaMsgListItem.h index 6eba337cfde..b8fc263f61b 100644 --- a/src/xrGame/ui/UIPdaMsgListItem.h +++ b/src/xrGame/ui/UIPdaMsgListItem.h @@ -1,5 +1,5 @@ #pragma once -#include "xrUICore/Static/UIStatic.h" +#include "UIStatic.h" class CUIPdaMsgListItem : public CUIColorAnimConrollerContainer { diff --git a/src/xrGame/ui/UIPdaWnd.cpp b/src/xrGame/ui/UIPdaWnd.cpp index e8bd186d9b1..c20b9450832 100644 --- a/src/xrGame/ui/UIPdaWnd.cpp +++ b/src/xrGame/ui/UIPdaWnd.cpp @@ -2,27 +2,27 @@ #include "UIPdaWnd.h" #include "PDA.h" -#include "xrUICore/XML/xrUIXmlParser.h" +#include "xrUIXmlParser.h" #include "UIXmlInit.h" #include "UIInventoryUtilities.h" #include "Level.h" #include "UIGameCustom.h" -#include "xrUICore/Static/UIStatic.h" -#include "xrUICore/Windows/UIFrameWindow.h" -#include "xrUICore/TabControl/UITabControl.h" +#include "UIStatic.h" +#include "UIFrameWindow.h" +#include "UITabControl.h" #include "UIMapWnd.h" -#include "xrUICore/Windows/UIFrameLineWnd.h" +#include "UIFrameLineWnd.h" #include "Common/object_broker.h" #include "UIMessagesWindow.h" #include "UIMainIngameWnd.h" -#include "xrUICore/TabControl/UITabButton.h" -#include "xrUICore/Static/UIAnimatedStatic.h" +#include "UITabButton.h" +#include "UIAnimatedStatic.h" #include "UIHelper.h" -#include "xrUICore/Hint/UIHint.h" -#include "xrUICore/Buttons/UIBtnHint.h" +#include "UIHint.h" +#include "UIBtnHint.h" #include "UITaskWnd.h" #include "UIFactionWarWnd.h" #include "UIRankingWnd.h" diff --git a/src/xrUICore/ProgressBar/UIProgressBar.cpp b/src/xrGame/ui/UIProgressBar.cpp similarity index 97% rename from src/xrUICore/ProgressBar/UIProgressBar.cpp rename to src/xrGame/ui/UIProgressBar.cpp index 2f3ffba2b03..7a7e3c6262c 100644 --- a/src/xrUICore/ProgressBar/UIProgressBar.cpp +++ b/src/xrGame/ui/UIProgressBar.cpp @@ -1,5 +1,5 @@ -#include "pch.hpp" -#include "UIProgressBar.h" +#include "stdafx.h" +#include "uiprogressbar.h" CUIProgressBar::CUIProgressBar(void) { @@ -46,15 +46,18 @@ void CUIProgressBar::UpdateProgressBar() case om_fromcenter: m_CurrentLength = GetWidth() * fCurrentLength; break; + case om_vert: case om_down: case om_vfromcenter: m_CurrentLength = GetHeight() * fCurrentLength; break; + case om_tocenter: case om_vtocenter: R_ASSERT2(false, "to_center mode is not implemented."); break; + default: m_CurrentLength = 0.0f; } @@ -123,7 +126,7 @@ void CUIProgressBar::Draw() case om_vert: progress_rect.set(0, GetHeight() - m_CurrentLength, GetWidth(), GetHeight()); break; case om_back: progress_rect.set(GetWidth() - m_CurrentLength * 1.01f, 0, GetWidth(), GetHeight()); break; case om_down: progress_rect.set(0, 0, GetWidth(), m_CurrentLength); break; - case om_fromcenter: + case om_fromcenter: { const float center = GetWidth() / 2.f; progress_rect.set(center - m_CurrentLength, 0, center + m_CurrentLength, GetHeight()); @@ -135,7 +138,7 @@ void CUIProgressBar::Draw() progress_rect.set(0, center - m_CurrentLength, GetWidth(), center + m_CurrentLength); break; } - // XXX: Implement two-way progress bar + // XXX: Implement to_center mode case om_tocenter: case om_vtocenter: R_ASSERT2(false, "to_center mode is not implemented."); break; default: NODEFAULT; break; diff --git a/src/xrUICore/ProgressBar/UIProgressBar.h b/src/xrGame/ui/UIProgressBar.h similarity index 90% rename from src/xrUICore/ProgressBar/UIProgressBar.h rename to src/xrGame/ui/UIProgressBar.h index dc9afd76da3..11090ebb0a0 100644 --- a/src/xrUICore/ProgressBar/UIProgressBar.h +++ b/src/xrGame/ui/UIProgressBar.h @@ -1,10 +1,11 @@ #pragma once -#include "xrUICore/Windows/UIWindow.h" -#include "xrUICore/Buttons/UIButton.h" -class XRUICORE_API CUIProgressBar : public CUIWindow +#include "UIWindow.h" +#include "UIButton.h" + +class CUIProgressBar : public CUIWindow { - friend class CUIXmlInitBase; + friend class CUIXmlInit; typedef CUIWindow inherited; protected: diff --git a/src/xrGame/ui/UIProgressBar_script.cpp b/src/xrGame/ui/UIProgressBar_script.cpp new file mode 100644 index 00000000000..edf5b80bf34 --- /dev/null +++ b/src/xrGame/ui/UIProgressBar_script.cpp @@ -0,0 +1,15 @@ +#include "pch_script.h" +#include "UIProgressBar.h" +#include "xrScriptEngine/ScriptExporter.hpp" + +using namespace luabind; + +SCRIPT_EXPORT(CUIProgressBar, (CUIWindow), { + module(luaState)[class_("CUIProgressBar") + .def(constructor<>()) + .def("SetProgressPos", &CUIProgressBar::SetProgressPos) + .def("GetProgressPos", &CUIProgressBar::GetProgressPos) + + .def("GetRange_min", &CUIProgressBar::GetRange_min) + .def("GetRange_max", &CUIProgressBar::GetRange_max)]; +}); diff --git a/src/xrUICore/ProgressBar/UIProgressShape.cpp b/src/xrGame/ui/UIProgressShape.cpp similarity index 96% rename from src/xrUICore/ProgressBar/UIProgressShape.cpp rename to src/xrGame/ui/UIProgressShape.cpp index 02c92528188..cb35f4129c2 100644 --- a/src/xrUICore/ProgressBar/UIProgressShape.cpp +++ b/src/xrGame/ui/UIProgressShape.cpp @@ -1,11 +1,15 @@ -#include "pch.hpp" +#include "StdAfx.h" #include "UIProgressShape.h" + +#include "UIStatic.h" #include "Include/xrRender/UIShader.h" #include "Include/xrRender/UIRender.h" CUIProgressShape::CUIProgressShape() { m_bText = false; + // m_pTexture = new CUIStatic(); + // AttachChild (m_pTexture); m_blend = true; m_angle_begin = 0.0f; m_angle_end = PI_MUL_2; @@ -13,7 +17,9 @@ CUIProgressShape::CUIProgressShape() }; CUIProgressShape::~CUIProgressShape() -{} +{ + // xr_delete (m_pTexture); +} void CUIProgressShape::SetPos(float pos) { m_stage = pos; } void CUIProgressShape::SetPos(int pos, int max) diff --git a/src/xrUICore/ProgressBar/UIProgressShape.h b/src/xrGame/ui/UIProgressShape.h similarity index 75% rename from src/xrUICore/ProgressBar/UIProgressShape.h rename to src/xrGame/ui/UIProgressShape.h index 4d431bfe0e3..373c95e0c71 100644 --- a/src/xrUICore/ProgressBar/UIProgressShape.h +++ b/src/xrGame/ui/UIProgressShape.h @@ -1,12 +1,12 @@ #pragma once -#include "xrUICore/Static/UIStatic.h" +#include "UIStatic.h" class CUIStatic; -class XRUICORE_API CUIProgressShape : public CUIStatic +class CUIProgressShape : public CUIStatic { - friend class CUIXmlInitBase; + friend class CUIXmlInit; public: CUIProgressShape(); diff --git a/src/xrUICore/PropertiesBox/UIPropertiesBox.cpp b/src/xrGame/ui/UIPropertiesBox.cpp similarity index 97% rename from src/xrUICore/PropertiesBox/UIPropertiesBox.cpp rename to src/xrGame/ui/UIPropertiesBox.cpp index 193a6776c59..e2082f2c4b9 100644 --- a/src/xrUICore/PropertiesBox/UIPropertiesBox.cpp +++ b/src/xrGame/ui/UIPropertiesBox.cpp @@ -1,7 +1,8 @@ -#include "pch.hpp" +#include "stdafx.h" #include "UIPropertiesBox.h" -#include "ListBox/UIListBoxItem.h" -#include "XML/UIXmlInitBase.h" +#include "Level.h" +#include "UIListBoxItem.h" +#include "UIXmlInit.h" #define OFFSET_X (5.0f) #define OFFSET_Y (5.0f) @@ -39,7 +40,7 @@ void CUIPropertiesBox::InitPropertiesBox(Fvector2 pos, Fvector2 size) R_ASSERT(t); InitTexture(t); - CUIXmlInitBase::InitListBox(xml_doc, "properties_box:list", 0, &m_UIListWnd); + CUIXmlInit::InitListBox(xml_doc, "properties_box:list", 0, &m_UIListWnd); m_UIListWnd.SetWndPos(Fvector2().set(OFFSET_X, OFFSET_Y)); m_UIListWnd.SetWndSize(Fvector2().set(size.x - OFFSET_X * 2, size.y - OFFSET_Y * 2)); diff --git a/src/xrUICore/PropertiesBox/UIPropertiesBox.h b/src/xrGame/ui/UIPropertiesBox.h similarity index 89% rename from src/xrUICore/PropertiesBox/UIPropertiesBox.h rename to src/xrGame/ui/UIPropertiesBox.h index 446a3c9c09c..6aaab9fd488 100644 --- a/src/xrUICore/PropertiesBox/UIPropertiesBox.h +++ b/src/xrGame/ui/UIPropertiesBox.h @@ -1,8 +1,9 @@ #pragma once -#include "xrUICore/Windows/UIFrameWindow.h" -#include "xrUICore/ListBox/UIListBox.h" -class XRUICORE_API CUIPropertiesBox : public CUIFrameWindow, public CUIWndCallback +#include "uiframewindow.h" +#include "uilistbox.h" + +class CUIPropertiesBox : public CUIFrameWindow, public CUIWndCallback { private: typedef CUIFrameWindow inherited; diff --git a/src/xrUICore/PropertiesBox/UIPropertiesBox_script.cpp b/src/xrGame/ui/UIPropertiesBox_script.cpp similarity index 85% rename from src/xrUICore/PropertiesBox/UIPropertiesBox_script.cpp rename to src/xrGame/ui/UIPropertiesBox_script.cpp index 157f0619806..4aafb238585 100644 --- a/src/xrUICore/PropertiesBox/UIPropertiesBox_script.cpp +++ b/src/xrGame/ui/UIPropertiesBox_script.cpp @@ -1,4 +1,4 @@ -#include "pch.hpp" +#include "pch_script.h" #include "UIPropertiesBox.h" #include "xrScriptEngine/ScriptExporter.hpp" @@ -7,6 +7,7 @@ using namespace luabind; SCRIPT_EXPORT(CUIPropertiesBox, (CUIFrameWindow), { module(luaState)[class_("CUIPropertiesBox") .def(constructor<>()) + // .def("AddItem", &CUIPropertiesBox::AddItem) .def("RemoveItem", &CUIPropertiesBox::RemoveItemByTAG) .def("RemoveAll", &CUIPropertiesBox::RemoveAll) .def("Show", (void (CUIPropertiesBox::*)(int, int)) & CUIPropertiesBox::Show) @@ -14,5 +15,6 @@ SCRIPT_EXPORT(CUIPropertiesBox, (CUIFrameWindow), { // .def("GetClickedIndex", &CUIPropertiesBox::GetClickedIndex) .def("AutoUpdateSize", &CUIPropertiesBox::AutoUpdateSize) .def("AddItem", &CUIPropertiesBox::AddItem_script) + // .def("", &CUIPropertiesBox::) ]; }); diff --git a/src/xrUICore/Buttons/UIRadioButton.cpp b/src/xrGame/ui/UIRadioButton.cpp similarity index 89% rename from src/xrUICore/Buttons/UIRadioButton.cpp rename to src/xrGame/ui/UIRadioButton.cpp index 947708bd4c0..884925487bc 100644 --- a/src/xrUICore/Buttons/UIRadioButton.cpp +++ b/src/xrGame/ui/UIRadioButton.cpp @@ -1,6 +1,6 @@ -#include "pch.hpp" -#include "UIRadioButton.h" -#include "Lines/UILines.h" +#include "stdafx.h" +#include ".\uiradiobutton.h" +#include "UILines.h" void CUIRadioButton::InitButton(Fvector2 pos, Fvector2 size) { diff --git a/src/xrUICore/Buttons/UIRadioButton.h b/src/xrGame/ui/UIRadioButton.h similarity index 85% rename from src/xrUICore/Buttons/UIRadioButton.h rename to src/xrGame/ui/UIRadioButton.h index 63a1cc9649e..9b30d7b539e 100644 --- a/src/xrUICore/Buttons/UIRadioButton.h +++ b/src/xrGame/ui/UIRadioButton.h @@ -1,5 +1,7 @@ #pragma once -#include "xrUICore/TabControl/UITabButton.h" + +#pragma once +#include "UITabButton.h" class CUIRadioButton : public CUITabButton { diff --git a/src/xrGame/ui/UIRankIndicator.cpp b/src/xrGame/ui/UIRankIndicator.cpp index 716776e4e4c..4f0403e0419 100644 --- a/src/xrGame/ui/UIRankIndicator.cpp +++ b/src/xrGame/ui/UIRankIndicator.cpp @@ -1,7 +1,7 @@ #include "stdafx.h" #include "UIRankIndicator.h" #include "UIXmlInit.h" -#include "xrUICore/Static/UIStatic.h" +#include "UIStatic.h" CUIRankIndicator::CUIRankIndicator() { m_current = u8(-1); } CUIRankIndicator::~CUIRankIndicator() diff --git a/src/xrGame/ui/UIRankIndicator.h b/src/xrGame/ui/UIRankIndicator.h index f021c755a47..aa7c312811a 100644 --- a/src/xrGame/ui/UIRankIndicator.h +++ b/src/xrGame/ui/UIRankIndicator.h @@ -1,6 +1,6 @@ #pragma once -#include "xrUICore/Windows/UIWindow.h" +#include "UIWindow.h" class CUIStatic; class CUIXml; class CUIStatic; diff --git a/src/xrGame/ui/UIRankingWnd.cpp b/src/xrGame/ui/UIRankingWnd.cpp index 08e9e62cf42..31655cdef8d 100644 --- a/src/xrGame/ui/UIRankingWnd.cpp +++ b/src/xrGame/ui/UIRankingWnd.cpp @@ -7,11 +7,11 @@ #include "pch_script.h" #include "UIRankingWnd.h" -#include "xrUICore/ScrollBar/UIFixedScrollBar.h" +#include "UIFixedScrollBar.h" #include "UIXmlInit.h" -#include "xrUICore/ProgressBar/UIProgressBar.h" -#include "xrUICore/Windows/UIFrameLineWnd.h" -#include "xrUICore/ScrollView/UIScrollView.h" +#include "UIProgressBar.h" +#include "UIFrameLineWnd.h" +#include "UIScrollView.h" #include "UIHelper.h" #include "UIInventoryUtilities.h" #include "Actor.h" @@ -23,7 +23,7 @@ #include "relation_registry.h" #include "string_table.h" #include "UICharacterInfo.h" -#include "xrUICore/ui_base.h" +#include "ui_base.h" #define PDA_RANKING_XML "pda_ranking.xml" @@ -127,7 +127,7 @@ void CUIRankingWnd::Init() string256 buf; xr_strcpy(buf, sizeof(buf), m_center_caption->GetText()); - xr_strcat(buf, sizeof(buf), StringTable().translate("ui_ranking_center_caption").c_str()); + xr_strcat(buf, sizeof(buf), CStringTable().translate("ui_ranking_center_caption").c_str()); m_center_caption->SetText(buf); m_monster_icon_back = UIHelper::CreateStatic(xml, "monster_icon_back", this); diff --git a/src/xrGame/ui/UIRankingWnd.h b/src/xrGame/ui/UIRankingWnd.h index 22ee4e1410e..60257f17e06 100644 --- a/src/xrGame/ui/UIRankingWnd.h +++ b/src/xrGame/ui/UIRankingWnd.h @@ -6,8 +6,9 @@ //////////////////////////////////////////////////////////////////////////// #pragma once -#include "xrUICore/Windows/UIWindow.h" -#include "xrUICore/Callbacks/UIWndCallback.h" +#include "UIWindow.h" +#include "UIWndCallback.h" + #include "UIAchievements.h" class CUIStatic; diff --git a/src/xrGame/ui/UIScriptWnd.cpp b/src/xrGame/ui/UIScriptWnd.cpp index b5de0810201..0840fc9b297 100644 --- a/src/xrGame/ui/UIScriptWnd.cpp +++ b/src/xrGame/ui/UIScriptWnd.cpp @@ -1,7 +1,7 @@ #include "pch_script.h" #include "UIScriptWnd.h" #include "Common/object_broker.h" -#include "xrUICore/Callbacks/callback_info.h" +#include "callback_info.h" CUIDialogWndEx::CUIDialogWndEx() {} CUIDialogWndEx::~CUIDialogWndEx() { delete_data(m_callbacks); } diff --git a/src/xrUICore/ScrollBar/UIScrollBar.cpp b/src/xrGame/ui/UIScrollBar.cpp similarity index 95% rename from src/xrUICore/ScrollBar/UIScrollBar.cpp rename to src/xrGame/ui/UIScrollBar.cpp index 21b5dbfe101..a68c1cbb991 100644 --- a/src/xrUICore/ScrollBar/UIScrollBar.cpp +++ b/src/xrGame/ui/UIScrollBar.cpp @@ -1,11 +1,9 @@ -#include "pch.hpp" +#include "stdafx.h" #include "uiscrollbar.h" -#include "Buttons/UI3tButton.h" +#include "UI3tButton.h" #include "UIScrollBox.h" -#include "XML/UIXmlInitBase.h" -#include "XML/UITextureMaster.h" -#include "Cursor/UICursor.h" -#include "xrEngine/xr_input_xinput.h" +#include "UIXmlInit.h" +#include "UITextureMaster.h" CUIScrollBar::CUIScrollBar() { @@ -50,17 +48,17 @@ void CUIScrollBar::InitScrollBar(Fvector2 pos, float length, bool bIsHorizontal, inherited::SetWndSize(Fvector2().set(length, height)); strconcat(sizeof(_path), _path, profile, ":left_arrow"); - CUIXmlInitBase::Init3tButton(xml_doc, _path, 0, m_DecButton); + CUIXmlInit::Init3tButton(xml_doc, _path, 0, m_DecButton); m_DecButton->SetWndPos(Fvector2().set(0, 0)); strconcat(sizeof(_path), _path, profile, ":right_arrow"); - CUIXmlInitBase::Init3tButton(xml_doc, _path, 0, m_IncButton); + CUIXmlInit::Init3tButton(xml_doc, _path, 0, m_IncButton); m_IncButton->SetWndPos(Fvector2().set(length - m_IncButton->GetWidth(), 0.0f)); m_ScrollBox->SetHorizontal(true); strconcat(sizeof(_path), _path, profile, ":box"); - CUIXmlInitBase::InitFrameLine(xml_doc, _path, 0, m_ScrollBox); + CUIXmlInit::InitFrameLine(xml_doc, _path, 0, m_ScrollBox); strconcat(sizeof(_path), _path, profile, ":back:texture"); LPCSTR texture = xml_doc.Read(_path, 0, ""); @@ -73,17 +71,17 @@ void CUIScrollBar::InitScrollBar(Fvector2 pos, float length, bool bIsHorizontal, inherited::SetWndSize(Fvector2().set(height, length)); strconcat(sizeof(_path), _path, profile, ":up_arrow"); - CUIXmlInitBase::Init3tButton(xml_doc, _path, 0, m_DecButton); + CUIXmlInit::Init3tButton(xml_doc, _path, 0, m_DecButton); m_DecButton->SetWndPos(Fvector2().set(0, 0)); strconcat(sizeof(_path), _path, profile, ":down_arrow"); - CUIXmlInitBase::Init3tButton(xml_doc, _path, 0, m_IncButton); + CUIXmlInit::Init3tButton(xml_doc, _path, 0, m_IncButton); m_IncButton->SetWndPos(Fvector2().set(0.0f, length - m_IncButton->GetHeight())); m_ScrollBox->SetHorizontal(false); strconcat(sizeof(_path), _path, profile, ":box_v"); - CUIXmlInitBase::InitFrameLine(xml_doc, _path, 0, m_ScrollBox); + CUIXmlInit::InitFrameLine(xml_doc, _path, 0, m_ScrollBox); strconcat(sizeof(_path), _path, profile, ":back_v:texture"); LPCSTR texture = xml_doc.Read(_path, 0, ""); @@ -200,6 +198,8 @@ void CUIScrollBar::UpdateScrollBar() ClampByViewRect(); } +#include "UICursor.h" + u32 last_hold_time = 0; bool CUIScrollBar::OnKeyboardHold(int dik) diff --git a/src/xrUICore/ScrollBar/UIScrollBar.h b/src/xrGame/ui/UIScrollBar.h similarity index 96% rename from src/xrUICore/ScrollBar/UIScrollBar.h rename to src/xrGame/ui/UIScrollBar.h index 8b94b7e7e03..935146a74ef 100644 --- a/src/xrUICore/ScrollBar/UIScrollBar.h +++ b/src/xrGame/ui/UIScrollBar.h @@ -1,11 +1,11 @@ #pragma once -#include "xrUICore/Windows/UIWindow.h" +#include "UIWindow.h" class CUI3tButton; class CUIScrollBox; class CUIFrameLineWnd; -class XRUICORE_API CUIScrollBar : public CUIWindow +class CUIScrollBar : public CUIWindow { private: typedef CUIWindow inherited; diff --git a/src/xrUICore/ScrollBar/UIScrollBox.cpp b/src/xrGame/ui/UIScrollBox.cpp similarity index 96% rename from src/xrUICore/ScrollBar/UIScrollBox.cpp rename to src/xrGame/ui/UIScrollBox.cpp index 9a02a50ed5a..d81894c68a2 100644 --- a/src/xrUICore/ScrollBar/UIScrollBox.cpp +++ b/src/xrGame/ui/UIScrollBox.cpp @@ -1,6 +1,6 @@ -#include "pch.hpp" +#include "stdafx.h" #include "UIScrollBox.h" -#include "Cursor/UICursor.h" +#include "UICursor.h" CUIScrollBox::CUIScrollBox() {} bool CUIScrollBox::OnMouseAction(float x, float y, EUIMessages mouse_action) diff --git a/src/xrUICore/ScrollBar/UIScrollBox.h b/src/xrGame/ui/UIScrollBox.h similarity index 85% rename from src/xrUICore/ScrollBar/UIScrollBox.h rename to src/xrGame/ui/UIScrollBox.h index d58ac6d1db9..63e1c43c301 100644 --- a/src/xrUICore/ScrollBar/UIScrollBox.h +++ b/src/xrGame/ui/UIScrollBox.h @@ -1,5 +1,5 @@ #pragma once -#include "Windows/uiFrameLineWnd.h" +#include "uiFrameLineWnd.h" class CUIScrollBox : public CUIFrameLineWnd { diff --git a/src/xrUICore/ScrollView/UIScrollView.cpp b/src/xrGame/ui/UIScrollView.cpp similarity index 98% rename from src/xrUICore/ScrollView/UIScrollView.cpp rename to src/xrGame/ui/UIScrollView.cpp index 7997132b06b..21f657606bd 100644 --- a/src/xrUICore/ScrollView/UIScrollView.cpp +++ b/src/xrGame/ui/UIScrollView.cpp @@ -1,9 +1,9 @@ -#include "pch.hpp" +#include "stdafx.h" #include "UIScrollView.h" -#include "ScrollBar/UIScrollBar.h" -#include "ScrollBar/UIFixedScrollBar.h" +#include "UIScrollBar.h" +#include "UIFixedScrollBar.h" #include "ui_base.h" -#include "Cursor/UICursor.h" +#include "UICursor.h" #include "xrEngine/xr_input.h" CUIScrollView::CUIScrollView() diff --git a/src/xrUICore/ScrollView/UIScrollView.h b/src/xrGame/ui/UIScrollView.h similarity index 92% rename from src/xrUICore/ScrollView/UIScrollView.h rename to src/xrGame/ui/UIScrollView.h index bc34bb86e38..700c36740dc 100644 --- a/src/xrUICore/ScrollView/UIScrollView.h +++ b/src/xrGame/ui/UIScrollView.h @@ -1,15 +1,15 @@ #pragma once -#include "xrUICore/ScrollBar/UIScrollBar.h" -#include "xrUICore/Windows/UIWindow.h" -#include "xrUICore/Callbacks/UIWndCallback.h" +#include "UIScrollBar.h" +#include "UIWindow.h" +#include "UIWndCallback.h" class CUIScrollBar; class CUIFixedScrollBar; -class XRUICORE_API CUIScrollView : public CUIWindow, public CUIWndCallback +class CUIScrollView : public CUIWindow, public CUIWndCallback { typedef CUIWindow inherited; - friend class CUIXmlInitBase; // for init + friend class CUIXmlInit; // for init protected: enum { diff --git a/src/xrGame/ui/UISecondTaskWnd.cpp b/src/xrGame/ui/UISecondTaskWnd.cpp index c02b207a90e..2540387a60f 100644 --- a/src/xrGame/ui/UISecondTaskWnd.cpp +++ b/src/xrGame/ui/UISecondTaskWnd.cpp @@ -7,17 +7,17 @@ #include "stdafx.h" #include "UISecondTaskWnd.h" -#include "xrUICore/XML/xrUIXmlParser.h" +#include "xrUIXmlParser.h" #include "UIXmlInit.h" #include "UIHelper.h" -#include "xrUICore/Windows/UIFrameWindow.h" -#include "xrUICore/ScrollView/UIScrollView.h" -#include "xrUICore/Static/UIStatic.h" -#include "xrUICore/Buttons/UI3tButton.h" -#include "xrUICore/Buttons/UICheckButton.h" -#include "xrUICore/Windows/UIFrameLineWnd.h" -#include "xrUICore/ScrollBar/UIFixedScrollBar.h" -#include "xrUICore/Hint/UIHint.h" +#include "UIFrameWindow.h" +#include "UIScrollView.h" +#include "UIStatic.h" +#include "UI3tButton.h" +#include "UICheckButton.h" +#include "UIFrameLineWnd.h" +#include "UIFixedScrollBar.h" +#include "UIHint.h" #include "UITaskWnd.h" #include "GameTaskDefs.h" #include "GameTask.h" diff --git a/src/xrGame/ui/UISecondTaskWnd.h b/src/xrGame/ui/UISecondTaskWnd.h index cf400c0e5dc..71e6cf3b215 100644 --- a/src/xrGame/ui/UISecondTaskWnd.h +++ b/src/xrGame/ui/UISecondTaskWnd.h @@ -8,8 +8,8 @@ #ifndef UI_SECOND_TASK_WND_H_INCLUDED #define UI_SECOND_TASK_WND_H_INCLUDED -#include "xrUICore/Windows/UIWindow.h" -#include "xrUICore/Callbacks/UIWndCallback.h" +#include "UIWindow.h" +#include "UIWndCallback.h" #define PDA_TASK_XML "pda_tasks.xml" diff --git a/src/xrGame/ui/UIServerInfo.cpp b/src/xrGame/ui/UIServerInfo.cpp index 94af18bbc55..e7901d494fa 100644 --- a/src/xrGame/ui/UIServerInfo.cpp +++ b/src/xrGame/ui/UIServerInfo.cpp @@ -1,10 +1,10 @@ #include "stdafx.h" #include "UIServerInfo.h" -#include "xrUICore/Static/UIStatic.h" -#include "xrUICore/Cursor/UICursor.h" -#include "xrUICore/ScrollView/UIScrollView.h" +#include "UIStatic.h" +#include "UICursor.h" +#include "UIScrollView.h" #include "UIXmlInit.h" -#include "xrUICore/Buttons/UI3tButton.h" +#include "UI3tButton.h" #include "UIGameCustom.h" #include "Level.h" #include "game_cl_mp.h" diff --git a/src/xrGame/ui/UIServerInfo.h b/src/xrGame/ui/UIServerInfo.h index 82b6c6c9444..090e16a84f3 100644 --- a/src/xrGame/ui/UIServerInfo.h +++ b/src/xrGame/ui/UIServerInfo.h @@ -2,7 +2,7 @@ #define UISERVER_INFO_INCLUDED #include "UIDialogWnd.h" -#include "xrUICore/Callbacks/UIWndCallback.h" +#include "UIWndCallback.h" class CUIStatic; class CUIScrollView; diff --git a/src/xrGame/ui/UISkinSelector.cpp b/src/xrGame/ui/UISkinSelector.cpp index 0a9d192c34e..fa6d1ce64b4 100644 --- a/src/xrGame/ui/UISkinSelector.cpp +++ b/src/xrGame/ui/UISkinSelector.cpp @@ -1,10 +1,10 @@ #include "StdAfx.h" #include "UISkinSelector.h" #include "UIXmlInit.h" -#include "xrUICore/Static/UIAnimatedStatic.h" -#include "xrUICore/Buttons/UI3tButton.h" +#include "UIAnimatedStatic.h" +#include "UI3tButton.h" #include "UIStatix.h" -#include "xrUICore/Cursor/UICursor.h" +#include "UICursor.h" #include "UIGameCustom.h" #include "game_cl_deathmatch.h" #include "xr_level_controller.h" diff --git a/src/xrGame/ui/UISleepStatic.cpp b/src/xrGame/ui/UISleepStatic.cpp deleted file mode 100644 index a71c48520a7..00000000000 --- a/src/xrGame/ui/UISleepStatic.cpp +++ /dev/null @@ -1,66 +0,0 @@ -#include "stdafx.h" -#include "UISleepStatic.h" -#include "Actor_Flags.h" -#include "Level.h" -#include "date_time.h" -#include "xrUICore/XML/UITextureMaster.h" - -CUISleepStatic::CUISleepStatic() : m_cur_time(0){}; - -void CUISleepStatic::Draw() -{ - // inherited::Draw(); - m_UIStaticItem.Render(); - m_UIStaticItem2.Render(); -} - -void CUISleepStatic::Update() -{ - u32 year = 0, month = 0, day = 0, hours = 0, mins = 0, secs = 0, milisecs = 0; - split_time(Level().GetGameTime(), year, month, day, hours, mins, secs, milisecs); - - u32 start_pixel = 0, end_pixel = 0, start_pixel2 = 0, end_pixel2 = 0; - hours += psActorSleepTime - 1; - if (hours >= 24) - hours -= 24; - - start_pixel = hours * 85; - end_pixel = (hours + 7) * 85; - if (end_pixel > 2048) - { - end_pixel2 = end_pixel - 2048; - end_pixel = 2048; - } - - Fvector2 parent_pos = GetParent()->GetWndPos(); - Fvector2 pos = GetWndPos(); - pos.x += parent_pos.x; - pos.y += parent_pos.y; - - Frect r = Frect().set((float)start_pixel, 0.0f, (float)end_pixel, 128.0f); - m_UIStaticItem.SetTextureRect(r); - m_UIStaticItem.SetSize(Fvector2().set(iFloor((end_pixel - start_pixel) * UI().get_current_kx()), 128)); - m_UIStaticItem.SetPos(pos.x, pos.y); - if (end_pixel2 > 0) - { - r.set((float)start_pixel2, 0.0f, (float)end_pixel2, 128.0f); - m_UIStaticItem2.SetTextureRect(r); - m_UIStaticItem2.SetSize(Fvector2().set(iFloor(end_pixel2 * UI().get_current_kx()), 128)); - m_UIStaticItem2.SetPos(m_UIStaticItem.GetPosX() + m_UIStaticItem.GetSize().x, m_UIStaticItem.GetPosY()); - } - else - m_UIStaticItem2.SetSize(Fvector2().set(1, 1)); -} - -void CUISleepStatic::InitTextureEx(LPCSTR tex_name, LPCSTR sh_name) -{ - inherited::InitTextureEx(tex_name, sh_name); - - LPCSTR res_shname = GEnv.UIRender->UpdateShaderName(tex_name, sh_name); - CUITextureMaster::InitTexture(tex_name, &m_UIStaticItem2, res_shname); - - Fvector2 p = GetWndPos(); - m_UIStaticItem2.SetPos(p.x, p.y); - p.set(1, 1); - m_UIStaticItem2.SetSize(p); -} diff --git a/src/xrGame/ui/UISleepStatic.h b/src/xrGame/ui/UISleepStatic.h deleted file mode 100644 index af44c580f0a..00000000000 --- a/src/xrGame/ui/UISleepStatic.h +++ /dev/null @@ -1,17 +0,0 @@ -#pragma once -#include "xrUICore/Static/UIStatic.h" - -class CUISleepStatic : public CUIStatic -{ -private: - typedef CUIStatic inherited; - - int m_cur_time; - CUIStaticItem m_UIStaticItem2; - -public: - CUISleepStatic(); - virtual void Draw(); - virtual void Update(); - virtual void InitTextureEx(LPCSTR tex_name, LPCSTR sh_name = "hud\\default"); -}; diff --git a/src/xrGame/ui/UISpawnWnd.cpp b/src/xrGame/ui/UISpawnWnd.cpp index 5645a3fb1a8..e8c7ddf91e3 100644 --- a/src/xrGame/ui/UISpawnWnd.cpp +++ b/src/xrGame/ui/UISpawnWnd.cpp @@ -4,10 +4,10 @@ #include "Level.h" #include "game_cl_teamdeathmatch.h" #include "UIStatix.h" -#include "xrUICore/ScrollView/UIScrollView.h" -#include "xrUICore/Buttons/UI3tButton.h" +#include "UIScrollView.h" +#include "UI3tButton.h" #include "xr_level_controller.h" -#include "xrUICore/Cursor/UICursor.h" +#include "uicursor.h" #include "uigamecustom.h" CUISpawnWnd::CUISpawnWnd() : m_iCurTeam(0) diff --git a/src/xrGame/ui/UISpeechMenu.cpp b/src/xrGame/ui/UISpeechMenu.cpp index 6bfb98feb1f..d8e8c168341 100644 --- a/src/xrGame/ui/UISpeechMenu.cpp +++ b/src/xrGame/ui/UISpeechMenu.cpp @@ -1,7 +1,7 @@ #include "StdAfx.h" #include "UISpeechMenu.h" -#include "xrUICore/ScrollView/UIScrollView.h" -#include "xrUICore/Static/UIStatic.h" +#include "UIScrollView.h" +#include "UIStatic.h" #include "UIGameCustom.h" #include "UIXmlInit.h" #include "game_cl_mp.h" @@ -43,7 +43,7 @@ void CUISpeechMenu::InitList(LPCSTR section_name) { LPCSTR s = pSettings->r_string(section_name, phrase); _GetItem(s, 0, phrase); - xr_sprintf(str, "%d. %s", i + 1, StringTable().translate(phrase).c_str()); + xr_sprintf(str, "%d. %s", i + 1, CStringTable().translate(phrase).c_str()); ADD_TEXT_TO_VIEW3(str, pItem, m_pList); pItem->SetFont(m_pFont); diff --git a/src/xrUICore/SpinBox/UISpinNum.cpp b/src/xrGame/ui/UISpinNum.cpp similarity index 93% rename from src/xrUICore/SpinBox/UISpinNum.cpp rename to src/xrGame/ui/UISpinNum.cpp index 50626d602c1..5d6d428fc0b 100644 --- a/src/xrUICore/SpinBox/UISpinNum.cpp +++ b/src/xrGame/ui/UISpinNum.cpp @@ -4,19 +4,21 @@ // author: Serge Vynnychenko // -#include "pch.hpp" +#include "StdAfx.h" #include "UISpinNum.h" -#include "Lines/UILines.h" +#include "UILines.h" CUISpinNum::CUISpinNum() : m_iVal(0), m_iMin(0), m_iMax(100), m_iStep(1) {} void CUISpinNum::SetCurrentOptValue() // opt->current { + CUIOptionsItem::SetCurrentOptValue(); GetOptIntegerValue(m_iVal, m_iMin, m_iMax); SetValue(m_iVal); } void CUISpinNum::SaveBackUpOptValue() // current->backup { + CUIOptionsItem::SaveBackUpOptValue(); m_opt_backup_value = m_iVal; } @@ -83,6 +85,7 @@ bool CUISpinNum::CanPressDown() { return m_iVal - m_iStep >= m_iMin; } CUISpinFlt::CUISpinFlt() : m_fVal(0), m_fMin(0), m_fMax(100), m_fStep(0.1f) {} void CUISpinFlt::SaveBackUpOptValue() { + CUIOptionsItem::SaveBackUpOptValue(); m_opt_backup_value = m_fVal; } @@ -95,6 +98,7 @@ void CUISpinFlt::UndoOptValue() void CUISpinFlt::SetCurrentOptValue() { + CUIOptionsItem::SetCurrentOptValue(); GetOptFloatValue(m_fVal, m_fMin, m_fMax); SetValue(m_fVal); } diff --git a/src/xrUICore/SpinBox/UISpinNum.h b/src/xrGame/ui/UISpinNum.h similarity index 91% rename from src/xrUICore/SpinBox/UISpinNum.h rename to src/xrGame/ui/UISpinNum.h index acf7ba8df48..cca0bc0cea2 100644 --- a/src/xrUICore/SpinBox/UISpinNum.h +++ b/src/xrGame/ui/UISpinNum.h @@ -1,6 +1,6 @@ -#include "xrUICore/SpinBox/UICustomSpin.h" +#include "UICustomSpin.h" -class XRUICORE_API CUISpinNum : public CUICustomSpin +class CUISpinNum : public CUICustomSpin { public: CUISpinNum(); @@ -34,7 +34,7 @@ class XRUICORE_API CUISpinNum : public CUICustomSpin int m_opt_backup_value; }; -class XRUICORE_API CUISpinFlt : public CUICustomSpin +class CUISpinFlt : public CUICustomSpin { public: CUISpinFlt(); diff --git a/src/xrUICore/SpinBox/UISpinText.cpp b/src/xrGame/ui/UISpinText.cpp similarity index 90% rename from src/xrUICore/SpinBox/UISpinText.cpp rename to src/xrGame/ui/UISpinText.cpp index c71b16bb060..a296c433f76 100644 --- a/src/xrUICore/SpinBox/UISpinText.cpp +++ b/src/xrGame/ui/UISpinText.cpp @@ -1,7 +1,7 @@ -#include "pch.hpp" +#include "StdAfx.h" #include "UISpinText.h" -#include "Lines/UILines.h" -#include "xrEngine/StringTable/IStringTable.h" +#include "UILines.h" +#include "string_table.h" #include "xrCore/xr_token.h" CUISpinText::CUISpinText() : m_curItem(-1) {} @@ -9,7 +9,7 @@ void CUISpinText::AddItem_(const char* item, int id) { SInfo _info; _info._orig = item; - _info._transl = gStringTable->translate(item); + _info._transl = CStringTable().translate(item); _info._id = id; m_list.push_back(_info); @@ -34,6 +34,8 @@ LPCSTR CUISpinText::GetTokenText() void CUISpinText::SetCurrentOptValue() { + CUIOptionsItem::SetCurrentOptValue(); + const xr_token* tok = GetOptToken(); while (tok->name) @@ -55,6 +57,7 @@ void CUISpinText::SetCurrentOptValue() void CUISpinText::SaveBackUpOptValue() { + CUIOptionsItem::SaveBackUpOptValue(); m_opt_backup_value = m_curItem; } diff --git a/src/xrUICore/SpinBox/UISpinText.h b/src/xrGame/ui/UISpinText.h similarity index 90% rename from src/xrUICore/SpinBox/UISpinText.h rename to src/xrGame/ui/UISpinText.h index 3e4a9dbaf0a..96d7cce23f0 100644 --- a/src/xrUICore/SpinBox/UISpinText.h +++ b/src/xrGame/ui/UISpinText.h @@ -1,6 +1,6 @@ -#include "xrUICore/SpinBox/UICustomSpin.h" +#include "UICustomSpin.h" -class XRUICORE_API CUISpinText : public CUICustomSpin +class CUISpinText : public CUICustomSpin { public: CUISpinText(); diff --git a/src/xrUICore/Static/UIStatic.cpp b/src/xrGame/ui/UIStatic.cpp similarity index 97% rename from src/xrUICore/Static/UIStatic.cpp rename to src/xrGame/ui/UIStatic.cpp index 385e45d69d3..9553baa0414 100644 --- a/src/xrUICore/Static/UIStatic.cpp +++ b/src/xrGame/ui/UIStatic.cpp @@ -1,13 +1,15 @@ -#include "pch.hpp" -#include "Windows/UIWindow.h" -#include "UIStatic.h" - -#include "XML/UITextureMaster.h" +#include "stdafx.h" +#include "uistatic.h" +#include "UIXmlInit.h" +#include "UITextureMaster.h" #include "xrEngine/LightAnimLibrary.h" -#include "Lines/uiLines.h" +#include "uilines.h" +#include "ui_base.h" + #include "Include/xrRender/UIRender.h" -#include "Buttons/UIBtnHint.h" -#include "Cursor/UICursor.h" + +#include "UIBtnHint.h" +#include "UICursor.h" bool is_in2(const Frect& b1, const Frect& b2); diff --git a/src/xrUICore/Static/UIStatic.h b/src/xrGame/ui/UIStatic.h similarity index 92% rename from src/xrUICore/Static/UIStatic.h rename to src/xrGame/ui/UIStatic.h index d2c80eaffb4..3a4b094e761 100644 --- a/src/xrUICore/Static/UIStatic.h +++ b/src/xrGame/ui/UIStatic.h @@ -1,8 +1,8 @@ #pragma once -#include "xrUICore/Static/UILanimController.h" -#include "xrUICore/Static/UIStaticItem.h" -#include "xrUICore/Windows/UIWindow.h" -#include "xrUICore/Lines/UILines.h" +#include "UILanimController.h" +#include "UIStaticItem.h" + +#include "UILines.h" class CUIFrameWindow; class CLAItem; @@ -23,9 +23,9 @@ struct lanim_cont_xf : public lanim_cont void set_defaults(); }; -class XRUICORE_API CUIStatic : public CUIWindow, public ITextureOwner, public CUILightAnimColorConrollerImpl +class CUIStatic : public CUIWindow, public ITextureOwner, public CUILightAnimColorConrollerImpl { - friend class CUIXmlInitBase; + friend class CUIXmlInit; private: typedef CUIWindow inherited; @@ -100,7 +100,7 @@ class XRUICORE_API CUIStatic : public CUIWindow, public ITextureOwner, public CU shared_str m_stat_hint_text; }; -class XRUICORE_API CUITextWnd : public CUIWindow, public CUILightAnimColorConrollerImpl +class CUITextWnd : public CUIWindow, public CUILightAnimColorConrollerImpl { typedef CUIWindow inherited; CUILines m_lines; diff --git a/src/xrUICore/Static/UIStatic_script.cpp b/src/xrGame/ui/UIStatic_script.cpp similarity index 93% rename from src/xrUICore/Static/UIStatic_script.cpp rename to src/xrGame/ui/UIStatic_script.cpp index 043c7896f13..c89e36c4708 100644 --- a/src/xrUICore/Static/UIStatic_script.cpp +++ b/src/xrGame/ui/UIStatic_script.cpp @@ -1,4 +1,4 @@ -#include "pch.hpp" +#include "pch_script.h" #include "UIStatic.h" #include "UIAnimatedStatic.h" #include "xrScriptEngine/ScriptExporter.hpp" @@ -46,3 +46,6 @@ SCRIPT_EXPORT(CUITextWnd, (CUIWindow), { // .def("", &CUITextWnd::) ]; }); + +SCRIPT_EXPORT(CUISleepStatic, (CUIStatic), + { module(luaState)[class_("CUISleepStatic").def(constructor<>())]; }); diff --git a/src/xrGame/ui/UIStatix.h b/src/xrGame/ui/UIStatix.h index 1c4bede8c3e..0093669c332 100644 --- a/src/xrGame/ui/UIStatix.h +++ b/src/xrGame/ui/UIStatix.h @@ -1,6 +1,6 @@ #pragma once -#include "xrUICore/Static/UIStatic.h" +#include "UIStatic.h" class CUIStatix : public CUIStatic { diff --git a/src/xrGame/ui/UIStats.cpp b/src/xrGame/ui/UIStats.cpp index 7542d781eba..6dcf45983ed 100644 --- a/src/xrGame/ui/UIStats.cpp +++ b/src/xrGame/ui/UIStats.cpp @@ -3,8 +3,8 @@ #include "UIStats.h" #include "UIXmlInit.h" #include "UIStatsPlayerList.h" -#include "xrUICore/Static/UIStatic.h" -#include "xrUICore/Windows/UIFrameWindow.h" +#include "UIStatic.h" +#include "UIFrameWindow.h" #include "Level.h" #include "game_base_space.h" diff --git a/src/xrGame/ui/UIStats.h b/src/xrGame/ui/UIStats.h index 6d1848cf65c..6c2a36b0ac2 100644 --- a/src/xrGame/ui/UIStats.h +++ b/src/xrGame/ui/UIStats.h @@ -1,6 +1,6 @@ #pragma once -#include "xrUICore/ScrollView/UIScrollView.h" +#include "UIScrollView.h" #include "UIStatsPlayerList.h" class CUIXml; diff --git a/src/xrGame/ui/UIStatsIcon.cpp b/src/xrGame/ui/UIStatsIcon.cpp index 71fce1ed4ed..0d70e08486e 100644 --- a/src/xrGame/ui/UIStatsIcon.cpp +++ b/src/xrGame/ui/UIStatsIcon.cpp @@ -1,6 +1,6 @@ #include "StdAfx.h" #include "UIStatsIcon.h" -#include "xrUICore/XML/UITextureMaster.h" +#include "UITextureMaster.h" #include "UIInventoryUtilities.h" #include "Include/xrRender/UIShader.h" diff --git a/src/xrGame/ui/UIStatsIcon.h b/src/xrGame/ui/UIStatsIcon.h index 0d247450e92..9120a428e53 100644 --- a/src/xrGame/ui/UIStatsIcon.h +++ b/src/xrGame/ui/UIStatsIcon.h @@ -1,6 +1,6 @@ #pragma once -#include "xrUICore/Static/UIStatic.h" +#include "UIStatic.h" class CUIStatsIcon : public CUIStatic { diff --git a/src/xrGame/ui/UIStatsPlayerInfo.cpp b/src/xrGame/ui/UIStatsPlayerInfo.cpp index fc792a28780..87839f48bbf 100644 --- a/src/xrGame/ui/UIStatsPlayerInfo.cpp +++ b/src/xrGame/ui/UIStatsPlayerInfo.cpp @@ -1,6 +1,6 @@ #include "StdAfx.h" #include "UIStatsPlayerInfo.h" -#include "xrUICore/Static/UIStatic.h" +#include "UIStatic.h" #include "game_cl_base.h" #include "UIStatsIcon.h" #include "game_cl_artefacthunt.h" @@ -104,6 +104,7 @@ void CUIStatsPlayerInfo::AddField(float len, CGameFont* pF, u32 text_col, bool i const char* CUIStatsPlayerInfo::GetInfoByID(const char* id) { static string64 ans; + CStringTable st; if (0 == xr_strcmp(id, "name")) xr_strcpy(ans, m_pPlayerInfo->getName()); @@ -145,7 +146,7 @@ const char* CUIStatsPlayerInfo::GetInfoByID(const char* id) else if (0 == xr_strcmp(id, "status")) { if (m_pPlayerInfo->testFlag(GAME_PLAYER_FLAG_READY)) - xr_strcpy(ans, *StringTable().translate("st_mp_ready")); + xr_strcpy(ans, *st.translate("st_mp_ready")); else xr_strcpy(ans, ""); } diff --git a/src/xrGame/ui/UIStatsPlayerInfo.h b/src/xrGame/ui/UIStatsPlayerInfo.h index da5b367d5ce..9e00e563818 100644 --- a/src/xrGame/ui/UIStatsPlayerInfo.h +++ b/src/xrGame/ui/UIStatsPlayerInfo.h @@ -1,6 +1,6 @@ #pragma once -#include "xrUICore/Windows/UIWindow.h" +#include "UIWindow.h" struct game_PlayerState; class CUIStatic; diff --git a/src/xrGame/ui/UIStatsPlayerList.cpp b/src/xrGame/ui/UIStatsPlayerList.cpp index f4d575d8abf..34e73bd7443 100644 --- a/src/xrGame/ui/UIStatsPlayerList.cpp +++ b/src/xrGame/ui/UIStatsPlayerList.cpp @@ -6,7 +6,7 @@ #include "UIStatsIcon.h" #include "string_table.h" #include "Level.h" -#include "xrUICore/Static/UIStatic.h" +#include "UIStatic.h" #include "UIXmlInit.h" IC bool DM_Compare_Players(game_PlayerState* p1, game_PlayerState* p2); @@ -231,20 +231,21 @@ void CUIStatsPlayerList::Update() }; pl_count = items.size(); + CStringTable st; if (GameID() == eGameIDArtefactHunt && !m_bSpectator) { game_cl_ArtefactHunt* game = static_cast(&Game()); pl_artefacts = game->teams[m_CurTeam - 1].score; - xr_sprintf(teaminfo, "%s: %u, %s: %u, %s: %d", *StringTable().translate("mp_artefacts_upcase"), pl_artefacts, - *StringTable().translate("mp_players"), pl_count, *StringTable().translate("mp_frags_upcase"), pl_frags); + xr_sprintf(teaminfo, "%s: %u, %s: %u, %s: %d", *st.translate("mp_artefacts_upcase"), pl_artefacts, + *st.translate("mp_players"), pl_count, *st.translate("mp_frags_upcase"), pl_frags); m_header_text->SetText(teaminfo); } else if (GameID() == eGameIDTeamDeathmatch && !m_bSpectator) { game_cl_TeamDeathmatch* game = static_cast(&Game()); pl_frags = game->teams[m_CurTeam - 1].score; - xr_sprintf(teaminfo, "%s: %d, %s: %u", *StringTable().translate("mp_frags_upcase"), pl_frags, - *StringTable().translate("mp_players"), pl_count); + xr_sprintf(teaminfo, "%s: %d, %s: %u", *st.translate("mp_frags_upcase"), pl_frags, *st.translate("mp_players"), + pl_count); m_header_text->SetText(teaminfo); } diff --git a/src/xrGame/ui/UIStatsPlayerList.h b/src/xrGame/ui/UIStatsPlayerList.h index a828f55a8c5..4f4a17e0fee 100644 --- a/src/xrGame/ui/UIStatsPlayerList.h +++ b/src/xrGame/ui/UIStatsPlayerList.h @@ -1,6 +1,6 @@ #pragma once -#include "xrUICore/ScrollView/UIScrollView.h" +#include "UIScrollView.h" #include "UIStatsPlayerInfo.h" class CUIXml; diff --git a/src/xrUICore/Lines/UISubLine.cpp b/src/xrGame/ui/UISubLine.cpp similarity index 52% rename from src/xrUICore/Lines/UISubLine.cpp rename to src/xrGame/ui/UISubLine.cpp index eabbad9365f..9bc6fa88188 100644 --- a/src/xrUICore/Lines/UISubLine.cpp +++ b/src/xrGame/ui/UISubLine.cpp @@ -6,18 +6,44 @@ // // Copyright 2005 GSC Game World -#include "pch.hpp" +#include "StdAfx.h" #include "UISubLine.h" #include "uilinestd.h" #include "ui_base.h" #include "xrEngine/GameFont.h" +//#define LOG_ALL_LINES +#ifdef LOG_ALL_LINES +int ListSubLinesCount = 0; +struct DBGList +{ + CUISubLine* wnd; + int num; +}; +xr_vector dbg_list_sublines; +void dump_list_sublines() +{ + Msg("------Total SubLines %d", dbg_list_sublines.size()); + xr_vector::iterator _it = dbg_list_sublines.begin(); + for (; _it != dbg_list_sublines.end(); ++_it) + Msg("--leak detected ---- SubLine = %d", (*_it).num); +} +#else +void dump_list_sublines() {} +#endif + CUISubLine::CUISubLine(const CUISubLine& other) { m_color = other.m_color; m_last_in_line = other.m_last_in_line; m_text = other.m_text; m_pTempLine = NULL; +#ifdef LOG_ALL_LINES + ListSubLinesCount++; + dbg_list_sublines.push_back(DBGList()); + dbg_list_sublines.back().wnd = this; + dbg_list_sublines.back().num = ListSubLinesCount; +#endif } CUISubLine& CUISubLine::operator=(const CUISubLine& other) @@ -31,11 +57,32 @@ CUISubLine& CUISubLine::operator=(const CUISubLine& other) CUISubLine::CUISubLine() : m_color(0), m_pTempLine(NULL), m_last_in_line(false) { +#ifdef LOG_ALL_LINES + ListSubLinesCount++; + dbg_list_sublines.push_back(DBGList()); + dbg_list_sublines.back().wnd = this; + dbg_list_sublines.back().num = ListSubLinesCount; +#endif } CUISubLine::~CUISubLine() { xr_delete(m_pTempLine); +#ifdef LOG_ALL_LINES + xr_vector::iterator _it = dbg_list_sublines.begin(); + bool bOK = false; + for (; _it != dbg_list_sublines.end(); ++_it) + { + if ((*_it).wnd == this) + { + bOK = true; + dbg_list_sublines.erase(_it); + break; + } + } + if (!bOK) + Msg("CUISubLine::~CUISubLine()!!!!!!!!!!!!!!!!!!!!!!! cannot find window in list"); +#endif } const CUISubLine* CUISubLine::Cut2Pos(int i) diff --git a/src/xrUICore/Lines/UISubLine.h b/src/xrGame/ui/UISubLine.h similarity index 100% rename from src/xrUICore/Lines/UISubLine.h rename to src/xrGame/ui/UISubLine.h diff --git a/src/xrUICore/TabControl/UITabButton.cpp b/src/xrGame/ui/UITabButton.cpp similarity index 93% rename from src/xrUICore/TabControl/UITabButton.cpp rename to src/xrGame/ui/UITabButton.cpp index 7a190a273a0..af4798c18bf 100644 --- a/src/xrUICore/TabControl/UITabButton.cpp +++ b/src/xrGame/ui/UITabButton.cpp @@ -1,6 +1,5 @@ -#include "pch.hpp" +#include "StdAfx.h" #include "UITabButton.h" -#include "xrEngine\xr_input_xinput.h" CUITabButton::CUITabButton() {} CUITabButton::~CUITabButton() {} diff --git a/src/xrUICore/TabControl/UITabButton.h b/src/xrGame/ui/UITabButton.h similarity index 77% rename from src/xrUICore/TabControl/UITabButton.h rename to src/xrGame/ui/UITabButton.h index 6a1c5950239..46f2dee0dac 100644 --- a/src/xrUICore/TabControl/UITabButton.h +++ b/src/xrGame/ui/UITabButton.h @@ -1,7 +1,7 @@ #pragma once -#include "xrUICore/Buttons/UI3tButton.h" +#include "UI3tButton.h" -class XRUICORE_API CUITabButton : public CUI3tButton +class CUITabButton : public CUI3tButton { typedef CUI3tButton inherited; diff --git a/src/xrGame/ui/UITabButtonMP.h b/src/xrGame/ui/UITabButtonMP.h index 3a9489c09f1..7db6b42ddb4 100644 --- a/src/xrGame/ui/UITabButtonMP.h +++ b/src/xrGame/ui/UITabButtonMP.h @@ -1,5 +1,5 @@ #pragma once -#include "xrUICore/TabControl/UITabButton.h" +#include "UITabButton.h" class CUITabButtonMP : public CUITabButton { diff --git a/src/xrUICore/TabControl/UITabControl.cpp b/src/xrGame/ui/UITabControl.cpp similarity index 98% rename from src/xrUICore/TabControl/UITabControl.cpp rename to src/xrGame/ui/UITabControl.cpp index 32b1538fd4a..e172657b292 100644 --- a/src/xrUICore/TabControl/UITabControl.cpp +++ b/src/xrGame/ui/UITabControl.cpp @@ -1,4 +1,4 @@ -#include "pch.hpp" +#include "StdAfx.h" #include "UITabControl.h" #include "UITabButton.h" @@ -11,6 +11,7 @@ CUITabControl::CUITabControl() CUITabControl::~CUITabControl() { RemoveAll(); } void CUITabControl::SetCurrentOptValue() { + CUIOptionsItem::SetCurrentOptValue(); shared_str v = GetOptStringValue(); CUITabButton* b = GetButtonById(v); if (NULL == b) @@ -37,6 +38,7 @@ void CUITabControl::UndoOptValue() void CUITabControl::SaveBackUpOptValue() { + CUIOptionsItem::SaveBackUpOptValue(); m_opt_backup_value = GetActiveId(); } diff --git a/src/xrUICore/TabControl/UITabControl.h b/src/xrGame/ui/UITabControl.h similarity index 93% rename from src/xrUICore/TabControl/UITabControl.h rename to src/xrGame/ui/UITabControl.h index c07633d9772..0abd314ff32 100644 --- a/src/xrUICore/TabControl/UITabControl.h +++ b/src/xrGame/ui/UITabControl.h @@ -1,12 +1,14 @@ #pragma once -#include "xrUICore/Windows/UIWindow.h" -#include "xrUICore/Options/UIOptionsItem.h" + +#include "uiwindow.h" + +#include "UIOptionsItem.h" class CUITabButton; using TABS_VECTOR = xr_vector; -class XRUICORE_API CUITabControl : public CUIWindow, public CUIOptionsItem +class CUITabControl : public CUIWindow, public CUIOptionsItem { typedef CUIWindow inherited; diff --git a/src/xrUICore/TabControl/UITabControl_script.cpp b/src/xrGame/ui/UITabControl_script.cpp similarity index 97% rename from src/xrUICore/TabControl/UITabControl_script.cpp rename to src/xrGame/ui/UITabControl_script.cpp index 211e2fe7096..b0633781cbc 100644 --- a/src/xrUICore/TabControl/UITabControl_script.cpp +++ b/src/xrGame/ui/UITabControl_script.cpp @@ -1,4 +1,4 @@ -#include "pch.hpp" +#include "pch_script.h" #include "UITabControl.h" #include "UITabButton.h" #include "xrScriptEngine/ScriptExporter.hpp" diff --git a/src/xrGame/ui/UITalkDialogWnd.cpp b/src/xrGame/ui/UITalkDialogWnd.cpp index 85fdf7ffbb2..8f0936f707e 100644 --- a/src/xrGame/ui/UITalkDialogWnd.cpp +++ b/src/xrGame/ui/UITalkDialogWnd.cpp @@ -1,13 +1,13 @@ #include "stdafx.h" #include "UITalkDialogWnd.h" -#include "xrUICore/XML/xrUIXmlParser.h" +#include "xrUIXmlParser.h" #include "UIXmlInit.h" -#include "xrUICore/ScrollView/UIScrollView.h" -#include "xrUICore/Buttons/UI3tButton.h" +#include "UIScrollView.h" +#include "UI3tButton.h" #include "UITalkWnd.h" #include "UIInventoryUtilities.h" -#include "xrUICore/Buttons/UIBtnHint.h" +#include "UIBtnHint.h" #include "game_news.h" #include "Level.h" diff --git a/src/xrGame/ui/UITalkDialogWnd.h b/src/xrGame/ui/UITalkDialogWnd.h index 6d428b77ccb..bac0a637b90 100644 --- a/src/xrGame/ui/UITalkDialogWnd.h +++ b/src/xrGame/ui/UITalkDialogWnd.h @@ -1,11 +1,11 @@ #pragma once -#include "xrUICore/Static/UIStatic.h" -#include "xrUICore/Buttons/UI3tButton.h" -#include "xrUICore/Windows/UIFrameLineWnd.h" +#include "UIStatic.h" +#include "UI3tButton.h" +#include "UIFrameLineWnd.h" #include "InfoPortion.h" #include "UICharacterInfo.h" #include "UIItemInfo.h" -#include "xrUICore/Callbacks/UIWndCallback.h" +#include "UIWndCallback.h" class CUIScrollView; class CUIXml; diff --git a/src/xrGame/ui/UITalkWnd.cpp b/src/xrGame/ui/UITalkWnd.cpp index 94853eccee6..dd889a17b7a 100644 --- a/src/xrGame/ui/UITalkWnd.cpp +++ b/src/xrGame/ui/UITalkWnd.cpp @@ -14,7 +14,7 @@ #include "xr_level_controller.h" #include "xrEngine/cameraBase.h" #include "UIXmlInit.h" -#include "xrUICore/Buttons/UI3tButton.h" +#include "UI3tButton.h" CUITalkWnd::CUITalkWnd() { @@ -86,6 +86,7 @@ void CUITalkWnd::InitOthersStartDialog() m_pOthersDialogManager->InitDialog(m_pOurDialogManager, m_pCurrentDialog); //сказать фразу + CStringTable stbl; AddAnswer(m_pCurrentDialog->GetPhraseText("0"), m_pOthersInvOwner->Name()); m_pOthersDialogManager->SayPhrase(m_pCurrentDialog, "0"); @@ -292,7 +293,7 @@ void CUITalkWnd::AddQuestion(const shared_str& text, const shared_str& value, in if (text.size() == 0) return; - UITalkDialogWnd->AddQuestion(StringTable().translate(text).c_str(), value.c_str(), number, b_finalizer); + UITalkDialogWnd->AddQuestion(CStringTable().translate(text).c_str(), value.c_str(), number, b_finalizer); } void CUITalkWnd::AddAnswer(const shared_str& text, LPCSTR SpeakerName) @@ -305,7 +306,7 @@ void CUITalkWnd::AddAnswer(const shared_str& text, LPCSTR SpeakerName) PlaySnd(text.c_str()); bool i_am = (0 == xr_strcmp(SpeakerName, m_pOurInvOwner->Name())); - UITalkDialogWnd->AddAnswer(SpeakerName, *StringTable().translate(text), i_am); + UITalkDialogWnd->AddAnswer(SpeakerName, *CStringTable().translate(text), i_am); } void CUITalkWnd::SwitchToTrade() diff --git a/src/xrGame/ui/UITalkWnd.h b/src/xrGame/ui/UITalkWnd.h index e461b747908..110b0227562 100644 --- a/src/xrGame/ui/UITalkWnd.h +++ b/src/xrGame/ui/UITalkWnd.h @@ -1,9 +1,9 @@ #pragma once #include "UIDialogWnd.h" -#include "xrUICore/Static/UIStatic.h" -#include "xrUICore/Buttons/UIButton.h" -#include "xrUICore/EditBox/UIEditBox.h" -#include "xrUICore/Windows/UIFrameWindow.h" +#include "UIStatic.h" +#include "UIButton.h" +#include "UIEditBox.h" +#include "UIFrameWindow.h" #include "PhraseDialogDefs.h" class CActor; diff --git a/src/xrGame/ui/UITaskWnd.cpp b/src/xrGame/ui/UITaskWnd.cpp index da542c051dc..43be2bed286 100644 --- a/src/xrGame/ui/UITaskWnd.cpp +++ b/src/xrGame/ui/UITaskWnd.cpp @@ -3,13 +3,13 @@ #include "UIMapWnd.h" #include "Common/object_broker.h" #include "UIXmlInit.h" -#include "xrUICore/Static/UIStatic.h" -#include "xrUICore/Buttons/UI3tButton.h" -#include "xrUICore/Windows/UIFrameLineWnd.h" +#include "UIStatic.h" +#include "UI3tButton.h" +#include "UIFrameLineWnd.h" #include "UISecondTaskWnd.h" #include "UIMapLegend.h" #include "UIHelper.h" -#include "xrUICore/Hint/UIHint.h" +#include "UIHint.h" #include "GameTask.h" #include "map_location.h" #include "map_location_defs.h" @@ -19,7 +19,7 @@ #include "Level.h" #include "GametaskManager.h" #include "Actor.h" -#include "xrUICore/Buttons/UICheckButton.h" +#include "UICheckButton.h" CUITaskWnd::CUITaskWnd() { hint_wnd = NULL; } CUITaskWnd::~CUITaskWnd() { delete_data(m_pMapWnd); } diff --git a/src/xrGame/ui/UITaskWnd.h b/src/xrGame/ui/UITaskWnd.h index 7195f77ac08..6f9a25ffd5a 100644 --- a/src/xrGame/ui/UITaskWnd.h +++ b/src/xrGame/ui/UITaskWnd.h @@ -1,9 +1,9 @@ #pragma once -#include "xrUICore/Windows/UIWindow.h" -#include "xrUICore/Callbacks/UIWndCallback.h" +#include "UIWindow.h" +#include "UIWndCallback.h" #include "xrCore/Containers/AssociativeVector.hpp" #include "GameTaskDefs.h" -#include "xrUICore/Buttons/UICheckButton.h" +#include "UICheckButton.h" class CUIMapWnd; class CUIStatic; diff --git a/src/xrGame/ui/UITextVote.cpp b/src/xrGame/ui/UITextVote.cpp index 49952056fd3..8368b78a2c7 100644 --- a/src/xrGame/ui/UITextVote.cpp +++ b/src/xrGame/ui/UITextVote.cpp @@ -3,7 +3,7 @@ #include "UITextVote.h" #include "UIVotingCategory.h" #include "UIXmlInit.h" -#include "xrUICore/Buttons/UI3tButton.h" +#include "UI3tButton.h" #include "UIEditboxEx.h" #include "Level.h" #include "game_cl_teamdeathmatch.h" diff --git a/src/xrUICore/XML/UITextureMaster.cpp b/src/xrGame/ui/UITextureMaster.cpp similarity index 98% rename from src/xrUICore/XML/UITextureMaster.cpp rename to src/xrGame/ui/UITextureMaster.cpp index 745bc48a13d..bab3276a80d 100644 --- a/src/xrUICore/XML/UITextureMaster.cpp +++ b/src/xrGame/ui/UITextureMaster.cpp @@ -7,9 +7,9 @@ // // copyright 2005 GSC Game World -#include "pch.hpp" +#include "StdAfx.h" #include "UITextureMaster.h" -#include "Static/UIStaticItem.h" +#include "UIStaticItem.h" #include "uiabstract.h" #include "xrUIXmlParser.h" #include "Include/xrRender/UIShader.h" diff --git a/src/xrUICore/XML/UITextureMaster.h b/src/xrGame/ui/UITextureMaster.h similarity index 96% rename from src/xrUICore/XML/UITextureMaster.h rename to src/xrGame/ui/UITextureMaster.h index ae41c9a9d33..a39082e903b 100644 --- a/src/xrUICore/XML/UITextureMaster.h +++ b/src/xrGame/ui/UITextureMaster.h @@ -10,7 +10,7 @@ #pragma once class CUIStaticItem; -#include "xrUICore/ui_defs.h" +#include "ui_defs.h" struct TEX_INFO { @@ -33,7 +33,7 @@ struct sh_pair } }; -class XRUICORE_API CUITextureMaster +class CUITextureMaster { public: static void ParseShTexInfo(LPCSTR xml_file); diff --git a/src/xrUICore/TrackBar/UITrackBar.cpp b/src/xrGame/ui/UITrackBar.cpp similarity index 97% rename from src/xrUICore/TrackBar/UITrackBar.cpp rename to src/xrGame/ui/UITrackBar.cpp index a0309be92e8..e2af6637e07 100644 --- a/src/xrUICore/TrackBar/UITrackBar.cpp +++ b/src/xrGame/ui/UITrackBar.cpp @@ -1,7 +1,8 @@ -#include "pch.hpp" +#include "StdAfx.h" + #include "UITrackBar.h" -#include "Buttons/UI3tButton.h" -#include "XML/UITextureMaster.h" +#include "UI3tButton.h" +#include "UITextureMaster.h" #include "xrEngine/xr_input.h" #define DEF_CONTROL_HEIGHT 16.0f @@ -121,6 +122,7 @@ void CUITrackBar::Update() void CUITrackBar::SetCurrentOptValue() { + CUIOptionsItem::SetCurrentOptValue(); if (m_b_is_float) GetOptFloatValue(m_f_val, m_f_min, m_f_max); else @@ -152,6 +154,8 @@ bool CUITrackBar::IsChangedOptValue() const void CUITrackBar::SaveBackUpOptValue() { + CUIOptionsItem::SaveBackUpOptValue(); + if (m_b_is_float) m_f_opt_backup_value = m_f_val; else diff --git a/src/xrUICore/TrackBar/UITrackBar.h b/src/xrGame/ui/UITrackBar.h similarity index 89% rename from src/xrUICore/TrackBar/UITrackBar.h rename to src/xrGame/ui/UITrackBar.h index 27758cb9d38..cccb2be5b11 100644 --- a/src/xrUICore/TrackBar/UITrackBar.h +++ b/src/xrGame/ui/UITrackBar.h @@ -1,10 +1,11 @@ #pragma once -#include "xrUICore/Options/UIOptionsItem.h" -#include "xrUICore/InteractiveBackground/UI_IB_Static.h" + +#include "UIOptionsItem.h" +#include "UI_IB_Static.h" class CUI3tButton; -class XRUICORE_API CUITrackBar : public CUI_IB_FrameLineWnd, public CUIOptionsItem +class CUITrackBar : public CUI_IB_FrameLineWnd, public CUIOptionsItem { public: CUITrackBar(); diff --git a/src/xrGame/ui/UIVote.cpp b/src/xrGame/ui/UIVote.cpp index fece9c9c2b6..cad0d7c90a2 100644 --- a/src/xrGame/ui/UIVote.cpp +++ b/src/xrGame/ui/UIVote.cpp @@ -1,9 +1,9 @@ #include "StdAfx.h" #include "UIVote.h" -#include "xrUICore/Static/UIStatic.h" -#include "xrUICore/Buttons/UI3tButton.h" -#include "xrUICore/ListBox/UIListBox.h" -#include "xrUICore/Windows/UIFrameWindow.h" +#include "UIStatic.h" +#include "UI3tButton.h" +#include "UIListBox.h" +#include "UIFrameWindow.h" #include "UIXmlInit.h" #include "Level.h" #include "game_cl_base.h" diff --git a/src/xrGame/ui/UIVoteStatusWnd.cpp b/src/xrGame/ui/UIVoteStatusWnd.cpp index 8e750b4d489..a804814b781 100644 --- a/src/xrGame/ui/UIVoteStatusWnd.cpp +++ b/src/xrGame/ui/UIVoteStatusWnd.cpp @@ -1,7 +1,7 @@ #include "stdafx.h" #include "UIVoteStatusWnd.h" #include "UIXmlInit.h" -#include "xrUICore/Static/UIStatic.h" +#include "UIStatic.h" void UIVoteStatusWnd::InitFromXML(CUIXml& xml_doc) { diff --git a/src/xrGame/ui/UIVoteStatusWnd.h b/src/xrGame/ui/UIVoteStatusWnd.h index 3e10c980534..9358ae06f7b 100644 --- a/src/xrGame/ui/UIVoteStatusWnd.h +++ b/src/xrGame/ui/UIVoteStatusWnd.h @@ -1,5 +1,5 @@ #pragma once -#include "xrUICore/Windows/UIFrameWindow.h" +#include "UIFrameWindow.h" class CUIXml; class CUITextWnd; diff --git a/src/xrGame/ui/UIVotingCategory.cpp b/src/xrGame/ui/UIVotingCategory.cpp index cc0e2c72d03..bade4638313 100644 --- a/src/xrGame/ui/UIVotingCategory.cpp +++ b/src/xrGame/ui/UIVotingCategory.cpp @@ -1,7 +1,7 @@ #include "stdafx.h" #include "UIVotingCategory.h" #include "UIXmlInit.h" -#include "xrUICore/Buttons/UI3tButton.h" +#include "UI3tButton.h" #include "UIKickPlayer.h" #include "UIChangeMap.h" #include "ChangeWeatherDialog.hpp" diff --git a/src/xrGame/ui/UIWarState.cpp b/src/xrGame/ui/UIWarState.cpp index 1e6c73d970c..19ef18cb6ea 100644 --- a/src/xrGame/ui/UIWarState.cpp +++ b/src/xrGame/ui/UIWarState.cpp @@ -7,7 +7,7 @@ #include "stdafx.h" #include "UIWarState.h" -#include "xrUICore/Static/UIStatic.h" +#include "UIStatic.h" #include "UIXmlInit.h" #include "UIHelper.h" diff --git a/src/xrGame/ui/UIWarState.h b/src/xrGame/ui/UIWarState.h index a8f4a83abcf..0107dfe67be 100644 --- a/src/xrGame/ui/UIWarState.h +++ b/src/xrGame/ui/UIWarState.h @@ -6,7 +6,7 @@ //////////////////////////////////////////////////////////////////////////// #pragma once -#include "xrUICore/Hint/UIHint.h" +#include "UIHint.h" class CUIXml; class CUIStatic; diff --git a/src/xrUICore/Windows/UIWindow.cpp b/src/xrGame/ui/UIWindow.cpp similarity index 88% rename from src/xrUICore/Windows/UIWindow.cpp rename to src/xrGame/ui/UIWindow.cpp index 189acc21afb..70671283282 100644 --- a/src/xrUICore/Windows/UIWindow.cpp +++ b/src/xrGame/ui/UIWindow.cpp @@ -1,14 +1,35 @@ -#include "pch.hpp" +#include "stdafx.h" #include "UIWindow.h" -#include "Cursor/UICursor.h" +#include "UICursor.h" +#include "MainMenu.h" #include "Include/xrRender/DebugRender.h" #include "Include/xrRender/UIRender.h" -#include "xrEngine\xr_input_xinput.h" + +// #define LOG_ALL_WNDS +#ifdef LOG_ALL_WNDS +int ListWndCount = 0; +struct DBGList +{ + int num; + bool closed; +}; +xr_vector dbg_list_wnds; +void dump_list_wnd() +{ + Msg("------Total wnds %d", dbg_list_wnds.size()); + xr_vector::iterator _it = dbg_list_wnds.begin(); + for (; _it != dbg_list_wnds.end(); ++_it) + if (!(*_it).closed) + Msg("--leak detected ---- wnd = %d", (*_it).num); +} +#else +void dump_list_wnd() {} +#endif xr_vector g_wnds_rects; BOOL g_show_wnd_rect2 = FALSE; -XRUICORE_API void clean_wnd_rects() +void clean_wnd_rects() { #ifdef DEBUG GEnv.DRender->DestroyDebugShader(IDebugRender::dbgShaderWindow); @@ -36,8 +57,7 @@ void draw_rect(Frect& r, u32 color) #endif // DEBUG } - -XRUICORE_API void draw_wnds_rects() +void draw_wnds_rects() { if (0 == g_wnds_rects.size()) return; @@ -56,12 +76,35 @@ XRUICORE_API void draw_wnds_rects() g_wnds_rects.clear(); } +void CUIWindow::SetPPMode() +{ + m_bPP = true; + MainMenu()->RegisterPPDraw(this); + Show(false); +}; + +void CUIWindow::ResetPPMode() +{ + if (GetPPMode()) + { + MainMenu()->UnregisterPPDraw(this); + m_bPP = false; + } +} + CUIWindow::CUIWindow() : m_pParentWnd(NULL), m_pMouseCapturer(NULL), m_pMessageTarget(NULL), m_pKeyboardCapturer(NULL), - m_bAutoDelete(false), m_bCursorOverWindow(false), m_dwFocusReceiveTime(0), m_bCustomDraw(false) + m_bAutoDelete(false), m_bCursorOverWindow(false), m_bPP(false), m_dwFocusReceiveTime(0), m_bCustomDraw(false) { Show(true); Enable(true); +#ifdef LOG_ALL_WNDS + ListWndCount++; + m_dbg_id = ListWndCount; + dbg_list_wnds.push_back(DBGList()); + dbg_list_wnds.back().num = m_dbg_id; + dbg_list_wnds.back().closed = false; +#endif } CUIWindow::~CUIWindow() @@ -74,6 +117,31 @@ CUIWindow::~CUIWindow() parent->CUIWindow::DetachChild(this); DetachAll(); + + if (GetPPMode()) + MainMenu()->UnregisterPPDraw(this); + +#ifdef LOG_ALL_WNDS + xr_vector::iterator _it = dbg_list_wnds.begin(); + bool bOK = false; + for (; _it != dbg_list_wnds.end(); ++_it) + { + if ((*_it).num == m_dbg_id && !(*_it).closed) + { + bOK = true; + (*_it).closed = true; + dbg_list_wnds.erase(_it); + break; + } + if ((*_it).num == m_dbg_id && (*_it).closed) + { + Msg("--CUIWindow [%d] already deleted", m_dbg_id); + bOK = true; + } + } + if (!bOK) + Msg("CUIWindow::~CUIWindow.[%d] cannot find window in list", m_dbg_id); +#endif } void CUIWindow::Draw() diff --git a/src/xrUICore/Windows/UIWindow.h b/src/xrGame/ui/UIWindow.h similarity index 94% rename from src/xrUICore/Windows/UIWindow.h rename to src/xrGame/ui/UIWindow.h index d4c6f5ea3eb..cc156aee3d1 100644 --- a/src/xrUICore/Windows/UIWindow.h +++ b/src/xrGame/ui/UIWindow.h @@ -1,5 +1,7 @@ #pragma once +#include "xr_level_controller.h" +//#define xr_list xr_list #define ui_list xr_vector #define DEF_UILIST(N, T) \ @@ -8,10 +10,10 @@ ////////////////////////////////////////////////////////////////////////// -#include "xrUICore/UIMessages.h" -#include "xrUICore/uiabstract.h" +#include "UIMessages.h" +#include "uiabstract.h" -class XRUICORE_API CUIWindow : public CUISimpleWindow +class CUIWindow : public CUISimpleWindow { public: CUIWindow(); @@ -96,6 +98,9 @@ class XRUICORE_API CUIWindow : public CUISimpleWindow //обновление окна передпрорисовкой virtual void Update(); + void SetPPMode(); + void ResetPPMode(); + IC bool GetPPMode() { return m_bPP; }; //для перевода окна и потомков в исходное состояние virtual void Reset(); void ResetAll(); @@ -150,6 +155,7 @@ class XRUICORE_API CUIWindow : public CUISimpleWindow //флаг автоматического удаления во время вызова деструктора bool m_bAutoDelete; + bool m_bPP; bool m_bIsEnabled; // Если курсор над окном @@ -161,5 +167,4 @@ class XRUICORE_API CUIWindow : public CUISimpleWindow #endif }; -XRUICORE_API extern BOOL g_show_wnd_rect2; -XRUICORE_API bool fit_in_rect(CUIWindow* w, Frect const& vis_rect, float border = 0.0f, float dx16pos = 0.0f); +bool fit_in_rect(CUIWindow* w, Frect const& vis_rect, float border = 0.0f, float dx16pos = 0.0f); diff --git a/src/xrGame/ui/UIWindow_script.cpp b/src/xrGame/ui/UIWindow_script.cpp index 7c3d331fef3..17dc33f9551 100644 --- a/src/xrGame/ui/UIWindow_script.cpp +++ b/src/xrGame/ui/UIWindow_script.cpp @@ -1,18 +1,68 @@ #include "pch_script.h" +#include "UIWindow.h" +#include "UIFrameWindow.h" +#include "UIFrameLineWnd.h" #include "UIDialogWnd.h" #include "UIDialogHolder.h" #include "GamePersistent.h" -#include "UIMessageBoxEx.h" #include "UILabel.h" #include "UIMMShniaga.h" -#include "UISleepStatic.h" -#include "ScriptXMLInit.h" +#include "UITextureMaster.h" +#include "UIScrollView.h" #include "xrScriptEngine/ScriptExporter.hpp" +CFontManager& mngr() { return UI().Font(); } +// hud font +CGameFont* GetFontSmall() { return mngr().pFontStat; } +CGameFont* GetFontMedium() { return mngr().pFontMedium; } +CGameFont* GetFontDI() { return mngr().pFontDI; } +//шрифты для интерфейса +CGameFont* GetFontGraffiti19Russian() { return mngr().pFontGraffiti19Russian; } +CGameFont* GetFontGraffiti22Russian() { return mngr().pFontGraffiti22Russian; } +CGameFont* GetFontLetterica16Russian() { return mngr().pFontLetterica16Russian; } +CGameFont* GetFontLetterica18Russian() { return mngr().pFontLetterica18Russian; } +CGameFont* GetFontGraffiti32Russian() { return mngr().pFontGraffiti32Russian; } +CGameFont* GetFontGraffiti50Russian() { return mngr().pFontGraffiti50Russian; } +CGameFont* GetFontLetterica25() { return mngr().pFontLetterica25; } +int GetARGB(u16 a, u16 r, u16 g, u16 b) { return color_argb(a, r, g, b); } +const Fvector2 get_wnd_pos(CUIWindow* w) { return w->GetWndPos(); } using namespace luabind; using namespace luabind::policy; -// clang-format off +SCRIPT_EXPORT(CUIWindow, (), { + module(luaState)[def("GetARGB", &GetARGB), def("GetFontSmall", &GetFontSmall), def("GetFontMedium", &GetFontMedium), + def("GetFontDI", &GetFontDI), def("GetFontGraffiti19Russian", &GetFontGraffiti19Russian), + def("GetFontGraffiti22Russian", &GetFontGraffiti22Russian), + def("GetFontLetterica16Russian", &GetFontLetterica16Russian), + def("GetFontLetterica18Russian", &GetFontLetterica18Russian), + def("GetFontGraffiti32Russian", &GetFontGraffiti32Russian), + def("GetFontGraffiti50Russian", &GetFontGraffiti50Russian), def("GetFontLetterica25", &GetFontLetterica25), + + class_("CUIWindow") + .def(constructor<>()) + .def("AttachChild", &CUIWindow::AttachChild, adopt<2>()) + .def("DetachChild", &CUIWindow::DetachChild) + .def("SetAutoDelete", &CUIWindow::SetAutoDelete) + .def("IsAutoDelete", &CUIWindow::IsAutoDelete) + + .def("SetWndRect", (void (CUIWindow::*)(Frect)) & CUIWindow::SetWndRect_script) + .def("SetWndPos", (void (CUIWindow::*)(Fvector2)) & CUIWindow::SetWndPos_script) + .def("SetWndSize", (void (CUIWindow::*)(Fvector2)) & CUIWindow::SetWndSize_script) + .def("GetWndPos", &get_wnd_pos) + .def("GetWidth", &CUIWindow::GetWidth) + .def("GetHeight", &CUIWindow::GetHeight) + + .def("Enable", &CUIWindow::Enable) + .def("IsEnabled", &CUIWindow::IsEnabled) + .def("Show", &CUIWindow::Show) + .def("IsShown", &CUIWindow::IsShown) + + .def("WindowName", &CUIWindow::WindowName_script) + .def("SetWindowName", &CUIWindow::SetWindowName) + .def("SetPPMode", &CUIWindow::SetPPMode) + .def("ResetPPMode", &CUIWindow::ResetPPMode)]; +}); + SCRIPT_EXPORT(CDialogHolder, (), { module(luaState)[class_("CDialogHolder") .def("AddDialogToRender", &CDialogHolder::AddDialogToRender) @@ -20,43 +70,106 @@ SCRIPT_EXPORT(CDialogHolder, (), { }); SCRIPT_EXPORT(CUIDialogWnd, (CUIWindow), { - module(luaState) - [ - class_("CUIDialogWnd") - .def("ShowDialog", &CUIDialogWnd::ShowDialog) - .def("HideDialog", &CUIDialogWnd::HideDialog) - .def("GetHolder", &CUIDialogWnd::GetHolder) - ]; -}); - -SCRIPT_EXPORT(CUIMessageBoxEx, (CUIDialogWnd), { - module(luaState) - [ - class_("CUIMessageBoxEx") - .def(constructor<>()) - .def("InitMessageBox", &CUIMessageBoxEx::InitMessageBox) - .def("SetText", &CUIMessageBoxEx::SetText) - .def("GetHost", &CUIMessageBoxEx::GetHost) - .def("GetPassword", &CUIMessageBoxEx::GetPassword) - ]; + module(luaState)[class_("CUIDialogWnd") + .def("ShowDialog", &CUIDialogWnd::ShowDialog) + .def("HideDialog", &CUIDialogWnd::HideDialog) + .def("GetHolder", &CUIDialogWnd::GetHolder)]; +}); + +SCRIPT_EXPORT(CUIFrameWindow, (CUIWindow), { + module(luaState)[class_("CUIFrameWindow") + .def(constructor<>()) + .def("SetWidth", &CUIFrameWindow::SetWidth) + .def("SetHeight", &CUIFrameWindow::SetHeight) + .def("SetColor", &CUIFrameWindow::SetTextureColor)]; +}); + +SCRIPT_EXPORT(CUIFrameLineWnd, (CUIWindow), { + module(luaState)[class_("CUIFrameLineWnd") + .def(constructor<>()) + .def("SetWidth", &CUIFrameLineWnd::SetWidth) + .def("SetHeight", &CUIFrameLineWnd::SetHeight) + .def("SetColor", &CUIFrameLineWnd::SetTextureColor)]; }); SCRIPT_EXPORT(CUIMMShniaga, (CUIWindow), { - module(luaState) - [ - class_("CUIMMShniaga") - .enum_("enum_page_id") - [ - value("epi_main", CUIMMShniaga::epi_main), - value("epi_new_game", CUIMMShniaga::epi_new_game), - value("epi_new_network_game", CUIMMShniaga::epi_new_network_game) - ] - .def("SetVisibleMagnifier", &CUIMMShniaga::SetVisibleMagnifier) - .def("SetPage", &CUIMMShniaga::SetPage) - .def("ShowPage", &CUIMMShniaga::ShowPage) - ]; -}); - -SCRIPT_EXPORT(CUISleepStatic, (CUIStatic), - { module(luaState)[class_("CUISleepStatic").def(constructor<>())]; }); -// clang-format on + module(luaState)[class_("CUIMMShniaga") + .enum_("enum_page_id")[value("epi_main", CUIMMShniaga::epi_main), + value("epi_new_game", CUIMMShniaga::epi_new_game), + value("epi_new_network_game", CUIMMShniaga::epi_new_network_game)] + .def("SetVisibleMagnifier", &CUIMMShniaga::SetVisibleMagnifier) + .def("SetPage", &CUIMMShniaga::SetPage) + .def("ShowPage", &CUIMMShniaga::ShowPage)]; +}); + +SCRIPT_EXPORT(CUIScrollView, (CUIWindow), { + module(luaState)[class_("CUIScrollView") + .def(constructor<>()) + .def("AddWindow", &CUIScrollView::AddWindow) + .def("RemoveWindow", &CUIScrollView::RemoveWindow) + .def("Clear", &CUIScrollView::Clear) + .def("ScrollToBegin", &CUIScrollView::ScrollToBegin) + .def("ScrollToEnd", &CUIScrollView::ScrollToEnd) + .def("GetMinScrollPos", &CUIScrollView::GetMinScrollPos) + .def("GetMaxScrollPos", &CUIScrollView::GetMaxScrollPos) + .def("GetCurrentScrollPos", &CUIScrollView::GetCurrentScrollPos) + .def("SetScrollPos", &CUIScrollView::SetScrollPos)]; +}); + +SCRIPT_EXPORT(EnumUIMessages, (), { + class EnumUIMessages + { + }; + module(luaState)[class_("ui_events") + .enum_("events")[ + // CUIWindow + value("WINDOW_LBUTTON_DOWN", int(WINDOW_LBUTTON_DOWN)), + value("WINDOW_RBUTTON_DOWN", int(WINDOW_RBUTTON_DOWN)), + value("WINDOW_LBUTTON_UP", int(WINDOW_LBUTTON_UP)), + value("WINDOW_RBUTTON_UP", int(WINDOW_RBUTTON_UP)), + value("WINDOW_MOUSE_MOVE", int(WINDOW_MOUSE_MOVE)), + value("WINDOW_LBUTTON_DB_CLICK", int(WINDOW_LBUTTON_DB_CLICK)), + value("WINDOW_KEY_PRESSED", int(WINDOW_KEY_PRESSED)), + value("WINDOW_KEY_RELEASED", int(WINDOW_KEY_RELEASED)), + value("WINDOW_KEYBOARD_CAPTURE_LOST", int(WINDOW_KEYBOARD_CAPTURE_LOST)), + + // CUIButton + value("BUTTON_CLICKED", int(BUTTON_CLICKED)), value("BUTTON_DOWN", int(BUTTON_DOWN)), + + // CUITabControl + value("TAB_CHANGED", int(TAB_CHANGED)), + + // CUICheckButton + value("CHECK_BUTTON_SET", int(CHECK_BUTTON_SET)), + value("CHECK_BUTTON_RESET", int(CHECK_BUTTON_RESET)), + + // CUIRadioButton + value("RADIOBUTTON_SET", int(RADIOBUTTON_SET)), + + // CUIScrollBox + value("SCROLLBOX_MOVE", int(SCROLLBOX_MOVE)), + + // CUIScrollBar + value("SCROLLBAR_VSCROLL", int(SCROLLBAR_VSCROLL)), + value("SCROLLBAR_HSCROLL", int(SCROLLBAR_HSCROLL)), + + // CUIListWnd + value("LIST_ITEM_CLICKED", int(LIST_ITEM_CLICKED)), + value("LIST_ITEM_SELECT", int(LIST_ITEM_SELECT)), + + // UIPropertiesBox + value("PROPERTY_CLICKED", int(PROPERTY_CLICKED)), + + // CUIMessageBox + value("MESSAGE_BOX_OK_CLICKED", int(MESSAGE_BOX_OK_CLICKED)), + value("MESSAGE_BOX_YES_CLICKED", int(MESSAGE_BOX_YES_CLICKED)), + value("MESSAGE_BOX_NO_CLICKED", int(MESSAGE_BOX_NO_CLICKED)), + value("MESSAGE_BOX_CANCEL_CLICKED", int(MESSAGE_BOX_CANCEL_CLICKED)), + value("MESSAGE_BOX_COPY_CLICKED", int(MESSAGE_BOX_COPY_CLICKED)), + value("MESSAGE_BOX_QUIT_GAME_CLICKED", int(MESSAGE_BOX_QUIT_GAME_CLICKED)), + value("MESSAGE_BOX_QUIT_WIN_CLICKED", int(MESSAGE_BOX_QUIT_WIN_CLICKED)), + + value("EDIT_TEXT_COMMIT", int(EDIT_TEXT_COMMIT)), + // CMainMenu + value("MAIN_MENU_RELOADED", int(MAIN_MENU_RELOADED))]]; +}); diff --git a/src/xrUICore/Callbacks/UIWndCallback.cpp b/src/xrGame/ui/UIWndCallback.cpp similarity index 96% rename from src/xrUICore/Callbacks/UIWndCallback.cpp rename to src/xrGame/ui/UIWndCallback.cpp index 316a1bbb5f7..366a2fb562c 100644 --- a/src/xrUICore/Callbacks/UIWndCallback.cpp +++ b/src/xrGame/ui/UIWndCallback.cpp @@ -1,6 +1,6 @@ -#include "pch.hpp" +#include "pch_script.h" #include "UIWndCallback.h" -#include "Windows/UIWindow.h" +#include "UIWindow.h" #include "Common/object_broker.h" #include "callback_info.h" diff --git a/src/xrUICore/Callbacks/UIWndCallback.h b/src/xrGame/ui/UIWndCallback.h similarity index 95% rename from src/xrUICore/Callbacks/UIWndCallback.h rename to src/xrGame/ui/UIWndCallback.h index ed8e5bbdc8f..555089dcdb0 100644 --- a/src/xrUICore/Callbacks/UIWndCallback.h +++ b/src/xrGame/ui/UIWndCallback.h @@ -6,7 +6,7 @@ struct SCallbackInfo; class CUIWindow; class shared_str; -class XRUICORE_API CUIWndCallback +class CUIWndCallback { public: typedef fastdelegate::FastDelegate2 void_function; diff --git a/src/xrGame/ui/UIWpnParams.h b/src/xrGame/ui/UIWpnParams.h index cd6575be653..b81d924d56c 100644 --- a/src/xrGame/ui/UIWpnParams.h +++ b/src/xrGame/ui/UIWpnParams.h @@ -1,6 +1,7 @@ #pragma once -#include "xrUICore/Windows/UIWindow.h" -#include "xrUICore/ProgressBar/UIDoubleProgressBar.h" +#include "UIWindow.h" + +#include "UIDoubleProgressBar.h" class CUIXml; class CInventoryItem; diff --git a/src/xrGame/ui/UIXmlInit.cpp b/src/xrGame/ui/UIXmlInit.cpp index ae602d6dc22..c92051f691e 100644 --- a/src/xrGame/ui/UIXmlInit.cpp +++ b/src/xrGame/ui/UIXmlInit.cpp @@ -2,86 +2,417 @@ #include "UIXmlInit.h" #include "Level.h" #include "string_table.h" -#include "xrUICore/Windows/UIFrameWindow.h" -#include "xrUICore/Buttons/UICheckButton.h" -#include "xrUICore/SpinBox/UICustomSpin.h" -#include "xrUICore/Buttons/UIRadioButton.h" -#include "xrUICore/ProgressBar/UIProgressBar.h" -#include "xrUICore/ProgressBar/UIProgressShape.h" -#include "xrUICore/TabControl/UITabControl.h" +#include "UIFrameWindow.h" +#include "UICheckButton.h" +#include "UICustomSpin.h" +#include "UIRadioButton.h" +#include "UIProgressBar.h" +#include "UIProgressShape.h" +#include "UITabControl.h" #include "UILabel.h" -#include "xrUICore/Static/UIAnimatedStatic.h" -#include "UISleepStatic.h" +#include "UIAnimatedStatic.h" #include "uixmlinit.h" -#include "xrUICore/ListBox/UIListBox.h" -#include "xrUICore/ComboBox/UIComboBox.h" -#include "xrUICore/TrackBar/UITrackBar.h" +#include "UIListBox.h" +#include "UIComboBox.h" +#include "UITrackBar.h" +#include "UIHint.h" #include "game_base_space.h" -#include "xrUICore/XML/UITextureMaster.h" +#include "UITextureMaster.h" #include "UIDragDropListEx.h" #include "UIDragDropReferenceList.h" #include "UItabButtonMP.h" -#include "xrUICore/Lines/UILines.h" +#include "UILines.h" + +extern int keyname_to_dik(LPCSTR); + +#define ARIAL_FONT_NAME "arial" + +#define MEDIUM_FONT_NAME "medium" +#define SMALL_FONT_NAME "small" + +#define GRAFFITI19_FONT_NAME "graffiti19" +#define GRAFFITI22_FONT_NAME "graffiti22" +#define GRAFFITI32_FONT_NAME "graffiti32" +#define GRAFFITI50_FONT_NAME "graffiti50" + +#define LETTERICA16_FONT_NAME "letterica16" +#define LETTERICA18_FONT_NAME "letterica18" +#define LETTERICA25_FONT_NAME "letterica25" + +#define DI_FONT_NAME "di" + +////////////////////////////////////////////////////////////////////////// + +const char* const COLOR_DEFINITIONS = "color_defs.xml"; +CUIXmlInit::ColorDefs* CUIXmlInit::m_pColorDefs = NULL; + +////////////////////////////////////////////////////////////////////////// + +CUIXmlInit::CUIXmlInit() { InitColorDefs(); } +////////////////////////////////////////////////////////////////////////// -CUIXmlInit::CUIXmlInit() : baseClass() {} CUIXmlInit::~CUIXmlInit() {} +////////////////////////////////////////////////////////////////////////// Frect CUIXmlInit::GetFRect(CUIXml& xml_doc, LPCSTR path, int index) { - return baseClass::GetFRect(xml_doc, path, index); + R_ASSERT4(xml_doc.NavigateToNode(path, index), "XML node not found", path, xml_doc.m_xml_file_name); + Frect rect; + rect.set(0, 0, 0, 0); + rect.x1 = xml_doc.ReadAttribFlt(path, index, "x"); + rect.y1 = xml_doc.ReadAttribFlt(path, index, "y"); + rect.x2 = rect.x1 + xml_doc.ReadAttribFlt(path, index, "width"); + rect.y2 = rect.y1 + xml_doc.ReadAttribFlt(path, index, "height"); + + return rect; } bool CUIXmlInit::InitWindow(CUIXml& xml_doc, LPCSTR path, int index, CUIWindow* pWnd) { - return baseClass::InitWindow(xml_doc, path, index, pWnd); + R_ASSERT4(xml_doc.NavigateToNode(path, index), "XML node not found", path, xml_doc.m_xml_file_name); + + Fvector2 pos, size; + pos.x = xml_doc.ReadAttribFlt(path, index, "x"); + pos.y = xml_doc.ReadAttribFlt(path, index, "y"); + InitAlignment(xml_doc, path, index, pos.x, pos.y, pWnd); + size.x = xml_doc.ReadAttribFlt(path, index, "width"); + size.y = xml_doc.ReadAttribFlt(path, index, "height"); + pWnd->SetWndPos(pos); + pWnd->SetWndSize(size); + + string512 buf; + + strconcat(sizeof(buf), buf, path, ":window_name"); + if (xml_doc.NavigateToNode(buf, index)) + pWnd->SetWindowName(xml_doc.Read(buf, index, NULL)); + + InitAutoStaticGroup(xml_doc, path, index, pWnd); + //. InitAutoFrameLineGroup (xml_doc, path, index, pWnd); + + return true; } ////////////////////////////////////////////////////////////////////////// bool CUIXmlInit::InitFrameWindow(CUIXml& xml_doc, LPCSTR path, int index, CUIFrameWindow* pWnd) { - return baseClass::InitFrameWindow(xml_doc, path, index, pWnd); + R_ASSERT4(xml_doc.NavigateToNode(path, index), "XML node not found", path, xml_doc.m_xml_file_name); + + InitTexture(xml_doc, path, index, pWnd); + InitWindow(xml_doc, path, index, pWnd); + return true; } bool CUIXmlInit::InitOptionsItem(CUIXml& xml_doc, LPCSTR path, int index, CUIOptionsItem* pWnd) { - return baseClass::InitOptionsItem(xml_doc, path, index, pWnd); + string256 buf; + strconcat(sizeof(buf), buf, path, ":options_item"); + + if (xml_doc.NavigateToNode(buf, index)) + { + shared_str entry = xml_doc.ReadAttrib(buf, index, "entry"); + shared_str group = xml_doc.ReadAttrib(buf, index, "group"); + pWnd->AssignProps(entry, group); + + LPCSTR depends = xml_doc.ReadAttrib(buf, index, "depend", NULL); + if (depends) + { + CUIOptionsItem::ESystemDepends d = CUIOptionsItem::sdNothing; + + if (0 == xr_stricmp(depends, "vid")) + d = CUIOptionsItem::sdVidRestart; + else if (0 == xr_stricmp(depends, "snd")) + d = CUIOptionsItem::sdSndRestart; + else if (0 == xr_stricmp(depends, "ui")) + d = CUIOptionsItem::sdUIRestart; + else if (0 == xr_stricmp(depends, "restart")) + d = CUIOptionsItem::sdSystemRestart; + else if (0 == xr_stricmp(depends, "runtime")) + d = CUIOptionsItem::sdApplyOnChange; + else + Msg("! unknown param [%s] in optionsItem [%s]", depends, entry.c_str()); + + pWnd->SetSystemDepends(d); + } + return true; + } + else + return false; } bool CUIXmlInit::InitStatic(CUIXml& xml_doc, LPCSTR path, int index, CUIStatic* pWnd) { - return baseClass::InitStatic(xml_doc, path, index, pWnd); + R_ASSERT4(xml_doc.NavigateToNode(path, index), "XML node not found", path, xml_doc.m_xml_file_name); + + InitWindow(xml_doc, path, index, pWnd); + + string256 buf; + InitText(xml_doc, strconcat(sizeof(buf), buf, path, ":text"), index, pWnd); + InitTexture(xml_doc, path, index, pWnd); + InitTextureOffset(xml_doc, path, index, pWnd); + + int flag = xml_doc.ReadAttribInt(path, index, "heading", 0); + pWnd->EnableHeading((flag) ? true : false); + + float heading_angle = xml_doc.ReadAttribFlt(path, index, "heading_angle", 0.0f); + if (!fis_zero(heading_angle)) + { + pWnd->EnableHeading(true); + pWnd->SetConstHeading(true); + pWnd->SetHeading(deg2rad(heading_angle)); + } + + LPCSTR str_flag = xml_doc.ReadAttrib(path, index, "light_anim", ""); + int flag_cyclic = xml_doc.ReadAttribInt(path, index, "la_cyclic", 1); + int flag_text = xml_doc.ReadAttribInt(path, index, "la_text", 1); + int flag_texture = xml_doc.ReadAttribInt(path, index, "la_texture", 1); + int flag_alpha = xml_doc.ReadAttribInt(path, index, "la_alpha", 0); + + u8 flags = 0; + if (flag_cyclic) + flags |= LA_CYCLIC; + if (flag_alpha) + flags |= LA_ONLYALPHA; + if (flag_text) + flags |= LA_TEXTCOLOR; + if (flag_texture) + flags |= LA_TEXTURECOLOR; + + pWnd->SetColorAnimation(str_flag, flags); + + str_flag = xml_doc.ReadAttrib(path, index, "xform_anim", ""); + flag_cyclic = xml_doc.ReadAttribInt(path, index, "xform_anim_cyclic", 1); + + pWnd->SetXformLightAnim(str_flag, (flag_cyclic) ? true : false); + + bool bComplexMode = xml_doc.ReadAttribInt(path, index, "complex_mode", 0) ? true : false; + if (bComplexMode) + pWnd->TextItemControl()->SetTextComplexMode(bComplexMode); + + pWnd->m_stat_hint_text = xml_doc.ReadAttrib(path, index, "hint", ""); + + return true; } bool CUIXmlInit::InitTextWnd(CUIXml& xml_doc, LPCSTR path, int index, CUITextWnd* pWnd) { - return baseClass::InitTextWnd(xml_doc, path, index, pWnd); + R_ASSERT4(xml_doc.NavigateToNode(path, index), "XML node not found", path, xml_doc.m_xml_file_name); + + InitWindow(xml_doc, path, index, pWnd); + + string256 buf; + InitText(xml_doc, strconcat(sizeof(buf), buf, path, ":text"), index, &pWnd->TextItemControl()); + + LPCSTR str_flag = xml_doc.ReadAttrib(path, index, "light_anim", ""); + int flag_cyclic = xml_doc.ReadAttribInt(path, index, "la_cyclic", 1); + int flag_alpha = xml_doc.ReadAttribInt(path, index, "la_alpha", 0); + + u8 flags = LA_TEXTCOLOR; + if (flag_cyclic) + flags |= LA_CYCLIC; + if (flag_alpha) + flags |= LA_ONLYALPHA; + pWnd->SetColorAnimation(str_flag, flags); + + bool bComplexMode = xml_doc.ReadAttribInt(path, index, "complex_mode", 0) ? true : false; + if (bComplexMode) + pWnd->SetTextComplexMode(bComplexMode); + + strconcat(sizeof(buf), buf, path, ":texture"); + R_ASSERT3(NULL == xml_doc.NavigateToNode(buf, index), xml_doc.m_xml_file_name, buf); + + R_ASSERT(pWnd->GetChildWndList().size() == 0); + return true; } bool CUIXmlInit::InitCheck(CUIXml& xml_doc, LPCSTR path, int index, CUICheckButton* pWnd) { - return baseClass::InitCheck(xml_doc, path, index, pWnd); + InitStatic(xml_doc, path, index, pWnd); + + string256 buf; + strconcat(sizeof(buf), buf, path, ":texture"); + LPCSTR texture = xml_doc.Read(buf, index, "ui_checker"); + + pWnd->InitCheckButton(pWnd->GetWndPos(), pWnd->GetWndSize(), texture); + + u32 color; + strconcat(sizeof(buf), buf, path, ":text_color:e"); + if (xml_doc.NavigateToNode(buf, index)) + { + color = GetColor(xml_doc, buf, index, 0x00); + pWnd->SetStateTextColor(color, S_Enabled); + } + + strconcat(sizeof(buf), buf, path, ":text_color:d"); + if (xml_doc.NavigateToNode(buf, index)) + { + color = GetColor(xml_doc, buf, index, 0x00); + pWnd->SetStateTextColor(color, S_Disabled); + } + + strconcat(sizeof(buf), buf, path, ":text_color:t"); + if (xml_doc.NavigateToNode(buf, index)) + { + color = GetColor(xml_doc, buf, index, 0x00); + pWnd->SetStateTextColor(color, S_Touched); + } + + strconcat(sizeof(buf), buf, path, ":text_color:h"); + if (xml_doc.NavigateToNode(buf, index)) + { + color = GetColor(xml_doc, buf, index, 0x00); + pWnd->SetStateTextColor(color, S_Highlighted); + } + + InitOptionsItem(xml_doc, path, index, pWnd); + + return true; } bool CUIXmlInit::InitSpin(CUIXml& xml_doc, LPCSTR path, int index, CUICustomSpin* pWnd) { - return baseClass::InitSpin(xml_doc, path, index, pWnd); + InitWindow(xml_doc, path, index, pWnd); + InitOptionsItem(xml_doc, path, index, pWnd); + pWnd->InitSpin(pWnd->GetWndPos(), pWnd->GetWndSize()); + + string256 foo; + u32 color; + strconcat(sizeof(foo), foo, path, ":text_color:e"); + if (xml_doc.NavigateToNode(foo, index)) + { + color = GetColor(xml_doc, foo, index, 0x00); + pWnd->SetTextColor(color); + } + strconcat(sizeof(foo), foo, path, ":text_color:d"); + if (xml_doc.NavigateToNode(foo, index)) + { + color = GetColor(xml_doc, foo, index, 0x00); + pWnd->SetTextColorD(color); + } + + return true; } bool CUIXmlInit::InitText(CUIXml& xml_doc, LPCSTR path, int index, CUIStatic* pWnd) { - return baseClass::InitText(xml_doc, path, index, pWnd); + if (!xml_doc.NavigateToNode(path, index)) + return false; + + return InitText(xml_doc, path, index, pWnd->TextItemControl()); } bool CUIXmlInit::InitText(CUIXml& xml_doc, LPCSTR path, int index, CUILines* pLines) { - return baseClass::InitText(xml_doc, path, index, pLines); + if (!xml_doc.NavigateToNode(path, index)) + return false; + + u32 color; + CGameFont* pTmpFont = NULL; + InitFont(xml_doc, path, index, color, pTmpFont); + pLines->SetTextColor(color); + R_ASSERT(pTmpFont); + pLines->SetFont(pTmpFont); + + // Load font alignment + shared_str al = xml_doc.ReadAttrib(path, index, "align"); + if (0 == xr_strcmp(al, "c")) + pLines->SetTextAlignment(CGameFont::alCenter); + else if (0 == xr_strcmp(al, "r")) + pLines->SetTextAlignment(CGameFont::alRight); + else if (0 == xr_strcmp(al, "l")) + pLines->SetTextAlignment(CGameFont::alLeft); + + al = xml_doc.ReadAttrib(path, index, "vert_align", ""); + + if (0 == xr_strcmp(al, "c")) + pLines->SetVTextAlignment(valCenter); + else if (0 == xr_strcmp(al, "b")) + pLines->SetVTextAlignment(valBotton); + else if (0 == xr_strcmp(al, "t")) + pLines->SetVTextAlignment(valTop); + + pLines->SetTextComplexMode(xml_doc.ReadAttribInt(path, index, "complex_mode", 0) ? true : false); + + // Text coordinates + float text_x = xml_doc.ReadAttribFlt(path, index, "x", 0); + float text_y = xml_doc.ReadAttribFlt(path, index, "y", 0); + + pLines->m_TextOffset.set(text_x, text_y); + + shared_str text = xml_doc.Read(path, index, NULL); + if (text.size()) + pLines->SetText(CStringTable().translate(text).c_str()); + + return true; } +//////////////////////////////////////////////////////////////////////////////////////////// bool CUIXmlInit::Init3tButton(CUIXml& xml_doc, LPCSTR path, int index, CUI3tButton* pWnd) { - return baseClass::Init3tButton(xml_doc, path, index, pWnd); + R_ASSERT4(xml_doc.NavigateToNode(path, index), "XML node not found", path, xml_doc.m_xml_file_name); + + pWnd->m_frameline_mode = (xml_doc.ReadAttribInt(path, index, "frame_mode", 0) == 1) ? true : false; + + pWnd->vertical = (xml_doc.ReadAttribInt(path, index, "vertical", 0) == 1) ? true : false; + + InitWindow(xml_doc, path, index, pWnd); + pWnd->InitButton(pWnd->GetWndPos(), pWnd->GetWndSize()); + + string256 buf; + InitText(xml_doc, strconcat(sizeof(buf), buf, path, ":text"), index, pWnd); + u32 color; + + strconcat(sizeof(buf), buf, path, ":text_color:e"); + if (xml_doc.NavigateToNode(buf, index)) + { + color = GetColor(xml_doc, buf, index, 0x00); + pWnd->SetStateTextColor(color, S_Enabled); + } + + strconcat(sizeof(buf), buf, path, ":text_color:d"); + if (xml_doc.NavigateToNode(buf, index)) + { + color = GetColor(xml_doc, buf, index, 0x00); + pWnd->SetStateTextColor(color, S_Disabled); + } + + strconcat(sizeof(buf), buf, path, ":text_color:t"); + if (xml_doc.NavigateToNode(buf, index)) + { + color = GetColor(xml_doc, buf, index, 0x00); + pWnd->SetStateTextColor(color, S_Touched); + } + + strconcat(sizeof(buf), buf, path, ":text_color:h"); + if (xml_doc.NavigateToNode(buf, index)) + { + color = GetColor(xml_doc, buf, index, 0x00); + pWnd->SetStateTextColor(color, S_Highlighted); + } + + InitMultiTexture(xml_doc, path, index, pWnd); + InitTextureOffset(xml_doc, path, index, pWnd); + InitSound(xml_doc, path, index, pWnd); + + LPCSTR accel = xml_doc.ReadAttrib(path, index, "accel", NULL); + if (accel) + { + int acc = keyname_to_dik(accel); + pWnd->SetAccelerator(acc, 0); + } + accel = xml_doc.ReadAttrib(path, index, "accel_ext", NULL); + if (accel) + { + int acc = keyname_to_dik(accel); + pWnd->SetAccelerator(acc, 1); + } + + LPCSTR text_hint = xml_doc.ReadAttrib(path, index, "hint", NULL); + if (text_hint) + pWnd->m_hint_text = CStringTable().translate(text_hint); + + return true; } bool CUIXmlInit::InitTabButtonMP(CUIXml& xml_doc, LPCSTR path, int index, CUITabButtonMP* pWnd) @@ -113,7 +444,21 @@ bool CUIXmlInit::InitTabButtonMP(CUIXml& xml_doc, LPCSTR path, int index, CUITab bool CUIXmlInit::InitSound(CUIXml& xml_doc, LPCSTR path, int index, CUI3tButton* pWnd) { - return baseClass::InitSound(xml_doc, path, index, pWnd); + string256 sound_h; + string256 sound_t; + strconcat(sizeof(sound_h), sound_h, path, ":sound_h"); + strconcat(sizeof(sound_t), sound_t, path, ":sound_t"); + + shared_str sound_h_result = xml_doc.Read(sound_h, index, ""); + shared_str sound_t_result = xml_doc.Read(sound_t, index, ""); + + if (xr_strlen(sound_h_result) != 0) + pWnd->InitSoundH(*sound_h_result); + + if (xr_strlen(sound_t_result) != 0) + pWnd->InitSoundT(*sound_t_result); + + return true; } bool CUIXmlInit::InitDragDropListEx(CUIXml& xml_doc, LPCSTR path, int index, CUIDragDropListEx* pWnd) @@ -178,59 +523,442 @@ bool CUIXmlInit::InitDragDropListEx(CUIXml& xml_doc, LPCSTR path, int index, CUI bool CUIXmlInit::InitProgressBar(CUIXml& xml_doc, LPCSTR path, int index, CUIProgressBar* pWnd) { - return baseClass::InitProgressBar(xml_doc, path, index, pWnd); + R_ASSERT4(xml_doc.NavigateToNode(path, index), "XML node not found", path, xml_doc.m_xml_file_name); + + InitAutoStaticGroup(xml_doc, path, index, pWnd); + + string256 buf; + Fvector2 pos, size; + pos.x = xml_doc.ReadAttribFlt(path, index, "x"); + pos.y = xml_doc.ReadAttribFlt(path, index, "y"); + + InitAlignment(xml_doc, path, index, pos.x, pos.y, pWnd); + + size.x = xml_doc.ReadAttribFlt(path, index, "width"); + size.y = xml_doc.ReadAttribFlt(path, index, "height"); + + CUIProgressBar::EOrientMode mode = CUIProgressBar::om_vert; + int mode_horz = xml_doc.ReadAttribInt(path, index, "horz", 0); + LPCSTR mode_str = xml_doc.ReadAttrib(path, index, "mode"); + if (mode_horz == 1) // om_horz + { + mode = CUIProgressBar::om_horz; + } + else if (xr_stricmp(mode_str, "horz") == 0) + { + mode = CUIProgressBar::om_horz; + } + else if (xr_stricmp(mode_str, "vert") == 0) + { + mode = CUIProgressBar::om_vert; + } + else if (xr_stricmp(mode_str, "back") == 0) + { + mode = CUIProgressBar::om_back; + } + else if (xr_stricmp(mode_str, "down") == 0) + { + mode = CUIProgressBar::om_down; + } + else if (xr_stricmp(mode_str, "from_center") == 0) + { + mode = CUIProgressBar::om_fromcenter; + } + else if (xr_stricmp(mode_str, "vert_from_center") == 0) + { + mode = CUIProgressBar::om_vfromcenter; + } + else if (xr_stricmp(mode_str, "to_center") == 0) + { + mode = CUIProgressBar::om_tocenter; + } + else if (xr_stricmp(mode_str, "vert_to_center") == 0) + { + mode = CUIProgressBar::om_vtocenter; + } + + pWnd->InitProgressBar(pos, size, mode); + + float min = xml_doc.ReadAttribFlt(path, index, "min"); + float max = xml_doc.ReadAttribFlt(path, index, "max"); + float ppos = xml_doc.ReadAttribFlt(path, index, "pos"); + + pWnd->SetRange(min, max); + pWnd->SetProgressPos(ppos); + pWnd->m_inertion = xml_doc.ReadAttribFlt(path, index, "inertion", 0.0f); + pWnd->colorSmoothing = xml_doc.ReadAttribInt(path, index, "color_smoothing"); + + // progress + strconcat(sizeof(buf), buf, path, ":progress"); + + if (!xml_doc.NavigateToNode(buf, index)) + return false; + + InitStatic(xml_doc, buf, index, &pWnd->m_UIProgressItem); + + pWnd->m_UIProgressItem.SetWndSize(pWnd->GetWndSize()); + + // background + strconcat(sizeof(buf), buf, path, ":background"); + + if (xml_doc.NavigateToNode(buf, index)) + { + InitStatic(xml_doc, buf, index, &pWnd->m_UIBackgroundItem); + pWnd->m_bBackgroundPresent = true; + pWnd->m_UIBackgroundItem.SetWndSize(pWnd->GetWndSize()); + } + + strconcat(sizeof(buf), buf, path, ":min_color"); + + if (xml_doc.NavigateToNode(buf, index)) + { + pWnd->m_bUseColor = true; + + u32 color = GetColor(xml_doc, buf, index, 0xff); + pWnd->m_minColor.set(color); + + strconcat(sizeof(buf), buf, path, ":middle_color"); + + color = GetColor(xml_doc, buf, index, 0xff); + pWnd->m_middleColor.set(color); + + strconcat(sizeof(buf), buf, path, ":max_color"); + + color = GetColor(xml_doc, buf, index, 0xff); + pWnd->m_maxColor.set(color); + } + + return true; } bool CUIXmlInit::InitProgressShape(CUIXml& xml_doc, LPCSTR path, int index, CUIProgressShape* pWnd) { - return baseClass::InitProgressShape(xml_doc, path, index, pWnd); + R_ASSERT4(xml_doc.NavigateToNode(path, index), "XML node not found", path, xml_doc.m_xml_file_name); + + InitStatic(xml_doc, path, index, pWnd); + + if (xml_doc.ReadAttribInt(path, index, "text")) + pWnd->SetTextVisible(true); + + string256 _path; + + if (xml_doc.NavigateToNode(strconcat(sizeof(_path), _path, path, ":back"), index)) + { + R_ASSERT2(0, "unused node in progress shape "); + } + + if (xml_doc.NavigateToNode(strconcat(sizeof(_path), _path, path, ":front"), index)) + { + R_ASSERT2(0, "unused node in progress shape "); + } + // InitStatic(xml_doc, strconcat(sizeof(_path),_path, path, ":front"), index, pWnd->m_pTexture); + + pWnd->m_sectorCount = xml_doc.ReadAttribInt(path, index, "sector_count", 8); + pWnd->m_bClockwise = xml_doc.ReadAttribInt(path, index, "clockwise") ? true : false; + + pWnd->m_blend = (xml_doc.ReadAttribInt(path, index, "blend", 1) == 1) ? true : false; + pWnd->m_angle_begin = xml_doc.ReadAttribFlt(path, index, "begin_angle", 0.0f); + pWnd->m_angle_end = xml_doc.ReadAttribFlt(path, index, "end_angle", PI_MUL_2); + + return true; } void CUIXmlInit::InitAutoStaticGroup(CUIXml& xml_doc, LPCSTR path, int index, CUIWindow* pParentWnd) { - baseClass::InitAutoStaticGroup(xml_doc, path, index, pParentWnd); + XML_NODE _stored_root = xml_doc.GetLocalRoot(); + xml_doc.SetLocalRoot(xml_doc.NavigateToNode(path, index)); + + XML_NODE curr_root = xml_doc.GetLocalRoot(); + if (!curr_root) + curr_root = xml_doc.GetRoot(); + + XML_NODE node = curr_root.firstChild(); + int cnt_static = 0; + int cnt_frameline = 0; + int cnt_text = 0; + string512 buff; + + while (node) + { + LPCSTR node_name = node.value(); + if (0 == xr_stricmp(node_name, "auto_static")) + { + CUIStatic* pUIStatic = new CUIStatic(); + InitStatic(xml_doc, "auto_static", cnt_static, pUIStatic); + xr_sprintf(buff, "auto_static_%d", cnt_static); + pUIStatic->SetWindowName(buff); + pUIStatic->SetAutoDelete(true); + pParentWnd->AttachChild(pUIStatic); + + ++cnt_static; + } + else if (0 == xr_stricmp(node_name, "auto_frameline")) + { + CUIFrameLineWnd* pUIFrameline = new CUIFrameLineWnd(); + InitFrameLine(xml_doc, "auto_frameline", cnt_frameline, pUIFrameline); + xr_sprintf(buff, "auto_frameline_%d", cnt_frameline); + pUIFrameline->SetWindowName(buff); + pUIFrameline->SetAutoDelete(true); + pParentWnd->AttachChild(pUIFrameline); + + ++cnt_frameline; + } + else if (0 == xr_stricmp(node_name, "auto_text")) + { + ++cnt_text; + } + node = node.nextSibling(); + } + /* + CUIStatic* pUIStatic = NULL; + string64 sname; + for(int i=0; iSetWindowName (sname); + pUIStatic->SetAutoDelete (true); + pParentWnd->AttachChild (pUIStatic); + pUIStatic = NULL; + } + */ + xml_doc.SetLocalRoot(_stored_root); } void CUIXmlInit::InitAutoFrameLineGroup(CUIXml& xml_doc, LPCSTR path, int index, CUIWindow* pParentWnd) { - baseClass::InitAutoFrameLineGroup(xml_doc, path, index, pParentWnd); + int items_num = xml_doc.GetNodesNum(path, index, "auto_frameline"); + if (items_num == 0) + { + return; + } + XML_NODE _stored_root = xml_doc.GetLocalRoot(); + xml_doc.SetLocalRoot(xml_doc.NavigateToNode(path, index)); + + CUIFrameLineWnd* pUIFL = NULL; + string64 sname; + for (int i = 0; i < items_num; ++i) + { + pUIFL = new CUIFrameLineWnd(); + InitFrameLine(xml_doc, "auto_frameline", i, pUIFL); + xr_sprintf(sname, "auto_frameline_%d", i); + pUIFL->SetWindowName(sname); + pUIFL->SetAutoDelete(true); + pParentWnd->AttachChild(pUIFL); + pUIFL = NULL; + } + + xml_doc.SetLocalRoot(_stored_root); } bool CUIXmlInit::InitFont(CUIXml& xml_doc, LPCSTR path, int index, u32& color, CGameFont*& pFnt) { - return baseClass::InitFont(xml_doc, path, index, color, pFnt); + color = GetColor(xml_doc, path, index, 0xff); + + LPCSTR font_name = xml_doc.ReadAttrib(path, index, "font", NULL); + if (!font_name) + { + pFnt = NULL; + return false; + } + else + { + if (!xr_strcmp(font_name, GRAFFITI19_FONT_NAME)) + { + pFnt = UI().Font().pFontGraffiti19Russian; + } + else if (!xr_strcmp(font_name, GRAFFITI22_FONT_NAME)) + { + pFnt = UI().Font().pFontGraffiti22Russian; + } + else if (!xr_strcmp(font_name, GRAFFITI32_FONT_NAME)) + { + pFnt = UI().Font().pFontGraffiti32Russian; + } + else if (!xr_strcmp(font_name, GRAFFITI50_FONT_NAME)) + { + pFnt = UI().Font().pFontGraffiti50Russian; + } + else if (!xr_strcmp(font_name, "arial_14")) + { + pFnt = UI().Font().pFontArial14; + } + else if (!xr_strcmp(font_name, MEDIUM_FONT_NAME)) + { + pFnt = UI().Font().pFontMedium; + } + else if (!xr_strcmp(font_name, SMALL_FONT_NAME)) + { + pFnt = UI().Font().pFontStat; + } + else if (!xr_strcmp(font_name, LETTERICA16_FONT_NAME)) + { + pFnt = UI().Font().pFontLetterica16Russian; + } + else if (!xr_strcmp(font_name, LETTERICA18_FONT_NAME)) + { + pFnt = UI().Font().pFontLetterica18Russian; + } + else if (!xr_strcmp(font_name, LETTERICA25_FONT_NAME)) + { + pFnt = UI().Font().pFontLetterica25; + } + else if (!xr_strcmp(font_name, DI_FONT_NAME)) + { + pFnt = UI().Font().pFontDI; + } + else + { + R_ASSERT3(0, "unknown font", font_name); + pFnt = NULL; + } + } + return true; } bool CUIXmlInit::InitTabControl(CUIXml& xml_doc, LPCSTR path, int index, CUITabControl* pWnd) { - return baseClass::InitTabControl(xml_doc, path, index, pWnd); + R_ASSERT4(xml_doc.NavigateToNode(path, index), "XML node not found", path, xml_doc.m_xml_file_name); + + bool status = true; + + status &= InitWindow(xml_doc, path, index, pWnd); + InitOptionsItem(xml_doc, path, index, pWnd); + int tabsCount = xml_doc.GetNodesNum(path, index, "button"); + int radio = xml_doc.ReadAttribInt(path, index, "radio"); + + XML_NODE tab_node = xml_doc.NavigateToNode(path, index); + xml_doc.SetLocalRoot(tab_node); + + CUITabButton* newButton; + + for (int i = 0; i < tabsCount; ++i) + { + newButton = radio ? new CUIRadioButton() : new CUITabButton(); + status &= Init3tButton(xml_doc, "button", i, newButton); + newButton->m_btn_id = xml_doc.ReadAttrib("button", i, "id"); + R_ASSERT3(newButton->m_btn_id.size(), xml_doc.m_xml_file_name, path); + pWnd->AddItem(newButton); + } + + xml_doc.SetLocalRoot(xml_doc.GetRoot()); + + return status; } ////////////////////////////////////////////////////////////////////////// bool CUIXmlInit::InitFrameLine(CUIXml& xml_doc, LPCSTR path, int index, CUIFrameLineWnd* pWnd) { - return baseClass::InitFrameLine(xml_doc, path, index, pWnd); + R_ASSERT3(xml_doc.NavigateToNode(path, index), "XML node not found", path); + + string256 buf; + + bool stretch_flag = xml_doc.ReadAttribInt(path, index, "stretch") ? true : false; + R_ASSERT(stretch_flag == false); + //. pWnd->SetStretchTexture( stretch_flag ); + + Fvector2 pos, size; + pos.x = xml_doc.ReadAttribFlt(path, index, "x"); + pos.y = xml_doc.ReadAttribFlt(path, index, "y"); + + InitAlignment(xml_doc, path, index, pos.x, pos.y, pWnd); + + size.x = xml_doc.ReadAttribFlt(path, index, "width"); + size.y = xml_doc.ReadAttribFlt(path, index, "height"); + bool vertical = !!xml_doc.ReadAttribInt(path, index, "vertical"); + + strconcat(sizeof(buf), buf, path, ":texture"); + shared_str base_name = xml_doc.Read(buf, index, NULL); + + VERIFY(base_name); + + u32 color = GetColor(xml_doc, buf, index, 0xff); + pWnd->SetTextureColor(color); + + InitWindow(xml_doc, path, index, pWnd); + pWnd->InitFrameLineWnd(*base_name, pos, size, !vertical); + return true; } bool CUIXmlInit::InitCustomEdit(CUIXml& xml_doc, LPCSTR path, int index, CUICustomEdit* pWnd) { - return baseClass::InitCustomEdit(xml_doc, path, index, pWnd); + InitStatic(xml_doc, path, index, pWnd); + pWnd->InitCustomEdit(pWnd->GetWndPos(), pWnd->GetWndSize()); + + string256 foo; + u32 color; + strconcat(sizeof(foo), foo, path, ":text_color:e"); + if (xml_doc.NavigateToNode(foo, index)) + { + color = GetColor(xml_doc, foo, index, 0x00); + pWnd->TextItemControl()->SetTextColor(color); + } + + int max_count = xml_doc.ReadAttribInt(path, index, "max_symb_count", 0); + bool num_only = (xml_doc.ReadAttribInt(path, index, "num_only", 0) == 1); + bool read_only = (xml_doc.ReadAttribInt(path, index, "read_only", 0) == 1); + bool file_name_mode = (xml_doc.ReadAttribInt(path, index, "file_name_mode", 0) == 1); + + if (file_name_mode || read_only || num_only || 0 < max_count) + { + if (max_count <= 0) + { + max_count = 32; + } + pWnd->Init(max_count, num_only, read_only, file_name_mode); + } + + if (xml_doc.ReadAttribInt(path, index, "password", 0)) + { + pWnd->SetPasswordMode(); + } + return true; } bool CUIXmlInit::InitEditBox(CUIXml& xml_doc, LPCSTR path, int index, CUIEditBox* pWnd) { - return baseClass::InitEditBox(xml_doc, path, index, pWnd); + InitCustomEdit(xml_doc, path, index, pWnd); + + InitTexture(xml_doc, path, index, pWnd); + InitOptionsItem(xml_doc, path, index, pWnd); + + return true; } ////////////////////////////////////////////////////////////////////////// -bool CUIXmlInit::InitAnimatedStatic(CUIXml& xml_doc, LPCSTR path, int index, CUIAnimatedStatic* pWnd) +bool CUIXmlInit::InitAnimatedStatic(CUIXml& xml_doc, const char* path, int index, CUIAnimatedStatic* pWnd) { - return baseClass::InitAnimatedStatic(xml_doc, path, index, pWnd); + R_ASSERT4(xml_doc.NavigateToNode(path, index), "XML node not found", path, xml_doc.m_xml_file_name); + + InitStatic(xml_doc, path, index, pWnd); + + float x = xml_doc.ReadAttribFlt(path, index, "x_offset", 0); + float y = xml_doc.ReadAttribFlt(path, index, "y_offset", 0); + u32 framesCount = static_cast(xml_doc.ReadAttribInt(path, index, "frames", 0)); + u32 animDuration = static_cast(xml_doc.ReadAttribInt(path, index, "duration", 0)); + u32 animCols = static_cast(xml_doc.ReadAttribInt(path, index, "columns", 0)); + float frameWidth = xml_doc.ReadAttribFlt(path, index, "frame_width", 0); + float frameHeight = xml_doc.ReadAttribFlt(path, index, "frame_height", 0); + bool cyclic = !!xml_doc.ReadAttribInt(path, index, "cyclic", 0); + bool play = !!xml_doc.ReadAttribInt(path, index, "autoplay", 0); + + pWnd->SetFrameDimentions(frameWidth, frameHeight); + pWnd->SetFramesCount(framesCount); + pWnd->m_bCyclic = cyclic; + pWnd->SetAnimCols(animCols); + pWnd->SetAnimationDuration(animDuration); + pWnd->SetOffset(x, y); + pWnd->SetAnimPos(0.0f); + if (play) + pWnd->Play(); + + return true; } -bool CUIXmlInit::InitSleepStatic(CUIXml& xml_doc, LPCSTR path, int index, CUISleepStatic* pWnd) +bool CUIXmlInit::InitSleepStatic(CUIXml& xml_doc, const char* path, int index, CUISleepStatic* pWnd) { R_ASSERT4(xml_doc.NavigateToNode(path, index), "XML node not found", path, xml_doc.m_xml_file_name); @@ -241,54 +969,355 @@ bool CUIXmlInit::InitSleepStatic(CUIXml& xml_doc, LPCSTR path, int index, CUISle bool CUIXmlInit::InitTexture(CUIXml& xml_doc, LPCSTR path, int index, ITextureOwner* pWnd) { - return baseClass::InitTexture(xml_doc, path, index, pWnd); + string256 buf; + LPCSTR texture = NULL; + LPCSTR shader = NULL; + strconcat(sizeof(buf), buf, path, ":texture"); + if (xml_doc.NavigateToNode(buf)) + { + texture = xml_doc.Read(buf, index, NULL); + shader = xml_doc.ReadAttrib(buf, index, "shader", NULL); + } + if (texture) + { + if (shader) + pWnd->InitTextureEx(texture, shader); + else + pWnd->InitTexture(texture); + } + //-------------------- + Frect rect; + rect.x1 = xml_doc.ReadAttribFlt(buf, index, "x", 0); + rect.y1 = xml_doc.ReadAttribFlt(buf, index, "y", 0); + rect.x2 = rect.x1 + xml_doc.ReadAttribFlt(buf, index, "width", 0); + rect.y2 = rect.y1 + xml_doc.ReadAttribFlt(buf, index, "height", 0); + + bool stretch_flag = xml_doc.ReadAttribInt(path, index, "stretch") ? true : false; + pWnd->SetStretchTexture(stretch_flag); + + u32 color = GetColor(xml_doc, buf, index, 0xff); + pWnd->SetTextureColor(color); + + if (rect.width() != 0 && rect.height() != 0) + pWnd->SetTextureRect(rect); + + return true; } bool CUIXmlInit::InitTextureOffset(CUIXml& xml_doc, LPCSTR path, int index, CUIStatic* pWnd) { - return baseClass::InitTextureOffset(xml_doc, path, index, pWnd); + string256 textureOffset; + if (0 == xr_strcmp(path, "")) + xr_strcpy(textureOffset, "texture_offset"); + else + strconcat(sizeof(textureOffset), textureOffset, path, ":texture_offset"); + + float x = xml_doc.ReadAttribFlt(textureOffset, index, "x"); + float y = xml_doc.ReadAttribFlt(textureOffset, index, "y"); + + pWnd->SetTextureOffset(x, y); + + return true; } bool CUIXmlInit::InitMultiTexture(CUIXml& xml_doc, LPCSTR path, int index, CUI3tButton* pWnd) { - return baseClass::InitMultiTexture(xml_doc, path, index, pWnd); + string256 buff; + bool success = false; + + strconcat(sizeof(buff), buff, path, ":texture"); + shared_str texture = xml_doc.Read(buff, index, NULL); + + if (texture.size() > 0) + { + pWnd->InitTexture(*texture); + return true; + } + + strconcat(sizeof(buff), buff, path, ":texture_e"); + texture = xml_doc.Read(buff, index, NULL); + if (texture.size()) + { + if (pWnd->m_background) + { + pWnd->m_background->InitState(S_Enabled, texture.c_str()); + } + else if (pWnd->m_back_frameline) + { + pWnd->m_back_frameline->InitState(S_Enabled, texture.c_str()); + pWnd->m_back_frameline->Get(S_Enabled)->SetHorizontal(!(pWnd->vertical)); + } + success = true; + } + + strconcat(sizeof(buff), buff, path, ":texture_t"); + texture = xml_doc.Read(buff, index, NULL); + if (texture.size()) + { + if (pWnd->m_background) + { + pWnd->m_background->InitState(S_Touched, texture.c_str()); + } + else if (pWnd->m_back_frameline) + { + pWnd->m_back_frameline->InitState(S_Touched, texture.c_str()); + pWnd->m_back_frameline->Get(S_Touched)->SetHorizontal(!(pWnd->vertical)); + } + success = true; + } + + strconcat(sizeof(buff), buff, path, ":texture_d"); + texture = xml_doc.Read(buff, index, NULL); + if (texture.size()) + { + if (pWnd->m_background) + { + pWnd->m_background->InitState(S_Disabled, texture.c_str()); + } + else if (pWnd->m_back_frameline) + { + pWnd->m_back_frameline->InitState(S_Disabled, texture.c_str()); + pWnd->m_back_frameline->Get(S_Disabled)->SetHorizontal(!(pWnd->vertical)); + } + success = true; + } + + strconcat(sizeof(buff), buff, path, ":texture_h"); + texture = xml_doc.Read(buff, index, NULL); + if (texture.size()) + { + if (pWnd->m_background) + { + pWnd->m_background->InitState(S_Highlighted, texture.c_str()); + } + else if (pWnd->m_back_frameline) + { + pWnd->m_back_frameline->InitState(S_Highlighted, texture.c_str()); + pWnd->m_back_frameline->Get(S_Highlighted)->SetHorizontal(!(pWnd->vertical)); + } + success = true; + } + + if (success) + pWnd->TextureOn(); + + return success; +} + +float CUIXmlInit::ApplyAlignX(float coord, u32 align) { return coord; } +////////////////////////////////////////////////////////////////////////// + +float CUIXmlInit::ApplyAlignY(float coord, u32 align) { return coord; } +////////////////////////////////////////////////////////////////////////// + +void CUIXmlInit::ApplyAlign(float& x, float& y, u32 align) +{ + x = ApplyAlignX(x, align); + y = ApplyAlignY(y, align); } ////////////////////////////////////////////////////////////////////////// bool CUIXmlInit::InitAlignment(CUIXml& xml_doc, const char* path, int index, float& x, float& y, CUIWindow* pWnd) { - return baseClass::InitAlignment(xml_doc, path, index, x, y, pWnd); + xr_string wnd_alignment = xml_doc.ReadAttrib(path, index, "alignment", ""); + + if (strchr(wnd_alignment.c_str(), 'c')) + pWnd->SetAlignment(waCenter); + + // Alignment: right: "r", bottom: "b". Top, left - useless + shared_str alignStr = xml_doc.ReadAttrib(path, index, "align", ""); + + bool result = false; + + if (strchr(*alignStr, 'r')) + { + x = ApplyAlignX(x, alRight); + result = true; + } + if (strchr(*alignStr, 'b')) + { + y = ApplyAlignY(y, alBottom); + result = true; + } + if (strchr(*alignStr, 'c')) + { + ApplyAlign(x, y, alCenter); + result = true; + } + + return result; } ////////////////////////////////////////////////////////////////////////// -void CUIXmlInit::InitColorDefs() { baseClass::InitColorDefs(); } +void CUIXmlInit::InitColorDefs() +{ + if (NULL != m_pColorDefs) + return; + + m_pColorDefs = new ColorDefs(); + + CUIXml uiXml; + uiXml.Load(CONFIG_PATH, UI_PATH, COLOR_DEFINITIONS); + + int num = uiXml.GetNodesNum("colors", 0, "color"); + + shared_str name; + int r, b, g, a; + + for (int i = 0; i < num; ++i) + { + name = uiXml.ReadAttrib("color", i, "name", ""); + r = uiXml.ReadAttribInt("color", i, "r", 0); + g = uiXml.ReadAttribInt("color", i, "g", 0); + b = uiXml.ReadAttribInt("color", i, "b", 0); + a = uiXml.ReadAttribInt("color", i, "a", 255); + + (*m_pColorDefs)[name] = color_argb(a, r, g, b); + } +} bool CUIXmlInit::InitScrollView(CUIXml& xml_doc, LPCSTR path, int index, CUIScrollView* pWnd) { - return baseClass::InitScrollView(xml_doc, path, index, pWnd); + R_ASSERT4(xml_doc.NavigateToNode(path, index), "XML node not found", path, xml_doc.m_xml_file_name); + + InitWindow(xml_doc, path, index, pWnd); + pWnd->SetRightIndention(xml_doc.ReadAttribFlt(path, index, "right_ident", 0.0f)); + pWnd->SetLeftIndention(xml_doc.ReadAttribFlt(path, index, "left_ident", 0.0f)); + pWnd->SetUpIndention(xml_doc.ReadAttribFlt(path, index, "top_indent", 0.0f)); + pWnd->SetDownIndention(xml_doc.ReadAttribFlt(path, index, "bottom_indent", 0.0f)); + + float vi = xml_doc.ReadAttribFlt(path, index, "vert_interval", 0.0f); + pWnd->m_vertInterval = (vi); + + bool bInverseDir = (1 == xml_doc.ReadAttribInt(path, index, "inverse_dir", 0)); + pWnd->m_flags.set(CUIScrollView::eInverseDir, bInverseDir); + + pWnd->SetScrollBarProfile(xml_doc.ReadAttrib(path, index, "scroll_profile", "default")); + + pWnd->InitScrollView(); + + bool bVertFlip = (1 == xml_doc.ReadAttribInt(path, index, "flip_vert", 0)); + pWnd->SetVertFlip(bVertFlip); + + bool b = (1 == xml_doc.ReadAttribInt(path, index, "always_show_scroll", 1)); + + pWnd->SetFixedScrollBar(b); + + b = (1 == xml_doc.ReadAttribInt(path, index, "can_select", 0)); + + pWnd->m_flags.set(CUIScrollView::eItemsSelectabe, b); + + ///////////////////////////////////////////////////////////////////// + int tabsCount = xml_doc.GetNodesNum(path, index, "text"); + + XML_NODE _stored_root = xml_doc.GetLocalRoot(); + xml_doc.SetLocalRoot(xml_doc.NavigateToNode(path, index)); + + for (int i = 0; i < tabsCount; ++i) + { + CUITextWnd* newText = new CUITextWnd(); + InitText(xml_doc, "text", i, &newText->TextItemControl()); + newText->SetTextComplexMode(true); + newText->SetWidth(pWnd->GetDesiredChildWidth()); + newText->AdjustHeightToText(); + pWnd->AddWindow(newText, true); + } + xml_doc.SetLocalRoot(_stored_root); + return true; } bool CUIXmlInit::InitListBox(CUIXml& xml_doc, LPCSTR path, int index, CUIListBox* pWnd) { - return baseClass::InitListBox(xml_doc, path, index, pWnd); + InitScrollView(xml_doc, path, index, pWnd); + + string512 _path; + u32 t_color; + CGameFont* pFnt; + strconcat(sizeof(_path), _path, path, ":font"); + InitFont(xml_doc, _path, index, t_color, pFnt); + + pWnd->SetTextColor(t_color); + pWnd->SetFont(pFnt); + + float h = xml_doc.ReadAttribFlt(path, index, "item_height", 20.0f); + pWnd->SetItemHeight(h); + return true; } bool CUIXmlInit::InitTrackBar(CUIXml& xml_doc, LPCSTR path, int index, CUITrackBar* pWnd) { - return baseClass::InitTrackBar(xml_doc, path, index, pWnd); + InitWindow(xml_doc, path, 0, pWnd); + pWnd->InitTrackBar(pWnd->GetWndPos(), pWnd->GetWndSize()); + int is_integer = xml_doc.ReadAttribInt(path, index, "is_integer", 0); + pWnd->SetType(!is_integer); + InitOptionsItem(xml_doc, path, 0, pWnd); + + int invert = xml_doc.ReadAttribInt(path, index, "invert", 0); + pWnd->SetInvert(!!invert); + float step = xml_doc.ReadAttribFlt(path, index, "step", 0.1f); + pWnd->SetStep(step); + + return true; } bool CUIXmlInit::InitComboBox(CUIXml& xml_doc, LPCSTR path, int index, CUIComboBox* pWnd) { - return baseClass::InitComboBox(xml_doc, path, index, pWnd); + u32 color; + CGameFont* pFont; + + pWnd->SetListLength(xml_doc.ReadAttribInt(path, index, "list_length", 4)); + + InitWindow(xml_doc, path, index, pWnd); + pWnd->InitComboBox(pWnd->GetWndPos(), pWnd->GetWidth()); + InitOptionsItem(xml_doc, path, index, pWnd); + + bool b = (1 == xml_doc.ReadAttribInt(path, index, "always_show_scroll", 1)); + + pWnd->m_list_box.SetFixedScrollBar(b); + + string512 _path; + strconcat(sizeof(_path), _path, path, ":list_font"); + InitFont(xml_doc, _path, index, color, pFont); + //. pWnd->SetFont (pFont); + pWnd->m_list_box.SetFont(pFont); + pWnd->m_list_box.SetTextColor(color); + + strconcat(sizeof(_path), _path, path, ":text_color:e"); + if (xml_doc.NavigateToNode(_path, index)) + { + color = GetColor(xml_doc, _path, index, 0x00); + pWnd->SetTextColor(color); + } + + strconcat(sizeof(_path), _path, path, ":text_color:d"); + if (xml_doc.NavigateToNode(_path, index)) + { + color = GetColor(xml_doc, _path, index, 0x00); + pWnd->SetTextColorD(color); + } + + return true; } -void CUIXmlInit::AssignColor(LPCSTR name, u32 clr) { baseClass::AssignColor(name, clr); } +void CUIXmlInit::AssignColor(LPCSTR name, u32 clr) { (*m_pColorDefs)[name] = clr; } u32 CUIXmlInit::GetColor(CUIXml& xml_doc, LPCSTR path, int index, u32 def_clr) { - return baseClass::GetColor(xml_doc, path, index, def_clr); + LPCSTR clr_def = xml_doc.ReadAttrib(path, index, "color", NULL); + if (clr_def) + { + VERIFY(GetColorDefs()->find(clr_def) != GetColorDefs()->end()); + return (*m_pColorDefs)[clr_def]; + } + else + { + int r = xml_doc.ReadAttribInt(path, index, "r", def_clr); + int g = xml_doc.ReadAttribInt(path, index, "g", def_clr); + int b = xml_doc.ReadAttribInt(path, index, "b", def_clr); + int a = xml_doc.ReadAttribInt(path, index, "a", 0xff); + return color_argb(a, r, g, b); + } } bool CUIXmlInit::InitHintWindow(CUIXml& xml_doc, LPCSTR path, int index, UIHintWindow* pWnd) diff --git a/src/xrGame/ui/UIXmlInit.h b/src/xrGame/ui/UIXmlInit.h index 97179015ebe..85994cb7c4f 100644 --- a/src/xrGame/ui/UIXmlInit.h +++ b/src/xrGame/ui/UIXmlInit.h @@ -1,13 +1,43 @@ #pragma once -#include "xrUICore/XML/UIXmlInitBase.h" +#include "xrUIXmlParser.h" +#include "xrCore/_rect.h" +#include "xrCommon/xr_map.h" + +class ITextureOwner; +class CUIWindow; +class CUIFrameWindow; +class CUIStaticItem; +class CUIStatic; +class CUICheckButton; +class CUICustomSpin; +class CUIButton; +class CUI3tButton; class CUIDragDropList; +class CUIProgressBar; +class CUIProgressShape; +class CUITabControl; +class CUIFrameLineWnd; +class CUIEditBoxEx; +class CUIEditBox; +class CUICustomEdit; +class CUIAnimatedStatic; class CUISleepStatic; +class CUIOptionsItem; +class CUIScrollView; +class CUIListBox; +class CUIStatsPlayerList; +class CUIDragDropListEx; +class CUIComboBox; class CUITabButtonMP; +class CUITrackBar; +class UIHintWindow; +class CUILines; +class CUITextWnd; +class CGameFont; -class CUIXmlInit : public CUIXmlInitBase +class CUIXmlInit { - using baseClass = CUIXmlInitBase; public: CUIXmlInit(); virtual ~CUIXmlInit(); @@ -50,15 +80,23 @@ class CUIXmlInit : public CUIXmlInitBase static void InitAutoStaticGroup(CUIXml& xml_doc, LPCSTR path, int index, CUIWindow* pParentWnd); static void InitAutoFrameLineGroup(CUIXml& xml_doc, LPCSTR path, int index, CUIWindow* pParentWnd); + static float ApplyAlignX(float coord, u32 align); + static float ApplyAlignY(float coord, u32 align); + static void ApplyAlign(float& x, float& y, u32 align); + // Initialize and store predefined colors - using ColorDefs = baseClass::ColorDefs; + using ColorDefs = xr_map; static const ColorDefs* GetColorDefs() { - baseClass::GetColorDefs(); + R_ASSERT(m_pColorDefs); + return m_pColorDefs; } static void InitColorDefs(); - static void DeleteColorDefs() { baseClass::DeleteColorDefs(); } + static void DeleteColorDefs() { xr_delete(m_pColorDefs); } static void AssignColor(LPCSTR name, u32 clr); + +private: + static ColorDefs* m_pColorDefs; }; diff --git a/src/xrUICore/InteractiveBackground/UI_IB_Static.cpp b/src/xrGame/ui/UI_IB_Static.cpp similarity index 96% rename from src/xrUICore/InteractiveBackground/UI_IB_Static.cpp rename to src/xrGame/ui/UI_IB_Static.cpp index 9a18f42a7a1..247505536e0 100644 --- a/src/xrUICore/InteractiveBackground/UI_IB_Static.cpp +++ b/src/xrGame/ui/UI_IB_Static.cpp @@ -7,7 +7,7 @@ // Copyright 2005 GSC Game World -#include "pch.hpp" +#include "StdAfx.h" #include "UI_IB_Static.h" void CUI_IB_Static::SetTextureOffset(float x, float y) diff --git a/src/xrUICore/InteractiveBackground/UI_IB_Static.h b/src/xrGame/ui/UI_IB_Static.h similarity index 80% rename from src/xrUICore/InteractiveBackground/UI_IB_Static.h rename to src/xrGame/ui/UI_IB_Static.h index e15558d2521..440df94a6c0 100644 --- a/src/xrUICore/InteractiveBackground/UI_IB_Static.h +++ b/src/xrGame/ui/UI_IB_Static.h @@ -8,8 +8,9 @@ // Copyright 2005 GSC Game World #pragma once -#include "xrUICore/InteractiveBackground/UIInteractiveBackground.h" -#include "xrUICore/Static/UIStatic.h" + +#include "UIInteractiveBackground.h" +#include "UIStatic.h" class CUI_IB_Static : public CUIInteractiveBackground { diff --git a/src/xrGame/ui/map_hint.cpp b/src/xrGame/ui/map_hint.cpp index b4b1a7d65c8..5c45053205f 100644 --- a/src/xrGame/ui/map_hint.cpp +++ b/src/xrGame/ui/map_hint.cpp @@ -1,6 +1,6 @@ #include "stdafx.h" #include "map_hint.h" -#include "xrUICore/Static/UIStatic.h" +#include "UIStatic.h" #include "UIXmlInit.h" #include "map_location.h" #include "map_spot.h" @@ -119,7 +119,7 @@ void CUIMapLocationHint::SetInfoTask(CGameTask* task) string512 buff, buff2; InventoryUtilities::GetTimePeriodAsString(buff, sizeof(buff), Level().GetGameTime(), task->m_TimeToComplete); - strconcat(sizeof(buff2), buff2, StringTable().translate("ui_st_time_remains").c_str(), " ", buff); + strconcat(sizeof(buff2), buff2, CStringTable().translate("ui_st_time_remains").c_str(), " ", buff); S->TextItemControl()->SetText(buff2); } pos = S->GetWndPos(); diff --git a/src/xrGame/ui/map_hint.h b/src/xrGame/ui/map_hint.h index 93b7894a22a..0f7b5323cd6 100644 --- a/src/xrGame/ui/map_hint.h +++ b/src/xrGame/ui/map_hint.h @@ -1,5 +1,5 @@ #pragma once -#include "xrUICore/Windows/UIFrameWindow.h" +#include "UIFrameWindow.h" #include "xrCore/Containers/AssociativeVector.hpp" class CUIStatic; diff --git a/src/xrGame/ui/ui_af_params.cpp b/src/xrGame/ui/ui_af_params.cpp index 418841942ef..6bcd6f9ae61 100644 --- a/src/xrGame/ui/ui_af_params.cpp +++ b/src/xrGame/ui/ui_af_params.cpp @@ -1,6 +1,6 @@ #include "stdafx.h" #include "ui_af_params.h" -#include "xrUICore/Static/UIStatic.h" +#include "UIStatic.h" #include "Actor.h" #include "ActorCondition.h" #include "Common/object_broker.h" @@ -112,7 +112,7 @@ void CUIArtefactParams::InitFromXml(CUIXml& xml) m_immunity_item[i]->Init(xml, af_immunity_section_names[i]); m_immunity_item[i]->SetAutoDelete(false); - LPCSTR name = StringTable().translate(af_immunity_caption[i]).c_str(); + LPCSTR name = CStringTable().translate(af_immunity_caption[i]).c_str(); m_immunity_item[i]->SetCaption(name); xml.SetLocalRoot(base_node); @@ -124,7 +124,7 @@ void CUIArtefactParams::InitFromXml(CUIXml& xml) m_restore_item[i]->Init(xml, af_restore_section_names[i]); m_restore_item[i]->SetAutoDelete(false); - LPCSTR name = StringTable().translate(af_restore_caption[i]).c_str(); + LPCSTR name = CStringTable().translate(af_restore_caption[i]).c_str(); m_restore_item[i]->SetCaption(name); xml.SetLocalRoot(base_node); @@ -135,7 +135,7 @@ void CUIArtefactParams::InitFromXml(CUIXml& xml) m_additional_weight->Init(xml, "additional_weight"); m_additional_weight->SetAutoDelete(false); - LPCSTR name = StringTable().translate("ui_inv_weight").c_str(); + LPCSTR name = CStringTable().translate("ui_inv_weight").c_str(); m_additional_weight->SetCaption(name); // xml.SetLocalRoot( base_node ); @@ -245,7 +245,7 @@ void UIArtefactParamItem::Init(CUIXml& xml, LPCSTR section) m_sign_inverse = (xml.ReadAttribInt("value", 0, "sign_inverse", 0) == 1); LPCSTR unit_str = xml.ReadAttrib("value", 0, "unit_str", ""); - m_unit_str._set(StringTable().translate(unit_str)); + m_unit_str._set(CStringTable().translate(unit_str)); LPCSTR texture_minus = xml.Read("texture_minus", 0, ""); if (texture_minus && xr_strlen(texture_minus)) diff --git a/src/xrGame/ui/ui_af_params.h b/src/xrGame/ui/ui_af_params.h index a5e7c89e30e..15aa3a6c2d7 100644 --- a/src/xrGame/ui/ui_af_params.h +++ b/src/xrGame/ui/ui_af_params.h @@ -1,5 +1,5 @@ #pragma once -#include "xrUICore/Windows/UIWindow.h" +#include "UIWindow.h" #include "xrServerEntities/alife_space.h" class CUIXml; diff --git a/src/xrUICore/arrow/ui_arrow.cpp b/src/xrGame/ui/ui_arrow.cpp similarity index 89% rename from src/xrUICore/arrow/ui_arrow.cpp rename to src/xrGame/ui/ui_arrow.cpp index c41aafa7927..602cdf5624d 100644 --- a/src/xrUICore/arrow/ui_arrow.cpp +++ b/src/xrGame/ui/ui_arrow.cpp @@ -1,6 +1,8 @@ -#include "pch.hpp" + +#include "stdafx.h" + #include "ui_arrow.h" -#include "XML/UIXmlInitBase.h" +#include "UIXmlInit.h" UI_Arrow::UI_Arrow() { @@ -15,9 +17,10 @@ UI_Arrow::UI_Arrow() UI_Arrow::~UI_Arrow() {} void UI_Arrow::init_from_xml(CUIXml& xml, LPCSTR path, CUIWindow* parent) { + // m_arrow = UIHelper::CreateStatic( xml, "arrow", this ); parent->AttachChild(this); SetAutoDelete(true); - CUIXmlInitBase::InitStatic(xml, path, 0, this); + CUIXmlInit::InitStatic(xml, path, 0, this); m_angle_begin = xml.ReadAttribFlt(path, 0, "begin_angle", 0.0f); m_angle_end = xml.ReadAttribFlt(path, 0, "end_angle", PI_MUL_2); diff --git a/src/xrUICore/arrow/ui_arrow.h b/src/xrGame/ui/ui_arrow.h similarity index 75% rename from src/xrUICore/arrow/ui_arrow.h rename to src/xrGame/ui/ui_arrow.h index 1844205eda9..7420ebbb2e4 100644 --- a/src/xrUICore/arrow/ui_arrow.h +++ b/src/xrGame/ui/ui_arrow.h @@ -1,7 +1,9 @@ -#pragma once -#include "xrUICore/Static/UIStatic.h" +#ifndef UI_ARROW_H_INCLUDED +#define UI_ARROW_H_INCLUDED -class XRUICORE_API UI_Arrow : public CUIStatic +#include "UIStatic.h" + +class UI_Arrow : public CUIStatic { private: typedef CUIStatic inherited; @@ -24,3 +26,5 @@ class XRUICORE_API UI_Arrow : public CUIStatic float m_pos; }; // class UI_Arrow + +#endif // UI_ARROW_H_INCLUDED diff --git a/src/xrUICore/uiabstract.h b/src/xrGame/ui/uiabstract.h similarity index 99% rename from src/xrUICore/uiabstract.h rename to src/xrGame/ui/uiabstract.h index ebfb7478655..184f9888578 100644 --- a/src/xrUICore/uiabstract.h +++ b/src/xrGame/ui/uiabstract.h @@ -3,6 +3,7 @@ #pragma warning(disable : 4511) #pragma warning(disable : 4512) +#include "ui_base.h" #include "Common/Noncopyable.hpp" #include "xrEngine/GameFont.h" diff --git a/src/xrUICore/Lines/uilinestd.h b/src/xrGame/ui/uilinestd.h similarity index 79% rename from src/xrUICore/Lines/uilinestd.h rename to src/xrGame/ui/uilinestd.h index 64daceec134..d5ee7fa2faa 100644 --- a/src/xrUICore/Lines/uilinestd.h +++ b/src/xrGame/ui/uilinestd.h @@ -2,5 +2,6 @@ typedef xr_string::size_type StrSize; #define BEGIN "%c[" #define END "]" +//#define xr_string::npos npos const StrSize npos = (StrSize)xr_string::npos; diff --git a/src/xrGame/ui/uiscriptwnd_script2.cpp b/src/xrGame/ui/uiscriptwnd_script2.cpp index 9a1a528aed8..3b48e805aeb 100644 --- a/src/xrGame/ui/uiscriptwnd_script2.cpp +++ b/src/xrGame/ui/uiscriptwnd_script2.cpp @@ -3,17 +3,17 @@ // UI-controls #include "UIScriptWnd.h" -#include "xrUICore/Buttons/UIButton.h" -#include "xrUICore/MessageBox/UIMessageBox.h" -#include "xrUICore/PropertiesBox/UIPropertiesBox.h" -#include "xrUICore/Buttons/UICheckButton.h" -#include "xrUICore/Buttons/UIRadioButton.h" -#include "xrUICore/Static/UIStatic.h" -#include "xrUICore/EditBox/UIEditBox.h" -#include "xrUICore/Windows/UIFrameWindow.h" -#include "xrUICore/Windows/UIFrameLineWnd.h" -#include "xrUICore/ProgressBar/UIProgressBar.h" -#include "xrUICore/TabControl/UITabControl.h" +#include "UIButton.h" +#include "UIMessageBox.h" +#include "UIPropertiesBox.h" +#include "UICheckButton.h" +#include "UIRadioButton.h" +#include "UIStatic.h" +#include "UIEditBox.h" +#include "UIFrameWindow.h" +#include "UIFrameLineWnd.h" +#include "UIProgressBar.h" +#include "UITabControl.h" #include "uiscriptwnd_script.h" diff --git a/src/xrGame/ui/xrUIXmlParser.cpp b/src/xrGame/ui/xrUIXmlParser.cpp new file mode 100644 index 00000000000..a4e40ec064d --- /dev/null +++ b/src/xrGame/ui/xrUIXmlParser.cpp @@ -0,0 +1,77 @@ +#include "stdafx.h" +#include "xrUIXmlParser.h" + +#ifdef XRGAME_EXPORTS +#include "ui_base.h" +#endif + +shared_str CUIXml::correct_file_name(pcstr path, pcstr fn) +{ +#ifdef XRGAME_EXPORTS + if (0 == xr_strcmp(path, UI_PATH) || 0 == xr_strcmp(path, "UI")) + { + return UI().get_xml_name(fn); + } + else + return fn; +#else + return fn; +#endif +} + +//#define LOG_ALL_XMLS +#ifdef LOG_ALL_XMLS +int ListXmlCount = 0; +struct DBGList_ +{ + int num; + bool closed; +}; +xr_vector dbg_list_xmls; +void dump_list_xmls() +{ + Msg("------Total xmls %d", dbg_list_xmls.size()); + xr_vector::iterator _it = dbg_list_xmls.begin(); + for (; _it != dbg_list_xmls.end(); ++_it) + if (!(*_it).closed) + Msg("--leak detected ---- xml = %d", (*_it).num); +} +#else +void dump_list_xmls() {} +#endif + +CUIXml::CUIXml() +{ +#ifdef LOG_ALL_XMLS + ListXmlCount++; + m_dbg_id = ListXmlCount; + dbg_list_xmls.push_back(DBGList_()); + dbg_list_xmls.back().num = m_dbg_id; + dbg_list_xmls.back().closed = false; +#endif +} + +CUIXml::~CUIXml() +{ +#ifdef LOG_ALL_XMLS + xr_vector::iterator _it = dbg_list_xmls.begin(); + bool bOK = false; + for (; _it != dbg_list_xmls.end(); ++_it) + { + if ((*_it).num == m_dbg_id && !(*_it).closed) + { + bOK = true; + (*_it).closed = true; + dbg_list_xmls.erase(_it); + break; + } + if ((*_it).num == m_dbg_id && (*_it).closed) + { + Msg("--XML [%d] already deleted", m_dbg_id); + bOK = true; + } + } + if (!bOK) + Msg("CUIXml::~CUIXml.[%d] cannot find xml in list", m_dbg_id); +#endif +} diff --git a/src/xrUICore/XML/xrUIXmlParser.h b/src/xrGame/ui/xrUIXmlParser.h similarity index 79% rename from src/xrUICore/XML/xrUIXmlParser.h rename to src/xrGame/ui/xrUIXmlParser.h index e4d87d8c7b4..d97bd71d32b 100644 --- a/src/xrUICore/XML/xrUIXmlParser.h +++ b/src/xrGame/ui/xrUIXmlParser.h @@ -1,7 +1,7 @@ #pragma once #include "xrCore/XML/XMLDocument.hpp" -class XRUICORE_API CUIXml : public XMLDocument +class CUIXml : public XMLDocument { int m_dbg_id; diff --git a/src/xrUICore/ui_base.cpp b/src/xrGame/ui_base.cpp similarity index 97% rename from src/xrUICore/ui_base.cpp rename to src/xrGame/ui_base.cpp index 6b8f95dccc2..9727885f934 100644 --- a/src/xrUICore/ui_base.cpp +++ b/src/xrGame/ui_base.cpp @@ -1,11 +1,12 @@ -#include "pch.hpp" +#include "stdafx.h" #include "ui_base.h" -#include "Cursor/UICursor.h" +#include "GamePersistent.h" +#include "UICursor.h" pcstr UI_PATH = "ui"; CUICursor& GetUICursor() { return UI().GetUICursor(); }; -ui_core& UI() { return *GEnv.UI; }; +ui_core& UI() { return *GamePersistent().m_pUI_core; }; extern ENGINE_API Fvector2 g_current_font_scale; void S2DVert::rotate_pt(const Fvector2& pivot, const float cosA, const float sinA, const float kx) @@ -217,8 +218,8 @@ ui_core::ui_core() } else { - m_pUICursor = nullptr; - m_pFontManager = nullptr; + m_pUICursor = NULL; + m_pFontManager = NULL; } m_bPostprocess = false; diff --git a/src/xrUICore/ui_base.h b/src/xrGame/ui_base.h similarity index 66% rename from src/xrUICore/ui_base.h rename to src/xrGame/ui_base.h index feabb0f9266..d3ad2a4cc8b 100644 --- a/src/xrUICore/ui_base.h +++ b/src/xrGame/ui_base.h @@ -4,9 +4,8 @@ #include "xrEngine/device.h" #include "xrCommon/xr_vector.h" #include "xrCommon/xr_stack.h" -#include "xrUICore/FontManager/FontManager.h" -XRUICORE_API extern pcstr UI_PATH; +extern pcstr UI_PATH; class CUICursor; class CUIGameCustom; @@ -19,7 +18,38 @@ class CDeviceResetNotifier : public pureDeviceReset virtual void OnDeviceReset(){}; }; -class XRUICORE_API ui_core : public CDeviceResetNotifier +struct CFontManager : public pureDeviceReset +{ + CFontManager(); + ~CFontManager(); + + typedef xr_vector FONTS_VEC; + typedef FONTS_VEC::iterator FONTS_VEC_IT; + FONTS_VEC m_all_fonts; + void Render(); + + // hud font + CGameFont* pFontMedium; + CGameFont* pFontDI; + + CGameFont* pFontArial14; + CGameFont* pFontGraffiti19Russian; + CGameFont* pFontGraffiti22Russian; + CGameFont* pFontLetterica16Russian; + CGameFont* pFontLetterica18Russian; + CGameFont* pFontGraffiti32Russian; + CGameFont* pFontGraffiti50Russian; + CGameFont* pFontLetterica25; + CGameFont* pFontStat; + + void InitializeFonts(); + void InitializeFont(CGameFont*& F, LPCSTR section, u32 flags = 0); + LPCSTR GetFontTexName(LPCSTR section); + + virtual void OnDeviceReset(); +}; + +class ui_core : public CDeviceResetNotifier { C2DFrustum m_2DFrustum; C2DFrustum m_2DFrustumPP; @@ -66,5 +96,6 @@ class XRUICORE_API ui_core : public CDeviceResetNotifier IUIRender::ePointType m_currentPointType; }; -XRUICORE_API extern CUICursor& GetUICursor(); -XRUICORE_API extern ui_core& UI(); +extern CUICursor& GetUICursor(); +extern ui_core& UI(); +extern CUIGameCustom* CurrentGameUI(); diff --git a/src/xrUICore/ui_defs.h b/src/xrGame/ui_defs.h similarity index 97% rename from src/xrUICore/ui_defs.h rename to src/xrGame/ui_defs.h index 520833709aa..aea31f1d16d 100644 --- a/src/xrUICore/ui_defs.h +++ b/src/xrGame/ui_defs.h @@ -51,7 +51,7 @@ struct S2DVert #define UI_FRUSTUM_SAFE (UI_FRUSTUM_MAXPLANES * 4) typedef svector sPoly2D; -class XRUICORE_API C2DFrustum +class C2DFrustum { svector planes; Frect m_rect; diff --git a/src/xrGame/ui_export_script.cpp b/src/xrGame/ui_export_script.cpp index fddb1e80f48..88b51e9f467 100644 --- a/src/xrGame/ui_export_script.cpp +++ b/src/xrGame/ui_export_script.cpp @@ -1,7 +1,16 @@ #include "pch_script.h" + #include "MainMenu.h" #include "UIGameCustom.h" #include "UI/UIScriptWnd.h" +#include "UI/UIButton.h" +#include "UI/UIProgressBar.h" +#include "UI/UIEditBox.h" +#include "UI/UIMessageBox.h" +#include "UI/UIPropertiesBox.h" +#include "UI/UITabControl.h" +#include "UI/UIComboBox.h" +#include "ui/UIOptionsManagerScript.h" #include "ui/UIMapInfo.h" #include "ScriptXmlInit.h" #include "login_manager.h" diff --git a/src/xrGame/xrGame.cpp b/src/xrGame/xrGame.cpp index 8ace2928146..999ab133cb9 100644 --- a/src/xrGame/xrGame.cpp +++ b/src/xrGame/xrGame.cpp @@ -8,7 +8,7 @@ #include "stdafx.h" #include "object_factory.h" -#include "xrUICore/XML/xrUIXmlParser.h" +#include "ui/xrUIXmlParser.h" #include "xr_level_controller.h" #include "xrEngine/profiler.h" @@ -49,15 +49,12 @@ BOOL APIENTRY DllMain(HANDLE hModule, u32 ul_reason_for_call, LPVOID lpReserved) // XXX nitrocaster PROFILER: temporarily disabled due to linkage issues // g_profiler = new CProfiler(); #endif - gStringTable = new CStringTable(); - StringTable().Init(); break; } case DLL_PROCESS_DETACH: { CleanupUIStyleToken(); - xr_delete(gStringTable); break; } } diff --git a/src/xrGame/xrGame.vcxproj b/src/xrGame/xrGame.vcxproj index c2ce915865d..a94debaea47 100644 --- a/src/xrGame/xrGame.vcxproj +++ b/src/xrGame/xrGame.vcxproj @@ -700,6 +700,7 @@ + @@ -1168,6 +1169,7 @@ + @@ -1367,6 +1369,7 @@ + @@ -1389,6 +1392,7 @@ + @@ -1399,6 +1403,7 @@ + @@ -1412,10 +1417,15 @@ + + + + + @@ -1428,17 +1438,29 @@ + + + + + + + + + + + + @@ -1447,6 +1469,13 @@ + + + + + + + @@ -1459,7 +1488,9 @@ + + @@ -1472,37 +1503,61 @@ + + + + + + + + + + - + + + + + + + + + + + + + + + @@ -3279,6 +3334,7 @@ + @@ -3299,6 +3355,7 @@ + @@ -3312,6 +3369,7 @@ + pch_script.h $(IntDir)$(ProjectName)_script.pch @@ -3334,7 +3392,14 @@ $(IntDir)$(ProjectName)_script.pch + + + + + pch_script.h + $(IntDir)$(ProjectName)_script.pch + @@ -3346,16 +3411,34 @@ + + + + pch_script.h + $(IntDir)$(ProjectName)_script.pch + + + true true + + + + + pch_script.h + $(IntDir)$(ProjectName)_script.pch + + + + pch_script.h @@ -3370,6 +3453,7 @@ $(IntDir)$(ProjectName)_script.pch + pch_script.h @@ -3401,6 +3485,16 @@ + + + + + + + + pch_script.h + $(IntDir)$(ProjectName)_script.pch + @@ -3417,7 +3511,12 @@ + + + pch_script.h + $(IntDir)$(ProjectName)_script.pch + @@ -3435,10 +3534,28 @@ + + + + pch_script.h + $(IntDir)$(ProjectName)_script.pch + + + + pch_script.h + $(IntDir)$(ProjectName)_script.pch + + + + + pch_script.h + $(IntDir)$(ProjectName)_script.pch + + pch_script.h @@ -3456,36 +3573,63 @@ pch_script.h $(IntDir)$(ProjectName)_script.pch + + + - + + + + + pch_script.h + $(IntDir)$(ProjectName)_script.pch + + + + + + pch_script.h + $(IntDir)$(ProjectName)_script.pch + + + + pch_script.h $(IntDir)$(ProjectName)_script.pch + + pch_script.h + $(IntDir)$(ProjectName)_script.pch + pch_script.h $(IntDir)$(ProjectName)_script.pch + + + + pch_script.h $(IntDir)$(ProjectName)_script.pch @@ -3696,9 +3840,6 @@ {ccd4afae-aa10-42c6-a452-fdee497ccdf1} - - {37b3642c-b706-4c93-bc54-badadc8fc9b1} - diff --git a/src/xrGame/xrGame.vcxproj.filters b/src/xrGame/xrGame.vcxproj.filters index cc3a284ae9a..870d092c18c 100644 --- a/src/xrGame/xrGame.vcxproj.filters +++ b/src/xrGame/xrGame.vcxproj.filters @@ -1909,6 +1909,9 @@ {bfd4c1f4-faf7-45fc-855e-1fd70023ad4c} + + {fe660738-cb41-4277-9092-9e2d9a2d9731} + {519f65e1-f943-4b85-928f-462419d21ec0} @@ -1936,18 +1939,69 @@ {ebf2a580-795f-4a30-aedb-2f92cb084382} + + {31d61eb9-a7c5-4527-b6cc-d890d465a560} + {f929b1ad-769e-456e-804d-5d4776fd3fb4} + + {a143c653-e625-4712-addc-2e246193f299} + + + {b1e33d94-b247-463d-9508-374a51bc5c3a} + {810cb2af-200b-4ebc-864c-f6fe45f26e00} + + {e84328d8-4117-4060-a5d8-022c0823060c} + + + {92ec8b27-4fbc-456c-a642-ad3a302eb6a3} + {39d38509-7911-4699-a4d7-9c10c8f29206} + + {6ab408a1-77bc-4a1b-b10d-67275aadf448} + + + {89add78b-1722-4806-b081-5be13f816451} + + + {64a7553d-e422-4b9f-84db-e3ec71dcd52f} + + + {52c08b50-a211-4278-a85a-d4e794004347} + + + {39a86d7b-6f39-4fd8-8646-5989eac29b47} + + + {6ac65b85-b69c-4f46-9f6e-97c5cfd37e18} + + + {c8b00191-d1aa-43c9-a4ef-11fb0981fcd0} + {59ae40a5-3d82-4975-af99-d70e3b756581} + + {a2ba0397-f13a-4bcc-a6d0-a3613ffcbc71} + + + {84975978-12e8-41fd-a796-954a22fdfd2a} + + + {7bdb8f05-f548-40f1-8d33-5c79ee1effbf} + + + {355b0b35-b53e-4e47-935e-67222f25c82a} + + + {daaf29c6-feac-4708-8f68-ff1fdfadda75} + {be2630ed-da7e-40c0-8271-533e359cc040} @@ -2212,6 +2266,9 @@ {9902c3e6-be5f-44b6-b539-cca3243e5e07} + + {c030db0f-190c-4415-a003-bf69d21c43cc} + {0b7f91ec-8546-438f-9598-b42cc9f39725} @@ -4575,6 +4632,9 @@ ScriptClasses\BaseClientClasses + + ScriptClasses\ScriptCallbackEx + ScriptClasses\ScriptParticles @@ -5475,6 +5535,9 @@ Core\Common\StringTable + + Core\Common\StringTable + Core\Common\Registry @@ -5889,6 +5952,12 @@ Core\Server\filetransfer + + UI + + + UI + UI @@ -5994,6 +6063,15 @@ UI\Common\MainIngame + + UI\Common\OptionsItem + + + UI\Common\OptionsItem + + + UI\Common\OptionsItem + UI\Common\OptionsConsoleCommands @@ -6027,21 +6105,132 @@ UI\Common\_Debug Fonts + + UI\UIWindows + + + UI\UIWindows + + + UI\UIWindows + + + UI\UIWindows + + + UI\UIWindows\XML + UI\UIWindows\XML + + UI\UIWindows\XML + + + UI\UIWindows\MessageBox + UI\UIWindows\MessageBox + + UI\UIWindows\PropertiesBox + + + UI\UIWindows\Static + + + UI\UIWindows\Static + + + UI\UIWindows\Static + + + UI\UIWindows\Static + + + UI\UIWindows\EditBox + + + UI\UIWindows\EditBox + + + UI\UIWindows\EditBox\customEB + UI\UIWindows\Windows + + UI\UIWindows\Windows + + + UI\UIWindows\Windows + + + UI\UIWindows\Windows + + + UI\UIWindows\ProgressBar + + + UI\UIWindows\ProgressBar + + + UI\UIWindows\ProgressBar + + + UI\UIWindows\TabControl + + + UI\UIWindows\TabControl + UI\UIWindows\ScriptWnd UI\UIWindows\ScriptWnd + + UI\UIWindows\Buttons + + + UI\UIWindows\Buttons + + + UI\UIWindows\Buttons + + + UI\UIWindows\Buttons + + + UI\UIWindows\Buttons + + + UI\UIWindows\ComboBox + + + UI\UIWindows\InteractiveBackground + + + UI\UIWindows\InteractiveBackground + + + UI\UIWindows\TrackBar + + + UI\UIWindows\ScrollView + + + UI\UIWindows\Lines + + + UI\UIWindows\Lines + + + UI\UIWindows\Lines + + + UI\UIWindows\Lines + UI\UIWindows\DragDrop @@ -6057,6 +6246,39 @@ UI\UIWindows\DragDrop + + UI\UIWindows\ScrollBar + + + UI\UIWindows\ScrollBar + + + UI\UIWindows\ScrollBar + + + UI\UIWindows\SpinBox + + + UI\UIWindows\SpinBox + + + UI\UIWindows\SpinBox + + + UI\UIWindows\arrow + + + UI\UIWindows\Hint + + + UI\UIWindows\ListBox + + + UI\UIWindows\ListBox + + + UI\UIWindows\ListBox + UI\HUD @@ -6228,6 +6450,9 @@ UI\Cursor + + UI\Cursor + UI\Tutorial @@ -6455,9 +6680,6 @@ UI\Common\LoadingScreen - - UI\UIWindows\Static - @@ -9223,6 +9445,9 @@ Core\Server\ServerConnect + + UI + UI @@ -9331,6 +9556,15 @@ UI\Common\MainIngame + + UI\Common\OptionsItem + + + UI\Common\OptionsItem + + + UI\Common\OptionsItem + UI\Common\OptionsConsoleCommands @@ -9385,18 +9619,96 @@ UI\Common\_Debug Fonts + + UI\UIWindows + + + UI\UIWindows\XML + UI\UIWindows\XML + + UI\UIWindows\XML + + + UI\UIWindows\MessageBox + + + UI\UIWindows\MessageBox + UI\UIWindows\MessageBox + + UI\UIWindows\PropertiesBox + + + UI\UIWindows\PropertiesBox + + + UI\UIWindows\Static + + + UI\UIWindows\Static + + + UI\UIWindows\Static + + + UI\UIWindows\Static + + + UI\UIWindows\Static + + + UI\UIWindows\EditBox + + + UI\UIWindows\EditBox + + + UI\UIWindows\EditBox\customEB + + + UI\UIWindows\EditBox\customEB + UI\UIWindows\Windows + + UI\UIWindows\Windows + + + UI\UIWindows\Windows + + + UI\UIWindows\Windows + UI\UIWindows\Windows + + UI\UIWindows\ProgressBar + + + UI\UIWindows\ProgressBar + + + UI\UIWindows\ProgressBar + + + UI\UIWindows\ProgressBar + + + UI\UIWindows\TabControl + + + UI\UIWindows\TabControl + + + UI\UIWindows\TabControl + UI\UIWindows\ScriptWnd @@ -9406,6 +9718,48 @@ UI\UIWindows\ScriptWnd + + UI\UIWindows\Buttons + + + UI\UIWindows\Buttons + + + UI\UIWindows\Buttons + + + UI\UIWindows\Buttons + + + UI\UIWindows\Buttons + + + UI\UIWindows\Buttons + + + UI\UIWindows\ComboBox + + + UI\UIWindows\ComboBox + + + UI\UIWindows\InteractiveBackground + + + UI\UIWindows\TrackBar + + + UI\UIWindows\ScrollView + + + UI\UIWindows\Lines + + + UI\UIWindows\Lines + + + UI\UIWindows\Lines + UI\UIWindows\DragDrop @@ -9421,6 +9775,42 @@ UI\UIWindows\DragDrop + + UI\UIWindows\ScrollBar + + + UI\UIWindows\ScrollBar + + + UI\UIWindows\ScrollBar + + + UI\UIWindows\SpinBox + + + UI\UIWindows\SpinBox + + + UI\UIWindows\SpinBox + + + UI\UIWindows\arrow + + + UI\UIWindows\Hint + + + UI\UIWindows\ListBox + + + UI\UIWindows\ListBox + + + UI\UIWindows\ListBox + + + UI\UIWindows\ListBox + UI\HUD @@ -9610,6 +10000,9 @@ UI\Cursor + + UI\Cursor + UI\Tutorial @@ -9825,9 +10218,6 @@ UI\Common\LoadingScreen - - UI\UIWindows\Static - diff --git a/src/xrGame/xrServer.cpp b/src/xrGame/xrServer.cpp index 70d1782ad5f..21324a2f4b9 100644 --- a/src/xrGame/xrServer.cpp +++ b/src/xrGame/xrServer.cpp @@ -1044,7 +1044,7 @@ void xrServer::PerformCheckClientsForMaxPing() if (Client->m_ping_warn.m_maxPingWarnings >= g_sv_maxPingWarningsCount) { // kick LPSTR reason; - STRCONCAT(reason, StringTable().translate("st_kicked_by_server").c_str()); + STRCONCAT(reason, CStringTable().translate("st_kicked_by_server").c_str()); Level().Server->DisconnectClient(Client, reason); } else diff --git a/src/xrGame/xr_level_controller.cpp b/src/xrGame/xr_level_controller.cpp index a680564f20d..1d6a31ea8f8 100644 --- a/src/xrGame/xr_level_controller.cpp +++ b/src/xrGame/xr_level_controller.cpp @@ -5,6 +5,391 @@ #include "xr_level_controller.h" #include "string_table.h" +_binding g_key_bindings[bindings_count]; +_key_group g_current_keygroup = _sp; + +_action actions[] = +{ + { "left", kLEFT, _both }, + { "right", kRIGHT, _both }, + { "up", kUP, _both }, + { "down", kDOWN, _both }, + { "jump", kJUMP, _both }, + { "crouch", kCROUCH, _both }, + { "accel", kACCEL, _both }, + { "sprint_toggle", kSPRINT_TOGGLE, _both }, + + { "forward", kFWD, _both }, + { "back", kBACK, _both }, + { "lstrafe", kL_STRAFE, _both }, + { "rstrafe", kR_STRAFE, _both }, + + { "llookout", kL_LOOKOUT, _both }, + { "rlookout", kR_LOOKOUT, _both }, + + { "cam_1", kCAM_1, _both }, + { "cam_2", kCAM_2, _both }, + { "cam_3", kCAM_3, _both }, + { "cam_zoom_in", kCAM_ZOOM_IN, _both }, + { "cam_zoom_out", kCAM_ZOOM_OUT, _both }, + + { "torch", kTORCH, _both }, + { "night_vision", kNIGHT_VISION, _both }, + { "show_detector", kDETECTOR, _sp }, + + { "wpn_1", kWPN_1, _both }, + { "wpn_2", kWPN_2, _both }, + { "wpn_3", kWPN_3, _both }, + { "wpn_4", kWPN_4, _both }, + { "wpn_5", kWPN_5, _both }, + { "wpn_6", kWPN_6, _both }, + { "artefact", kARTEFACT, _both /*_mp*/ }, + { "wpn_next", kWPN_NEXT, _both }, // means next ammo type + { "wpn_fire", kWPN_FIRE, _both }, + { "wpn_zoom", kWPN_ZOOM, _both }, + { "wpn_zoom_inc", kWPN_ZOOM_INC, _both }, + { "wpn_zoom_dec", kWPN_ZOOM_DEC, _both }, + { "wpn_reload", kWPN_RELOAD, _both }, + { "wpn_func", kWPN_FUNC, _both }, + { "wpn_firemode_prev", kWPN_FIREMODE_PREV, _both }, + { "wpn_firemode_next", kWPN_FIREMODE_NEXT, _both }, + + { "pause", kPAUSE, _both }, + { "drop", kDROP, _both }, + { "use", kUSE, _both }, + { "scores", kSCORES, _both }, + { "chat", kCHAT, _mp }, + { "chat_team", kCHAT_TEAM, _mp }, + { "screenshot", kSCREENSHOT, _both }, + { "quit", kQUIT, _both }, + { "console", kCONSOLE, _both }, + { "inventory", kINVENTORY, _both }, + { "buy_menu", kBUY, _mp }, + { "skin_menu", kSKIN, _mp }, + { "team_menu", kTEAM, _mp }, + { "active_jobs", kACTIVE_JOBS, _sp }, + + { "vote_begin", kVOTE_BEGIN, _mp }, + { "show_admin_menu", kSHOW_ADMIN_MENU, _mp }, + { "vote", kVOTE, _mp }, + { "vote_yes", kVOTEYES, _mp }, + { "vote_no", kVOTENO, _mp }, + + { "next_slot", kNEXT_SLOT, _both }, + { "prev_slot", kPREV_SLOT, _both }, + + { "speech_menu_0", kSPEECH_MENU_0, _mp }, + { "speech_menu_1", kSPEECH_MENU_1, _mp }, + + { "quick_use_1", kQUICK_USE_1, _both }, + { "quick_use_2", kQUICK_USE_2, _both }, + { "quick_use_3", kQUICK_USE_3, _both }, + { "quick_use_4", kQUICK_USE_4, _both }, + + { "quick_save", kQUICK_SAVE, _sp }, + { "quick_load", kQUICK_LOAD, _sp }, + //{ "alife_command", kALIFE_CMD, _sp }, + + { nullptr, kLASTACTION, _both } +}; + +_keyboard keyboards[] = +{ + { "mouse1", MOUSE_1, "Mouse 1" }, + { "mouse2", MOUSE_2, "Mouse 2" }, + { "mouse3", MOUSE_3, "Mouse 3" }, + { "mouse4", MOUSE_4, "Mouse 4" }, + { "mouse5", MOUSE_5, "Mouse 5" }, + { "mouse6", MOUSE_6, "Mouse 6" }, + { "mouse7", MOUSE_7, "Mouse 7" }, + { "mouse8", MOUSE_8, "Mouse 8" }, + + { "kUNKNOWN", SDL_SCANCODE_UNKNOWN, "Unknown" }, + + { "kA", SDL_SCANCODE_A, "A" }, + { "kB", SDL_SCANCODE_B, "B" }, + { "kC", SDL_SCANCODE_C, "C" }, + { "kD", SDL_SCANCODE_D, "D" }, + { "kE", SDL_SCANCODE_E, "E" }, + { "kF", SDL_SCANCODE_F, "F" }, + { "kG", SDL_SCANCODE_G, "G" }, + { "kH", SDL_SCANCODE_H, "H" }, + { "kI", SDL_SCANCODE_I, "I" }, + { "kJ", SDL_SCANCODE_J, "J" }, + { "kK", SDL_SCANCODE_K, "K" }, + { "kL", SDL_SCANCODE_L, "L" }, + { "kM", SDL_SCANCODE_M, "M" }, + { "kN", SDL_SCANCODE_N, "N" }, + { "kO", SDL_SCANCODE_O, "O" }, + { "kP", SDL_SCANCODE_P, "P" }, + { "kQ", SDL_SCANCODE_Q, "Q" }, + { "kR", SDL_SCANCODE_R, "R" }, + { "kS", SDL_SCANCODE_S, "S" }, + { "kT", SDL_SCANCODE_T, "T" }, + { "kU", SDL_SCANCODE_U, "U" }, + { "kV", SDL_SCANCODE_V, "V" }, + { "kW", SDL_SCANCODE_W, "W" }, + { "kX", SDL_SCANCODE_X, "X" }, + { "kY", SDL_SCANCODE_Y, "Y" }, + { "kZ", SDL_SCANCODE_Z, "Z" }, + + { "k1", SDL_SCANCODE_1, "1" }, + { "k2", SDL_SCANCODE_2, "2" }, + { "k3", SDL_SCANCODE_3, "3" }, + { "k4", SDL_SCANCODE_4, "4" }, + { "k5", SDL_SCANCODE_5, "5" }, + { "k6", SDL_SCANCODE_6, "6" }, + { "k7", SDL_SCANCODE_7, "7" }, + { "k8", SDL_SCANCODE_8, "8" }, + { "k9", SDL_SCANCODE_9, "9" }, + { "k0", SDL_SCANCODE_0, "0" }, + + { "kRETURN", SDL_SCANCODE_RETURN, "Return" }, + { "kESCAPE", SDL_SCANCODE_ESCAPE, "Escape" }, + { "kBACK", SDL_SCANCODE_BACKSPACE, "Backspace" }, + { "kTAB", SDL_SCANCODE_TAB, "Tab" }, + { "kSPACE", SDL_SCANCODE_SPACE, "Space" }, + + { "kMINUS", SDL_SCANCODE_MINUS, "Minus" }, + { "kEQUALS", SDL_SCANCODE_EQUALS, "Equals" }, + { "kLBRACKET", SDL_SCANCODE_LEFTBRACKET, "Left bracket" }, + { "kRBRACKET", SDL_SCANCODE_RIGHTBRACKET, "Right bracket" }, + { "kBACKSLASH", SDL_SCANCODE_BACKSLASH, "Backslash" }, + { "kNONUSHASH", SDL_SCANCODE_NONUSHASH, "Non US Hash" }, + + { "kSEMICOLON", SDL_SCANCODE_SEMICOLON, "Semicolon" }, + { "kAPOSTROPHE", SDL_SCANCODE_APOSTROPHE, "Apostrophe" }, + { "kGRAVE", SDL_SCANCODE_GRAVE, "Grave" }, + { "kCOMMA", SDL_SCANCODE_COMMA, "Comma" }, + { "kPERIOD", SDL_SCANCODE_PERIOD, "Period" }, + { "kSLASH", SDL_SCANCODE_SLASH, "Slash" }, + + { "kCAPITAL", SDL_SCANCODE_CAPSLOCK, "Caps Lock" }, + + { "kF1", SDL_SCANCODE_F1, "F1" }, + { "kF2", SDL_SCANCODE_F2, "F2" }, + { "kF3", SDL_SCANCODE_F3, "F3" }, + { "kF4", SDL_SCANCODE_F4, "F4" }, + { "kF5", SDL_SCANCODE_F5, "F5" }, + { "kF6", SDL_SCANCODE_F6, "F6" }, + { "kF7", SDL_SCANCODE_F7, "F7" }, + { "kF8", SDL_SCANCODE_F8, "F8" }, + { "kF9", SDL_SCANCODE_F9, "F9" }, + { "kF10", SDL_SCANCODE_F10, "F10" }, + { "kF11", SDL_SCANCODE_F11, "F11" }, + { "kF12", SDL_SCANCODE_F12, "F12" }, + + { "kPRINTSCREEN", SDL_SCANCODE_PRINTSCREEN, "Print Screen" }, + { "kSCROLL", SDL_SCANCODE_SCROLLLOCK, "Scroll Lock" }, + { "kPAUSE", SDL_SCANCODE_PAUSE, "Pause" }, + { "kINSERT", SDL_SCANCODE_INSERT, "Insert" }, + + { "kHOME", SDL_SCANCODE_HOME, "Home" }, + { "kPGUP", SDL_SCANCODE_PAGEUP, "Page Up" }, + { "kDELETE", SDL_SCANCODE_DELETE, "Delete" }, + { "kEND", SDL_SCANCODE_END, "End" }, + { "kPGDN", SDL_SCANCODE_PAGEDOWN, "Page Down" }, + + { "kRIGHT", SDL_SCANCODE_RIGHT, "Right" }, + { "kLEFT", SDL_SCANCODE_LEFT, "Left" }, + { "kDOWN", SDL_SCANCODE_DOWN, "Down" }, + { "kUP", SDL_SCANCODE_UP, "Up" }, + + { "kNUMLOCK", SDL_SCANCODE_NUMLOCKCLEAR, "Num Lock" }, + + { "kDIVIDE", SDL_SCANCODE_KP_DIVIDE, "Numpad Divide" }, + { "kMULTIPLY", SDL_SCANCODE_KP_MULTIPLY, "Numpad Multiply" }, + { "kSUBTRACT", SDL_SCANCODE_KP_MINUS, "Numpad Minus" }, + { "kADD", SDL_SCANCODE_KP_PLUS, "Numpad Plus" }, + { "kNUMPADENTER", SDL_SCANCODE_KP_ENTER, "Numpad Enter" }, + + { "kNUMPAD1", SDL_SCANCODE_KP_1, "Numpad 1" }, + { "kNUMPAD2", SDL_SCANCODE_KP_2, "Numpad 2" }, + { "kNUMPAD3", SDL_SCANCODE_KP_3, "Numpad 3" }, + { "kNUMPAD4", SDL_SCANCODE_KP_4, "Numpad 4" }, + { "kNUMPAD5", SDL_SCANCODE_KP_5, "Numpad 5" }, + { "kNUMPAD6", SDL_SCANCODE_KP_6, "Numpad 6" }, + { "kNUMPAD7", SDL_SCANCODE_KP_7, "Numpad 7" }, + { "kNUMPAD8", SDL_SCANCODE_KP_8, "Numpad 8" }, + { "kNUMPAD9", SDL_SCANCODE_KP_9, "Numpad 9" }, + { "kNUMPAD0", SDL_SCANCODE_KP_0, "Numpad 0" }, + + { "kNUMPADPERIOD", SDL_SCANCODE_KP_PERIOD, "Numpad Period" }, + { "kNONUSBACKSLASH", SDL_SCANCODE_NONUSBACKSLASH, "Non US Backslash" }, + { "kAPPLICATION", SDL_SCANCODE_APPLICATION, "Application" }, + { "kPOWER", SDL_SCANCODE_POWER, "Power" }, + { "kNUMPADEQUALS", SDL_SCANCODE_KP_EQUALS, "Numpad Equals" }, + + { "kF13", SDL_SCANCODE_F13, "F13" }, + { "kF14", SDL_SCANCODE_F14, "F14" }, + { "kF15", SDL_SCANCODE_F15, "F15" }, + { "kF16", SDL_SCANCODE_F16, "F16" }, + { "kF17", SDL_SCANCODE_F17, "F17" }, + { "kF18", SDL_SCANCODE_F18, "F18" }, + { "kF19", SDL_SCANCODE_F19, "F19" }, + { "kF20", SDL_SCANCODE_F20, "F20" }, + { "kF21", SDL_SCANCODE_F21, "F21" }, + { "kF22", SDL_SCANCODE_F22, "F22" }, + { "kF23", SDL_SCANCODE_F23, "F23" }, + { "kF24", SDL_SCANCODE_F24, "F24" }, + + { "kEXECUTE", SDL_SCANCODE_EXECUTE, "Execute" }, + { "kHELP", SDL_SCANCODE_HELP, "Help" }, + { "kMENU", SDL_SCANCODE_MENU, "Menu" }, + + { "kSELECT", SDL_SCANCODE_SELECT, "Select" }, + { "kSTOP", SDL_SCANCODE_STOP, "Stop" }, + + { "kREDO", SDL_SCANCODE_AGAIN, "Redo" }, + { "kUNDO", SDL_SCANCODE_UNDO, "Undo" }, + + { "kCUT", SDL_SCANCODE_CUT, "Cut" }, + { "kCOPY", SDL_SCANCODE_COPY, "Copy" }, + { "kPASTE", SDL_SCANCODE_PASTE, "Paste" }, + + { "kFIND", SDL_SCANCODE_FIND, "Find" }, + + { "kMUTE", SDL_SCANCODE_MUTE, "Mute" }, + { "kVOLUMEUP", SDL_SCANCODE_VOLUMEUP, "Volume Up" }, + { "kVOLUMEDOWN", SDL_SCANCODE_VOLUMEDOWN, "Volume Down" }, + + { "kNUMPADCOMMA", SDL_SCANCODE_KP_COMMA, "Numpad Comma" }, + { "kNUMPADEQUALSAS400", SDL_SCANCODE_KP_EQUALSAS400, "Equals AS400" }, + + { "kINTERNATIONAL1", SDL_SCANCODE_INTERNATIONAL1 /* Give a better name? */ }, + { "kINTERNATIONAL2", SDL_SCANCODE_INTERNATIONAL2 /* Give a better name? */ }, + { "kYEN", SDL_SCANCODE_INTERNATIONAL3, "Yen" }, + { "kINTERNATIONAL4", SDL_SCANCODE_INTERNATIONAL4 /* Give a better name? */ }, + { "kINTERNATIONAL5", SDL_SCANCODE_INTERNATIONAL5 /* Give a better name? */ }, + { "kINTERNATIONAL6", SDL_SCANCODE_INTERNATIONAL6 /* Give a better name? */ }, + { "kINTERNATIONAL7", SDL_SCANCODE_INTERNATIONAL7 /* Give a better name? */ }, + { "kINTERNATIONAL8", SDL_SCANCODE_INTERNATIONAL8 /* Give a better name? */ }, + { "kINTERNATIONAL9", SDL_SCANCODE_INTERNATIONAL9 /* Give a better name? */ }, + + { "kHANGUL", SDL_SCANCODE_LANG1, "Hangul" }, + { "kHANJA", SDL_SCANCODE_LANG2, "Hanja" }, + { "kKATAKANA", SDL_SCANCODE_LANG3, "Katakana" }, + { "kHIRAGANA", SDL_SCANCODE_LANG4, "Hiragana" }, + { "kZENHANKAKU", SDL_SCANCODE_LANG5, "Zen-Han-kaku" }, + { "kLANG6", SDL_SCANCODE_LANG6 /* Give a better name? */ }, + { "kLANG7", SDL_SCANCODE_LANG7 /* Give a better name? */ }, + { "kLANG8", SDL_SCANCODE_LANG8 /* Give a better name? */ }, + { "kLANG9", SDL_SCANCODE_LANG9 /* Give a better name? */ }, + + { "kALTERASE", SDL_SCANCODE_ALTERASE, "Alterase" }, + { "kCANCEL", SDL_SCANCODE_CANCEL, "Cancel" }, + { "kCLEAR", SDL_SCANCODE_CLEAR, "Clear" }, + { "kPRIOR", SDL_SCANCODE_PRIOR, "Prior" }, + { "kRETURN2", SDL_SCANCODE_RETURN2, "Return 2" }, + { "kSEPARATOR", SDL_SCANCODE_SEPARATOR, "Separator" }, + { "kOUT", SDL_SCANCODE_OUT, "Out" }, + { "kOPER", SDL_SCANCODE_OPER, "Oper" }, + { "kCLEARAGAIN", SDL_SCANCODE_CLEARAGAIN, "Clear Again" }, + { "kCRSEL", SDL_SCANCODE_CRSEL, "Crsel" }, + { "kEXSEL", SDL_SCANCODE_EXSEL, "Excel" }, + + { "kNUMPAD_00", SDL_SCANCODE_KP_00, "Numpad 00" }, + { "kNUMPAD_000", SDL_SCANCODE_KP_000, "Numpad 000" }, + { "kTHOUSANDSSEPARATOR", SDL_SCANCODE_THOUSANDSSEPARATOR, "Thousand Separator" }, + { "kDECIMALSEPARATOR", SDL_SCANCODE_DECIMALSEPARATOR, "Decimal Separator" }, + { "kCURRENCYUNIT", SDL_SCANCODE_CURRENCYUNIT, "Currency Unit" }, + { "kCURRENCYSUBUNIT", SDL_SCANCODE_CURRENCYSUBUNIT, "Currency Subunit" }, + { "kNUMPAD_LEFTPAREN", SDL_SCANCODE_KP_LEFTPAREN, "Numpad Left Paren" }, + { "kNUMPAD_RIGHTPAREN", SDL_SCANCODE_KP_RIGHTPAREN, "Numpad Right Paren" }, + { "kNUMPAD_LEFTBRACE", SDL_SCANCODE_KP_LEFTBRACE, "Numpad Left Brace" }, + { "kNUMPAD_RIGHTBRACE", SDL_SCANCODE_KP_RIGHTBRACE, "Numpad Right Brace" }, + { "kNUMPAD_TAB", SDL_SCANCODE_KP_TAB, "Numpad Tab" }, + { "kNUMPAD_BACKSPACE", SDL_SCANCODE_KP_BACKSPACE, "Numpad Backspace" }, + { "kNUMPAD_A", SDL_SCANCODE_KP_A, "Numpad A" }, + { "kNUMPAD_B", SDL_SCANCODE_KP_B, "Numpad B" }, + { "kNUMPAD_C", SDL_SCANCODE_KP_C, "Numpad C" }, + { "kNUMPAD_D", SDL_SCANCODE_KP_D, "Numpad D" }, + { "kNUMPAD_E", SDL_SCANCODE_KP_E, "Numpad E" }, + { "kNUMPAD_F", SDL_SCANCODE_KP_F, "Numpad F" }, + + { "kNUMPAD_XOR", SDL_SCANCODE_KP_XOR, "Numpad XOR" }, + + { "kNUMPAD_POWER", SDL_SCANCODE_KP_POWER, "Numpad Power" }, + { "kNUMPAD_PERCENT", SDL_SCANCODE_KP_PERCENT, "Numpad Percent" }, + + { "kNUMPAD_LESS", SDL_SCANCODE_KP_LESS, "Numpad Less" }, + { "kNUMPAD_GREATER", SDL_SCANCODE_KP_GREATER, "Numpad Greater" }, + + { "kNUMPAD_AMPERSAND", SDL_SCANCODE_KP_AMPERSAND, "Numpad Ampersand" }, + { "kNUMPAD_DBLAMPERSAND", SDL_SCANCODE_KP_DBLAMPERSAND, "Numpad Double Ampersand" }, + + { "kNUMPAD_VERTICALBAR", SDL_SCANCODE_KP_VERTICALBAR, "Numpad Vertical Bar" }, + { "kNUMPAD_DBLVERTICALBAR", SDL_SCANCODE_KP_DBLVERTICALBAR, "Numpad Double Vertical Bar" }, + + { "kNUMPAD_COLON", SDL_SCANCODE_KP_COLON, "Numpad Colon" }, + { "kNUMPAD_HASH", SDL_SCANCODE_KP_HASH, "Numpad Hash" }, + { "kNUMPAD_SPACE", SDL_SCANCODE_KP_SPACE, "Numpad Space" }, + { "kNUMPAD_AT", SDL_SCANCODE_KP_AT, "Numpad At" }, + { "kNUMPAD_EXCLAM", SDL_SCANCODE_KP_EXCLAM, "Numpad Exclam" }, + + { "kNUMPAD_MEMSTORE", SDL_SCANCODE_KP_MEMSTORE, "Numpad Mem Store" }, + { "kNUMPAD_MEMRECALL", SDL_SCANCODE_KP_MEMRECALL, "Numpad Mem Recall" }, + { "kNUMPAD_MEMCLEAR", SDL_SCANCODE_KP_MEMCLEAR, "Numpad Mem Clear" }, + { "kNUMPAD_MEMADD", SDL_SCANCODE_KP_MEMADD, "Numpad Mem Add" }, + { "kNUMPAD_MEMSUBTRACT", SDL_SCANCODE_KP_MEMSUBTRACT, "Numpad Mem Subtract" }, + { "kNUMPAD_MEMMULTIPLY", SDL_SCANCODE_KP_MEMMULTIPLY, "Numpad Mem Multiply" }, + { "kNUMPAD_MEMDIVIDE", SDL_SCANCODE_KP_MEMDIVIDE, "Numpad Mem Divide" }, + + { "kNUMPAD_PLUSMINUS", SDL_SCANCODE_KP_PLUSMINUS, "Numpad Plus-Minus" }, + { "kNUMPAD_CLEAR", SDL_SCANCODE_KP_CLEAR, "Numpad Clear" }, + { "kNUMPAD_CLEARENTRY", SDL_SCANCODE_KP_CLEARENTRY, "Numpad Clear Entry" }, + { "kNUMPAD_BINARY", SDL_SCANCODE_KP_BINARY, "Numpad Binary" }, + { "kNUMPAD_OCTAL", SDL_SCANCODE_KP_OCTAL, "Numpad Octal" }, + { "kNUMPAD_DECIMAL", SDL_SCANCODE_KP_DECIMAL, "Numpad Decimal" }, + { "kNUMPAD_HEXADECIMAL", SDL_SCANCODE_KP_HEXADECIMAL, "Numpad Hexadecimal" }, + + { "kLCONTROL", SDL_SCANCODE_LCTRL, "Left Ctrl" }, + { "kLSHIFT", SDL_SCANCODE_LSHIFT, "Left shift" }, + { "kLMENU", SDL_SCANCODE_LALT, "Left Alt" }, + { "kLWIN", SDL_SCANCODE_LGUI, "Left Windows" }, + { "kRCONTROL", SDL_SCANCODE_RCTRL, "Right Ctrl" }, + { "kRSHIFT", SDL_SCANCODE_RSHIFT, "Right Shift" }, + { "kRMENU", SDL_SCANCODE_RALT, "Right Alt" }, + { "kRWIN", SDL_SCANCODE_RGUI, "Right Windows" }, + + { "kMODE", SDL_SCANCODE_MODE, "Mode" }, + + { "kAUDIONEXT", SDL_SCANCODE_AUDIONEXT, "Audio Next" }, + { "kAUDIOPREV", SDL_SCANCODE_AUDIOPREV, "Audio Prev" }, + { "kAUDIOSTOP", SDL_SCANCODE_AUDIOSTOP, "Audio Stop" }, + { "kAUDIOPLAY", SDL_SCANCODE_AUDIOPLAY, "Audio Play" }, + { "kAUDIOMUTE", SDL_SCANCODE_AUDIOMUTE, "Audio Mute" }, + + { "kMEDIASELECT", SDL_SCANCODE_MEDIASELECT, "Media Select" }, + { "kWWW", SDL_SCANCODE_WWW, "WWW" }, + { "kMAIL", SDL_SCANCODE_MAIL, "Mail" }, + { "kCALCULATOR", SDL_SCANCODE_CALCULATOR, "Calculator" }, + { "kCOMPUTER", SDL_SCANCODE_COMPUTER, "My Computer" }, + + { "kNUMPAD_AC_SEARCH", SDL_SCANCODE_AC_SEARCH, "AC Search" }, + { "kNUMPAD_AC_HOME", SDL_SCANCODE_AC_HOME, "AC Home" }, + { "kNUMPAD_AC_BACK", SDL_SCANCODE_AC_BACK, "AC Back" }, + { "kNUMPAD_AC_FORWARD", SDL_SCANCODE_AC_FORWARD, "AC Forward" }, + { "kNUMPAD_AC_STOP", SDL_SCANCODE_AC_STOP, "AC Stop" }, + { "kNUMPAD_AC_REFRESH", SDL_SCANCODE_AC_REFRESH, "AC Refresh" }, + { "kNUMPAD_AC_BOOKMARKS", SDL_SCANCODE_AC_BOOKMARKS, "AC Bookmarks" }, + + { "kBRIGHTNESSDOWN", SDL_SCANCODE_BRIGHTNESSDOWN, "Brightness Down" }, + { "kBRIGHTNESSUP", SDL_SCANCODE_BRIGHTNESSUP, "Brightness Up" }, + { "kDISPLAYSWITCH", SDL_SCANCODE_DISPLAYSWITCH, "Display Switch" }, + + { "kKBDILLUMTOGGLE)", SDL_SCANCODE_KBDILLUMTOGGLE, "Illum Toogle" }, + { "kKBDILLUMDOWN", SDL_SCANCODE_KBDILLUMDOWN, "Illum Down" }, + { "kKBDILLUMUP", SDL_SCANCODE_KBDILLUMUP, "Illum Up" }, + + { "kEJECT", SDL_SCANCODE_EJECT, "Eject" }, + { "kSLEEP", SDL_SCANCODE_SLEEP, "Sleep" }, + + { "kAPP1", SDL_SCANCODE_APP1, "App 1" }, + { "kAPP2", SDL_SCANCODE_APP2, "App 2" }, + { nullptr, -1, "(null)" } +}; + void initialize_bindings() { #ifdef DEBUG @@ -67,6 +452,28 @@ pcstr id_to_action_name(EGameActions _id) return NULL; } +EGameActions action_name_to_id(pcstr _name) +{ + _action* action = action_name_to_ptr(_name); + if (action) + return action->id; + else + return kNOTBINDED; +} + +_action* action_name_to_ptr(pcstr _name) +{ + int idx = 0; + while (actions[idx].action_name) + { + if (!xr_stricmp(_name, actions[idx].action_name)) + return &actions[idx]; + ++idx; + } + Msg("! cant find corresponding [id] for '%s'", _name); + return NULL; +} + pcstr dik_to_keyname(int _dik) { _keyboard* kb = dik_to_ptr(_dik, true); @@ -87,7 +494,28 @@ _keyboard* dik_to_ptr(int _dik, bool bSafe) ++idx; } if (!bSafe) - Msg("! [dik_to_ptr] cant find corresponding '_keyboard' for dik '%d'", _dik); + Msg("! cant find corresponding [_keyboard] for dik"); + return NULL; +} + +int keyname_to_dik(pcstr _name) +{ + _keyboard* _kb = keyname_to_ptr(_name); + return _kb->dik; +} + +_keyboard* keyname_to_ptr(pcstr _name) +{ + int idx = 0; + while (keyboards[idx].key_name) + { + _keyboard& kb = keyboards[idx]; + if (!xr_stricmp(_name, kb.key_name)) + return &keyboards[idx]; + ++idx; + } + + Msg("! cant find corresponding [_keyboard*] for keyname %s", _name); return NULL; } @@ -97,6 +525,37 @@ bool is_group_not_conflicted(_key_group g1, _key_group g2) } bool is_group_matching(_key_group g1, _key_group g2) { return ((g1 == g2) || (g1 == _both) || (g2 == _both)); } +bool is_binded(EGameActions _action_id, int _dik) +{ + _binding* pbinding = &g_key_bindings[_action_id]; + if (pbinding->m_keyboard[0] && pbinding->m_keyboard[0]->dik == _dik) + return true; + + if (pbinding->m_keyboard[1] && pbinding->m_keyboard[1]->dik == _dik) + return true; + + return false; +} + +int get_action_dik(EGameActions _action_id, int idx) +{ + _binding* pbinding = &g_key_bindings[_action_id]; + + if (idx == -1) + { + if (pbinding->m_keyboard[0]) + return pbinding->m_keyboard[0]->dik; + + if (pbinding->m_keyboard[1]) + return pbinding->m_keyboard[1]->dik; + } + else + { + if (pbinding->m_keyboard[idx]) + return pbinding->m_keyboard[idx]->dik; + } + return SDL_SCANCODE_UNKNOWN; +} EGameActions get_binded_action(int _dik) { @@ -118,6 +577,33 @@ EGameActions get_binded_action(int _dik) return kNOTBINDED; } +void GetActionAllBinding(LPCSTR _action, char* dst_buff, int dst_buff_sz) +{ + int action_id = action_name_to_id(_action); + _binding* pbinding = &g_key_bindings[action_id]; + + string128 prim; + string128 sec; + prim[0] = 0; + sec[0] = 0; + + if (pbinding->m_keyboard[0]) + { + xr_strcpy(prim, pbinding->m_keyboard[0]->key_local_name.c_str()); + } + if (pbinding->m_keyboard[1]) + { + xr_strcpy(sec, pbinding->m_keyboard[1]->key_local_name.c_str()); + } + if (NULL == pbinding->m_keyboard[0] && NULL == pbinding->m_keyboard[1]) + { + xr_sprintf(dst_buff, dst_buff_sz, "%s", CStringTable().translate("st_key_notbinded").c_str()); + } + else + xr_sprintf( + dst_buff, dst_buff_sz, "%s%s%s", prim[0] ? prim : "", (sec[0] && prim[0]) ? " , " : "", sec[0] ? sec : ""); +} + ConsoleBindCmds bindConsoleCmds; BOOL bRemapped = FALSE; diff --git a/src/xrGame/xr_level_controller.h b/src/xrGame/xr_level_controller.h index a46046a5811..021775ecc58 100644 --- a/src/xrGame/xr_level_controller.h +++ b/src/xrGame/xr_level_controller.h @@ -2,14 +2,142 @@ #include "xrCore/xrstring.h" #include "xrCommon/xr_string.h" #include "xrCommon/xr_map.h" -#include "xrEngine/xr_input_xinput.h" +#include "xrEngine/xr_input.h" // Don't remove this include + +enum EGameActions +{ + kLEFT, + kRIGHT, + kUP, + kDOWN, + kJUMP, + kCROUCH, + kACCEL, + kSPRINT_TOGGLE, + + kFWD, + kBACK, + kL_STRAFE, + kR_STRAFE, + + kL_LOOKOUT, + kR_LOOKOUT, + + kCAM_1, + kCAM_2, + kCAM_3, + kCAM_ZOOM_IN, + kCAM_ZOOM_OUT, + + kTORCH, + kNIGHT_VISION, + kDETECTOR, + kWPN_1, + kWPN_2, + kWPN_3, + kWPN_4, + kWPN_5, + kWPN_6, + kARTEFACT, + kWPN_NEXT, + kWPN_FIRE, + kWPN_ZOOM, + kWPN_ZOOM_INC, + kWPN_ZOOM_DEC, + kWPN_RELOAD, + kWPN_FUNC, + kWPN_FIREMODE_PREV, + kWPN_FIREMODE_NEXT, + + kPAUSE, + kDROP, + kUSE, + kSCORES, + kCHAT, + kCHAT_TEAM, + kSCREENSHOT, + kQUIT, + kCONSOLE, + kINVENTORY, + kBUY, + kSKIN, + kTEAM, + kACTIVE_JOBS, + + kVOTE_BEGIN, + kSHOW_ADMIN_MENU, + kVOTE, + kVOTEYES, + kVOTENO, + + kNEXT_SLOT, + kPREV_SLOT, + + kSPEECH_MENU_0, + kSPEECH_MENU_1, + + kQUICK_USE_1, + kQUICK_USE_2, + kQUICK_USE_3, + kQUICK_USE_4, + + kQUICK_SAVE, + kQUICK_LOAD, + kALIFE_CMD, + + kLASTACTION, + kNOTBINDED, + kFORCEDWORD = u32(-1) +}; + +struct _keyboard +{ + pcstr key_name; + int dik; + xr_string key_local_name; +}; +enum _key_group +{ + _both = (1 << 0), + _sp = _both | (1 << 1), + _mp = _both | (1 << 2), +}; + +extern _key_group g_current_keygroup; bool is_group_not_conflicted(_key_group g1, _key_group g2); +struct _action +{ + pcstr action_name; + EGameActions id; + _key_group key_group; +}; + pcstr dik_to_keyname(int _dik); +int keyname_to_dik(pcstr _name); +_keyboard* keyname_to_ptr(pcstr _name); _keyboard* dik_to_ptr(int _dik, bool bSafe); pcstr id_to_action_name(EGameActions _id); +EGameActions action_name_to_id(pcstr _name); +_action* action_name_to_ptr(pcstr _name); + +extern _action actions[]; +// extern _keyboard keyboards[]; +// extern xr_vector<_keyboard> keyboards; + +#define bindings_count kLASTACTION +struct _binding +{ + _action* m_action; + _keyboard* m_keyboard[2]; +}; + +extern _binding g_key_bindings[]; + +bool is_binded(EGameActions action_id, int dik); +int get_action_dik(EGameActions action_id, int idx = -1); EGameActions get_binded_action(int dik); extern void CCC_RegisterInput(); @@ -31,4 +159,6 @@ class ConsoleBindCmds void save(IWriter* F); }; +void GetActionAllBinding(LPCSTR action, char* dst_buff, int dst_buff_sz); + extern ConsoleBindCmds bindConsoleCmds; diff --git a/src/xrGame/xrgame_dll_detach.cpp b/src/xrGame/xrgame_dll_detach.cpp index b5eb3e46195..74cbf0ba798 100644 --- a/src/xrGame/xrgame_dll_detach.cpp +++ b/src/xrGame/xrgame_dll_detach.cpp @@ -7,7 +7,7 @@ #include "entity_alive.h" #include "ui/UIInventoryUtilities.h" #include "UI/UIXmlInit.h" -#include "xrUICore/XML/UITextureMaster.h" +#include "UI/UItextureMaster.h" #include "InfoPortion.h" #include "PhraseDialog.h" @@ -30,7 +30,14 @@ typedef xr_vector> STORY_PAIRS; extern STORY_PAIRS story_ids; extern STORY_PAIRS spawn_story_ids; +extern void show_smart_cast_stats(); +extern void clear_smart_cast_stats(); +extern void release_smart_cast_stats(); +extern void dump_list_wnd(); +extern void dump_list_lines(); +extern void dump_list_sublines(); extern void clean_wnd_rects(); +extern void dump_list_xmls(); extern void CreateUIGeom(); extern void DestroyUIGeom(); extern void InitHudSoundSettings(); @@ -75,6 +82,12 @@ void clean_game_globals() if (!GEnv.isDedicatedServer) { + //. CInfoPortion::DeleteSharedData (); + //. CInfoPortion::DeleteIdToIndexData (); + + //. CEncyclopediaArticle::DeleteSharedData (); + //. CEncyclopediaArticle::DeleteIdToIndexData (); + CPhraseDialog::DeleteSharedData(); CPhraseDialog::DeleteIdToIndexData(); @@ -94,6 +107,8 @@ void clean_game_globals() // static shader for blood CEntityAlive::UnloadBloodyWallmarks(); CEntityAlive::UnloadFireParticles(); + //очищение памяти таблицы строк + CStringTable::Destroy(); // Очищение таблицы цветов CUIXmlInit::DeleteColorDefs(); // Очищение таблицы идентификаторов рангов и отношений сталкеров @@ -104,13 +119,17 @@ void clean_game_globals() #ifdef DEBUG // XXX nitrocaster PROFILER: temporarily disabled due to linkage issues // xr_delete (g_profiler); - // release_smart_cast_stats(); + release_smart_cast_stats(); #endif RELATION_REGISTRY::clear_relation_registry(); + dump_list_wnd(); + dump_list_lines(); + dump_list_sublines(); clean_wnd_rects(); xr_delete(g_uiSpotXml); + dump_list_xmls(); DestroyUIGeom(); xr_delete(pWpnScopeXml); CUITextureMaster::FreeTexInfo(); diff --git a/src/xrScriptEngine/xrScriptEngine.vcxproj b/src/xrScriptEngine/xrScriptEngine.vcxproj index 390afddcc96..d93441e732d 100644 --- a/src/xrScriptEngine/xrScriptEngine.vcxproj +++ b/src/xrScriptEngine/xrScriptEngine.vcxproj @@ -155,7 +155,6 @@ - diff --git a/src/xrScriptEngine/xrScriptEngine.vcxproj.filters b/src/xrScriptEngine/xrScriptEngine.vcxproj.filters index d5227082777..685c2339f53 100644 --- a/src/xrScriptEngine/xrScriptEngine.vcxproj.filters +++ b/src/xrScriptEngine/xrScriptEngine.vcxproj.filters @@ -28,9 +28,6 @@ {48cb416c-d090-4ae9-b4e3-56abea843d93} - - {b1b81af3-4b79-4435-92cc-5226c808c8ca} - @@ -117,9 +114,6 @@ Engine - - ScriptCallbackEx - @@ -165,7 +159,4 @@ Engine - - - \ No newline at end of file diff --git a/src/xrServerEntities/character_info.cpp b/src/xrServerEntities/character_info.cpp index 2875721f89f..b11c4fc1afa 100644 --- a/src/xrServerEntities/character_info.cpp +++ b/src/xrServerEntities/character_info.cpp @@ -7,11 +7,11 @@ #include "character_info.h" #ifdef XRGAME_EXPORTS -#include "xrUICore/XML/xrUIXmlParser.h" +#include "ui/xrUIXmlParser.h" #include "PhraseDialog.h" #include "xrServer_Objects_ALife_Monsters.h" #else // XRGAME_EXPORTS -#include "xrUICore/XML/xrUIXmlParser.h" +#include "xrUIXmlParser.h" #endif // XRGAME_EXPORTS ////////////////////////////////////////////////////////////////////////// diff --git a/src/xrServerEntities/smart_cast.cpp b/src/xrServerEntities/smart_cast.cpp index 2f1ccd2973d..3e8edc61ea7 100644 --- a/src/xrServerEntities/smart_cast.cpp +++ b/src/xrServerEntities/smart_cast.cpp @@ -16,7 +16,7 @@ #include "actor.h" #include "custommonster.h" #include "ai/stalker/ai_stalker.h" -#include "xrUICore/Windows/UIWindow.h" +#include "ui/uiwindow.h" #include "customzone.h" #include "weapon.h" #include "cameraeffector.h" diff --git a/src/xrServerEntities/specific_character.cpp b/src/xrServerEntities/specific_character.cpp index 6c8fe9f2ba7..ecccd01e66e 100644 --- a/src/xrServerEntities/specific_character.cpp +++ b/src/xrServerEntities/specific_character.cpp @@ -101,7 +101,7 @@ void CSpecificCharacter::load_shared(LPCSTR) //игровое имя персонажа data()->m_sGameName = pXML->Read("name", 0, ""); - data()->m_sBioText = StringTable().translate(pXML->Read("bio", 0, "")); + data()->m_sBioText = CStringTable().translate(pXML->Read("bio", 0, "")); data()->m_fPanic_threshold = pXML->ReadFlt("panic_threshold", 0, 0.f); data()->m_fHitProbabilityFactor = pXML->ReadFlt("hit_probability_factor", 0, 1.f); diff --git a/src/xrServerEntities/xml_str_id_loader.h b/src/xrServerEntities/xml_str_id_loader.h index 8de14378467..25487fddb42 100644 --- a/src/xrServerEntities/xml_str_id_loader.h +++ b/src/xrServerEntities/xml_str_id_loader.h @@ -1,9 +1,9 @@ #pragma once #ifdef XRGAME_EXPORTS -#include "xrUICore/XML/xrUIXmlParser.h" +#include "ui/xrUIXmlParser.h" #else // XRGAME_EXPORTS -#include "xrUICore/XML/xrUIXmlParser.h" +#include "xrUIXmlParser.h" #include "Common/object_broker.h" #endif // XRGAME_EXPORTS diff --git a/src/xrServerEntities/xrServer_Objects_ALife_Monsters.cpp b/src/xrServerEntities/xrServer_Objects_ALife_Monsters.cpp index 99ee7861c2d..2b2334649e5 100644 --- a/src/xrServerEntities/xrServer_Objects_ALife_Monsters.cpp +++ b/src/xrServerEntities/xrServer_Objects_ALife_Monsters.cpp @@ -429,7 +429,7 @@ void CSE_ALifeTraderAbstract::set_specific_character(shared_str new_spec_char) if (NO_REPUTATION == m_reputation) m_reputation = selected_char.Reputation(); - m_character_name = *(StringTable().translate(selected_char.Name())); + m_character_name = *(CStringTable().translate(selected_char.Name())); LPCSTR gen_name = "GENERATE_NAME_"; if (strstr(m_character_name.c_str(), gen_name)) @@ -447,14 +447,14 @@ void CSE_ALifeTraderAbstract::set_specific_character(shared_str new_spec_char) n += subset; n += "_"; n += xr_itoa(::Random.randI(name_cnt), S, 10); - m_character_name = *(StringTable().translate(n.c_str())); + m_character_name = *(CStringTable().translate(n.c_str())); m_character_name += " "; n = "lname_"; n += subset; n += "_"; n += xr_itoa(::Random.randI(last_name_cnt), S, 10); - m_character_name += *(StringTable().translate(n.c_str())); + m_character_name += *(CStringTable().translate(n.c_str())); } u32 min_m = selected_char.MoneyDef().min_money; u32 max_m = selected_char.MoneyDef().max_money; diff --git a/src/xrUICore/CMakeLists.txt b/src/xrUICore/CMakeLists.txt deleted file mode 100644 index c5b62c33eb2..00000000000 --- a/src/xrUICore/CMakeLists.txt +++ /dev/null @@ -1,79 +0,0 @@ -cmake_minimum_required(VERSION 3.8) - -project(xrUICore) - -file(GLOB ARROW arrow/*.h arrow/*.cpp) -file(GLOB BUTTONS Buttons/*.h Buttons/*.cpp) -file(GLOB CALLBACKS Callbacks/*.h Callbacks/*.cpp) -file(GLOB COMBO_BOX ComboBox/*.h ComboBox/*.cpp) -file(GLOB CURSOR Cursor/*.h Cursor/*.cpp) -file(GLOB EDIT_BOX EditBox/*.h EditBox/*.cpp) -file(GLOB FONT_MANAGER FontManager/*.h FontManager/*.cpp) -file(GLOB HINT Hint/*.h Hint/*.cpp) -file(GLOB INTERACTIVE_BACKGROUND InteractiveBackground/*.h InteractiveBackground/*.cpp) -file(GLOB LINES Lines/*.h Lines/*.cpp) -file(GLOB LIST_BOX ListBox/*.h ListBox/*.cpp) -file(GLOB MESSAGE_BOX MessageBox/*.h MessageBox/*.cpp) -file(GLOB OPTIONS Options/*.h Options/*.cpp) -set(PCH pch.cpp pch.hpp) -file(GLOB PROGRESS_BAR ProgressBar/*.h ProgressBar/*.cpp) -file(GLOB PROPERTIES_BOX PropertiesBox/*.h PropertiesBox/*.cpp) -file(GLOB SCROLL_BAR ScrollBar/*.h ScrollBar/*.cpp) -file(GLOB SCROLL_VIEW ScrollView/*.h ScrollView/*.cpp) -file(GLOB SPIN_BOX SpinBox/*.h SpinBox/*.cpp) -file(GLOB STATIC_WINDS Static/*.h Static/*.cpp) -file(GLOB TAB_CONTROL TabControl/*.h TabControl/*.cpp) -file(GLOB TRACK_BAR TrackBar/*.h TrackBar/*.cpp) -file(GLOB WINDOWS Windows/*.h Windows/*.cpp) -file(GLOB XML XML/*.h XML/*.cpp) -set(GENERAL ui_base.cpp ui_base.h ui_defs.h uiabstract.h UIMessages.h) - -###################################################### - -source_group("arrow" FILES ${ARROW}) -source_group("Buttons" FILES ${BUTTONS}) -source_group("Callbacks" FILES ${CALLBACKS}) -source_group("ComboBox" FILES ${COMBO_BOX}) -source_group("Cursor" FILES ${CURSOR}) -source_group("EditBox" FILES ${EDIT_BOX}) -source_group("FontManager" FILES ${FONT_MANAGER}) -source_group("Hint" FILES ${HINT}) -source_group("InteractiveBackground" FILES ${INTERACTIVE_BACKGROUND}) -source_group("Lines" FILES ${LINES}) -source_group("ListBox" FILES ${LIST_BOX}) -source_group("MessageBox" FILES ${MESSAGE_BOX}) -source_group("Options" FILES ${OPTIONS}) -source_group("PCH" FILES ${PCH}) -source_group("ProgressBar" FILES ${PROGRESS_BAR}) -source_group("PropertiesBox" FILES ${PROPERTIES_BOX}) -source_group("ScrollBar" FILES ${SCROLL_BAR}) -source_group("ScrollView" FILES ${SCROLL_VIEW}) -source_group("SpinBox" FILES ${SPIN_BOX}) -source_group("Static" FILES ${STATIC_WINDS}) -source_group("TabControl" FILES ${TAB_CONTROL}) -source_group("TrackBar" FILES ${TRACK_BAR}) -source_group("Windows" FILES ${WINDOWS}) -source_group("XML" FILES ${XML}) -source_group("" FILES ${GENERAL}) - -########################################## - -message("path " ${CMAKE_CURRENT_SOURCE_DIR}) - -add_definitions(-DXRUICORE_EXPORTS -D_SECURE_SCL=0) - -add_compile_options(/fp:fast "/Yupch.hpp") -set_source_files_properties(${CMAKE_CURRENT_SOURCE_DIR}/pch.cpp PROPERTIES COMPILE_FLAGS /Yc) - -add_library(xrUICore SHARED ${ARROW} ${BUTTONS} ${CALLBACKS} - ${COMBO_BOX} ${CURSOR} - ${EDIT_BOX} ${FONT_MANAGER} ${HINT} - ${INTERACTIVE_BACKGROUND} ${LINES} ${LIST_BOX} - ${MESSAGE_BOX} ${OPTIONS} ${PCH} - ${PROGRESS_BAR} ${PROPERTIES_BOX} ${SCROLL_BAR} ${SCROLL_VIEW} ${SPIN_BOX} - ${STATIC_WINDS} ${TAB_CONTROL} ${TRACK_BAR} ${WINDOWS} ${XML} - ${GENERAL}) - -set_target_properties(xrUICore PROPERTIES PREFIX "") -target_include_directories(xrUICore PRIVATE ${CMAKE_CURRENT_SOURCE_DIR} ../../Externals/lzo/include) -target_link_libraries(xrUICore xrAPI pugixml xrScriptEngine LuaJIT xrEngine xrMiscMath xrCore luabind) diff --git a/src/xrUICore/EditBox/UIEditBox_script.cpp b/src/xrUICore/EditBox/UIEditBox_script.cpp deleted file mode 100644 index 6fe6621efeb..00000000000 --- a/src/xrUICore/EditBox/UIEditBox_script.cpp +++ /dev/null @@ -1,20 +0,0 @@ -#include "pch.hpp" -#include "UIEditBox.h" -#include "xrScriptEngine/ScriptExporter.hpp" - -using namespace luabind; - -SCRIPT_EXPORT(CUIEditBox, (CUIWindow), { - module(luaState) - [ - class_("CUICustomEdit") - .def("SetText", &CUICustomEdit::SetText) - .def("GetText", &CUICustomEdit::GetText) - .def("CaptureFocus", &CUICustomEdit::CaptureFocus) - .def("SetNextFocusCapturer", &CUICustomEdit::SetNextFocusCapturer), - - class_("CUIEditBox") - .def(constructor<>()) - .def("InitTexture", &CUIEditBox::InitTexture) - ]; -}); diff --git a/src/xrUICore/FontManager/FontManager.cpp b/src/xrUICore/FontManager/FontManager.cpp deleted file mode 100644 index 231bf8a6d9a..00000000000 --- a/src/xrUICore/FontManager/FontManager.cpp +++ /dev/null @@ -1,101 +0,0 @@ -#include "pch.hpp" -#include "FontManager.h" -#include "xrEngine/GameFont.h" - -CFontManager::CFontManager() -{ - Device.seqDeviceReset.Add(this, REG_PRIORITY_HIGH); - - m_all_fonts.push_back(&pFontMedium); // used cpp - m_all_fonts.push_back(&pFontDI); // used cpp - m_all_fonts.push_back(&pFontArial14); // used xml - m_all_fonts.push_back(&pFontGraffiti19Russian); - m_all_fonts.push_back(&pFontGraffiti22Russian); - m_all_fonts.push_back(&pFontLetterica16Russian); - m_all_fonts.push_back(&pFontLetterica18Russian); - m_all_fonts.push_back(&pFontGraffiti32Russian); - m_all_fonts.push_back(&pFontGraffiti50Russian); - m_all_fonts.push_back(&pFontLetterica25); - m_all_fonts.push_back(&pFontStat); - - FONTS_VEC_IT it = m_all_fonts.begin(); - FONTS_VEC_IT it_e = m_all_fonts.end(); - for (; it != it_e; ++it) - (**it) = NULL; - - InitializeFonts(); -} - -void CFontManager::InitializeFonts() -{ - InitializeFont(pFontMedium, "hud_font_medium"); - InitializeFont(pFontDI, "hud_font_di", CGameFont::fsGradient | CGameFont::fsDeviceIndependent); - InitializeFont(pFontArial14, "ui_font_arial_14"); - InitializeFont(pFontGraffiti19Russian, "ui_font_graffiti19_russian"); - InitializeFont(pFontGraffiti22Russian, "ui_font_graffiti22_russian"); - InitializeFont(pFontLetterica16Russian, "ui_font_letterica16_russian"); - InitializeFont(pFontLetterica18Russian, "ui_font_letterica18_russian"); - InitializeFont(pFontGraffiti32Russian, "ui_font_graff_32"); - InitializeFont(pFontGraffiti50Russian, "ui_font_graff_50"); - InitializeFont(pFontLetterica25, "ui_font_letter_25"); - InitializeFont(pFontStat, "stat_font", CGameFont::fsDeviceIndependent); - pFontStat->SetInterval(0.75f, 1.0f); -} - -LPCSTR CFontManager::GetFontTexName(LPCSTR section) -{ - constexpr pcstr tex_names[] = { "texture800", "texture", "texture1600" }; - int def_idx = 1; // default 1024x768 - int idx = def_idx; - - u32 h = Device.dwHeight; - - if (h <= 600) - idx = 0; - else if (h < 1024) - idx = 1; - else - idx = 2; - - while (idx >= 0) - { - if (pSettings->line_exist(section, tex_names[idx])) - return pSettings->r_string(section, tex_names[idx]); - --idx; - } - return pSettings->r_string(section, tex_names[def_idx]); -} - -void CFontManager::InitializeFont(CGameFont*& F, LPCSTR section, u32 flags) -{ - LPCSTR font_tex_name = GetFontTexName(section); - R_ASSERT(font_tex_name); - - LPCSTR sh_name = pSettings->r_string(section, "shader"); - if (!F) - F = new CGameFont(sh_name, font_tex_name, flags); - else - F->Initialize(sh_name, font_tex_name); - -#ifdef DEBUG - F->m_font_name = section; -#endif -} - -CFontManager::~CFontManager() -{ - Device.seqDeviceReset.Remove(this); - FONTS_VEC_IT it = m_all_fonts.begin(); - FONTS_VEC_IT it_e = m_all_fonts.end(); - for (; it != it_e; ++it) - xr_delete(**it); -} - -void CFontManager::Render() -{ - FONTS_VEC_IT it = m_all_fonts.begin(); - FONTS_VEC_IT it_e = m_all_fonts.end(); - for (; it != it_e; ++it) - (**it)->OnRender(); -} -void CFontManager::OnDeviceReset() { InitializeFonts(); } diff --git a/src/xrUICore/FontManager/FontManager.h b/src/xrUICore/FontManager/FontManager.h deleted file mode 100644 index af4af1aad0d..00000000000 --- a/src/xrUICore/FontManager/FontManager.h +++ /dev/null @@ -1,33 +0,0 @@ -#pragma once - - -struct XRUICORE_API CFontManager : public pureDeviceReset -{ - CFontManager(); - ~CFontManager(); - - typedef xr_vector FONTS_VEC; - typedef FONTS_VEC::iterator FONTS_VEC_IT; - FONTS_VEC m_all_fonts; - void Render(); - - // hud font - CGameFont* pFontMedium; - CGameFont* pFontDI; - - CGameFont* pFontArial14; - CGameFont* pFontGraffiti19Russian; - CGameFont* pFontGraffiti22Russian; - CGameFont* pFontLetterica16Russian; - CGameFont* pFontLetterica18Russian; - CGameFont* pFontGraffiti32Russian; - CGameFont* pFontGraffiti50Russian; - CGameFont* pFontLetterica25; - CGameFont* pFontStat; - - void InitializeFonts(); - void InitializeFont(CGameFont*& F, LPCSTR section, u32 flags = 0); - LPCSTR GetFontTexName(LPCSTR section); - - virtual void OnDeviceReset(); -}; diff --git a/src/xrUICore/ListBox/UIListBox_script.cpp b/src/xrUICore/ListBox/UIListBox_script.cpp deleted file mode 100644 index 506b59d72b1..00000000000 --- a/src/xrUICore/ListBox/UIListBox_script.cpp +++ /dev/null @@ -1,77 +0,0 @@ -#include "pch.hpp" -#include "UIListBox.h" -#include "UIListBoxItem.h" -#include "UIListBoxItemMsgChain.h" -#include "SpinBox/UISpinText.h" -#include "ComboBox/UIComboBox.h" -#include "xrScriptEngine/ScriptExporter.hpp" - -using namespace luabind; -using namespace luabind::policy; - -struct CUIListBoxItemWrapper : public CUIListBoxItem, public luabind::wrap_base -{ - CUIListBoxItemWrapper(float h) : CUIListBoxItem(h) {} -}; - -struct CUIListBoxItemMsgChainWrapper : public CUIListBoxItemMsgChain, public luabind::wrap_base -{ - CUIListBoxItemMsgChainWrapper(float h) : CUIListBoxItemMsgChain(h) {} -}; - -// clang-format off -SCRIPT_EXPORT(CUIListBox, (CUIScrollView), { - module(luaState) - [ - class_("CUIListBox") - .def(constructor<>()) - .def("ShowSelectedItem", &CUIListBox::Show) - .def("RemoveAll", &CUIListBox::Clear) - .def("GetSize", &CUIListBox::GetSize) - .def("GetSelectedItem", &CUIListBox::GetSelectedItem) - .def("GetSelectedIndex", &CUIListBox::GetSelectedIDX) - .def("SetSelectedIndex", &CUIListBox::SetSelectedIDX) - .def("SetItemHeight", &CUIListBox::SetItemHeight) - .def("GetItemHeight", &CUIListBox::GetItemHeight) - .def("GetItemByIndex", &CUIListBox::GetItemByIDX) - .def("GetItem", &CUIListBox::GetItem) - .def("RemoveItem", &CUIListBox::RemoveWindow) - .def("AddTextItem", &CUIListBox::AddTextItem) - .def("AddExistingItem", &CUIListBox::AddExistingItem, adopt<2>()) - ]; -}); - -SCRIPT_EXPORT(CUIListBoxItem, (CUIFrameLineWnd), { - module(luaState) - [ - class_("CUIListBoxItem") - .def(constructor()) - .def("GetTextItem", &CUIListBoxItem::GetTextItem) - .def("AddTextField", &CUIListBoxItem::AddTextField) - .def("AddIconField", &CUIListBoxItem::AddIconField) - .def("SetTextColor", &CUIListBoxItem::SetTextColor) - ]; -}); - -SCRIPT_EXPORT(CUIListBoxItemMsgChain, (CUIListBoxItem), { - module(luaState) - [ - class_("CUIListBoxItemMsgChain") - .def(constructor()) - ]; -}); - -SCRIPT_EXPORT(EnumGameIDs, (), { - class EnumGameIDs - { - }; - module(luaState) - [ - class_("GAME_TYPE") - .enum_("gametype") - [ - value("GAME_UNKNOWN", int(-1)) - ] - ]; -}); -// clang-format on diff --git a/src/xrUICore/Options/UIOptionsManagerScript.h b/src/xrUICore/Options/UIOptionsManagerScript.h deleted file mode 100644 index f5754a45c44..00000000000 --- a/src/xrUICore/Options/UIOptionsManagerScript.h +++ /dev/null @@ -1,14 +0,0 @@ -#pragma once - -class CUIOptionsManagerScript -{ -public: - void SaveBackupValues(pcstr group); - void SetCurrentValues(pcstr group); - void SaveValues(pcstr group); - void UndoGroup(pcstr group); - void OptionsPostAccept(); - void SendMessage2Group(pcstr group, pcstr message); - bool NeedSystemRestart(); - bool NeedVidRestart(); -}; diff --git a/src/xrUICore/ProgressBar/UIProgressBar_script.cpp b/src/xrUICore/ProgressBar/UIProgressBar_script.cpp deleted file mode 100644 index deb4a773798..00000000000 --- a/src/xrUICore/ProgressBar/UIProgressBar_script.cpp +++ /dev/null @@ -1,19 +0,0 @@ -#include "pch.hpp" -#include "UIProgressBar.h" -#include "xrScriptEngine/ScriptExporter.hpp" - -using namespace luabind; - -SCRIPT_EXPORT(CUIProgressBar, (CUIWindow), -{ - module(luaState) - [ - class_("CUIProgressBar") - .def(constructor<>()) - .def("SetProgressPos", &CUIProgressBar::SetProgressPos) - .def("GetProgressPos", &CUIProgressBar::GetProgressPos) - - .def("GetRange_min", &CUIProgressBar::GetRange_min) - .def("GetRange_max", &CUIProgressBar::GetRange_max) - ]; -}); diff --git a/src/xrUICore/Windows/UIWindow_script.cpp b/src/xrUICore/Windows/UIWindow_script.cpp deleted file mode 100644 index c7cd76ea92d..00000000000 --- a/src/xrUICore/Windows/UIWindow_script.cpp +++ /dev/null @@ -1,186 +0,0 @@ -#include "pch.hpp" -#include "UIWindow.h" -#include "UIFrameWindow.h" -#include "UIFrameLineWnd.h" -#include "XML/UITextureMaster.h" -#include "ScrollView/UIScrollView.h" -#include "Hint/UIHint.h" -#include "Cursor/UICursor.h" -#include "xrScriptEngine/ScriptExporter.hpp" - -CFontManager& mngr() { return UI().Font(); } -// hud font -CGameFont* GetFontSmall() { return mngr().pFontStat; } -CGameFont* GetFontMedium() { return mngr().pFontMedium; } -CGameFont* GetFontDI() { return mngr().pFontDI; } -//шрифты для интерфейса -CGameFont* GetFontGraffiti19Russian() { return mngr().pFontGraffiti19Russian; } -CGameFont* GetFontGraffiti22Russian() { return mngr().pFontGraffiti22Russian; } -CGameFont* GetFontLetterica16Russian() { return mngr().pFontLetterica16Russian; } -CGameFont* GetFontLetterica18Russian() { return mngr().pFontLetterica18Russian; } -CGameFont* GetFontGraffiti32Russian() { return mngr().pFontGraffiti32Russian; } -CGameFont* GetFontGraffiti50Russian() { return mngr().pFontGraffiti50Russian; } -CGameFont* GetFontLetterica25() { return mngr().pFontLetterica25; } -int GetARGB(u16 a, u16 r, u16 g, u16 b) { return color_argb(a, r, g, b); } -const Fvector2 get_wnd_pos(CUIWindow* w) { return w->GetWndPos(); } - -Fvector2 GetCursorPosition_script() { return GetUICursor().GetCursorPosition(); } - -void SetCursorPosition_script(Fvector2& pos) { GetUICursor().SetUICursorPosition(pos); } - -using namespace luabind; -using namespace luabind::policy; - -// clang-format off -SCRIPT_EXPORT(CUIWindow, (), { - module(luaState) - [ - def("GetARGB", &GetARGB), def("GetFontSmall", &GetFontSmall), def("GetFontMedium", &GetFontMedium), - def("GetFontDI", &GetFontDI), def("GetFontGraffiti19Russian", &GetFontGraffiti19Russian), - def("GetFontGraffiti22Russian", &GetFontGraffiti22Russian), - def("GetFontLetterica16Russian", &GetFontLetterica16Russian), - def("GetFontLetterica18Russian", &GetFontLetterica18Russian), - def("GetFontGraffiti32Russian", &GetFontGraffiti32Russian), - def("GetFontGraffiti50Russian", &GetFontGraffiti50Russian), - def("GetFontLetterica25", &GetFontLetterica25), - def("GetCursorPosition", &GetCursorPosition_script), - def("SetCursorPosition", &SetCursorPosition_script), - def("FitInRect", &fit_in_rect), - - class_("CUIWindow") - .def(constructor<>()) - .def("AttachChild", &CUIWindow::AttachChild, adopt<2>()) - .def("DetachChild", &CUIWindow::DetachChild) - .def("SetAutoDelete", &CUIWindow::SetAutoDelete) - .def("IsAutoDelete", &CUIWindow::IsAutoDelete) - - .def("IsCursorOverWindow", &CUIWindow::CursorOverWindow) - .def("FocusReceiveTime", &CUIWindow::FocusReceiveTime) - .def("GetAbsoluteRect", &CUIWindow::GetAbsoluteRect) - - .def("SetWndRect", (void (CUIWindow::*)(Frect)) & CUIWindow::SetWndRect_script) - .def("SetWndPos", (void (CUIWindow::*)(Fvector2)) & CUIWindow::SetWndPos_script) - .def("SetWndSize", (void (CUIWindow::*)(Fvector2)) & CUIWindow::SetWndSize_script) - .def("GetWndPos", &get_wnd_pos) - .def("GetWidth", &CUIWindow::GetWidth) - .def("GetHeight", &CUIWindow::GetHeight) - - .def("Enable", &CUIWindow::Enable) - .def("IsEnabled", &CUIWindow::IsEnabled) - .def("Show", &CUIWindow::Show) - .def("IsShown", &CUIWindow::IsShown) - - .def("WindowName", &CUIWindow::WindowName_script) - .def("SetWindowName", &CUIWindow::SetWindowName) - ]; -}); - -SCRIPT_EXPORT(CUIFrameWindow, (CUIWindow), { - module(luaState)[class_("CUIFrameWindow") - .def(constructor<>()) - .def("SetWidth", &CUIFrameWindow::SetWidth) - .def("SetHeight", &CUIFrameWindow::SetHeight) - .def("SetColor", &CUIFrameWindow::SetTextureColor)]; -}); - -SCRIPT_EXPORT(CUIFrameLineWnd, (CUIWindow), { - module(luaState)[class_("CUIFrameLineWnd") - .def(constructor<>()) - .def("SetWidth", &CUIFrameLineWnd::SetWidth) - .def("SetHeight", &CUIFrameLineWnd::SetHeight) - .def("SetColor", &CUIFrameLineWnd::SetTextureColor)]; -}); - -SCRIPT_EXPORT(UIHint, (CUIWindow), { - module(luaState) - [ - class_("UIHint") - .def(constructor<>()) - .def("SetWidth", &UIHint::SetWidth) - .def("SetHeight", &UIHint::SetHeight) - .def("SetHintText", &UIHint::set_text) - .def("GetHintText", &UIHint::get_text) - ]; -}); - -SCRIPT_EXPORT(CUIScrollView, (CUIWindow), { - module(luaState) - [ - class_("CUIScrollView") - .def(constructor<>()) - .def("AddWindow", &CUIScrollView::AddWindow) - .def("RemoveWindow", &CUIScrollView::RemoveWindow) - .def("Clear", &CUIScrollView::Clear) - .def("ScrollToBegin", &CUIScrollView::ScrollToBegin) - .def("ScrollToEnd", &CUIScrollView::ScrollToEnd) - .def("GetMinScrollPos", &CUIScrollView::GetMinScrollPos) - .def("GetMaxScrollPos", &CUIScrollView::GetMaxScrollPos) - .def("GetCurrentScrollPos", &CUIScrollView::GetCurrentScrollPos) - .def("SetFixedScrollBar", &CUIScrollView::SetFixedScrollBar) - .def("SetScrollPos", &CUIScrollView::SetScrollPos) - ]; -}); - -SCRIPT_EXPORT(EnumUIMessages, (), { - class EnumUIMessages - { - }; - module(luaState) - [ - class_("ui_events") - .enum_("events") - [ - // CUIWindow - value("WINDOW_LBUTTON_DOWN", int(WINDOW_LBUTTON_DOWN)), - value("WINDOW_RBUTTON_DOWN", int(WINDOW_RBUTTON_DOWN)), - value("WINDOW_LBUTTON_UP", int(WINDOW_LBUTTON_UP)), - value("WINDOW_RBUTTON_UP", int(WINDOW_RBUTTON_UP)), - value("WINDOW_MOUSE_MOVE", int(WINDOW_MOUSE_MOVE)), - value("WINDOW_LBUTTON_DB_CLICK", int(WINDOW_LBUTTON_DB_CLICK)), - value("WINDOW_KEY_PRESSED", int(WINDOW_KEY_PRESSED)), - value("WINDOW_KEY_RELEASED", int(WINDOW_KEY_RELEASED)), - value("WINDOW_KEYBOARD_CAPTURE_LOST", int(WINDOW_KEYBOARD_CAPTURE_LOST)), - - // CUIButton - value("BUTTON_CLICKED", int(BUTTON_CLICKED)), value("BUTTON_DOWN", int(BUTTON_DOWN)), - - // CUITabControl - value("TAB_CHANGED", int(TAB_CHANGED)), - - // CUICheckButton - value("CHECK_BUTTON_SET", int(CHECK_BUTTON_SET)), - value("CHECK_BUTTON_RESET", int(CHECK_BUTTON_RESET)), - - // CUIRadioButton - value("RADIOBUTTON_SET", int(RADIOBUTTON_SET)), - - // CUIScrollBox - value("SCROLLBOX_MOVE", int(SCROLLBOX_MOVE)), - - // CUIScrollBar - value("SCROLLBAR_VSCROLL", int(SCROLLBAR_VSCROLL)), - value("SCROLLBAR_HSCROLL", int(SCROLLBAR_HSCROLL)), - - // CUIListWnd - value("LIST_ITEM_CLICKED", int(LIST_ITEM_CLICKED)), - value("LIST_ITEM_SELECT", int(LIST_ITEM_SELECT)), - - // UIPropertiesBox - value("PROPERTY_CLICKED", int(PROPERTY_CLICKED)), - - // CUIMessageBox - value("MESSAGE_BOX_OK_CLICKED", int(MESSAGE_BOX_OK_CLICKED)), - value("MESSAGE_BOX_YES_CLICKED", int(MESSAGE_BOX_YES_CLICKED)), - value("MESSAGE_BOX_NO_CLICKED", int(MESSAGE_BOX_NO_CLICKED)), - value("MESSAGE_BOX_CANCEL_CLICKED", int(MESSAGE_BOX_CANCEL_CLICKED)), - value("MESSAGE_BOX_COPY_CLICKED", int(MESSAGE_BOX_COPY_CLICKED)), - value("MESSAGE_BOX_QUIT_GAME_CLICKED", int(MESSAGE_BOX_QUIT_GAME_CLICKED)), - value("MESSAGE_BOX_QUIT_WIN_CLICKED", int(MESSAGE_BOX_QUIT_WIN_CLICKED)), - - value("EDIT_TEXT_COMMIT", int(EDIT_TEXT_COMMIT)), - // CMainMenu - value("MAIN_MENU_RELOADED", int(MAIN_MENU_RELOADED)) - ] - ]; -}); -// clang-format on diff --git a/src/xrUICore/XML/UIXmlInitBase.cpp b/src/xrUICore/XML/UIXmlInitBase.cpp deleted file mode 100644 index 4e5ef5ad50e..00000000000 --- a/src/xrUICore/XML/UIXmlInitBase.cpp +++ /dev/null @@ -1,1215 +0,0 @@ -#include "pch.hpp" -#include "UIXmlInitBase.h" -#include "xrEngine/StringTable/IStringTable.h" -#include "Windows/UIFrameWindow.h" -#include "Buttons/UICheckButton.h" -#include "SpinBox/UICustomSpin.h" -#include "Buttons/UIRadioButton.h" -#include "ProgressBar/UIProgressBar.h" -#include "ProgressBar/UIProgressShape.h" -#include "TabControl/UITabControl.h" -#include "Static/UIAnimatedStatic.h" -#include "ListBox/UIListBox.h" -#include "ComboBox/UIComboBox.h" -#include "TrackBar/UITrackBar.h" - -#include "UITextureMaster.h" -#include "Lines/UILines.h" -#include "xrEngine/xr_input_xinput.h" - -#define ARIAL_FONT_NAME "arial" - -#define MEDIUM_FONT_NAME "medium" -#define SMALL_FONT_NAME "small" - -#define GRAFFITI19_FONT_NAME "graffiti19" -#define GRAFFITI22_FONT_NAME "graffiti22" -#define GRAFFITI32_FONT_NAME "graffiti32" -#define GRAFFITI50_FONT_NAME "graffiti50" - -#define LETTERICA16_FONT_NAME "letterica16" -#define LETTERICA18_FONT_NAME "letterica18" -#define LETTERICA25_FONT_NAME "letterica25" - -#define DI_FONT_NAME "di" - -////////////////////////////////////////////////////////////////////////// - -const char* const COLOR_DEFINITIONS = "color_defs.xml"; -CUIXmlInitBase::ColorDefs* CUIXmlInitBase::m_pColorDefs = NULL; - -////////////////////////////////////////////////////////////////////////// - -CUIXmlInitBase::CUIXmlInitBase() { InitColorDefs(); } -////////////////////////////////////////////////////////////////////////// - -CUIXmlInitBase::~CUIXmlInitBase() {} -////////////////////////////////////////////////////////////////////////// - -Frect CUIXmlInitBase::GetFRect(CUIXml& xml_doc, LPCSTR path, int index) -{ - R_ASSERT4(xml_doc.NavigateToNode(path, index), "XML node not found", path, xml_doc.m_xml_file_name); - Frect rect; - rect.set(0, 0, 0, 0); - rect.x1 = xml_doc.ReadAttribFlt(path, index, "x"); - rect.y1 = xml_doc.ReadAttribFlt(path, index, "y"); - rect.x2 = rect.x1 + xml_doc.ReadAttribFlt(path, index, "width"); - rect.y2 = rect.y1 + xml_doc.ReadAttribFlt(path, index, "height"); - - return rect; -} - -bool CUIXmlInitBase::InitWindow(CUIXml& xml_doc, LPCSTR path, int index, CUIWindow* pWnd) -{ - R_ASSERT4(xml_doc.NavigateToNode(path, index), "XML node not found", path, xml_doc.m_xml_file_name); - - Fvector2 pos, size; - pos.x = xml_doc.ReadAttribFlt(path, index, "x"); - pos.y = xml_doc.ReadAttribFlt(path, index, "y"); - InitAlignment(xml_doc, path, index, pos.x, pos.y, pWnd); - size.x = xml_doc.ReadAttribFlt(path, index, "width"); - size.y = xml_doc.ReadAttribFlt(path, index, "height"); - pWnd->SetWndPos(pos); - pWnd->SetWndSize(size); - - string512 buf; - - strconcat(sizeof(buf), buf, path, ":window_name"); - if (xml_doc.NavigateToNode(buf, index)) - pWnd->SetWindowName(xml_doc.Read(buf, index, NULL)); - - InitAutoStaticGroup(xml_doc, path, index, pWnd); - //. InitAutoFrameLineGroup (xml_doc, path, index, pWnd); - - return true; -} - -////////////////////////////////////////////////////////////////////////// - -bool CUIXmlInitBase::InitFrameWindow(CUIXml& xml_doc, LPCSTR path, int index, CUIFrameWindow* pWnd) -{ - R_ASSERT4(xml_doc.NavigateToNode(path, index), "XML node not found", path, xml_doc.m_xml_file_name); - - InitTexture(xml_doc, path, index, pWnd); - InitWindow(xml_doc, path, index, pWnd); - return true; -} - -bool CUIXmlInitBase::InitOptionsItem(CUIXml& xml_doc, LPCSTR path, int index, CUIOptionsItem* pWnd) -{ - string256 buf; - strconcat(sizeof(buf), buf, path, ":options_item"); - - if (xml_doc.NavigateToNode(buf, index)) - { - shared_str entry = xml_doc.ReadAttrib(buf, index, "entry"); - shared_str group = xml_doc.ReadAttrib(buf, index, "group"); - pWnd->AssignProps(entry, group); - - LPCSTR depends = xml_doc.ReadAttrib(buf, index, "depend", NULL); - if (depends) - { - CUIOptionsItem::ESystemDepends d = CUIOptionsItem::sdNothing; - - if (0 == xr_stricmp(depends, "vid")) - d = CUIOptionsItem::sdVidRestart; - else if (0 == xr_stricmp(depends, "snd")) - d = CUIOptionsItem::sdSndRestart; - else if (0 == xr_stricmp(depends, "ui")) - d = CUIOptionsItem::sdUIRestart; - else if (0 == xr_stricmp(depends, "restart")) - d = CUIOptionsItem::sdSystemRestart; - else if (0 == xr_stricmp(depends, "runtime")) - d = CUIOptionsItem::sdApplyOnChange; - else - Msg("! unknown param [%s] in optionsItem [%s]", depends, entry.c_str()); - - pWnd->SetSystemDepends(d); - } - return true; - } - else - return false; -} - -bool CUIXmlInitBase::InitStatic(CUIXml& xml_doc, LPCSTR path, int index, CUIStatic* pWnd) -{ - R_ASSERT4(xml_doc.NavigateToNode(path, index), "XML node not found", path, xml_doc.m_xml_file_name); - - InitWindow(xml_doc, path, index, pWnd); - - string256 buf; - InitText(xml_doc, strconcat(sizeof(buf), buf, path, ":text"), index, pWnd); - InitTexture(xml_doc, path, index, pWnd); - InitTextureOffset(xml_doc, path, index, pWnd); - - int flag = xml_doc.ReadAttribInt(path, index, "heading", 0); - pWnd->EnableHeading((flag) ? true : false); - - float heading_angle = xml_doc.ReadAttribFlt(path, index, "heading_angle", 0.0f); - if (!fis_zero(heading_angle)) - { - pWnd->EnableHeading(true); - pWnd->SetConstHeading(true); - pWnd->SetHeading(deg2rad(heading_angle)); - } - - LPCSTR str_flag = xml_doc.ReadAttrib(path, index, "light_anim", ""); - int flag_cyclic = xml_doc.ReadAttribInt(path, index, "la_cyclic", 1); - int flag_text = xml_doc.ReadAttribInt(path, index, "la_text", 1); - int flag_texture = xml_doc.ReadAttribInt(path, index, "la_texture", 1); - int flag_alpha = xml_doc.ReadAttribInt(path, index, "la_alpha", 0); - - u8 flags = 0; - if (flag_cyclic) - flags |= LA_CYCLIC; - if (flag_alpha) - flags |= LA_ONLYALPHA; - if (flag_text) - flags |= LA_TEXTCOLOR; - if (flag_texture) - flags |= LA_TEXTURECOLOR; - - pWnd->SetColorAnimation(str_flag, flags); - - str_flag = xml_doc.ReadAttrib(path, index, "xform_anim", ""); - flag_cyclic = xml_doc.ReadAttribInt(path, index, "xform_anim_cyclic", 1); - - pWnd->SetXformLightAnim(str_flag, (flag_cyclic) ? true : false); - - bool bComplexMode = xml_doc.ReadAttribInt(path, index, "complex_mode", 0) ? true : false; - if (bComplexMode) - pWnd->TextItemControl()->SetTextComplexMode(bComplexMode); - - pWnd->m_stat_hint_text = xml_doc.ReadAttrib(path, index, "hint", ""); - - return true; -} - -bool CUIXmlInitBase::InitTextWnd(CUIXml& xml_doc, LPCSTR path, int index, CUITextWnd* pWnd) -{ - R_ASSERT4(xml_doc.NavigateToNode(path, index), "XML node not found", path, xml_doc.m_xml_file_name); - - InitWindow(xml_doc, path, index, pWnd); - - string256 buf; - InitText(xml_doc, strconcat(sizeof(buf), buf, path, ":text"), index, &pWnd->TextItemControl()); - - LPCSTR str_flag = xml_doc.ReadAttrib(path, index, "light_anim", ""); - int flag_cyclic = xml_doc.ReadAttribInt(path, index, "la_cyclic", 1); - int flag_alpha = xml_doc.ReadAttribInt(path, index, "la_alpha", 0); - - u8 flags = LA_TEXTCOLOR; - if (flag_cyclic) - flags |= LA_CYCLIC; - if (flag_alpha) - flags |= LA_ONLYALPHA; - pWnd->SetColorAnimation(str_flag, flags); - - bool bComplexMode = xml_doc.ReadAttribInt(path, index, "complex_mode", 0) ? true : false; - if (bComplexMode) - pWnd->SetTextComplexMode(bComplexMode); - - strconcat(sizeof(buf), buf, path, ":texture"); - R_ASSERT3(NULL == xml_doc.NavigateToNode(buf, index), xml_doc.m_xml_file_name, buf); - - R_ASSERT(pWnd->GetChildWndList().size() == 0); - return true; -} - -bool CUIXmlInitBase::InitCheck(CUIXml& xml_doc, LPCSTR path, int index, CUICheckButton* pWnd) -{ - InitStatic(xml_doc, path, index, pWnd); - - string256 buf; - strconcat(sizeof(buf), buf, path, ":texture"); - LPCSTR texture = xml_doc.Read(buf, index, "ui_checker"); - - pWnd->InitCheckButton(pWnd->GetWndPos(), pWnd->GetWndSize(), texture); - - u32 color; - strconcat(sizeof(buf), buf, path, ":text_color:e"); - if (xml_doc.NavigateToNode(buf, index)) - { - color = GetColor(xml_doc, buf, index, 0x00); - pWnd->SetStateTextColor(color, S_Enabled); - } - - strconcat(sizeof(buf), buf, path, ":text_color:d"); - if (xml_doc.NavigateToNode(buf, index)) - { - color = GetColor(xml_doc, buf, index, 0x00); - pWnd->SetStateTextColor(color, S_Disabled); - } - - strconcat(sizeof(buf), buf, path, ":text_color:t"); - if (xml_doc.NavigateToNode(buf, index)) - { - color = GetColor(xml_doc, buf, index, 0x00); - pWnd->SetStateTextColor(color, S_Touched); - } - - strconcat(sizeof(buf), buf, path, ":text_color:h"); - if (xml_doc.NavigateToNode(buf, index)) - { - color = GetColor(xml_doc, buf, index, 0x00); - pWnd->SetStateTextColor(color, S_Highlighted); - } - - InitOptionsItem(xml_doc, path, index, pWnd); - - return true; -} - -bool CUIXmlInitBase::InitSpin(CUIXml& xml_doc, LPCSTR path, int index, CUICustomSpin* pWnd) -{ - InitWindow(xml_doc, path, index, pWnd); - InitOptionsItem(xml_doc, path, index, pWnd); - pWnd->InitSpin(pWnd->GetWndPos(), pWnd->GetWndSize()); - - string256 foo; - u32 color; - strconcat(sizeof(foo), foo, path, ":text_color:e"); - if (xml_doc.NavigateToNode(foo, index)) - { - color = GetColor(xml_doc, foo, index, 0x00); - pWnd->SetTextColor(color); - } - strconcat(sizeof(foo), foo, path, ":text_color:d"); - if (xml_doc.NavigateToNode(foo, index)) - { - color = GetColor(xml_doc, foo, index, 0x00); - pWnd->SetTextColorD(color); - } - - return true; -} - -bool CUIXmlInitBase::InitText(CUIXml& xml_doc, LPCSTR path, int index, CUIStatic* pWnd) -{ - if (!xml_doc.NavigateToNode(path, index)) - return false; - - return InitText(xml_doc, path, index, pWnd->TextItemControl()); -} - -bool CUIXmlInitBase::InitText(CUIXml& xml_doc, LPCSTR path, int index, CUILines* pLines) -{ - if (!xml_doc.NavigateToNode(path, index)) - return false; - - u32 color; - CGameFont* pTmpFont = NULL; - InitFont(xml_doc, path, index, color, pTmpFont); - pLines->SetTextColor(color); - R_ASSERT(pTmpFont); - pLines->SetFont(pTmpFont); - - // Load font alignment - shared_str al = xml_doc.ReadAttrib(path, index, "align"); - if (0 == xr_strcmp(al, "c")) - pLines->SetTextAlignment(CGameFont::alCenter); - else if (0 == xr_strcmp(al, "r")) - pLines->SetTextAlignment(CGameFont::alRight); - else if (0 == xr_strcmp(al, "l")) - pLines->SetTextAlignment(CGameFont::alLeft); - - al = xml_doc.ReadAttrib(path, index, "vert_align", ""); - - if (0 == xr_strcmp(al, "c")) - pLines->SetVTextAlignment(valCenter); - else if (0 == xr_strcmp(al, "b")) - pLines->SetVTextAlignment(valBotton); - else if (0 == xr_strcmp(al, "t")) - pLines->SetVTextAlignment(valTop); - - pLines->SetTextComplexMode(xml_doc.ReadAttribInt(path, index, "complex_mode", 0) ? true : false); - - // Text coordinates - float text_x = xml_doc.ReadAttribFlt(path, index, "x", 0); - float text_y = xml_doc.ReadAttribFlt(path, index, "y", 0); - - pLines->m_TextOffset.set(text_x, text_y); - - shared_str text = xml_doc.Read(path, index, NULL); - if (text.size()) - pLines->SetText(gStringTable->translate(text).c_str()); - - return true; -} - -bool CUIXmlInitBase::Init3tButton(CUIXml& xml_doc, LPCSTR path, int index, CUI3tButton* pWnd) -{ - R_ASSERT4(xml_doc.NavigateToNode(path, index), "XML node not found", path, xml_doc.m_xml_file_name); - - pWnd->m_frameline_mode = (xml_doc.ReadAttribInt(path, index, "frame_mode", 0) == 1) ? true : false; - - pWnd->vertical = (xml_doc.ReadAttribInt(path, index, "vertical", 0) == 1) ? true : false; - - InitWindow(xml_doc, path, index, pWnd); - pWnd->InitButton(pWnd->GetWndPos(), pWnd->GetWndSize()); - - string256 buf; - InitText(xml_doc, strconcat(sizeof(buf), buf, path, ":text"), index, pWnd); - u32 color; - - strconcat(sizeof(buf), buf, path, ":text_color:e"); - if (xml_doc.NavigateToNode(buf, index)) - { - color = GetColor(xml_doc, buf, index, 0x00); - pWnd->SetStateTextColor(color, S_Enabled); - } - - strconcat(sizeof(buf), buf, path, ":text_color:d"); - if (xml_doc.NavigateToNode(buf, index)) - { - color = GetColor(xml_doc, buf, index, 0x00); - pWnd->SetStateTextColor(color, S_Disabled); - } - - strconcat(sizeof(buf), buf, path, ":text_color:t"); - if (xml_doc.NavigateToNode(buf, index)) - { - color = GetColor(xml_doc, buf, index, 0x00); - pWnd->SetStateTextColor(color, S_Touched); - } - - strconcat(sizeof(buf), buf, path, ":text_color:h"); - if (xml_doc.NavigateToNode(buf, index)) - { - color = GetColor(xml_doc, buf, index, 0x00); - pWnd->SetStateTextColor(color, S_Highlighted); - } - - InitMultiTexture(xml_doc, path, index, pWnd); - InitTextureOffset(xml_doc, path, index, pWnd); - InitSound(xml_doc, path, index, pWnd); - - LPCSTR accel = xml_doc.ReadAttrib(path, index, "accel", NULL); - if (accel) - { - int acc = keyname_to_dik(accel); - pWnd->SetAccelerator(acc, 0); - } - accel = xml_doc.ReadAttrib(path, index, "accel_ext", NULL); - if (accel) - { - int acc = keyname_to_dik(accel); - pWnd->SetAccelerator(acc, 1); - } - - LPCSTR text_hint = xml_doc.ReadAttrib(path, index, "hint", NULL); - if (text_hint) - pWnd->m_hint_text = gStringTable->translate(text_hint); - - return true; -} - -bool CUIXmlInitBase::InitSound(CUIXml& xml_doc, LPCSTR path, int index, CUI3tButton* pWnd) -{ - string256 sound_h; - string256 sound_t; - strconcat(sizeof(sound_h), sound_h, path, ":sound_h"); - strconcat(sizeof(sound_t), sound_t, path, ":sound_t"); - - shared_str sound_h_result = xml_doc.Read(sound_h, index, ""); - shared_str sound_t_result = xml_doc.Read(sound_t, index, ""); - - if (xr_strlen(sound_h_result) != 0) - pWnd->InitSoundH(*sound_h_result); - - if (xr_strlen(sound_t_result) != 0) - pWnd->InitSoundT(*sound_t_result); - - return true; -} - -bool CUIXmlInitBase::InitProgressBar(CUIXml& xml_doc, LPCSTR path, int index, CUIProgressBar* pWnd) -{ - R_ASSERT4(xml_doc.NavigateToNode(path, index), "XML node not found", path, xml_doc.m_xml_file_name); - - InitAutoStaticGroup(xml_doc, path, index, pWnd); - - string256 buf; - Fvector2 pos, size; - pos.x = xml_doc.ReadAttribFlt(path, index, "x"); - pos.y = xml_doc.ReadAttribFlt(path, index, "y"); - - InitAlignment(xml_doc, path, index, pos.x, pos.y, pWnd); - - size.x = xml_doc.ReadAttribFlt(path, index, "width"); - size.y = xml_doc.ReadAttribFlt(path, index, "height"); - - CUIProgressBar::EOrientMode mode = CUIProgressBar::om_vert; - int mode_horz = xml_doc.ReadAttribInt(path, index, "horz", 0); - LPCSTR mode_str = xml_doc.ReadAttrib(path, index, "mode"); - if (mode_horz == 1) // om_horz - { - mode = CUIProgressBar::om_horz; - } - else if (xr_stricmp(mode_str, "horz") == 0) - { - mode = CUIProgressBar::om_horz; - } - else if (xr_stricmp(mode_str, "vert") == 0) - { - mode = CUIProgressBar::om_vert; - } - else if (xr_stricmp(mode_str, "back") == 0) - { - mode = CUIProgressBar::om_back; - } - else if (xr_stricmp(mode_str, "down") == 0) - { - mode = CUIProgressBar::om_down; - } - else if (xr_stricmp(mode_str, "from_center") == 0) - { - mode = CUIProgressBar::om_fromcenter; - } - else if (xr_stricmp(mode_str, "vert_from_center") == 0) - { - mode = CUIProgressBar::om_vfromcenter; - } - else if (xr_stricmp(mode_str, "to_center") == 0) - { - mode = CUIProgressBar::om_tocenter; - } - else if (xr_stricmp(mode_str, "vert_to_center") == 0) - { - mode = CUIProgressBar::om_vtocenter; - } - - pWnd->InitProgressBar(pos, size, mode); - - float min = xml_doc.ReadAttribFlt(path, index, "min"); - float max = xml_doc.ReadAttribFlt(path, index, "max"); - float ppos = xml_doc.ReadAttribFlt(path, index, "pos"); - - pWnd->SetRange(min, max); - pWnd->SetProgressPos(ppos); - pWnd->m_inertion = xml_doc.ReadAttribFlt(path, index, "inertion", 0.0f); - pWnd->colorSmoothing = xml_doc.ReadAttribInt(path, index, "color_smoothing"); - - // progress - strconcat(sizeof(buf), buf, path, ":progress"); - - if (!xml_doc.NavigateToNode(buf, index)) - return false; - - InitStatic(xml_doc, buf, index, &pWnd->m_UIProgressItem); - - pWnd->m_UIProgressItem.SetWndSize(pWnd->GetWndSize()); - - // background - strconcat(sizeof(buf), buf, path, ":background"); - - if (xml_doc.NavigateToNode(buf, index)) - { - InitStatic(xml_doc, buf, index, &pWnd->m_UIBackgroundItem); - pWnd->m_bBackgroundPresent = true; - pWnd->m_UIBackgroundItem.SetWndSize(pWnd->GetWndSize()); - } - - strconcat(sizeof(buf), buf, path, ":min_color"); - - if (xml_doc.NavigateToNode(buf, index)) - { - pWnd->m_bUseColor = true; - - u32 color = GetColor(xml_doc, buf, index, 0xff); - pWnd->m_minColor.set(color); - - strconcat(sizeof(buf), buf, path, ":middle_color"); - - color = GetColor(xml_doc, buf, index, 0xff); - pWnd->m_middleColor.set(color); - - strconcat(sizeof(buf), buf, path, ":max_color"); - - color = GetColor(xml_doc, buf, index, 0xff); - pWnd->m_maxColor.set(color); - } - - return true; -} - -bool CUIXmlInitBase::InitProgressShape(CUIXml& xml_doc, LPCSTR path, int index, CUIProgressShape* pWnd) -{ - R_ASSERT4(xml_doc.NavigateToNode(path, index), "XML node not found", path, xml_doc.m_xml_file_name); - - InitStatic(xml_doc, path, index, pWnd); - - if (xml_doc.ReadAttribInt(path, index, "text")) - pWnd->SetTextVisible(true); - - string256 _path; - - if (xml_doc.NavigateToNode(strconcat(sizeof(_path), _path, path, ":back"), index)) - { - R_ASSERT2(0, "unused node in progress shape "); - } - - if (xml_doc.NavigateToNode(strconcat(sizeof(_path), _path, path, ":front"), index)) - { - R_ASSERT2(0, "unused node in progress shape "); - } - // InitStatic(xml_doc, strconcat(sizeof(_path),_path, path, ":front"), index, pWnd->m_pTexture); - - pWnd->m_sectorCount = xml_doc.ReadAttribInt(path, index, "sector_count", 8); - pWnd->m_bClockwise = xml_doc.ReadAttribInt(path, index, "clockwise") ? true : false; - - pWnd->m_blend = (xml_doc.ReadAttribInt(path, index, "blend", 1) == 1) ? true : false; - pWnd->m_angle_begin = xml_doc.ReadAttribFlt(path, index, "begin_angle", 0.0f); - pWnd->m_angle_end = xml_doc.ReadAttribFlt(path, index, "end_angle", PI_MUL_2); - - return true; -} - -void CUIXmlInitBase::InitAutoStaticGroup(CUIXml& xml_doc, LPCSTR path, int index, CUIWindow* pParentWnd) -{ - XML_NODE _stored_root = xml_doc.GetLocalRoot(); - xml_doc.SetLocalRoot(xml_doc.NavigateToNode(path, index)); - - XML_NODE curr_root = xml_doc.GetLocalRoot(); - if (!curr_root) - curr_root = xml_doc.GetRoot(); - - XML_NODE node = curr_root.firstChild(); - int cnt_static = 0; - int cnt_frameline = 0; - int cnt_text = 0; - string512 buff; - - while (node) - { - LPCSTR node_name = node.value(); - if (0 == xr_stricmp(node_name, "auto_static")) - { - CUIStatic* pUIStatic = new CUIStatic(); - InitStatic(xml_doc, "auto_static", cnt_static, pUIStatic); - xr_sprintf(buff, "auto_static_%d", cnt_static); - pUIStatic->SetWindowName(buff); - pUIStatic->SetAutoDelete(true); - pParentWnd->AttachChild(pUIStatic); - - ++cnt_static; - } - else if (0 == xr_stricmp(node_name, "auto_frameline")) - { - CUIFrameLineWnd* pUIFrameline = new CUIFrameLineWnd(); - InitFrameLine(xml_doc, "auto_frameline", cnt_frameline, pUIFrameline); - xr_sprintf(buff, "auto_frameline_%d", cnt_frameline); - pUIFrameline->SetWindowName(buff); - pUIFrameline->SetAutoDelete(true); - pParentWnd->AttachChild(pUIFrameline); - - ++cnt_frameline; - } - else if (0 == xr_stricmp(node_name, "auto_text")) - { - ++cnt_text; - } - node = node.nextSibling(); - } - /* - CUIStatic* pUIStatic = NULL; - string64 sname; - for(int i=0; iSetWindowName (sname); - pUIStatic->SetAutoDelete (true); - pParentWnd->AttachChild (pUIStatic); - pUIStatic = NULL; - } - */ - xml_doc.SetLocalRoot(_stored_root); -} - -void CUIXmlInitBase::InitAutoFrameLineGroup(CUIXml& xml_doc, LPCSTR path, int index, CUIWindow* pParentWnd) -{ - int items_num = xml_doc.GetNodesNum(path, index, "auto_frameline"); - if (items_num == 0) - { - return; - } - XML_NODE _stored_root = xml_doc.GetLocalRoot(); - xml_doc.SetLocalRoot(xml_doc.NavigateToNode(path, index)); - - CUIFrameLineWnd* pUIFL = NULL; - string64 sname; - for (int i = 0; i < items_num; ++i) - { - pUIFL = new CUIFrameLineWnd(); - InitFrameLine(xml_doc, "auto_frameline", i, pUIFL); - xr_sprintf(sname, "auto_frameline_%d", i); - pUIFL->SetWindowName(sname); - pUIFL->SetAutoDelete(true); - pParentWnd->AttachChild(pUIFL); - pUIFL = NULL; - } - - xml_doc.SetLocalRoot(_stored_root); -} - -bool CUIXmlInitBase::InitFont(CUIXml& xml_doc, LPCSTR path, int index, u32& color, CGameFont*& pFnt) -{ - color = GetColor(xml_doc, path, index, 0xff); - - LPCSTR font_name = xml_doc.ReadAttrib(path, index, "font", NULL); - if (!font_name) - { - pFnt = NULL; - return false; - } - else - { - if (!xr_strcmp(font_name, GRAFFITI19_FONT_NAME)) - { - pFnt = UI().Font().pFontGraffiti19Russian; - } - else if (!xr_strcmp(font_name, GRAFFITI22_FONT_NAME)) - { - pFnt = UI().Font().pFontGraffiti22Russian; - } - else if (!xr_strcmp(font_name, GRAFFITI32_FONT_NAME)) - { - pFnt = UI().Font().pFontGraffiti32Russian; - } - else if (!xr_strcmp(font_name, GRAFFITI50_FONT_NAME)) - { - pFnt = UI().Font().pFontGraffiti50Russian; - } - else if (!xr_strcmp(font_name, "arial_14")) - { - pFnt = UI().Font().pFontArial14; - } - else if (!xr_strcmp(font_name, MEDIUM_FONT_NAME)) - { - pFnt = UI().Font().pFontMedium; - } - else if (!xr_strcmp(font_name, SMALL_FONT_NAME)) - { - pFnt = UI().Font().pFontStat; - } - else if (!xr_strcmp(font_name, LETTERICA16_FONT_NAME)) - { - pFnt = UI().Font().pFontLetterica16Russian; - } - else if (!xr_strcmp(font_name, LETTERICA18_FONT_NAME)) - { - pFnt = UI().Font().pFontLetterica18Russian; - } - else if (!xr_strcmp(font_name, LETTERICA25_FONT_NAME)) - { - pFnt = UI().Font().pFontLetterica25; - } - else if (!xr_strcmp(font_name, DI_FONT_NAME)) - { - pFnt = UI().Font().pFontDI; - } - else - { - R_ASSERT3(0, "unknown font", font_name); - pFnt = NULL; - } - } - return true; -} - -bool CUIXmlInitBase::InitTabControl(CUIXml& xml_doc, LPCSTR path, int index, CUITabControl* pWnd) -{ - R_ASSERT4(xml_doc.NavigateToNode(path, index), "XML node not found", path, xml_doc.m_xml_file_name); - - bool status = true; - - status &= InitWindow(xml_doc, path, index, pWnd); - InitOptionsItem(xml_doc, path, index, pWnd); - int tabsCount = xml_doc.GetNodesNum(path, index, "button"); - int radio = xml_doc.ReadAttribInt(path, index, "radio"); - - XML_NODE tab_node = xml_doc.NavigateToNode(path, index); - xml_doc.SetLocalRoot(tab_node); - - CUITabButton* newButton; - - for (int i = 0; i < tabsCount; ++i) - { - newButton = radio ? new CUIRadioButton() : new CUITabButton(); - status &= Init3tButton(xml_doc, "button", i, newButton); - newButton->m_btn_id = xml_doc.ReadAttrib("button", i, "id"); - R_ASSERT3(newButton->m_btn_id.size(), xml_doc.m_xml_file_name, path); - pWnd->AddItem(newButton); - } - - xml_doc.SetLocalRoot(xml_doc.GetRoot()); - - return status; -} - -////////////////////////////////////////////////////////////////////////// - -bool CUIXmlInitBase::InitFrameLine(CUIXml& xml_doc, LPCSTR path, int index, CUIFrameLineWnd* pWnd) -{ - R_ASSERT3(xml_doc.NavigateToNode(path, index), "XML node not found", path); - - string256 buf; - - bool stretch_flag = xml_doc.ReadAttribInt(path, index, "stretch") ? true : false; - R_ASSERT(stretch_flag == false); - //. pWnd->SetStretchTexture( stretch_flag ); - - Fvector2 pos, size; - pos.x = xml_doc.ReadAttribFlt(path, index, "x"); - pos.y = xml_doc.ReadAttribFlt(path, index, "y"); - - InitAlignment(xml_doc, path, index, pos.x, pos.y, pWnd); - - size.x = xml_doc.ReadAttribFlt(path, index, "width"); - size.y = xml_doc.ReadAttribFlt(path, index, "height"); - bool vertical = !!xml_doc.ReadAttribInt(path, index, "vertical"); - - strconcat(sizeof(buf), buf, path, ":texture"); - shared_str base_name = xml_doc.Read(buf, index, NULL); - - VERIFY(base_name); - - u32 color = GetColor(xml_doc, buf, index, 0xff); - pWnd->SetTextureColor(color); - - InitWindow(xml_doc, path, index, pWnd); - pWnd->InitFrameLineWnd(*base_name, pos, size, !vertical); - return true; -} - -bool CUIXmlInitBase::InitCustomEdit(CUIXml& xml_doc, LPCSTR path, int index, CUICustomEdit* pWnd) -{ - InitStatic(xml_doc, path, index, pWnd); - pWnd->InitCustomEdit(pWnd->GetWndPos(), pWnd->GetWndSize()); - - string256 foo; - u32 color; - strconcat(sizeof(foo), foo, path, ":text_color:e"); - if (xml_doc.NavigateToNode(foo, index)) - { - color = GetColor(xml_doc, foo, index, 0x00); - pWnd->TextItemControl()->SetTextColor(color); - } - - int max_count = xml_doc.ReadAttribInt(path, index, "max_symb_count", 0); - bool num_only = (xml_doc.ReadAttribInt(path, index, "num_only", 0) == 1); - bool read_only = (xml_doc.ReadAttribInt(path, index, "read_only", 0) == 1); - bool file_name_mode = (xml_doc.ReadAttribInt(path, index, "file_name_mode", 0) == 1); - - if (file_name_mode || read_only || num_only || 0 < max_count) - { - if (max_count <= 0) - { - max_count = 32; - } - pWnd->Init(max_count, num_only, read_only, file_name_mode); - } - - if (xml_doc.ReadAttribInt(path, index, "password", 0)) - { - pWnd->SetPasswordMode(); - } - return true; -} - -bool CUIXmlInitBase::InitEditBox(CUIXml& xml_doc, LPCSTR path, int index, CUIEditBox* pWnd) -{ - InitCustomEdit(xml_doc, path, index, pWnd); - - InitTexture(xml_doc, path, index, pWnd); - InitOptionsItem(xml_doc, path, index, pWnd); - - return true; -} - -////////////////////////////////////////////////////////////////////////// - -bool CUIXmlInitBase::InitAnimatedStatic(CUIXml& xml_doc, LPCSTR path, int index, CUIAnimatedStatic* pWnd) -{ - R_ASSERT4(xml_doc.NavigateToNode(path, index), "XML node not found", path, xml_doc.m_xml_file_name); - - InitStatic(xml_doc, path, index, pWnd); - - float x = xml_doc.ReadAttribFlt(path, index, "x_offset", 0); - float y = xml_doc.ReadAttribFlt(path, index, "y_offset", 0); - u32 framesCount = static_cast(xml_doc.ReadAttribInt(path, index, "frames", 0)); - u32 animDuration = static_cast(xml_doc.ReadAttribInt(path, index, "duration", 0)); - u32 animCols = static_cast(xml_doc.ReadAttribInt(path, index, "columns", 0)); - float frameWidth = xml_doc.ReadAttribFlt(path, index, "frame_width", 0); - float frameHeight = xml_doc.ReadAttribFlt(path, index, "frame_height", 0); - bool cyclic = !!xml_doc.ReadAttribInt(path, index, "cyclic", 0); - bool play = !!xml_doc.ReadAttribInt(path, index, "autoplay", 0); - - pWnd->SetFrameDimentions(frameWidth, frameHeight); - pWnd->SetFramesCount(framesCount); - pWnd->m_bCyclic = cyclic; - pWnd->SetAnimCols(animCols); - pWnd->SetAnimationDuration(animDuration); - pWnd->SetOffset(x, y); - pWnd->SetAnimPos(0.0f); - if (play) - pWnd->Play(); - - return true; -} - -bool CUIXmlInitBase::InitTexture(CUIXml& xml_doc, LPCSTR path, int index, ITextureOwner* pWnd) -{ - string256 buf; - LPCSTR texture = NULL; - LPCSTR shader = NULL; - strconcat(sizeof(buf), buf, path, ":texture"); - if (xml_doc.NavigateToNode(buf)) - { - texture = xml_doc.Read(buf, index, NULL); - shader = xml_doc.ReadAttrib(buf, index, "shader", NULL); - } - if (texture) - { - if (shader) - pWnd->InitTextureEx(texture, shader); - else - pWnd->InitTexture(texture); - } - //-------------------- - Frect rect; - rect.x1 = xml_doc.ReadAttribFlt(buf, index, "x", 0); - rect.y1 = xml_doc.ReadAttribFlt(buf, index, "y", 0); - rect.x2 = rect.x1 + xml_doc.ReadAttribFlt(buf, index, "width", 0); - rect.y2 = rect.y1 + xml_doc.ReadAttribFlt(buf, index, "height", 0); - - bool stretch_flag = xml_doc.ReadAttribInt(path, index, "stretch") ? true : false; - pWnd->SetStretchTexture(stretch_flag); - - u32 color = GetColor(xml_doc, buf, index, 0xff); - pWnd->SetTextureColor(color); - - if (rect.width() != 0 && rect.height() != 0) - pWnd->SetTextureRect(rect); - - return true; -} - -bool CUIXmlInitBase::InitTextureOffset(CUIXml& xml_doc, LPCSTR path, int index, CUIStatic* pWnd) -{ - string256 textureOffset; - if (0 == xr_strcmp(path, "")) - xr_strcpy(textureOffset, "texture_offset"); - else - strconcat(sizeof(textureOffset), textureOffset, path, ":texture_offset"); - - float x = xml_doc.ReadAttribFlt(textureOffset, index, "x"); - float y = xml_doc.ReadAttribFlt(textureOffset, index, "y"); - - pWnd->SetTextureOffset(x, y); - - return true; -} - -bool CUIXmlInitBase::InitMultiTexture(CUIXml& xml_doc, LPCSTR path, int index, CUI3tButton* pWnd) -{ - string256 buff; - bool success = false; - - strconcat(sizeof(buff), buff, path, ":texture"); - shared_str texture = xml_doc.Read(buff, index, NULL); - - if (texture.size() > 0) - { - pWnd->InitTexture(*texture); - return true; - } - - strconcat(sizeof(buff), buff, path, ":texture_e"); - texture = xml_doc.Read(buff, index, NULL); - if (texture.size()) - { - if (pWnd->m_background) - { - pWnd->m_background->InitState(S_Enabled, texture.c_str()); - } - else if (pWnd->m_back_frameline) - { - pWnd->m_back_frameline->InitState(S_Enabled, texture.c_str()); - pWnd->m_back_frameline->Get(S_Enabled)->SetHorizontal(!(pWnd->vertical)); - } - success = true; - } - - strconcat(sizeof(buff), buff, path, ":texture_t"); - texture = xml_doc.Read(buff, index, NULL); - if (texture.size()) - { - if (pWnd->m_background) - { - pWnd->m_background->InitState(S_Touched, texture.c_str()); - } - else if (pWnd->m_back_frameline) - { - pWnd->m_back_frameline->InitState(S_Touched, texture.c_str()); - pWnd->m_back_frameline->Get(S_Touched)->SetHorizontal(!(pWnd->vertical)); - } - success = true; - } - - strconcat(sizeof(buff), buff, path, ":texture_d"); - texture = xml_doc.Read(buff, index, NULL); - if (texture.size()) - { - if (pWnd->m_background) - { - pWnd->m_background->InitState(S_Disabled, texture.c_str()); - } - else if (pWnd->m_back_frameline) - { - pWnd->m_back_frameline->InitState(S_Disabled, texture.c_str()); - pWnd->m_back_frameline->Get(S_Disabled)->SetHorizontal(!(pWnd->vertical)); - } - success = true; - } - - strconcat(sizeof(buff), buff, path, ":texture_h"); - texture = xml_doc.Read(buff, index, NULL); - if (texture.size()) - { - if (pWnd->m_background) - { - pWnd->m_background->InitState(S_Highlighted, texture.c_str()); - } - else if (pWnd->m_back_frameline) - { - pWnd->m_back_frameline->InitState(S_Highlighted, texture.c_str()); - pWnd->m_back_frameline->Get(S_Highlighted)->SetHorizontal(!(pWnd->vertical)); - } - success = true; - } - - if (success) - pWnd->TextureOn(); - - return success; -} - -float CUIXmlInitBase::ApplyAlignX(float coord, u32 align) { return coord; } -////////////////////////////////////////////////////////////////////////// - -float CUIXmlInitBase::ApplyAlignY(float coord, u32 align) { return coord; } -////////////////////////////////////////////////////////////////////////// - -void CUIXmlInitBase::ApplyAlign(float& x, float& y, u32 align) -{ - x = ApplyAlignX(x, align); - y = ApplyAlignY(y, align); -} - -////////////////////////////////////////////////////////////////////////// - -bool CUIXmlInitBase::InitAlignment(CUIXml& xml_doc, const char* path, int index, float& x, float& y, CUIWindow* pWnd) -{ - xr_string wnd_alignment = xml_doc.ReadAttrib(path, index, "alignment", ""); - - if (strchr(wnd_alignment.c_str(), 'c')) - pWnd->SetAlignment(waCenter); - - // Alignment: right: "r", bottom: "b". Top, left - useless - shared_str alignStr = xml_doc.ReadAttrib(path, index, "align", ""); - - bool result = false; - - if (strchr(*alignStr, 'r')) - { - x = ApplyAlignX(x, alRight); - result = true; - } - if (strchr(*alignStr, 'b')) - { - y = ApplyAlignY(y, alBottom); - result = true; - } - if (strchr(*alignStr, 'c')) - { - ApplyAlign(x, y, alCenter); - result = true; - } - - return result; -} - -////////////////////////////////////////////////////////////////////////// - -void CUIXmlInitBase::InitColorDefs() -{ - if (NULL != m_pColorDefs) - return; - - m_pColorDefs = new ColorDefs(); - - CUIXml uiXml; - uiXml.Load(CONFIG_PATH, UI_PATH, COLOR_DEFINITIONS); - - int num = uiXml.GetNodesNum("colors", 0, "color"); - - shared_str name; - int r, b, g, a; - - for (int i = 0; i < num; ++i) - { - name = uiXml.ReadAttrib("color", i, "name", ""); - r = uiXml.ReadAttribInt("color", i, "r", 0); - g = uiXml.ReadAttribInt("color", i, "g", 0); - b = uiXml.ReadAttribInt("color", i, "b", 0); - a = uiXml.ReadAttribInt("color", i, "a", 255); - - (*m_pColorDefs)[name] = color_argb(a, r, g, b); - } -} - -bool CUIXmlInitBase::InitScrollView(CUIXml& xml_doc, LPCSTR path, int index, CUIScrollView* pWnd) -{ - R_ASSERT4(xml_doc.NavigateToNode(path, index), "XML node not found", path, xml_doc.m_xml_file_name); - - InitWindow(xml_doc, path, index, pWnd); - pWnd->SetRightIndention(xml_doc.ReadAttribFlt(path, index, "right_ident", 0.0f)); - pWnd->SetLeftIndention(xml_doc.ReadAttribFlt(path, index, "left_ident", 0.0f)); - pWnd->SetUpIndention(xml_doc.ReadAttribFlt(path, index, "top_indent", 0.0f)); - pWnd->SetDownIndention(xml_doc.ReadAttribFlt(path, index, "bottom_indent", 0.0f)); - - float vi = xml_doc.ReadAttribFlt(path, index, "vert_interval", 0.0f); - pWnd->m_vertInterval = (vi); - - bool bInverseDir = (1 == xml_doc.ReadAttribInt(path, index, "inverse_dir", 0)); - pWnd->m_flags.set(CUIScrollView::eInverseDir, bInverseDir); - - pWnd->SetScrollBarProfile(xml_doc.ReadAttrib(path, index, "scroll_profile", "default")); - - pWnd->InitScrollView(); - - bool bVertFlip = (1 == xml_doc.ReadAttribInt(path, index, "flip_vert", 0)); - pWnd->SetVertFlip(bVertFlip); - - bool b = (1 == xml_doc.ReadAttribInt(path, index, "always_show_scroll", 1)); - - pWnd->SetFixedScrollBar(b); - - b = (1 == xml_doc.ReadAttribInt(path, index, "can_select", 0)); - - pWnd->m_flags.set(CUIScrollView::eItemsSelectabe, b); - - ///////////////////////////////////////////////////////////////////// - int tabsCount = xml_doc.GetNodesNum(path, index, "text"); - - XML_NODE _stored_root = xml_doc.GetLocalRoot(); - xml_doc.SetLocalRoot(xml_doc.NavigateToNode(path, index)); - - for (int i = 0; i < tabsCount; ++i) - { - CUITextWnd* newText = new CUITextWnd(); - InitText(xml_doc, "text", i, &newText->TextItemControl()); - newText->SetTextComplexMode(true); - newText->SetWidth(pWnd->GetDesiredChildWidth()); - newText->AdjustHeightToText(); - pWnd->AddWindow(newText, true); - } - xml_doc.SetLocalRoot(_stored_root); - return true; -} - -bool CUIXmlInitBase::InitListBox(CUIXml& xml_doc, LPCSTR path, int index, CUIListBox* pWnd) -{ - InitScrollView(xml_doc, path, index, pWnd); - - string512 _path; - u32 t_color; - CGameFont* pFnt; - strconcat(sizeof(_path), _path, path, ":font"); - InitFont(xml_doc, _path, index, t_color, pFnt); - - pWnd->SetTextColor(t_color); - pWnd->SetFont(pFnt); - - float h = xml_doc.ReadAttribFlt(path, index, "item_height", 20.0f); - pWnd->SetItemHeight(h); - return true; -} - -bool CUIXmlInitBase::InitTrackBar(CUIXml& xml_doc, LPCSTR path, int index, CUITrackBar* pWnd) -{ - InitWindow(xml_doc, path, 0, pWnd); - pWnd->InitTrackBar(pWnd->GetWndPos(), pWnd->GetWndSize()); - int is_integer = xml_doc.ReadAttribInt(path, index, "is_integer", 0); - pWnd->SetType(!is_integer); - InitOptionsItem(xml_doc, path, 0, pWnd); - - int invert = xml_doc.ReadAttribInt(path, index, "invert", 0); - pWnd->SetInvert(!!invert); - float step = xml_doc.ReadAttribFlt(path, index, "step", 0.1f); - pWnd->SetStep(step); - - return true; -} - -bool CUIXmlInitBase::InitComboBox(CUIXml& xml_doc, LPCSTR path, int index, CUIComboBox* pWnd) -{ - u32 color; - CGameFont* pFont; - - pWnd->SetListLength(xml_doc.ReadAttribInt(path, index, "list_length", 4)); - - InitWindow(xml_doc, path, index, pWnd); - pWnd->InitComboBox(pWnd->GetWndPos(), pWnd->GetWidth()); - InitOptionsItem(xml_doc, path, index, pWnd); - - bool b = (1 == xml_doc.ReadAttribInt(path, index, "always_show_scroll", 1)); - - pWnd->m_list_box.SetFixedScrollBar(b); - - string512 _path; - strconcat(sizeof(_path), _path, path, ":list_font"); - InitFont(xml_doc, _path, index, color, pFont); - //. pWnd->SetFont (pFont); - pWnd->m_list_box.SetFont(pFont); - pWnd->m_list_box.SetTextColor(color); - - strconcat(sizeof(_path), _path, path, ":text_color:e"); - if (xml_doc.NavigateToNode(_path, index)) - { - color = GetColor(xml_doc, _path, index, 0x00); - pWnd->SetTextColor(color); - } - - strconcat(sizeof(_path), _path, path, ":text_color:d"); - if (xml_doc.NavigateToNode(_path, index)) - { - color = GetColor(xml_doc, _path, index, 0x00); - pWnd->SetTextColorD(color); - } - - return true; -} - -void CUIXmlInitBase::AssignColor(LPCSTR name, u32 clr) { (*m_pColorDefs)[name] = clr; } -u32 CUIXmlInitBase::GetColor(CUIXml& xml_doc, LPCSTR path, int index, u32 def_clr) -{ - LPCSTR clr_def = xml_doc.ReadAttrib(path, index, "color", NULL); - if (clr_def) - { - VERIFY(GetColorDefs()->find(clr_def) != GetColorDefs()->end()); - return (*m_pColorDefs)[clr_def]; - } - else - { - int r = xml_doc.ReadAttribInt(path, index, "r", def_clr); - int g = xml_doc.ReadAttribInt(path, index, "g", def_clr); - int b = xml_doc.ReadAttribInt(path, index, "b", def_clr); - int a = xml_doc.ReadAttribInt(path, index, "a", 0xff); - return color_argb(a, r, g, b); - } -} diff --git a/src/xrUICore/XML/UIXmlInitBase.h b/src/xrUICore/XML/UIXmlInitBase.h deleted file mode 100644 index 476cb02c713..00000000000 --- a/src/xrUICore/XML/UIXmlInitBase.h +++ /dev/null @@ -1,94 +0,0 @@ -#pragma once -#include "xrUICore/XML/xrUIXmlParser.h" -#include "xrCore/_rect.h" -#include "xrCommon/xr_map.h" - -class ITextureOwner; -class CUIWindow; -class CUIFrameWindow; -class CUIStaticItem; -class CUIStatic; -class CUICheckButton; -class CUICustomSpin; -class CUIButton; -class CUI3tButton; -class CUIDragDropList; -class CUIProgressBar; -class CUIProgressShape; -class CUITabControl; -class CUIFrameLineWnd; -class CUIEditBoxEx; -class CUIEditBox; -class CUICustomEdit; -class CUIAnimatedStatic; -class CUISleepStatic; -class CUIOptionsItem; -class CUIScrollView; -class CUIListBox; -class CUIDragDropListEx; -class CUIComboBox; -class CUITrackBar; -class CUILines; -class CUITextWnd; -class CGameFont; - -class XRUICORE_API CUIXmlInitBase -{ -public: - CUIXmlInitBase(); - virtual ~CUIXmlInitBase(); - - static bool InitWindow(CUIXml& xml_doc, LPCSTR path, int index, CUIWindow* pWnd); - static bool InitFrameWindow(CUIXml& xml_doc, LPCSTR path, int index, CUIFrameWindow* pWnd); - static bool InitFrameLine(CUIXml& xml_doc, LPCSTR path, int index, CUIFrameLineWnd* pWnd); - static bool InitCustomEdit(CUIXml& xml_doc, LPCSTR paht, int index, CUICustomEdit* pWnd); - static bool InitEditBox(CUIXml& xml_doc, LPCSTR paht, int index, CUIEditBox* pWnd); - static bool InitStatic(CUIXml& xml_doc, LPCSTR path, int index, CUIStatic* pWnd); - static bool InitTextWnd(CUIXml& xml_doc, LPCSTR path, int index, CUITextWnd* pWnd); - static bool InitCheck(CUIXml& xml_doc, LPCSTR path, int index, CUICheckButton* pWnd); - static bool InitSpin(CUIXml& xml_doc, LPCSTR path, int index, CUICustomSpin* pWnd); - static bool InitText(CUIXml& xml_doc, LPCSTR path, int index, CUIStatic* pWnd); - static bool InitText(CUIXml& xml_doc, LPCSTR path, int index, CUILines* pLines); - static bool Init3tButton(CUIXml& xml_doc, LPCSTR path, int index, CUI3tButton* pWnd); - static bool InitProgressBar(CUIXml& xml_doc, LPCSTR path, int index, CUIProgressBar* pWnd); - static bool InitProgressShape(CUIXml& xml_doc, LPCSTR path, int index, CUIProgressShape* pWnd); - static bool InitFont(CUIXml& xml_doc, LPCSTR path, int index, u32& color, CGameFont*& pFnt); - static bool InitTabControl(CUIXml& xml_doc, LPCSTR path, int index, CUITabControl* pWnd); - static bool InitAnimatedStatic(CUIXml& xml_doc, LPCSTR path, int index, CUIAnimatedStatic* pWnd); - static bool InitTextureOffset(CUIXml& xml_doc, LPCSTR path, int index, CUIStatic* pWnd); - static bool InitSound(CUIXml& xml_doc, LPCSTR path, int index, CUI3tButton* pWnd); - static bool InitMultiTexture(CUIXml& xml_doc, LPCSTR path, int index, CUI3tButton* pWnd); - static bool InitTexture(CUIXml& xml_doc, LPCSTR path, int index, ITextureOwner* pWnd); - static bool InitOptionsItem(CUIXml& xml_doc, LPCSTR paht, int index, CUIOptionsItem* pWnd); - static bool InitScrollView(CUIXml& xml_doc, LPCSTR path, int index, CUIScrollView* pWnd); - static bool InitListBox(CUIXml& xml_doc, LPCSTR path, int index, CUIListBox* pWnd); - static bool InitComboBox(CUIXml& xml_doc, LPCSTR path, int index, CUIComboBox* pWnd); - static bool InitTrackBar(CUIXml& xml_doc, LPCSTR path, int index, CUITrackBar* pWnd); - static Frect GetFRect(CUIXml& xml_doc, LPCSTR path, int index); - static u32 GetColor(CUIXml& xml_doc, LPCSTR path, int index, u32 def_clr); - - static bool InitAlignment(CUIXml& xml_doc, const char* path, int index, float& x, float& y, CUIWindow* pWnd); - - static void InitAutoStaticGroup(CUIXml& xml_doc, LPCSTR path, int index, CUIWindow* pParentWnd); - static void InitAutoFrameLineGroup(CUIXml& xml_doc, LPCSTR path, int index, CUIWindow* pParentWnd); - - static float ApplyAlignX(float coord, u32 align); - static float ApplyAlignY(float coord, u32 align); - static void ApplyAlign(float& x, float& y, u32 align); - - // Initialize and store predefined colors - using ColorDefs = xr_map; - - static const ColorDefs* GetColorDefs() - { - R_ASSERT(m_pColorDefs); - return m_pColorDefs; - } - - static void InitColorDefs(); - static void DeleteColorDefs() { xr_delete(m_pColorDefs); } - static void AssignColor(LPCSTR name, u32 clr); - -private: - static ColorDefs* m_pColorDefs; -}; diff --git a/src/xrUICore/XML/xrUIXmlParser.cpp b/src/xrUICore/XML/xrUIXmlParser.cpp deleted file mode 100644 index c31be655a1d..00000000000 --- a/src/xrUICore/XML/xrUIXmlParser.cpp +++ /dev/null @@ -1,26 +0,0 @@ -#include "pch.hpp" -#include "xrUIXmlParser.h" - -#ifdef XRUICORE_EXPORTS -#include "ui_base.h" -#endif - -shared_str CUIXml::correct_file_name(pcstr path, pcstr fn) -{ -#ifdef XRUICORE_EXPORTS - if (0 == xr_strcmp(path, UI_PATH) || 0 == xr_strcmp(path, "UI")) - { - return UI().get_xml_name(fn); - } - else - return fn; -#else - return fn; -#endif -} - -CUIXml::CUIXml() -{} - -CUIXml::~CUIXml() -{} diff --git a/src/xrUICore/packages.config b/src/xrUICore/packages.config deleted file mode 100644 index 94957f1a022..00000000000 --- a/src/xrUICore/packages.config +++ /dev/null @@ -1,5 +0,0 @@ - - - - - \ No newline at end of file diff --git a/src/xrUICore/pch.cpp b/src/xrUICore/pch.cpp deleted file mode 100644 index 3854579ae1c..00000000000 --- a/src/xrUICore/pch.cpp +++ /dev/null @@ -1 +0,0 @@ -#include "pch.hpp" diff --git a/src/xrUICore/pch.hpp b/src/xrUICore/pch.hpp deleted file mode 100644 index 266ac67d2ea..00000000000 --- a/src/xrUICore/pch.hpp +++ /dev/null @@ -1,9 +0,0 @@ -#pragma once - -#include "Common/Common.hpp" - -#include "xrEngine/stdafx.h" -#include "xrServerEntities/smart_cast.h" -#include "Windows/UIWindow.h" -#include "ui_base.h" -#include "xrEngine/xr_input_xinput.h" diff --git a/src/xrUICore/xrUICore.vcxproj b/src/xrUICore/xrUICore.vcxproj deleted file mode 100644 index 8251cc25afa..00000000000 --- a/src/xrUICore/xrUICore.vcxproj +++ /dev/null @@ -1,392 +0,0 @@ - - - - - Debug - Win32 - - - Debug - x64 - - - Mixed_COC - Win32 - - - Mixed_COC - x64 - - - Mixed - Win32 - - - Mixed - x64 - - - Release_COC - Win32 - - - Release_COC - x64 - - - Release - Win32 - - - Release - x64 - - - - {37B3642C-B706-4C93-BC54-BADADC8FC9B1} - xrAICore - 10.0.16299.0 - - - - DynamicLibrary - v141 - MultiByte - - - DynamicLibrary - v141 - MultiByte - - - DynamicLibrary - v141 - MultiByte - - - DynamicLibrary - v141 - MultiByte - - - DynamicLibrary - v141 - MultiByte - - - DynamicLibrary - v141 - MultiByte - - - DynamicLibrary - v141 - MultiByte - true - - - DynamicLibrary - v141 - MultiByte - true - - - DynamicLibrary - v141 - MultiByte - true - - - DynamicLibrary - v141 - MultiByte - true - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - <_ProjectFileVersion>12.0.30501.0 - - - - XRUICORE_EXPORTS;%(PreprocessorDefinitions) - pch.hpp - .;$(SolutionDir);$(xrExternals);$(ProjectDir);$(xrSdkDir)include;$(xrSdkDir)DXSDK/Include;$(xrExternals)luajit\src;$(xrExternals)luabind;$(xrExternals)pugixml\src;%(AdditionalIncludeDirectories) - - - - - XRUICORE_EXPORTS;%(PreprocessorDefinitions) - pch.hpp - .;$(SolutionDir);$(xrExternals);$(ProjectDir);$(xrSdkDir)include;$(xrSdkDir)DXSDK/Include;$(xrExternals)luajit\src;$(xrExternals)luabind;$(xrExternals)pugixml\src;%(AdditionalIncludeDirectories) - - - - - XRUICORE_EXPORTS;%(PreprocessorDefinitions) - pch.hpp - .;$(SolutionDir);$(xrExternals);$(ProjectDir);$(xrSdkDir)include;$(xrSdkDir)DXSDK/Include;$(xrExternals)luajit\src;$(xrExternals)luabind;$(xrExternals)pugixml\src;%(AdditionalIncludeDirectories) - - - - - XRUICORE_EXPORTS;%(PreprocessorDefinitions) - pch.hpp - .;$(SolutionDir);$(xrExternals);$(ProjectDir);$(xrSdkDir)include;$(xrSdkDir)DXSDK/Include;$(xrExternals)luajit\src;$(xrExternals)luabind;$(xrExternals)pugixml\src;%(AdditionalIncludeDirectories) - - - - - XRUICORE_EXPORTS;%(PreprocessorDefinitions) - pch.hpp - .;$(SolutionDir);$(xrExternals);$(ProjectDir);$(xrSdkDir)include;$(xrSdkDir)DXSDK/Include;$(xrExternals)luajit\src;$(xrExternals)luabind;$(xrExternals)pugixml\src;%(AdditionalIncludeDirectories) - - - - - XRUICORE_EXPORTS;%(PreprocessorDefinitions) - pch.hpp - .;$(SolutionDir);$(xrExternals);$(ProjectDir);$(xrSdkDir)include;$(xrSdkDir)DXSDK/Include;$(xrExternals)luajit\src;$(xrExternals)luabind;$(xrExternals)pugixml\src;%(AdditionalIncludeDirectories) - - - - - XRUICORE_EXPORTS;%(PreprocessorDefinitions) - pch.hpp - .;$(SolutionDir);$(xrExternals);$(ProjectDir);$(xrSdkDir)include;$(xrSdkDir)DXSDK/Include;$(xrExternals)luajit\src;$(xrExternals)luabind;$(xrExternals)pugixml\src;%(AdditionalIncludeDirectories) - - - - - XRUICORE_EXPORTS;%(PreprocessorDefinitions) - pch.hpp - .;$(SolutionDir);$(xrExternals);$(ProjectDir);$(xrSdkDir)include;$(xrSdkDir)DXSDK/Include;$(xrExternals)luajit\src;$(xrExternals)luabind;$(xrExternals)pugixml\src;%(AdditionalIncludeDirectories) - - - - - XRUICORE_EXPORTS;%(PreprocessorDefinitions) - pch.hpp - .;$(SolutionDir);$(xrExternals);$(ProjectDir);$(xrSdkDir)include;$(xrSdkDir)DXSDK/Include;$(xrExternals)luajit\src;$(xrExternals)luabind;$(xrExternals)pugixml\src;%(AdditionalIncludeDirectories) - - - - - XRUICORE_EXPORTS;%(PreprocessorDefinitions) - pch.hpp - .;$(SolutionDir);$(xrExternals);$(ProjectDir);$(xrSdkDir)include;$(xrSdkDir)DXSDK/Include;$(xrExternals)luajit\src;$(xrExternals)luabind;$(xrExternals)pugixml\src;%(AdditionalIncludeDirectories) - - - - - {a0f7d1fb-59a7-4717-a7e4-96f37e91998e} - - - {7885cf3c-ee04-4c67-9467-1fbf9a36b037} - - - {132c62de-de85-4978-9675-c78ed4da46f0} - - - {ccd4afae-aa10-42c6-a452-fdee497ccdf1} - - - {632aeeb6-dc06-4e15-9551-b2b09a4b73c5} - - - {07cf01c0-b887-499d-ad9c-799cb6a9fe64} - - - {2578c6d8-660d-48ae-9322-7422f8664f06} - - - {1daec516-e52c-4a3c-a4da-ae3553e6e0f8} - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Create - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Данный проект ссылается на пакеты NuGet, отсутствующие на этом компьютере. Используйте восстановление пакетов NuGet, чтобы скачать их. Дополнительную информацию см. по адресу: http://go.microsoft.com/fwlink/?LinkID=322105. Отсутствует следующий файл: {0}. - - - - - \ No newline at end of file diff --git a/src/xrUICore/xrUICore.vcxproj.filters b/src/xrUICore/xrUICore.vcxproj.filters deleted file mode 100644 index d5c4d61170b..00000000000 --- a/src/xrUICore/xrUICore.vcxproj.filters +++ /dev/null @@ -1,431 +0,0 @@ - - - - - - - - {2c4605d6-d85a-4a2b-b9e8-caaa34c51732} - - - {6bf658bd-b309-4948-affa-ba0651ef9a19} - - - {f9ee2ff4-00bf-4896-97b2-fc3aa5495da5} - - - {dc322116-1803-4f16-9e44-23ab18aa76ee} - - - {23ef7748-6827-46d5-9d66-e520ba6b80e4} - - - {04778887-db2f-4107-8021-0992d1092b12} - - - {112e2de6-7862-45a6-8ed4-da4ef7038408} - - - {21d3bc62-8128-4944-be2e-daa914424f01} - - - {4dffbd4b-dc59-492a-aa4c-dba13d613e16} - - - {b3070c87-ea88-489e-8bc0-5ea24ab6ce51} - - - {3e8610b3-1915-40af-83d6-00b2fb6aec05} - - - {b4220112-9a21-4d06-b706-9368d0fc91dc} - - - {753cc68e-2da8-4dec-a993-310e93054da1} - - - {e352fa71-8c90-4ed6-872c-b1865c8acfba} - - - {6f52116b-6102-4390-9f3c-137fbf22f744} - - - {a2648ace-c298-4d95-ae19-80af269a9c74} - - - {618b8ca3-a4e2-4f7e-9c77-4effa1e15b35} - - - {63861209-c6b5-4f82-9afb-490d5f76bc1a} - - - {e071b646-1ee5-4467-ad2f-00f8ac7d37ee} - - - {9cd05982-0d31-4641-afb2-8b6deca5afb1} - - - {f5a509a4-cb23-4a22-aae7-4d8e6030d127} - - - {804a137f-667e-4ec3-9fb4-22ee8f929ba3} - - - {49658579-42e7-425d-b701-eddd1b219e84} - - - {6a4dc39a-f6c8-45f8-9505-11e65cb12e49} - - - - - arrow - - - PCH - - - Static - - - Static - - - Static - - - Static - - - Static - - - Cursor - - - Windows - - - Windows - - - Windows - - - Buttons - - - Buttons - - - Buttons - - - Buttons - - - Buttons - - - Buttons - - - ComboBox - - - ComboBox - - - - Options - - - Options - - - EditBox - - - EditBox - - - EditBox - - - EditBox - - - Hint - - - InteractiveBackground - - - Lines - - - Lines - - - Lines - - - ListBox - - - ListBox - - - ListBox - - - ListBox - - - ProgressBar - - - ProgressBar - - - ProgressBar - - - ProgressBar - - - PropertiesBox - - - PropertiesBox - - - Callbacks - - - MessageBox - - - MessageBox - - - ScrollBar - - - ScrollBar - - - ScrollBar - - - ScrollView - - - SpinBox - - - SpinBox - - - SpinBox - - - TabControl - - - TabControl - - - TabControl - - - TrackBar - - - XML - - - XML - - - XML - - - FontManager - - - Windows - - - Options - - - - - arrow - - - PCH - - - Static - - - Static - - - Static - - - Static - - - Cursor - - - - Windows - - - Windows - - - Windows - - - Buttons - - - Buttons - - - Buttons - - - Buttons - - - Buttons - - - ComboBox - - - - - - Options - - - Options - - - EditBox - - - EditBox - - - EditBox - - - Hint - - - InteractiveBackground - - - InteractiveBackground - - - Lines - - - Lines - - - Lines - - - Lines - - - ListBox - - - ListBox - - - ListBox - - - ProgressBar - - - ProgressBar - - - ProgressBar - - - PropertiesBox - - - Callbacks - - - Callbacks - - - MessageBox - - - ScrollBar - - - ScrollBar - - - ScrollBar - - - ScrollView - - - SpinBox - - - SpinBox - - - SpinBox - - - TabControl - - - TabControl - - - TrackBar - - - XML - - - XML - - - XML - - - FontManager - - - Options - - - - - - \ No newline at end of file