View Single Post
Old 4th June 2003, 20:31   #9
Joshuatree
Major Dude
 
Joshuatree's Avatar
 
Join Date: Dec 2001
Location: Buffalo NY
Posts: 635
Send a message via AIM to Joshuatree
ok, it didn't work...infact, it even stopped what was working...i am so confused....here is my script as it is right now. Everything is working exept that the bottons aren't in the active state when the skin loads.
code:
#include "../../../../lib/std.mi"

Global Container main;
Global Layout mode1, mode2, mode3, mini, stick, panel;
Global Button toggleMode1, toggleMode2, toggleMode3, toggleMini, toggleStick;

System.onScriptLoaded()
{
main = system.getContainer("main");
panel = system.getContainer("panel").getLayout("normal");
mode1 = main.getLayout("mode1");
mode2 = main.getLayout("mode2");
mode3 = main.getLayout("mode3");
mini = main.getLayout("mini");
stick = main.getLayout("stick");
toggleMode1 = panel.getObject("panel.mode1.toggle");
toggleMode2 = panel.getObject("panel.mode2.toggle");
toggleMode3 = panel.getObject("panel.mode3.toggle");
toggleMini = panel.getObject("panel.mini.toggle");
toggleStick = panel.getObject("panel.stick.toggle");
}

toggleMode1.OnLeftClick() {
main.switchToLayout("mode1");
}

toggleMode2.OnLeftClick() {
main.switchToLayout("mode2");
}

toggleMode3.OnLeftClick() {
main.switchToLayout("mode3");
}

toggleMini.OnLeftClick() {
main.switchToLayout("mini");
}

toggleStick.OnLeftClick() {
main.switchToLayout("stick");
}

main.onSwitchToLayout(Layout newlayout) {
if (newlayout == mode1) {
toggleMode1.setActivated(true);
toggleMode2.setActivated(false);
toggleMode3.setActivated(false);
toggleMini.setActivated(false);
toggleStick.setActivated(false);
}
if (newlayout == mode2) {
toggleMode1.setActivated(false);
toggleMode2.setActivated(true);
toggleMode3.setActivated(false);
toggleMini.setActivated(false);
toggleStick.setActivated(false);
}
if (newlayout == mode3) {
toggleMode1.setActivated(false);
toggleMode2.setActivated(false);
toggleMode3.setActivated(true);
toggleMini.setActivated(false);
toggleStick.setActivated(false);
}
if (newlayout == mini) {
toggleMode1.setActivated(false);
toggleMode2.setActivated(false);
toggleMode3.setActivated(false);
toggleMini.setActivated(true);
toggleStick.setActivated(false);
}
if (newlayout == stick) {
toggleMode1.setActivated(false);
toggleMode2.setActivated(false);
toggleMode3.setActivated(false);
toggleMini.setActivated(false);
toggleStick.setActivated(true);
}
}

Joshuatree is offline   Reply With Quote