Skip to content

Commit

Permalink
Revert "refactoring indicator mode to hash, API dosent changed"
Browse files Browse the repository at this point in the history
This reverts commit 064daac.
  • Loading branch information
sidi762 authored Aug 27, 2024
1 parent 8d1ed9d commit 8984a0e
Showing 1 changed file with 8 additions and 18 deletions.
26 changes: 8 additions & 18 deletions Nasal/systems.nas
Original file line number Diff line number Diff line change
Expand Up @@ -158,16 +158,6 @@ var IndicatorController = {
#
#

INDICATOR_MODE : {
off: 0,
right_without_led: 1,
left_without_led: 2,
both_without_led: 3,
right_with_led: 4,
left_with_led: 5,
both_with_led: 6
},

new: func() { return { parents:[IndicatorController]}; },

leftIndicator : Indicator.new("left"),
Expand Down Expand Up @@ -223,44 +213,44 @@ var IndicatorController = {
return me.mode;
},
setMode: func(targetMode){
if(targetMode == me.INDICATOR_MODE.off){
if(targetMode == 0){
me.resumeLedMessage();
me.rightIndicator.switchOff();
me.leftIndicator.switchOff();
me.mode = targetMode;
if(me.falseLight == 1){
me.setMode(me.INDICATOR_MODE.both_without_led);
me.setMode(3);
}
}else if(targetMode == me.INDICATOR_MODE.right_without_led){
}else if(targetMode == 1){
me.resumeLedMessage();
me.rightIndicator.switchOn();
me.leftIndicator.switchOff();
me.mode = targetMode;
}else if(targetMode == me.INDICATOR_MODE.left_without_led){
}else if(targetMode == 2){
me.resumeLedMessage();
me.rightIndicator.switchOff();
me.leftIndicator.switchOn();
me.mode = targetMode;
}else if(targetMode == me.INDICATOR_MODE.both_without_led){
}else if(targetMode == 3){
me.resumeLedMessage();
me.rightIndicator.switchOn();
me.leftIndicator.switchOn();
me.mode = targetMode;
}else if(targetMode == me.INDICATOR_MODE.right_with_led){
}else if(targetMode == 4){
me.resumeLedMessage();
me.saveLedMessage();
me.rightIndicator.switchOn();
me.leftIndicator.switchOff();
me.setLedMessage(me.textureRight);
me.mode = targetMode;
}else if(targetMode == me.INDICATOR_MODE.left_with_led){
}else if(targetMode == 5){
me.resumeLedMessage();
me.saveLedMessage();
me.rightIndicator.switchOff();
me.leftIndicator.switchOn();
me.setLedMessage(me.textureLeft);
me.mode = targetMode;
}else if(targetMode == me.INDICATOR_MODE.both_with_led){
}else if(targetMode == 6){
me.mode = targetMode;
}else{
return 0;
Expand Down

0 comments on commit 8984a0e

Please sign in to comment.