Example #1
0
 protected override void Awake()
 {
     try {
         base.Awake();
         string sprites = UUIHelpers.GetFullPath <LifeCycle.UserMod>("uui_ar.png");
         button_ = UUIHelpers.RegisterToolButton(
             name: nameof(ARTool),
             groupName: null, // default group
             tooltip: "Adaptive Roads",
             spritefile: sprites,
             tool: this,
             activationKey: ModSettings.Hotkey);
     } catch (Exception ex) {
         ex.Log();
     }
 }
Example #2
0
 protected override void Awake()
 {
     try {
         base.Awake();
         Log.Called();
         string sprites = UUIHelpers.GetFullPath <LifeCycle.Mod>("uui_cjm_dcr.png");
         Log.Info("sprites=" + sprites);
         button_ = UUIHelpers.RegisterToolButton(
             name: "DirectConnectRoad",
             groupName: null, // default group
             tooltip: "Direct Connect Road",
             spritefile: sprites,
             tool: this);
     } catch (Exception ex) {
         ex.Log();
     }
 }
Example #3
0
 protected override void Awake()
 {
     try {
         base.Awake();
         string sprites = UUIHelpers.GetFullPath <UserModExtension>("Resources", "B.png");
         Debug.Log("[UUIExampleMod] ExampleTool.Awake() sprites=" + sprites);
         button_ = UUIHelpers.RegisterToolButton(
             name: "ExampleModButton",
             groupName: null, // default group
             tooltip: "UUI Example Mod",
             spritefile: sprites,
             tool: this,
             activationKey: ModSettings.Hotkey);
     } catch (Exception ex) {
         Debug.LogException(ex);
         UIView.ForwardException(ex);
     }
 }
Example #4
0
        /// <summary>
        /// Initialise the tool.
        /// Called by unity when the tool is created.
        /// </summary>
        protected override void Awake()
        {
            base.Awake();

            // Initializae PropAPI.
            PropAPI.Initialize();

            // Load cursors.
            lightCursor = TextureUtils.LoadCursor("BOB-CursorLight.png");
            darkCursor  = TextureUtils.LoadCursor("BOB-CursorDark.png");
            m_cursor    = darkCursor;

            // Create new UUI button.
            UIComponent uuiButton = UUIHelpers.RegisterToolButton(
                name: nameof(BOBTool),
                groupName: null,                 // default group
                tooltip: Translations.Translate("BOB_NAM"),
                tool: this,
                icon: UUIHelpers.LoadTexture(UUIHelpers.GetFullPath <BOBMod>("Resources", "BOB-UUI.png"))
                //hotkeys: new UUIHotKeys { ActivationKey = ModSettings.PanelSavedKey }
                );
        }