Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding region settings for Combat2 #1640

Open
wants to merge 6 commits into
base: develop
Choose a base branch
from
Open

Conversation

Rider-Linden
Copy link
Contributor

Adds a number of fields to the Region tab of the Region/Estate floater and allows them to be set from the viewer. Also looks for the optional CombatSettings block when processing region settings for display. If the block is missing will disable non-relevant fields.

@Rider-Linden Rider-Linden marked this pull request as ready for review June 5, 2024 21:07
@Rider-Linden Rider-Linden requested a review from brad-linden June 5, 2024 21:07
left="250"
name="Combat"
top="110"
width="220">
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If we want to hide this, then I'd add

Suggested change
width="220">
width="220"
visibility_control="Combat2ShowExperimentalUI">

and add the following to the bottom of settings.xml:

  <key>Combat2ShowExperimentalUI</key>
  <map>
    <key>Comment</key>
    <string>Enable Combat2 UI support</string>
    <key>Persist</key>
    <integer>1</integer>
    <key>Type</key>
    <string>Boolean</string>
    <key>Value</key>
    <integer>0</integer>
  </map>

@@ -500,7 +522,7 @@ void LLFloaterRegionInfo::processRegionInfo(LLMessageSystem* msg)
panel->getChild<LLUICtrl>("block_terraform_check")->setValue(is_flag_set(region_flags, REGION_FLAGS_BLOCK_TERRAFORM));
panel->getChild<LLUICtrl>("block_fly_check")->setValue(is_flag_set(region_flags, REGION_FLAGS_BLOCK_FLY));
panel->getChild<LLUICtrl>("block_fly_over_check")->setValue(is_flag_set(region_flags, REGION_FLAGS_BLOCK_FLYOVER));
panel->getChild<LLUICtrl>("allow_damage_check")->setValue(is_flag_set(region_flags, REGION_FLAGS_ALLOW_DAMAGE));
panel->getChild<LLUICtrl>("allow_damage_check")->setValue((region_flags & REGION_FLAGS_ALLOW_DAMAGE) ? TRUE : FALSE );
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

these should probably be true and false. the BOOL->bool changes have merged into this branch

Comment on lines 543 to 562
panel->getChild<LLUICtrl>("allow_damage_check")->setValue((region_flags & REGION_FLAGS_ALLOW_DAMAGE) ? TRUE : FALSE);

panel->getChild<LLUICtrl>("combat_restrict_log")->setValue((combat_flags & REGION_COMBAT_FLAG_RESTRICT_LOG) ? TRUE : FALSE);
panel->getChild<LLUICtrl>("combat_allow_damage_adjust")->setValue((combat_flags & REGION_COMBAT_FLAG_DAMAGE_ADJUST) ? TRUE : FALSE);
panel->getChild<LLUICtrl>("combat_restore_health")->setValue((combat_flags & REGION_COMBAT_FLAG_RESTORE_HEALTH) ? TRUE : FALSE);
panel->getChild<LLUICtrl>("combat_on_death")->setValue(on_death);
panel->getChild<LLUICtrl>("combat_dps_spin")->setValue(damage_throttle);
panel->getChild<LLUICtrl>("combat_hps_spin")->setValue(regeneration_rate);
panel->getChild<LLUICtrl>("combat_invuln_spin")->setValue(invulnerability_time);

BOOL combat2_enabled = ((region_flags & REGION_FLAGS_ALLOW_DAMAGE) && supports_combat2) ? TRUE : FALSE;

panel->getChild<LLUICtrl>("combat_restrict_log")->setEnabled(combat2_enabled);
panel->getChild<LLUICtrl>("combat_allow_damage_adjust")->setEnabled(combat2_enabled);
panel->getChild<LLUICtrl>("combat_restore_health")->setEnabled(combat2_enabled);
panel->getChild<LLUICtrl>("combat_on_death")->setEnabled(combat2_enabled);
panel->getChild<LLUICtrl>("combat_dps_spin")->setEnabled(combat2_enabled);
panel->getChild<LLUICtrl>("combat_hps_spin")->setEnabled(combat2_enabled);
panel->getChild<LLUICtrl>("combat_invuln_spin")->setEnabled(combat2_enabled);

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

more BOOL->bool changes in this block

Base automatically changed from project/gltf_development to develop June 13, 2024 00:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants