Application: allow wild weapon type switching.
This commit is contained in:
parent
57f1a3ccef
commit
4dfc847113
1 changed files with 46 additions and 0 deletions
|
@ -270,6 +270,11 @@ Application::drawWeaponEditor(GameObjects::Weapon& weapon) {
|
||||||
ImGui::BeginGroup();
|
ImGui::BeginGroup();
|
||||||
drawAlignedText("Equipped:");
|
drawAlignedText("Equipped:");
|
||||||
|
|
||||||
|
if(conf().advancedMode()) {
|
||||||
|
drawAlignedText("Weapon type:");
|
||||||
|
drawAlignedText("");
|
||||||
|
}
|
||||||
|
|
||||||
if(weapon.type != GameObjects::Weapon::Type::Shield) {
|
if(weapon.type != GameObjects::Weapon::Type::Shield) {
|
||||||
drawAlignedText("Damage type:");
|
drawAlignedText("Damage type:");
|
||||||
}
|
}
|
||||||
|
@ -288,6 +293,47 @@ Application::drawWeaponEditor(GameObjects::Weapon& weapon) {
|
||||||
ImGui::BeginGroup();
|
ImGui::BeginGroup();
|
||||||
ImGui::Checkbox("##EquippedCheckbox", &weapon.attached);
|
ImGui::Checkbox("##EquippedCheckbox", &weapon.attached);
|
||||||
|
|
||||||
|
if(conf().advancedMode()) {
|
||||||
|
if(ImGui::RadioButton("Melee##MeleeType", weapon.type == GameObjects::Weapon::Type::Melee)) {
|
||||||
|
weapon.type = GameObjects::Weapon::Type::Melee;
|
||||||
|
if(weapon.damageType == GameObjects::Weapon::DamageType::Piercing || weapon.damageType == GameObjects::Weapon::DamageType::Plasma) {
|
||||||
|
weapon.damageType = GameObjects::Weapon::DamageType::Physical;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
ImGui::SameLine();
|
||||||
|
if(ImGui::RadioButton("Shield##ShieldType", weapon.type == GameObjects::Weapon::Type::Shield)) {
|
||||||
|
weapon.type = GameObjects::Weapon::Type::Shield;
|
||||||
|
}
|
||||||
|
ImGui::SameLine();
|
||||||
|
if(ImGui::RadioButton("Bullet shooter##BShooterType", weapon.type == GameObjects::Weapon::Type::BulletShooter)) {
|
||||||
|
weapon.type = GameObjects::Weapon::Type::BulletShooter;
|
||||||
|
if(weapon.damageType == GameObjects::Weapon::DamageType::Physical || weapon.damageType == GameObjects::Weapon::DamageType::Plasma) {
|
||||||
|
weapon.damageType = GameObjects::Weapon::DamageType::Piercing;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if(ImGui::RadioButton("Energy shooter##EShooterType", weapon.type == GameObjects::Weapon::Type::EnergyShooter)) {
|
||||||
|
weapon.type = GameObjects::Weapon::Type::EnergyShooter;
|
||||||
|
if(weapon.damageType == GameObjects::Weapon::DamageType::Physical || weapon.damageType == GameObjects::Weapon::DamageType::Piercing) {
|
||||||
|
weapon.damageType = GameObjects::Weapon::DamageType::Plasma;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
ImGui::SameLine();
|
||||||
|
if(ImGui::RadioButton("Bullet launcher##BLauncherType", weapon.type == GameObjects::Weapon::Type::BulletLauncher)) {
|
||||||
|
weapon.type = GameObjects::Weapon::Type::BulletLauncher;
|
||||||
|
if(weapon.damageType == GameObjects::Weapon::DamageType::Physical || weapon.damageType == GameObjects::Weapon::DamageType::Plasma) {
|
||||||
|
weapon.damageType = GameObjects::Weapon::DamageType::Piercing;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
ImGui::SameLine();
|
||||||
|
if(ImGui::RadioButton("Energy launcher##ELauncherType", weapon.type == GameObjects::Weapon::Type::EnergyLauncher)) {
|
||||||
|
weapon.type = GameObjects::Weapon::Type::EnergyLauncher;
|
||||||
|
if(weapon.damageType == GameObjects::Weapon::DamageType::Physical || weapon.damageType == GameObjects::Weapon::DamageType::Piercing) {
|
||||||
|
weapon.damageType = GameObjects::Weapon::DamageType::Plasma;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if(weapon.type != GameObjects::Weapon::Type::Shield) {
|
if(weapon.type != GameObjects::Weapon::Type::Shield) {
|
||||||
if(weapon.type == GameObjects::Weapon::Type::Melee &&
|
if(weapon.type == GameObjects::Weapon::Type::Melee &&
|
||||||
ImGui::RadioButton("Physical##NoElement", weapon.damageType == GameObjects::Weapon::DamageType::Physical))
|
ImGui::RadioButton("Physical##NoElement", weapon.damageType == GameObjects::Weapon::DamageType::Physical))
|
||||||
|
|
Loading…
Reference in a new issue