Skip to content

Commit

Permalink
Some UI and menu tweaks
Browse files Browse the repository at this point in the history
  • Loading branch information
punkUser committed Nov 4, 2018
1 parent 710ea0a commit eb66c3e
Show file tree
Hide file tree
Showing 9 changed files with 38 additions and 26 deletions.
6 changes: 5 additions & 1 deletion public/js/simulate.js
Expand Up @@ -271,7 +271,11 @@ $(document).ready(function()
});
// If we have a query string, trigger a simulation automatically (but don't update history)
if (window.location.search.length > 0) {
simulateUpdate(false);
// If there's an "nas" (no autosubmit) param, respect that
var urlParams = new URLSearchParams(window.location.search);
console.log(urlParams.has('nas'));
if (!urlParams.has('nas'))
simulateUpdate(false);
}

// AJAX form submission
Expand Down
16 changes: 10 additions & 6 deletions source/attack_preset_form.d
Expand Up @@ -14,6 +14,8 @@ public enum AttackPreset : ubyte
_3d,
_3dHowlrunner,
_4d,
_4dProtonTorpedoes,
_4dProtonTorpedoesWedge,
Count
};

Expand Down Expand Up @@ -41,12 +43,14 @@ public string attack_preset_url(ubyte attacker)
{
switch (attacker)
{
case AttackPreset._2d: return "IQAAAAAAAAA";
case AttackPreset._2dHowlrunner: return "IQAAAAAEAAA";
case AttackPreset._3d: return "MQAAAAAAAAA";
case AttackPreset._3dHowlrunner: return "MQAAAAAEAAA";
case AttackPreset._4d: return "QQAAAAAAAAA";
default: return "IQAAAAAAAAA"; // Failsafe!
case AttackPreset._2d: return "IQAAAAAAAAA";
case AttackPreset._2dHowlrunner: return "IQAAAAAEAAA";
case AttackPreset._3d: return "MQAAAAAAAAA";
case AttackPreset._3dHowlrunner: return "MQAAAAAEAAA";
case AttackPreset._4d: return "QQAAAAAAAAA";
case AttackPreset._4dProtonTorpedoes: return "QQAAgAAAAAA";
case AttackPreset._4dProtonTorpedoesWedge: return "QQAAgADgAQA";
default: return "IQAAAAAAAAA"; // Failsafe!
}
}

Expand Down
14 changes: 8 additions & 6 deletions source/views/attack_preset_form.inc.dt
Expand Up @@ -24,12 +24,14 @@
div(id="#{form_name}_panel", data-toggler=".hide", class="#{initial_visibility}")
select(name="preset")
- import attack_preset_form;
- select_control_option_t!("preset", form_name)("2 Dice", AttackPreset._2d );
- select_control_option_t!("preset", form_name)("2 Dice, Howlrunner", AttackPreset._2dHowlrunner );
- select_control_option_t!("preset", form_name)("3 Dice", AttackPreset._3d );
- select_control_option_t!("preset", form_name)("3 Dice, Howlrunner", AttackPreset._3dHowlrunner );
- select_control_option_t!("preset", form_name)("4 Dice", AttackPreset._4d );

- select_control_option_t!("preset", form_name)("2 Dice", AttackPreset._2d );
- select_control_option_t!("preset", form_name)("2 Dice, Howlrunner", AttackPreset._2dHowlrunner );
- select_control_option_t!("preset", form_name)("3 Dice", AttackPreset._3d );
- select_control_option_t!("preset", form_name)("3 Dice, Howlrunner", AttackPreset._3dHowlrunner );
- select_control_option_t!("preset", form_name)("4 Dice", AttackPreset._4d );
- select_control_option_t!("preset", form_name)("4 Dice, Proton Torpedoes", AttackPreset._4dProtonTorpedoes );
- select_control_option_t!("preset", form_name)("4 Dice, Proton Torpedoes, Wedge", AttackPreset._4dProtonTorpedoesWedge );

- switch_control_t!("focus", form_name)("Focus");
- switch_control_t!("lock" , form_name)("Lock");

