Skip to content

Commit 64ad169

Browse files
committed
2 parents 3acadfe + 0b7d75f commit 64ad169

File tree

4 files changed

+71
-188
lines changed

4 files changed

+71
-188
lines changed

Source/Stalker/Kernel/RBMK/Engine/RBMKEngine.cpp

+70-69
Original file line numberDiff line numberDiff line change
@@ -235,12 +235,78 @@ class IRBMKUnrealProxy* FRBMKEngine::GetUnrealPlayerCharacter()
235235
return nullptr;
236236
}
237237

238+
shared_str FRBMKEngine::GetUnrealVersion()
239+
{
240+
return TCHAR_TO_ANSI(FApp::GetBuildVersion());
241+
}
242+
243+
IRBMKSoundManager* FRBMKEngine::GetSoundManager()
244+
{
245+
return GStalkerEngineManager->GetResourcesManager()->GetSoundManager();
246+
}
247+
248+
IRBMKEnvironment* FRBMKEngine::GetEnvironment()
249+
{
250+
#if WITH_EDITORONLY_DATA
251+
check(GWorld&&GWorld->IsGameWorld());
252+
#endif
253+
if(AStalkerWorldSettings*WorldSettings = Cast<AStalkerWorldSettings>(GWorld->GetWorldSettings()))
254+
{
255+
if(!WorldSettings->Environment)
256+
{
257+
UE_DEBUG_BREAK();
258+
}
259+
return WorldSettings->Environment;
260+
}
261+
return nullptr;
262+
}
263+
264+
void FRBMKEngine::OnRunGame(const char* ServerParams, const char* ClientParams)
265+
{
266+
GStalkerEngineManager->GetResourcesManager()->LoadingScreenManager.Play(FCStringAnsi::Strstr(ServerParams,"/load") == nullptr,9);
267+
268+
IRBMKEngine::OnRunGame(ServerParams, ClientParams);
269+
if(!GIsEditor)
270+
{
271+
while (g_loading_events->size())
272+
{
273+
if (g_loading_events->front()())
274+
{
275+
g_loading_events->pop_front();
276+
}
277+
else
278+
{
279+
GEngine->Tick(FApp::GetDeltaTime(), false);
280+
}
281+
}
282+
GEngine->Tick(FApp::GetDeltaTime(), false);
283+
}
284+
GStalkerEngineManager->GetResourcesManager()->LoadingScreenManager.Wait();
285+
286+
}
287+
288+
IRBMKLoadingScreenManager* FRBMKEngine::GetLoadingScreen()
289+
{
290+
return &GStalkerEngineManager->GetResourcesManager()->LoadingScreenManager;
291+
}
292+
293+
void FRBMKEngine::LoadDefaultWorld()
294+
{
295+
GStalkerEngineManager->LoadDefaultWorld();
296+
}
297+
298+
void FRBMKEngine::Exit()
299+
{
300+
GEngine->Exec(nullptr, TEXT( "Exit" ) );
301+
}
302+
303+
238304
void FRBMKEngine::ExecUeCmd(const char* cmd)
239305
{
240306
GEngine->Exec(NULL, ANSI_TO_TCHAR(cmd));
241307
}
242308

243-
void FRBMKEngine::ChangeUeSettingsInt(const std::map<int, int> &settinglist)
309+
void FRBMKEngine::ChangeUeSettingsInt(const std::map<int, int>& settinglist)
244310
{
245311

246312
for (const auto& ref : settinglist)
@@ -422,15 +488,15 @@ void FRBMKEngine::ChangeUeSettingsFloat(const std::map<int, float>& settinglist)
422488
}
423489
}
424490

