forked from Mirrors/openclonk
Qt Editor: Add help/description label for current selection
parent
77c6baff3f
commit
4245f60e83
|
@ -45,6 +45,7 @@ IDS_CNS_CREATE=Erzeugen
|
|||
IDS_CNS_CREATESTATUS=Platzierung: %s
|
||||
IDS_CNS_CREATOR=Objekte erstellen
|
||||
IDS_CNS_DEFINITIONS=Definitionen
|
||||
IDS_CNS_DESCRIPTION=Beschreibung
|
||||
IDS_CNS_DROPNODEF=Ungültiges oder nicht geladenes Objekt: %s
|
||||
IDS_CNS_EDITOR=OpenClonk Editor
|
||||
IDS_CNS_EFFECTS=Effekte:
|
||||
|
|
|
@ -45,6 +45,7 @@ IDS_CNS_CREATE=Create
|
|||
IDS_CNS_CREATESTATUS=Place new %s
|
||||
IDS_CNS_CREATOR=Create objects
|
||||
IDS_CNS_DEFINITIONS=Definitions
|
||||
IDS_CNS_DESCRIPTION=Description
|
||||
IDS_CNS_DROPNODEF=Object invalid or not loaded: %s
|
||||
IDS_CNS_EDITOR=OpenClonk Editor
|
||||
IDS_CNS_EFFECTS=Effects:
|
||||
|
|
|
@ -483,6 +483,16 @@
|
|||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLabel" name="selectionHelpLabel">
|
||||
<property name="text">
|
||||
<string notr="true"/>
|
||||
</property>
|
||||
<property name="wordWrap">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<layout class="QGridLayout" name="objectActionPanel">
|
||||
<property name="verticalSpacing">
|
||||
|
|
|
@ -2112,6 +2112,17 @@ QMimeData *C4ConsoleQtPropListModel::mimeData(const QModelIndexList &indexes) co
|
|||
return mimeData;
|
||||
}
|
||||
|
||||
const char *C4ConsoleQtPropListModel::GetTargetPathHelp() const
|
||||
{
|
||||
// Help text in EditorInfo prop. Fall back to description.
|
||||
C4PropList *info_proplist = this->info_proplist.getPropList();
|
||||
if (!info_proplist) return nullptr;
|
||||
C4String *desc = info_proplist->GetPropertyStr(P_EditorInfo);
|
||||
if (!desc) desc = info_proplist->GetPropertyStr(P_Description);
|
||||
if (!desc) return nullptr;
|
||||
return desc->GetCStr();
|
||||
}
|
||||
|
||||
void C4ConsoleQtPropListModel::AddArrayElement()
|
||||
{
|
||||
C4Value new_val;
|
||||
|
|
|
@ -567,6 +567,7 @@ public:
|
|||
class C4PropList *GetBasePropList() const { return base_proplist.getPropList(); }
|
||||
int32_t GetTargetPathStackSize() const { return target_path_stack.size(); }
|
||||
const char *GetTargetPathText() const { return target_path.GetGetPath(); }
|
||||
const char *GetTargetPathHelp() const;
|
||||
bool IsArray() const { return !!target_value.getArray(); }
|
||||
void AddArrayElement();
|
||||
void RemoveArrayElement();
|
||||
|
|
|
@ -731,6 +731,7 @@ void C4ConsoleGUIState::PropertyDlgUpdate(C4EditCursorSelection &rSelection, boo
|
|||
ui.selectionInfoLabel->setText(rSelection.GetDataString().getData());
|
||||
ui.propertyEditAscendPathButton->hide();
|
||||
UpdateActionObject(nullptr);
|
||||
ui.selectionHelpLabel->hide();
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -749,6 +750,16 @@ void C4ConsoleGUIState::PropertyDlgUpdate(C4EditCursorSelection &rSelection, boo
|
|||
property_model->UpdateValue(false);
|
||||
}
|
||||
ui.selectionInfoLabel->setText(property_model->GetTargetPathText());
|
||||
const char *help_text = property_model->GetTargetPathHelp();
|
||||
if (help_text)
|
||||
{
|
||||
ui.selectionHelpLabel->setText(FormatString("%s: %s", LoadResStr("IDS_CNS_DESCRIPTION"), help_text).getData());
|
||||
ui.selectionHelpLabel->show();
|
||||
}
|
||||
else
|
||||
{
|
||||
ui.selectionHelpLabel->hide();
|
||||
}
|
||||
ui.propertyEditAscendPathButton->setVisible(property_model->GetTargetPathStackSize() >= 1);
|
||||
is_array = property_model->IsArray();
|
||||
if (is_array)
|
||||
|
|
|
@ -285,6 +285,8 @@ C4StringTable::C4StringTable()
|
|||
P[P_Select] = "Select";
|
||||
P[P_DescendPath] = "DescendPath";
|
||||
P[P_EmptyName] = "EmptyName";
|
||||
P[P_EditorInfo] = "EditorInfo";
|
||||
P[P_Description] = "Description";
|
||||
P[DFA_WALK] = "WALK";
|
||||
P[DFA_FLIGHT] = "FLIGHT";
|
||||
P[DFA_KNEEL] = "KNEEL";
|
||||
|
|
|
@ -509,6 +509,8 @@ enum C4PropertyName
|
|||
P_Select,
|
||||
P_DescendPath,
|
||||
P_EmptyName,
|
||||
P_EditorInfo,
|
||||
P_Description,
|
||||
// Default Action Procedures
|
||||
DFA_WALK,
|
||||
DFA_FLIGHT,
|
||||
|
|
Loading…
Reference in New Issue