コード例 #1
0
bool UIEulaAgreement::OnEvent(const TBWidgetEvent &ev)
{
    if (ev.type == EVENT_TYPE_CLICK)
    {
        if (ev.target->GetID() == TBIDC("quit"))
        {
            SendEvent(E_EXITREQUESTED);
            return true;
        }
        else if (ev.target->GetID() == TBIDC("ok"))
        {
            Editor* editor = GetSubsystem<Editor>();

            if (!eulaCheck_->GetValue())
            {
                editor->PostModalInfo("License Agreement", "Please agree to licensing terms and conditions to continue");
                return true;
            }

            SharedPtr<UIEulaAgreement> keepAlive(this);
            GetSubsystem<UIModalOps>()->Hide();
            LicenseSystem* licenseSystem = GetSubsystem<LicenseSystem>();
            licenseSystem->LicenseAgreementConfirmed();
            return true;
        }


    }


    return false;
}
コード例 #2
0
void UIAbout::GenerateAboutText(String& text)
{
    LicenseSystem* licenseSystem = GetSubsystem<LicenseSystem>();
    text.Clear();

    text += "<widget TBImageWidget: filename: 'AtomicEditor/editor/images/atomic_logo.png'>\n\n";
    text.AppendWithFormat("<color #D4FB79>Version  %i.%i.p%i</color>\n\n", ATOMIC_EDITOR_VERSION_MAJOR, ATOMIC_EDITOR_VERSION_MINOR, ATOMIC_EDITOR_VERSION_PATCH);
    text += "(c) 2014-2015 THUNDERBEAST GAMES LLC\n\n\n";

    text += "<color #D4FB79>Installed platforms and modules:</color>\n\n";

    if (licenseSystem->IsStandardLicense())
    {
        text += "    <widget TBSkinImage: skin: 'LogoMac-Small'> <widget TBSkinImage: skin: 'LogoWindows-Small'> <widget TBSkinImage: skin: 'Module2D-Small'>\n\n\n";

        text += "<color #76D6FF>Available platforms and modules:</color>\n\n" \
        "    <widget TBSkinImage: skin: 'LogoHTML5-Small'> <widget TBSkinImage: skin: 'LogoAndroid-Small'> " \
        "<widget TBSkinImage: skin: 'LogoIOS-Small'> <widget TBSkinImage: skin: 'Module3D-Small'> "\
        "<widget TBButton: text: 'Get Pro' skin: 'TBButton.greentext' id: 'purchase_pro' >\n\n\n";
    }
    else
    {
        text += "    <widget TBSkinImage: skin: 'LogoMac-Small'> <widget TBSkinImage: skin: 'LogoWindows-Small'> " \
        "<widget TBSkinImage: skin: 'LogoHTML5-Small'> <widget TBSkinImage: skin: 'LogoAndroid-Small'> " \
        "<widget TBSkinImage: skin: 'LogoIOS-Small'> <widget TBSkinImage: skin: 'Module2D-Small'> <widget TBSkinImage: skin: 'Module3D-Small'>\n\n";
    }

    text += "<color #76D6FF>Special Thanks:</color>\n\n";
    text += "    The Urho3D Project - http://urho3d.github.io\n\n";
    text += "    Sami Vaarala - http://www.duktape.org";
}
コード例 #3
0
void AtomicTool::DoActivation()
{
    LicenseSystem* licenseSystem = GetSubsystem<LicenseSystem>();

    if (!licenseSystem->ValidateKey(activationKey_))
    {
        ErrorExit(ToString("\nProduct key \"%s\" is invalid, keys are in the form ATOMIC-XXXX-XXXX-XXXX-XXXX\n", activationKey_.CString()));
        return;
    }

    licenseSystem->LicenseAgreementConfirmed();

    SubscribeToEvent(E_LICENSE_ACTIVATIONERROR, HANDLER(AtomicTool, HandleLicenseActivationError));
    SubscribeToEvent(E_LICENSE_ACTIVATIONSUCCESS, HANDLER(AtomicTool, HandleLicenseActivationSuccess));

    licenseSystem->RequestServerActivation(activationKey_);

}
コード例 #4
0
void AtomicTool::DoDeactivation()
{
    LicenseSystem* licenseSystem = GetSubsystem<LicenseSystem>();

    if (!licenseSystem->LoadLicense())
    {
        ErrorExit("\nNot activated");
        return;
    }

    if (!licenseSystem->Deactivate())
    {
        ErrorExit("\nNot activated\n");
        return;
    }

    SubscribeToEvent(E_LICENSE_DEACTIVATIONERROR, HANDLER(AtomicTool, HandleLicenseDeactivationError));
    SubscribeToEvent(E_LICENSE_DEACTIVATIONSUCCESS, HANDLER(AtomicTool, HandleLicenseDeactivationSuccess));
}
コード例 #5
0
void EditorMode::HandleIPCWorkerStarted(StringHash eventType, VariantMap& eventData)
{
    LicenseSystem* licenseSystem = GetSubsystem<LicenseSystem>();

    VariantMap startupData;
    SystemUI::DebugHud* debugHud = GetSubsystem<SystemUI::DebugHud>();

// BEGIN LICENSE MANAGEMENT

    startupData["license3D"] = licenseSystem->GetLicenseModule3D();

// END LICENSE MANAGEMENT

    startupData["debugHudMode"] = debugHud ? debugHud->GetMode() : (unsigned) 0;

    playerBroker_->PostMessage(E_IPCINITIALIZE, startupData);

    SendEvent(E_EDITORPLAYERSTARTED);

    playerEnabled_ = true;

}
コード例 #6
0
bool UINewProject::OnEvent(const TBWidgetEvent &ev)
{
    Editor* editor = GetSubsystem<Editor>();
    UIModalOps* ops = GetSubsystem<UIModalOps>();

    if (ev.type == EVENT_TYPE_CLICK)
    {
        if (ev.target->GetID() == TBIDC("cancel"))
        {
            ops->Hide();
            return true;
        }

        int projectType = -1;

        if (ev.target->GetID() == TBIDC("project_empty"))
        {
            projectType = 0;
        }
        else if (ev.target->GetID() == TBIDC("project_2d"))
        {
            projectType = 1;
        }
        else if (ev.target->GetID() == TBIDC("project_3d"))
        {
// BEGIN LICENSE MANAGEMENT
            LicenseSystem* licenseSystem = GetSubsystem<LicenseSystem>();

            if (licenseSystem->IsStandardLicense())
            {
                SharedPtr<UINewProject> keepAlive(this);
                UIModalOps* ops = GetSubsystem<UIModalOps>();
                ops->Hide();
                ops->ShowInfoModule3D();
                return true;
            }
// END LICENSE MANAGEMENT

            projectType = 2;
        }

        if (projectType != -1)
        {
            FileSystem* fileSystem = GetSubsystem<FileSystem>();

        #ifdef ATOMIC_PLATFORM_OSX
            String templateSourceDir = fileSystem->GetAppBundleResourceFolder();
        #else
            String templateSourceDir = fileSystem->GetProgramDir();
        #endif

            if (projectType == 0)
                templateSourceDir += "/ProjectTemplates/EmptyProject";
            else if (projectType == 1)
                templateSourceDir += "/ProjectTemplates/Project2D";
            else
                templateSourceDir += "/ProjectTemplates/Project3D";

            SharedPtr<UINewProject> keepAlive(this);
            UIModalOps* ops = GetSubsystem<UIModalOps>();
            ops->Hide();
            ops->ShowCreateProject(templateSourceDir);

            return true;

        }

    }

    return false;
}
コード例 #7
0
ファイル: BuildMac.cpp プロジェクト: gitter-badger/Clockwork
void BuildMac::Build(const String& buildPath)
{
    buildPath_ = buildPath + "/Mac-Build";

    Initialize();

    BuildSystem* buildSystem = GetSubsystem<BuildSystem>();

// BEGIN LICENSE MANAGEMENT
    LicenseSystem *licenseSystem = GetSubsystem<LicenseSystem>();
    if (licenseSystem->IsStandardLicense())
    {
        if (containsMDL_)
        {
            buildSystem->BuildComplete(CE_PLATFORM_MAC, buildPath_, false, true);
            return;
        }
    }
// END LICENSE MANAGEMENT

    FileSystem* fileSystem = GetSubsystem<FileSystem>();
    if (fileSystem->DirExists(buildPath_))
        fileSystem->RemoveDir(buildPath_, true);

 #ifdef CLOCKWORK_PLATFORM_WINDOWS
    String buildSourceDir = fileSystem->GetProgramDir();
 #else
    String buildSourceDir = fileSystem->GetAppBundleResourceFolder();
 #endif

    buildSourceDir += "Deployment/MacOS/ClockworkPlayer.app";

    fileSystem->CreateDir(buildPath_);

    buildPath_ += "/ClockworkPlayer.app";

    fileSystem->CreateDir(buildPath_);

    fileSystem->CreateDir(buildPath_ + "/Contents");
    fileSystem->CreateDir(buildPath_ + "/Contents/MacOS");
    fileSystem->CreateDir(buildPath_ + "/Contents/Resources");

    String resourcePackagePath = buildPath_ + "/Contents/Resources/ClockworkResources.pak";
    GenerateResourcePackage(resourcePackagePath);

    fileSystem->Copy(buildSourceDir + "/Contents/Resources/Clockwork.icns", buildPath_ + "/Contents/Resources/Clockwork.icns");

    fileSystem->Copy(buildSourceDir + "/Contents/Info.plist", buildPath_ + "/Contents/Info.plist");
    fileSystem->Copy(buildSourceDir + "/Contents/MacOS/ClockworkPlayer", buildPath_ + "/Contents/MacOS/ClockworkPlayer");

#ifdef CLOCKWORK_PLATFORM_OSX
    Vector<String> args;
    args.Push("+x");
    args.Push(buildPath_ + "/Contents/MacOS/ClockworkPlayer");
    fileSystem->SystemRun("chmod", args);
#endif

    buildPath_ = buildPath + "/Mac-Build";    
    buildSystem->BuildComplete(CE_PLATFORM_MAC, buildPath_);

}