Skip to content

Commit

Permalink
Removed version switcher (reverts #491, cancels part of #710)
Browse files Browse the repository at this point in the history
We want simplicity. I also want to reduce platform-specific code in the next commits.
So, let the user handle version switching for themselves.
The version switcher in the current form is unfinished and has some issues, e.g. some problems with FS or some missing features (were tracked in #710)

This reverts cc2e180 and 9cf69d0.
  • Loading branch information
Xottab-DUTY committed Jun 16, 2024
1 parent 7f18a2b commit c67235d
Show file tree
Hide file tree
Showing 22 changed files with 11 additions and 691 deletions.
1 change: 0 additions & 1 deletion res/fsgame.ltx
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
;abbreviation = recurs|notif| root| add| ext| description
$app_data_root$ = true| false| $fs_root$| _appdata_\
$game_versions$ = true| false| $fs_root$| versions\
$arch_dir$ = false| false| $fs_root$
$game_arch_mp$ = false| false| $fs_root$| mp\
$arch_dir_levels$ = false| false| $fs_root$| levels\
Expand Down
3 changes: 0 additions & 3 deletions res/gamedata/configs/text/eng/openxray.xml
Original file line number Diff line number Diff line change
Expand Up @@ -81,9 +81,6 @@
<string id="ui_mm_fov">
<text>Field of view</text>
</string>
<string id="st_switch_version_invitation">
<text>Do you really want to launch another version of the game?</text>
</string>
<string id="ui_mm_localization">
<text>Language</text>
</string>
Expand Down
3 changes: 0 additions & 3 deletions res/gamedata/configs/text/pol/openxray.xml
Original file line number Diff line number Diff line change
Expand Up @@ -78,9 +78,6 @@
<string id="ui_mm_fov">
<text>Pole widzenia</text>
</string>
<string id="st_switch_version_invitation">
<text>Czy na pewno chcesz uruchomic kolejna wersje gry?</text>
</string>
<string id="ui_mm_localization">
<text>J瞛yk</text>
</string>
Expand Down
3 changes: 0 additions & 3 deletions res/gamedata/configs/text/rus/openxray.xml
Original file line number Diff line number Diff line change
Expand Up @@ -87,9 +87,6 @@
<string id="ui_mm_fov">
<text>Ïîëå çðåíèÿ</text>
</string>
<string id="st_switch_version_invitation">
<text>Âû äåéñòâèòåëüíî õîòèòå çàïóñòèòü äðóãóþ âåðñèþ èãðû?</text>
</string>
<string id="ui_mm_localization">
<text>ßçûê</text>
</string>
Expand Down
17 changes: 0 additions & 17 deletions res/gamedata/configs/ui/message_box.xml
Original file line number Diff line number Diff line change
Expand Up @@ -583,21 +583,4 @@
<texture>ui_inGame2_Mp_bigbuttone</texture>
</button_no>
</message_box_ra_login>

<message_box_version_switch type="yes_no" x="173" y="256" width="677" height="255" stretch="1">
<texture>ui_inGame2_message_box</texture>
<message_text x="62" y="28" width="577" height="150" complex_mode="1">
<text align="c" vert_align="c" font="letterica18">st_switch_version_invitation</text>
</message_text>
<button_yes x="209" y="212" width="127" height="28" check_mode="0">
<window_name>button_yes</window_name>
<text font="letterica18">Btn_Yes</text>
<texture>ui_inGame2_Mp_bigbuttone</texture>
</button_yes>
<button_no x="341" y="212" width="127" height="28" check_mode="0">
<window_name>button_no</window_name>
<text font="letterica18">Btn_No</text>
<texture>ui_inGame2_Mp_bigbuttone</texture>
</button_no>
</message_box_version_switch>
</w>
17 changes: 0 additions & 17 deletions res/gamedata/configs/ui/message_box_16.xml
Original file line number Diff line number Diff line change
Expand Up @@ -584,21 +584,4 @@
<texture>ui_inGame2_Mp_bigbuttone</texture>
</button_no>
</message_box_ra_login>

<message_box_version_switch type="yes_no" x="240" y="256" width="541" height="255" stretch="1">
<texture>ui_inGame2_message_box</texture>
<message_text x="49" y="28" width="461" height="150" complex_mode="1">
<text align="c" vert_align="c" font="letterica18">st_switch_version_invitation</text>
</message_text>
<button_yes x="167" y="212" width="101" height="28" check_mode="0">
<window_name>button_yes</window_name>
<text font="letterica18">Btn_Yes</text>
<texture>ui_inGame2_Mp_bigbuttone</texture>
</button_yes>
<button_no x="272" y="212" width="101" height="28" check_mode="0">
<window_name>button_no</window_name>
<text font="letterica18">Btn_No</text>
<texture>ui_inGame2_Mp_bigbuttone</texture>
</button_no>
</message_box_version_switch>
</w>
52 changes: 0 additions & 52 deletions res/gamedata/configs/ui/ui_mm_versions_dlg.xml

This file was deleted.

58 changes: 0 additions & 58 deletions res/gamedata/configs/ui/ui_mm_versions_dlg_16.xml

This file was deleted.

18 changes: 1 addition & 17 deletions res/gamedata/scripts/ui_main_menu.script
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,9 @@ function main_menu:InitControls()
self.message_box = CUIMessageBoxEx()
self:Register (self.message_box, "msg_box")

local _ver = xml:Init3tButton ("static_version",self)
local _ver = xml:InitStatic ("static_version",self)
local mm = _G.main_menu.get_main_menu()
_ver:TextControl():SetText ("ver. " .. mm:GetGSVer())
self:Register(_ver, 'btn_version');

self.l_mgr = mm:GetLoginMngr()
self.acc_mgr = mm:GetAccountMngr()
Expand Down Expand Up @@ -86,8 +85,6 @@ function main_menu:InitCallBacks()
self:AddCallback("msg_box", ui_events.MESSAGE_BOX_NO_CLICKED, self.OnMsgNo, self)
self:AddCallback("msg_box", ui_events.MESSAGE_BOX_QUIT_GAME_CLICKED,self.OnMessageQuitGame, self)
self:AddCallback("msg_box", ui_events.MESSAGE_BOX_QUIT_WIN_CLICKED, self.OnMessageQuitWin, self)

self:AddCallback("btn_version", ui_events.BUTTON_CLICKED, self.OnButton_version_clicked, self)

self:Register(self, "self")
self:AddCallback("self", ui_events.MAIN_MENU_RELOADED, self.OnMenuReloaded, self)
Expand Down Expand Up @@ -323,19 +320,6 @@ function main_menu:OnButton_localnet_clicked()
console:execute ("check_for_updates 0")
end

function main_menu:OnButton_version_clicked()
if self.ver_dlg ==nil then
self.ver_dlg = ui_versions_dialog.versions_dialog()
self.ver_dlg.owner = self
end

if self.ver_dlg:NeedToBeShown() then
self.ver_dlg:ShowDialog(true)
self:HideDialog()
self:Show(false)
end
end

function main_menu:Dispatch(cmd, param) --virtual function
if cmd == 2 then
self:OnButton_multiplayer_clicked()
Expand Down
70 changes: 0 additions & 70 deletions res/gamedata/scripts/ui_versions_dialog.script

This file was deleted.

4 changes: 0 additions & 4 deletions src/xrGame/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -1591,8 +1591,6 @@ target_sources(xrGame PRIVATE
UITimeDilator.h
UIZoneMap.cpp
UIZoneMap.h
VersionSwitcher.cpp
VersionSwitcher.h
vision_client.cpp
vision_client.h
vision_client_inline.h
Expand Down Expand Up @@ -2471,8 +2469,6 @@ target_sources(xrGame PRIVATE
ui/UITradeBar.h
ui/UITradeWnd.cpp
ui/UITradeWnd.h
ui/UIVersionList.cpp
ui/UIVersionList.h
ui/UIVote.cpp
ui/UIVote.h
ui/UIVoteStatusWnd.cpp
Expand Down
10 changes: 0 additions & 10 deletions src/xrGame/ScriptXMLInit.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
#include "ui/UILabel.h"
#include "ui/ServerList.h"
#include "ui/UIMapList.h"
#include "ui/UIVersionList.h"
#include "ui/UIKeyBinding.h"
#include "xrUICore/EditBox/UIEditBox.h"
#include "xrUICore/Static/UIAnimatedStatic.h"
Expand Down Expand Up @@ -202,14 +201,6 @@ CUIMapList* CScriptXmlInit::InitMapList(LPCSTR path, CUIWindow* parent)
return pWnd;
}

CUIVersionList* CScriptXmlInit::InitVerList(LPCSTR path, CUIWindow* parent)
{
CUIVersionList* pWnd = xr_new<CUIVersionList>();
pWnd->InitFromXml(m_xml, path);
_attach_child(pWnd, parent);
return pWnd;
}

CUIMMShniaga* CScriptXmlInit::InitMMShniaga(LPCSTR path, CUIWindow* parent)
{
CUIMMShniaga* pWnd = xr_new<CUIMMShniaga>();
Expand Down Expand Up @@ -297,7 +288,6 @@ SCRIPT_EXPORT(CScriptXmlInit, (),
.def("InitTab", &CScriptXmlInit::InitTab)
.def("InitServerList", &CScriptXmlInit::InitServerList)
.def("InitMapList", &CScriptXmlInit::InitMapList)
.def("InitVerList", &CScriptXmlInit::InitVerList)
.def("InitMapInfo", &CScriptXmlInit::InitMapInfo)
.def("InitTrackBar", &CScriptXmlInit::InitTrackBar)
.def("InitCDkey", &CScriptXmlInit::InitCDkey)
Expand Down
2 changes: 0 additions & 2 deletions src/xrGame/ScriptXMLInit.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ class CUIAnimatedStatic;
class CUISleepStatic;
class CServerList;
class CUIMapList;
class CUIVersionList;
class CUITrackBar;
class CUIMapInfo;
class CUIMMShniaga;
Expand Down Expand Up @@ -53,7 +52,6 @@ class CScriptXmlInit
CUITabControl* InitTab(LPCSTR path, CUIWindow* parent);
CServerList* InitServerList(LPCSTR path, CUIWindow* parent);
CUIMapList* InitMapList(LPCSTR path, CUIWindow* parent);
CUIVersionList* InitVerList(LPCSTR path, CUIWindow* parent);
CUIMapInfo* InitMapInfo(LPCSTR path, CUIWindow* parent);
CUITrackBar* InitTrackBar(LPCSTR path, CUIWindow* parent);
CUIEditBox* InitCDkey(LPCSTR path, CUIWindow* parent);
Expand Down
Loading

0 comments on commit c67235d

Please sign in to comment.