425-
float FRBMKEngine::GetSettingFloat(int setting, float&min, float&max)
491+
float FRBMKEngine::GetSettingFloat(int setting, float& min, float& max)
426492
{
427493
USoundClass* Sound;
428494
switch (setting)
429495
{
430496
case EffectsVolume:
431497
{
432498
Sound = LoadObject<USoundClass>(nullptr, TEXT("/Game/Base/Sounds/EffectClass.EffectClass"));
433-
if(Sound)
499+
if (Sound)
434500
{
435501
min = 0.f;
436502
max = 1.f;
@@ -490,69 +556,4 @@ void FRBMKEngine::SetResolution(u32 w, u32 h)
490556
res.Y = h;
491557
GEngine->GetGameUserSettings()->SetScreenResolution(res);
492558
GEngine->GetGameUserSettings()->ApplySettings(true);
493-
}
494-
495-
shared_str FRBMKEngine::GetUnrealVersion()
496-
{
497-
return TCHAR_TO_ANSI(FApp::GetBuildVersion());
498-
}
499-
500-
IRBMKSoundManager* FRBMKEngine::GetSoundManager()
501-
{
502-
return GStalkerEngineManager->GetResourcesManager()->GetSoundManager();
503-
}
504-
505-
IRBMKEnvironment* FRBMKEngine::GetEnvironment()
506-
{
507-
#if WITH_EDITORONLY_DATA
508-
check(GWorld&&GWorld->IsGameWorld());
509-
#endif
510-
if(AStalkerWorldSettings*WorldSettings = Cast<AStalkerWorldSettings>(GWorld->GetWorldSettings()))
511-
{
512-
if(!WorldSettings->Environment)
513-
{
514-
UE_DEBUG_BREAK();
515-
}
516-
return WorldSettings->Environment;
517-
}
518-
return nullptr;
519-
}
520-
521-
void FRBMKEngine::OnRunGame(const char* ServerParams, const char* ClientParams)
522-
{
523-
GStalkerEngineManager->GetResourcesManager()->LoadingScreenManager.Play(FCStringAnsi::Strstr(ServerParams,"/load") == nullptr,9);
524-
525-
IRBMKEngine::OnRunGame(ServerParams, ClientParams);
526-
if(!GIsEditor)
527-
{
528-
while (g_loading_events->size())
529-
{
530-
if (g_loading_events->front()())
531-
{
532-
g_loading_events->pop_front();
533-
}
534-
else
535-
{
536-
GEngine->Tick(FApp::GetDeltaTime(), false);
537-
}
538-
}
539-
GEngine->Tick(FApp::GetDeltaTime(), false);
540-
}
541-
GStalkerEngineManager->GetResourcesManager()->LoadingScreenManager.Wait();
542-
543-
}
544-
545-
IRBMKLoadingScreenManager* FRBMKEngine::GetLoadingScreen()
546-
{
547-
return &GStalkerEngineManager->GetResourcesManager()->LoadingScreenManager;
548-
}
549-
550-
void FRBMKEngine::LoadDefaultWorld()
551-
{
552-
GStalkerEngineManager->LoadDefaultWorld();
553-
}
554-
555-
void FRBMKEngine::Exit()
556-
{
557-
GEngine->Exec(nullptr, TEXT( "Exit" ) );
558-
}
559+
}

gamedata_soc/config/ui/ui_mm_opt.xml

-33
Original file line numberDiff line numberDiff line change
@@ -73,18 +73,6 @@
7373
</tab>
7474
</main_dialog>
7575
<tab_video>
76-
<cap_renderer x="20" y="20" width="143" height="21">
77-
<text font="letterica16" r="215" g="195" b="170">ui_mm_renderer</text>
78-
</cap_renderer>
79-
<list_renderer x="194" y="20" width="261" height="21" list_length="3">
80-
<options_item entry="renderer" group="mm_opt_video"/>
81-
<text_color>
82-
<e r="216" g="186" b="140"/>
83-
<d r="227" g="199" b="178"/>
84-
</text_color>
85-
<list_font_s r="240" g="217" b="182"/>
86-
<list_font r="216" g="186" b="140" font="letterica16"/>
87-
</list_renderer>
8876
<cap_preset x="20" y="50" width="143" height="21">
8977
<text font="letterica16" r="215" g="195" b="170">ui_mm_quality_presets</text>
9078
</cap_preset>
@@ -111,27 +99,6 @@
11199
<list_font r="216" g="186" b="140" font="letterica16"/>
112100
</list_resolution>
113101

114-
<cap_gamma x="20" y="110" width="143" height="21">
115-
<text font="letterica16" r="215" g="195" b="170">ui_mm_gamma</text>
116-
</cap_gamma>
117-
<track_gamma x="194" y="110" width="261" height="21">
118-
<options_item entry="rs_c_gamma" group="mm_opt_video"/>
119-
</track_gamma>
120-
121-
<cap_contrast x="20" y="140" width="143" height="21">
122-
<text font="letterica16" r="215" g="195" b="170">ui_mm_contrast</text>
123-
</cap_contrast>
124-
<track_contrast x="194" y="140" width="261" height="21">
125-
<options_item entry="rs_c_contrast" group="mm_opt_video"/>
126-
</track_contrast>
127-
128-
<cap_brightness x="20" y="170" width="143" height="21">
129-
<text font="letterica16" r="215" g="195" b="170">ui_mm_brightness</text>
130-
</cap_brightness>
131-
<track_brightness x="194" y="170" width="261" height="21">
132-
<options_item entry="rs_c_brightness" group="mm_opt_video"/>
133-
</track_brightness>
134-
135102
<cap_fullscreen x="20" y="200" width="143" height="21">
136103
<text font="letterica16" r="215" g="195" b="170">ui_mm_fullscreen</text>
137104
</cap_fullscreen>

gamedata_soc/scripts/ui_mm_opt_main.script

+1-73
Original file line numberDiff line numberDiff line change
@@ -72,12 +72,6 @@ function options_dialog:InitControls()
7272

7373
self.b_r2_restart_shown = false
7474

75-
self.cap_download = xml:InitStatic ("download_static",self)
76-
self.text_download = xml:InitStatic ("download_text",self)
77-
self.download_progress = xml:InitProgressBar ("progress_download", self)
78-
self.btn_cancel_download = xml:Init3tButton ("btn_cancel_download", self)
79-
self:Register (self.btn_cancel_download, "btn_cancel_download")
80-
8175
end
8276

8377
function options_dialog:UpdateControls()
@@ -101,31 +95,6 @@ function options_dialog:UpdateControls()
10195
opt:SetCurrentValues("mm_opt_controls")
10296

10397
opt:SetCurrentValues("key_binding")
104-
105-
if not xrRender_test_r2_hw() then
106-
self.combo_r2:SetCurrentID (0)
107-
self.combo_r2:Enable (false)
108-
end
109-
110-
self:UpdateDependControls()
111-
end
112-
113-
function options_dialog:UpdateDependControls()
114-
115-
local _current_id = self.combo_r2:CurrentID()
116-
117-
for i,j in pairs(self.m_preconditions) do
118-
j (i, _current_id)
119-
end
120-
--[[
121-
if self.combo_r2:CurrentID()==1 then
122-
self.ch_r2_sun:Enable (true)
123-
self.ch_r2_sun_det:Enable (true)
124-
else
125-
self.ch_r2_sun:Enable (false)
126-
self.ch_r2_sun_det:Enable (false)
127-
end
128-
]]
12998
end
13099

131100
function options_dialog:InitCallBacks()
@@ -135,21 +104,11 @@ function options_dialog:InitCallBacks()
135104
self:AddCallback("btn_cancel", ui_events.BUTTON_CLICKED, self.OnBtnCancel, self)
136105
self:AddCallback("btn_default_graphic", ui_events.BUTTON_CLICKED, self.OnBtnDefGraph, self)
137106
self:AddCallback("btn_default_sound", ui_events.BUTTON_CLICKED, self.OnBtnDefSound, self)
138-
self:AddCallback("combo_r2", ui_events.LIST_ITEM_SELECT, self.OnR2changed, self)
139-
self:AddCallback("combo_preset", ui_events.LIST_ITEM_SELECT, self.OnPresetChanged, self)
140107
self:AddCallback("btn_simply_graphic", ui_events.BUTTON_CLICKED, self.OnSimplyGraphic, self)
141108
self:AddCallback("btn_keyb_default", ui_events.BUTTON_CLICKED, self.OnBtnDefault, self)
142-
self:AddCallback("btn_check_updates", ui_events.BUTTON_CLICKED, self.OnBtnCheckUpdates, self)
143-
144-
self:AddCallback("btn_cancel_download", ui_events.BUTTON_CLICKED, self.OnBtn_CancelDownload, self)
145109

146110
end
147111

148-
function options_dialog:OnBtnCheckUpdates()
149-
local console = get_console()
150-
console:execute ("check_for_updates 1")
151-
end
152-
153112
function options_dialog:OnBtnDefault()
154113
local console = get_console()
155114
-- console:execute ("cfg_load default_controls")
@@ -167,14 +126,6 @@ function options_dialog:OnPresetChanged()
167126
end
168127

169128
function options_dialog:OnR2changed()
170-
171-
self:UpdateDependControls ()
172-
173-
if false==self.b_r2_restart_shown then
174-
self.b_r2_restart_shown = true
175-
self.message_box:Init ("message_box_restart_game")
176-
self:GetHolder():start_stop_menu(self.message_box,true)
177-
end
178129

179130
end
180131

@@ -278,27 +229,4 @@ end
278229
function options_dialog:Update()
279230
CUIScriptWnd.Update(self)
280231

281-
local mm = main_menu.get_main_menu()
282-
local sss = mm:GetPatchProgress()
283-
284-
if sss:GetInProgress() then
285-
self.text_download:Show (true)
286-
self.cap_download:Show (true)
287-
self.download_progress:Show (true)
288-
local _progr = sss:GetProgress()
289-
self.download_progress:SetProgressPos (_progr)
290-
local str = string.format("%.0f%%(%s)",_progr,sss:GetFlieName())
291-
self.text_download:SetText (str)
292-
self.btn_cancel_download:Show (true)
293-
else
294-
self.text_download:Show (false)
295-
self.cap_download:Show (false)
296-
self.download_progress:Show (false)
297-
self.btn_cancel_download:Show (false)
298-
end
299-
end
300-
301-
function options_dialog:OnBtn_CancelDownload()
302-
local mm = main_menu.get_main_menu()
303-
mm:CancelDownload()
304-
end
232+
end

gamedata_soc/scripts/ui_mm_opt_video.script

-13
Original file line numberDiff line numberDiff line change
@@ -17,26 +17,13 @@ function opt_video:InitControls(x, y, xml, handler)
1717
xml:InitStatic ("tab_video:cap_fullscreen", self)
1818
xml:InitCheck ("tab_video:check_fullscreen", self)
1919

20-
xml:InitStatic ("tab_video:cap_brightness", self)
21-
xml:InitTrackBar ("tab_video:track_brightness", self)
22-
23-
xml:InitStatic ("tab_video:cap_contrast", self)
24-
xml:InitTrackBar ("tab_video:track_contrast", self)
25-
26-
xml:InitStatic ("tab_video:cap_gamma", self)
27-
xml:InitTrackBar ("tab_video:track_gamma", self)
28-
2920
xml:InitStatic ("tab_video:cap_resolution", self)
3021
xml:InitComboBox ("tab_video:list_resolution", self)
3122

3223
xml:InitStatic ("tab_video:cap_preset", self)
3324
handler.combo_preset = xml:InitComboBox("tab_video:list_presets", self)
3425
handler:Register (handler.combo_preset, "combo_preset")
3526

36-
xml:InitStatic ("tab_video:cap_renderer", self)
37-
handler.combo_r2 = xml:InitComboBox("tab_video:list_renderer", self)
38-
handler:Register (handler.combo_r2, "combo_r2")
39-
4027
btn = xml:Init3tButton ("tab_video:btn_advanced", self)
4128
handler:Register (btn, "btn_advanced_graphic")
4229
end

0 commit comments

Comments
 (0)