Skip to content

Commit

Permalink
LE stuff
Browse files Browse the repository at this point in the history
  • Loading branch information
St4lker0k765 committed Sep 23, 2024
1 parent 99c65a0 commit caf27d3
Show file tree
Hide file tree
Showing 62 changed files with 2,531 additions and 492 deletions.
1,031 changes: 1,025 additions & 6 deletions gamedata/configs/text/eng/ui_st_ixray_editors.xml

Large diffs are not rendered by default.

1,031 changes: 1,025 additions & 6 deletions gamedata/configs/text/rus/ui_st_ixray_editors.xml

Large diffs are not rendered by default.

38 changes: 19 additions & 19 deletions src/Editors/LevelEditor/Editor/Entry/CustomObjectAnimation.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -208,9 +208,9 @@ void CCustomObject::OnMotionCommandsClick(ButtonValue* value, bool& bModif, boo
m_FromTime = m_MotionParams->min_t;
m_ToTime = m_MotionParams->max_t;
m_ScaleFactor = 1.f;
PHelper().CreateFloat (items,"From Time", &m_FromTime, m_FromTime, m_ToTime, 1.f/30.f, 3);
PHelper().CreateFloat (items,"To Time", &m_ToTime, m_FromTime, m_ToTime, 1.f/30.f, 3);
PHelper().CreateFloat (items,"Scale", &m_ScaleFactor, -1000.f, 1000.f);
PHelper().CreateFloat (items,g_pStringTable->translate("ed_st_from_time").c_str(), &m_FromTime, m_FromTime, m_ToTime, 1.f / 30.f, 3);
PHelper().CreateFloat (items,g_pStringTable->translate("ed_st_to_time").c_str(), &m_ToTime, m_FromTime, m_ToTime, 1.f / 30.f, 3);
PHelper().CreateFloat (items,g_pStringTable->translate("ed_st_scale").c_str(), &m_ScaleFactor, -1000.f, 1000.f);
UIPropertiesModal::Show(items);
m_ButtonId = 2;
EDevice->seqDrawUI.Add(this);
Expand All @@ -221,9 +221,9 @@ void CCustomObject::OnMotionCommandsClick(ButtonValue* value, bool& bModif, boo
m_FromTime = m_MotionParams->min_t;
m_ToTime = m_MotionParams->max_t;
m_Speed=5.f;
PHelper().CreateFloat (items,"From Time", &m_FromTime, m_FromTime, m_ToTime, 1.f/30.f, 3);
PHelper().CreateFloat (items,"To Time", &m_ToTime, m_FromTime, m_ToTime, 1.f/30.f, 3);
PHelper().CreateFloat (items,"Speed (m/sec)", &m_Speed, 0.f, 100.f);
PHelper().CreateFloat (items,g_pStringTable->translate("ed_st_from_time").c_str(), &m_FromTime, m_FromTime, m_ToTime, 1.f / 30.f, 3);
PHelper().CreateFloat (items,g_pStringTable->translate("ed_st_to_time").c_str(), &m_ToTime, m_FromTime, m_ToTime, 1.f / 30.f, 3);
PHelper().CreateFloat (items,g_pStringTable->translate("ed_st_speed_m_sec").c_str(), &m_Speed, 0.f, 100.f);
UIPropertiesModal::Show(items);
m_ButtonId = 3;
EDevice->seqDrawUI.Add(this);
Expand Down Expand Up @@ -306,31 +306,31 @@ void CCustomObject::OnTransformChange(PropValue* value)

void CCustomObject::AnimationFillProp(LPCSTR pref, PropItemVec& items)
{
PropValue* V = PHelper().CreateFlag32(items,PrepareKey(pref,"Flags\\Motionable"),&m_CO_Flags, flMotion);
PropValue* V = PHelper().CreateFlag32(items,PrepareKey(pref,g_pStringTable->translate("ed_st_motionable").c_str()),&m_CO_Flags, flMotion);
V->OnChangeEvent.bind(this,&CCustomObject::OnMotionableChange);
if (Motionable()){
PHelper().CreateCaption (items,PrepareKey(pref,"Motion\\Hint"), "Make KEY only on Parent CS");
ButtonValue* B = PHelper().CreateButton (items,PrepareKey(pref,"Motion\\Files"), "Import,Export", 0);
PHelper().CreateCaption (items,PrepareKey(pref,g_pStringTable->translate("ed_st_motion_hint").c_str()), g_pStringTable->translate("ed_st_motion_hint_msg").c_str());
ButtonValue* B = PHelper().CreateButton (items,PrepareKey(pref,g_pStringTable->translate("ed_st_motion_files").c_str()), g_pStringTable->translate("ed_st_import_export").c_str(), 0);
B->OnBtnClickEvent.bind(this,&CCustomObject::OnMotionFilesClick);
B = PHelper().CreateButton (items,PrepareKey(pref,"Motion\\Commands"), "+ K,- K,Scale,Norm,Clamp", 0);
B = PHelper().CreateButton (items,PrepareKey(pref,g_pStringTable->translate("ed_st_motion_commands").c_str()), g_pStringTable->translate("ed_st_motion_commands_btn").c_str(), 0);
B->OnBtnClickEvent.bind(this,&CCustomObject::OnMotionCommandsClick);
B = PHelper().CreateButton (items,PrepareKey(pref,"Motion\\Controls"), " |<<, +<<, <<, >, ||, >>, >>+, >>|", 0);
B = PHelper().CreateButton (items,PrepareKey(pref,g_pStringTable->translate("ed_st_motion_controls").c_str()), " |<<, +<<, <<, >, ||, >>, >>+, >>|", 0);
B->OnBtnClickEvent.bind(this,&CCustomObject::OnMotionControlClick);
PHelper().CreateFlag32 (items,PrepareKey(pref,"Motion\\Flags\\Auto Key"), &m_CO_Flags, flAutoKey);
V = PHelper().CreateFlag32 (items,PrepareKey(pref,"Motion\\Flags\\Camera View"), &m_CO_Flags, flCameraView);
PHelper().CreateFlag32 (items,PrepareKey(pref,g_pStringTable->translate("ed_st_auto_key").c_str()), &m_CO_Flags, flAutoKey);
V = PHelper().CreateFlag32 (items,PrepareKey(pref,g_pStringTable->translate("ed_st_camera_view").c_str()), &m_CO_Flags, flCameraView);
V->OnChangeEvent.bind(this,&CCustomObject::OnMotionCameraViewChange);
V = PHelper().CreateFloat (items,PrepareKey(pref,"Motion\\Start Frame (sec)"), &m_MotionParams->min_t, -10000.f, m_MotionParams->max_t, 1.f/30.f, 3);
V = PHelper().CreateFloat (items,PrepareKey(pref,g_pStringTable->translate("ed_st_start_frame").c_str()), &m_MotionParams->min_t, -10000.f, m_MotionParams->max_t, 1.f/30.f, 3);
V->OnChangeEvent.bind(this,&CCustomObject::OnMotionFrameChange);
V = PHelper().CreateFloat (items,PrepareKey(pref,"Motion\\End Frame (sec)"), &m_MotionParams->max_t, m_MotionParams->min_t, 10000.f, 1.f/30.f, 3);
V = PHelper().CreateFloat (items,PrepareKey(pref,g_pStringTable->translate("ed_st_end_frame").c_str()), &m_MotionParams->max_t, m_MotionParams->min_t, 10000.f, 1.f/30.f, 3);
V->OnChangeEvent.bind(this,&CCustomObject::OnMotionFrameChange);
V = PHelper().CreateFloat (items,PrepareKey(pref,"Motion\\Current Frame (sec)"), &m_MotionParams->t_current, -10000.f, 10000.f, 1.f/30.f, 3);
V = PHelper().CreateFloat (items,PrepareKey(pref,g_pStringTable->translate("ed_st_current_frame").c_str()), &m_MotionParams->t_current, -10000.f, 10000.f, 1.f/30.f, 3);
V->OnChangeEvent.bind(this,&CCustomObject::OnMotionCurrentFrameChange);

V = PHelper().CreateFloat (items,PrepareKey(pref,"Motion\\ChangeKeyTime(sec)"), &m_MotionParams->tmp, -10000.f, 10000.f, 1.f/30.f, 3);
V = PHelper().CreateFloat (items,PrepareKey(pref,g_pStringTable->translate("ed_st_change_key_time").c_str()), &m_MotionParams->tmp, -10000.f, 10000.f, 1.f/30.f, 3);
V->OnChangeEvent.bind(this,&CCustomObject::OnMotionKeyTimeChange);

PHelper().CreateCaption (items,PrepareKey(pref,"Motion\\Key Count"), shared_str().printf("%d",m_Motion->KeyCount()));
PHelper().CreateCaption (items,PrepareKey(pref,"Motion\\Length (sec)"), shared_str().printf("%3.2f",m_Motion->GetLength()));
PHelper().CreateCaption (items,PrepareKey(pref,g_pStringTable->translate("ed_st_key_count").c_str()), shared_str().printf("%d",m_Motion->KeyCount()));
PHelper().CreateCaption (items,PrepareKey(pref,g_pStringTable->translate("ed_st_motion_length").c_str()), shared_str().printf("%3.2f",m_Motion->GetLength()));
}
}

Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ bool CEditableObject::ExportLWO(LPCSTR fname)
int im_idx=FindLPCSTR(images,S->_Texture());
R_ASSERT(im_idx>=0);
LPCSTR vm_name=S->_VMap();
F->Wsurface(S->_Name(),S->m_Flags.is(CSurface::sf2Sided),(u16)im_idx,(vm_name&&vm_name[0])?vm_name:"Texture",S->_ShaderName(),S->_ShaderXRLCName());
F->Wsurface(S->_Name(),S->m_Flags.is(CSurface::sf2Sided),(u16)im_idx,(vm_name&&vm_name[0])?vm_name:g_pStringTable->translate("ed_st_texture").c_str(), S->_ShaderName(), S->_ShaderXRLCName());
}
// meshes/layers
for (EditMeshIt mesh_it=FirstMesh(); mesh_it!=LastMesh(); mesh_it++){
Expand Down
13 changes: 7 additions & 6 deletions src/Editors/LevelEditor/Editor/Entry/Glow/glow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ bool CGlow::LoadLTX(CInifile& ini, LPCSTR sect_name)

if(version!=GLOW_VERSION)
{
ELog.DlgMsg( mtError, "CGlow: Unsupported version.");
ELog.DlgMsg( mtError, g_pStringTable->translate("ed_st_glow_unsupported_ver").c_str());
return false;
}

Expand Down Expand Up @@ -168,8 +168,9 @@ bool CGlow::LoadStream(IReader& F)
u16 version = 0;

R_ASSERT(F.r_chunk(GLOW_CHUNK_VERSION,&version));
if((version!=0x0011)&&(version!=GLOW_VERSION)){
ELog.DlgMsg( mtError, "CGlow: Unsupported version.");
if((version!=0x0011)&&(version!=GLOW_VERSION))
{
ELog.DlgMsg( mtError, g_pStringTable->translate("ed_st_glow_unsupported_ver").c_str());
return false;
}

Expand Down Expand Up @@ -225,9 +226,9 @@ void CGlow::FillProp(LPCSTR pref, PropItemVec& items)
{
inherited::FillProp(pref, items);
PropValue* V=0;
V=PHelper().CreateChoose (items,PrepareKey(pref,"Texture"), &m_TexName, smTexture); V->OnChangeEvent.bind(this,&CGlow::ShaderChange);
V=PHelper().CreateChoose (items,PrepareKey(pref,"Shader"), &m_ShaderName, smEShader); V->OnChangeEvent.bind(this,&CGlow::ShaderChange);
PHelper().CreateFloat (items,PrepareKey(pref,"Radius"), &m_fRadius, 0.01f,10000.f);
V=PHelper().CreateChoose (items,PrepareKey(pref,g_pStringTable->translate("ed_st_texture").c_str()), &m_TexName, smTexture); V->OnChangeEvent.bind(this,&CGlow::ShaderChange);
V=PHelper().CreateChoose (items,PrepareKey(pref,g_pStringTable->translate("ed_st_shader").c_str()), &m_ShaderName, smEShader); V->OnChangeEvent.bind(this,&CGlow::ShaderChange);
PHelper().CreateFloat (items,PrepareKey(pref,g_pStringTable->translate("ed_st_radius").c_str()), &m_fRadius, 0.01f,10000.f);
//. PHelper().CreateFlag<Flags8>(items,PHelper().PrepareKey(pref,"Fixed size"), &m_Flags, gfFixedSize);
}

Expand Down
2 changes: 1 addition & 1 deletion src/Editors/LevelEditor/Editor/Entry/Group/GroupObject.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -397,7 +397,7 @@ void CGroupObject::FillProp(LPCSTR pref, PropItemVec& items)
V->OnChangeEvent.bind(this,&CGroupObject::ReferenceChange);

ButtonValue* B;
B=PHelper().CreateButton (items,PrepareKey(pref,"FreezeObjects"), "Unique,Reference",0);
B=PHelper().CreateButton (items,PrepareKey(pref,g_pStringTable->translate("ed_st_freeze_objects").c_str()), g_pStringTable->translate("ed_st_uniq_ref").c_str(), 0);
B->OnBtnClickEvent.bind (this,&CGroupObject::OnFreezeAllClick);

for (ObjectsInGroup::iterator it=m_ObjectsInGroup.begin(); it!=m_ObjectsInGroup.end(); ++it)
Expand Down
10 changes: 5 additions & 5 deletions src/Editors/LevelEditor/Editor/Entry/Light/ELight_IO.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ bool CLight::LoadLTX(CInifile& ini, LPCSTR sect_name)

if(version!=LIGHT_VERSION)
{
ELog.DlgMsg( mtError, "CLight: Unsupported version.");
ELog.DlgMsg( mtError, g_pStringTable->translate("ed_st_light_unsupported_ver").c_str());
return false;
}

Expand All @@ -100,7 +100,7 @@ bool CLight::LoadLTX(CInifile& ini, LPCSTR sect_name)
{
m_pAnimRef = LALib.FindItem(anm);
if (!m_pAnimRef)
ELog.Msg(mtError, "Can't find light animation: %s",anm);
ELog.Msg(mtError, g_pStringTable->translate("ed_st_cant_find_la").c_str(), anm);
}

m_FalloffTex = ini.r_string (sect_name, "fallof_texture");
Expand Down Expand Up @@ -153,7 +153,7 @@ bool CLight::LoadStream(IReader& F)
string1024 buf;
R_ASSERT(F.r_chunk(LIGHT_CHUNK_VERSION,&version));
if((version!=0x0010)&&(version!=LIGHT_VERSION)){
ELog.DlgMsg( mtError, "CLight: Unsupported version.");
ELog.DlgMsg( mtError, g_pStringTable->translate("ed_st_light_unsupported_ver").c_str());
return false;
}

Expand Down Expand Up @@ -197,15 +197,15 @@ bool CLight::LoadStream(IReader& F)
{
ESceneLightTool* lt = dynamic_cast<ESceneLightTool*>(FParentTools); VERIFY(lt);
lt->m_SunShadowDir.set(FRotation.x,FRotation.y);
ELog.DlgMsg( mtError, "CLight: Can't load sun.");
ELog.DlgMsg( mtError, g_pStringTable->translate("ed_st_cant_load_sun").c_str());
return false;
}

if (F.find_chunk(LIGHT_CHUNK_ANIMREF))
{
F.r_stringZ(buf,sizeof(buf));
m_pAnimRef = LALib.FindItem(buf);
if (!m_pAnimRef) ELog.Msg(mtError, "Can't find light animation: %s",buf);
if (!m_pAnimRef) ELog.Msg(mtError, g_pStringTable->translate("ed_st_cant_find_la").c_str(), buf);
}

if (F.find_chunk(LIGHT_CHUNK_FALLOFF_TEXTURE))
Expand Down
Loading

0 comments on commit caf27d3

Please sign in to comment.