18 changes: 10 additions & 8 deletions source/views/layout.dt
Expand Up @@ -19,22 +19,24 @@ html(class="no-js", lang="en")
nav.top-bar
.top-bar-left
ul.dropdown.menu(data-dropdown-menu)
li
a(href="#{server_settings.url_root}2/multi/") Calculator
li.divider
li
a(href="#{server_settings.url_root}2/multi_preset/") Preset Calculator
ul.menu.vertical
li
a(href="#{server_settings.url_root}2/multi_preset/?a1=AgM&a2=AgM&a3=AgM&a4=AgM") 4x 3-Dice Focus
a(href="#{server_settings.url_root}2/multi_preset/") Preset Calculator
li
a(href="#{server_settings.url_root}2/multi_preset/?nas&a1=AgM&a2=AgM&a3=AgM&a4=AgM") 4x 3-Dice Focus
li
a(href="#{server_settings.url_root}2/multi_preset/?a1=AgM&a2=AgM&a3=AgM&a4=AgM&a5=AgM") 5x 3-Dice Focus
a(href="#{server_settings.url_root}2/multi_preset/?nas&a1=AgM&a2=AgM&a3=AgM&a4=AgM&a5=AgM") 5x 3-Dice Focus
li
a(href="#{server_settings.url_root}2/multi_preset/?a1=AgM&a2=AgM&a3=AgM&a4=AgM&a5=AgM&a6=AgM") 6x 3-Dice Focus
a(href="#{server_settings.url_root}2/multi_preset/?nas&a1=AgM&a2=AgM&a3=AgM&a4=AgM&a5=AgM&a6=AgM") 6x 3-Dice Focus
li
a(href="#{server_settings.url_root}2/multi_preset/?a1=AQM&a2=AQM&a3=AQM&a4=AQM&a5=AQM&a6=AwM") 6x TIE Howl Wampa Swarm
a(href="#{server_settings.url_root}2/multi_preset/?nas&a1=AQM&a2=AQM&a3=AQM&a4=AQM&a5=AQM&a6=AwM") 6x TIE Howl Wampa Swarm
li
a(href="#{server_settings.url_root}2/multi_preset/?a1=AQM&a2=AQM&a3=AQM&a4=AQM&a5=AAM&a6=AQM&a7=AQM") 7x TIE Howl Swarm
a(href="#{server_settings.url_root}2/multi_preset/?nas&a1=AQM&a2=AQM&a3=AQM&a4=AQM&a5=AAM&a6=AQM&a7=AQM") 7x TIE Howl Swarm
li.divider
li
a(href="#{server_settings.url_root}2/multi/") Advanced Calculator
li.divider
li
a(href="#{server_settings.url_root}2/modify_attack/") How To Modify
Expand Down
2 changes: 1 addition & 1 deletion source/views/modify_attack_form.dt
Expand Up @@ -4,7 +4,7 @@ block form
include controls.inc
include attack_form.inc

h1 2.0 How to Modify Attack Dice
h1 How to Modify Attack Dice

.grid-x.grid-margin-x.small-up-1.medium-up-2.large-up-2
.cell
Expand Down
2 changes: 1 addition & 1 deletion source/views/modify_defense_form.dt
Expand Up @@ -4,7 +4,7 @@ block form
include controls.inc
include defense_form.inc

h1 2.0 How to Modify Defense Dice
h1 How to Modify Defense Dice

.grid-x.grid-margin-x.small-up-1.medium-up-2.large-up-2
.cell
Expand Down
2 changes: 1 addition & 1 deletion source/views/multi2_form.dt
Expand Up @@ -6,7 +6,7 @@ block form
include defense_form.inc
- import form;

h1 2.0 Calculator
h1 Advanced Calculator

.grid-x.grid-margin-x.small-up-1.medium-up-2.large-up-2
.cell
Expand Down
2 changes: 1 addition & 1 deletion source/views/multi2_preset_form.dt
Expand Up @@ -6,7 +6,7 @@ block form
include defense_form.inc
- import form;

h1 2.0 Preset Calculator
h1 Preset Calculator

.grid-x.grid-margin-x.small-up-1.medium-up-2.large-up-2
.cell
Expand Down
2 changes: 1 addition & 1 deletion source/views/shots_to_die_form.dt
Expand Up @@ -5,7 +5,7 @@ block content
include attack_preset_form.inc
include defense_form.inc

h1 2.0 Ship Durability
h1 Ship Durability

.grid-x.grid-margin-x.small-up-1.medium-up-2.large-up-2
.cell
Expand Down

0 comments on commit eb66c3e

Please sign in to comment.